lib/google_api/content/v2/model/test_order.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.V2.Model.TestOrder do
  @moduledoc """


  ## Attributes

  *   `customer` (*type:* `GoogleApi.Content.V2.Model.TestOrderCustomer.t`, *default:* `nil`) - Required. The details of the customer who placed the order.
  *   `enableOrderinvoices` (*type:* `boolean()`, *default:* `nil`) - Whether the orderinvoices service should support this order.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Identifies what kind of resource this is. Value: the fixed string "`content#testOrder`"
  *   `lineItems` (*type:* `list(GoogleApi.Content.V2.Model.TestOrderLineItem.t)`, *default:* `nil`) - Required. Line items that are ordered. At least one line item must be provided.
  *   `notificationMode` (*type:* `String.t`, *default:* `nil`) - Restricted. Do not use.
  *   `paymentMethod` (*type:* `GoogleApi.Content.V2.Model.TestOrderPaymentMethod.t`, *default:* `nil`) - The details of the payment method.
  *   `predefinedDeliveryAddress` (*type:* `String.t`, *default:* `nil`) - Required. Identifier of one of the predefined delivery addresses for the delivery. Acceptable values are: - "`dwight`" - "`jim`" - "`pam`" 
  *   `predefinedPickupDetails` (*type:* `String.t`, *default:* `nil`) - Identifier of one of the predefined pickup details. Required for orders containing line items with shipping type `pickup`. Acceptable values are: - "`dwight`" - "`jim`" - "`pam`" 
  *   `promotions` (*type:* `list(GoogleApi.Content.V2.Model.OrderLegacyPromotion.t)`, *default:* `nil`) - Deprecated. Ignored if provided.
  *   `shippingCost` (*type:* `GoogleApi.Content.V2.Model.Price.t`, *default:* `nil`) - Required. The price of shipping for all items. Shipping tax is automatically calculated for orders where marketplace facilitator tax laws are applicable. Otherwise, tax settings from Merchant Center are applied. Note that shipping is not taxed in certain states.
  *   `shippingCostTax` (*type:* `GoogleApi.Content.V2.Model.Price.t`, *default:* `nil`) - Deprecated. Ignored if provided.
  *   `shippingOption` (*type:* `String.t`, *default:* `nil`) - Required. The requested shipping option. Acceptable values are: - "`economy`" - "`expedited`" - "`oneDay`" - "`sameDay`" - "`standard`" - "`twoDay`" 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :customer => GoogleApi.Content.V2.Model.TestOrderCustomer.t() | nil,
          :enableOrderinvoices => boolean() | nil,
          :kind => String.t() | nil,
          :lineItems => list(GoogleApi.Content.V2.Model.TestOrderLineItem.t()) | nil,
          :notificationMode => String.t() | nil,
          :paymentMethod => GoogleApi.Content.V2.Model.TestOrderPaymentMethod.t() | nil,
          :predefinedDeliveryAddress => String.t() | nil,
          :predefinedPickupDetails => String.t() | nil,
          :promotions => list(GoogleApi.Content.V2.Model.OrderLegacyPromotion.t()) | nil,
          :shippingCost => GoogleApi.Content.V2.Model.Price.t() | nil,
          :shippingCostTax => GoogleApi.Content.V2.Model.Price.t() | nil,
          :shippingOption => String.t() | nil
        }

  field(:customer, as: GoogleApi.Content.V2.Model.TestOrderCustomer)
  field(:enableOrderinvoices)
  field(:kind)
  field(:lineItems, as: GoogleApi.Content.V2.Model.TestOrderLineItem, type: :list)
  field(:notificationMode)
  field(:paymentMethod, as: GoogleApi.Content.V2.Model.TestOrderPaymentMethod)
  field(:predefinedDeliveryAddress)
  field(:predefinedPickupDetails)
  field(:promotions, as: GoogleApi.Content.V2.Model.OrderLegacyPromotion, type: :list)
  field(:shippingCost, as: GoogleApi.Content.V2.Model.Price)
  field(:shippingCostTax, as: GoogleApi.Content.V2.Model.Price)
  field(:shippingOption)
end

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

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