lib/google_api/content/v21/model/orders_custom_batch_request_entry_refund_item_item.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.OrdersCustomBatchRequestEntryRefundItemItem do
  @moduledoc """


  ## Attributes

  *   `amount` (*type:* `GoogleApi.Content.V21.Model.MonetaryAmount.t`, *default:* `nil`) - The total amount that is refunded. (e.g. refunding $5 each for 2 products should be done by setting quantity to 2 and amount to 10$) In case of multiple refunds, this should be the amount you currently want to refund to the customer.
  *   `fullRefund` (*type:* `boolean()`, *default:* `nil`) - If true, the full item will be refunded. If this is true, amount should not be provided and will be ignored.
  *   `lineItemId` (*type:* `String.t`, *default:* `nil`) - The ID of the line item. Either lineItemId or productId is required.
  *   `productId` (*type:* `String.t`, *default:* `nil`) - The ID of the product. This is the REST ID used in the products service. Either lineItemId or productId is required.
  *   `quantity` (*type:* `integer()`, *default:* `nil`) - The number of products that are refunded.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :amount => GoogleApi.Content.V21.Model.MonetaryAmount.t() | nil,
          :fullRefund => boolean() | nil,
          :lineItemId => String.t() | nil,
          :productId => String.t() | nil,
          :quantity => integer() | nil
        }

  field(:amount, as: GoogleApi.Content.V21.Model.MonetaryAmount)
  field(:fullRefund)
  field(:lineItemId)
  field(:productId)
  field(:quantity)
end

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

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