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


  ## Attributes

  *   `lastReturnDate` (*type:* `String.t`, *default:* `nil`) - Required. Last day for returning the items. In ISO 8601 format. When specifying the return window like this, set the policy type to "lastReturnDate". Use this for seasonal overrides only.
  *   `numberOfDays` (*type:* `String.t`, *default:* `nil`) - The number of days items can be returned after delivery, where one day is defined to be 24 hours after the delivery timestamp. When specifying the return window like this, set the policy type to "numberOfDaysAfterDelivery". Acceptable values are 30, 45, 60, 90, 100, 180, 270 and 365 for the default policy. Additional policies further allow 14, 15, 21 and 28 days, but note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics. A policy of less than 30 days can only be applied to those items.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Policy type. Use "lastReturnDate" for seasonal overrides only. Note that for most items a minimum of 30 days is required for returns. Exceptions may be made for electronics or non-returnable items such as food, perishables, and living things. A policy of less than 30 days can only be applied to those items. Acceptable values are: - "`lastReturnDate`" - "`lifetimeReturns`" - "`noReturns`" - "`numberOfDaysAfterDelivery`" 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :lastReturnDate => String.t() | nil,
          :numberOfDays => String.t() | nil,
          :type => String.t() | nil
        }

  field(:lastReturnDate)
  field(:numberOfDays)
  field(:type)
end

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

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