lib/google_api/content/v21/model/regional_inventory.ex

# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V21.Model.RegionalInventory do
  @moduledoc """
  Regional inventory resource. contains the regional name and all attributes which are overridden for the specified region.

  ## Attributes

  *   `availability` (*type:* `String.t`, *default:* `nil`) - The availability of the product.
  *   `customAttributes` (*type:* `list(GoogleApi.Content.V21.Model.CustomAttribute.t)`, *default:* `nil`) - A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the feed specification in its generic form.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Identifies what kind of resource this is. Value: the fixed string "`content#regionalInventory`".
  *   `price` (*type:* `GoogleApi.Content.V21.Model.Price.t`, *default:* `nil`) - The price of the product.
  *   `regionId` (*type:* `String.t`, *default:* `nil`) - The ID uniquely identifying each region.
  *   `salePrice` (*type:* `GoogleApi.Content.V21.Model.Price.t`, *default:* `nil`) - The sale price of the product. Mandatory if `sale_price_effective_date` is defined.
  *   `salePriceEffectiveDate` (*type:* `String.t`, *default:* `nil`) - A date range represented by a pair of ISO 8601 dates separated by a space, comma, or slash. Both dates might be specified as 'null' if undecided.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :availability => String.t() | nil,
          :customAttributes => list(GoogleApi.Content.V21.Model.CustomAttribute.t()) | nil,
          :kind => String.t() | nil,
          :price => GoogleApi.Content.V21.Model.Price.t() | nil,
          :regionId => String.t() | nil,
          :salePrice => GoogleApi.Content.V21.Model.Price.t() | nil,
          :salePriceEffectiveDate => String.t() | nil
        }

  field(:availability)
  field(:customAttributes, as: GoogleApi.Content.V21.Model.CustomAttribute, type: :list)
  field(:kind)
  field(:price, as: GoogleApi.Content.V21.Model.Price)
  field(:regionId)
  field(:salePrice, as: GoogleApi.Content.V21.Model.Price)
  field(:salePriceEffectiveDate)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V21.Model.RegionalInventory do
  def decode(value, options) do
    GoogleApi.Content.V21.Model.RegionalInventory.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V21.Model.RegionalInventory do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end