lib/google_api/content/v21/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.V21.Model.TestOrder do
  @moduledoc """


  ## Attributes

  *   `deliveryDetails` (*type:* `GoogleApi.Content.V21.Model.TestOrderDeliveryDetails.t`, *default:* `nil`) - Overrides the predefined delivery details if provided.
  *   `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.V21.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.
  *   `pickupDetails` (*type:* `GoogleApi.Content.V21.Model.TestOrderPickupDetails.t`, *default:* `nil`) - Overrides the predefined pickup details if provided.
  *   `predefinedBillingAddress` (*type:* `String.t`, *default:* `nil`) - Required. The billing address. Acceptable values are: - "`dwight`" - "`jim`" - "`pam`" 
  *   `predefinedDeliveryAddress` (*type:* `String.t`, *default:* `nil`) - Required. Identifier of one of the predefined delivery addresses for the delivery. Acceptable values are: - "`dwight`" - "`jim`" - "`pam`" 
  *   `predefinedEmail` (*type:* `String.t`, *default:* `nil`) - Required. Email address of the customer. Acceptable values are: - "`pog.dwight.schrute@gmail.com`" - "`pog.jim.halpert@gmail.com`" - "`penpog.pam.beesly@gmail.comding`" 
  *   `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.V21.Model.OrderPromotion.t)`, *default:* `nil`) - Promotions associated with the order.
  *   `shippingCost` (*type:* `GoogleApi.Content.V21.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.
  *   `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__{
          :deliveryDetails => GoogleApi.Content.V21.Model.TestOrderDeliveryDetails.t() | nil,
          :enableOrderinvoices => boolean() | nil,
          :kind => String.t() | nil,
          :lineItems => list(GoogleApi.Content.V21.Model.TestOrderLineItem.t()) | nil,
          :notificationMode => String.t() | nil,
          :pickupDetails => GoogleApi.Content.V21.Model.TestOrderPickupDetails.t() | nil,
          :predefinedBillingAddress => String.t() | nil,
          :predefinedDeliveryAddress => String.t() | nil,
          :predefinedEmail => String.t() | nil,
          :predefinedPickupDetails => String.t() | nil,
          :promotions => list(GoogleApi.Content.V21.Model.OrderPromotion.t()) | nil,
          :shippingCost => GoogleApi.Content.V21.Model.Price.t() | nil,
          :shippingOption => String.t() | nil
        }

  field(:deliveryDetails, as: GoogleApi.Content.V21.Model.TestOrderDeliveryDetails)
  field(:enableOrderinvoices)
  field(:kind)
  field(:lineItems, as: GoogleApi.Content.V21.Model.TestOrderLineItem, type: :list)
  field(:notificationMode)
  field(:pickupDetails, as: GoogleApi.Content.V21.Model.TestOrderPickupDetails)
  field(:predefinedBillingAddress)
  field(:predefinedDeliveryAddress)
  field(:predefinedEmail)
  field(:predefinedPickupDetails)
  field(:promotions, as: GoogleApi.Content.V21.Model.OrderPromotion, type: :list)
  field(:shippingCost, as: GoogleApi.Content.V21.Model.Price)
  field(:shippingOption)
end

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

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