# 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.Retail.V2.Model.GoogleCloudRetailV2Tile do
  @moduledoc """
  This field specifies the tile information including an attribute key, attribute value. More fields will be added in the future, eg: product id or product counts, etc.

  ## Attributes

  *   `productAttributeInterval` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeInterval.t`, *default:* `nil`) - The product attribute key-numeric interval.
  *   `productAttributeValue` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeValue.t`, *default:* `nil`) - The product attribute key-value.
  *   `representativeProductId` (*type:* `String.t`, *default:* `nil`) - The representative product id for this tile.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :productAttributeInterval =>
            GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeInterval.t() | nil,
          :productAttributeValue =>
            GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeValue.t() | nil,
          :representativeProductId => String.t() | nil
        }

  field(:productAttributeInterval,
    as: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeInterval
  )

  field(:productAttributeValue,
    as: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2ProductAttributeValue
  )

  field(:representativeProductId)
end

defimpl Poison.Decoder, for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2Tile do
  def decode(value, options) do
    GoogleApi.Retail.V2.Model.GoogleCloudRetailV2Tile.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2Tile do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
