Current section

Files

Jump to
google_api_content lib google_api content v2 model rate_group.ex
Raw

lib/google_api/content/v2/model/rate_group.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 class is auto generated by the elixir code generator program.
# Do not edit the class manually.
defmodule GoogleApi.Content.V2.Model.RateGroup do
@moduledoc """
## Attributes
- applicableShippingLabels (list(String.t)): A list of shipping labels defining the products to which this rate group applies to. This is a disjunction: only one of the labels has to match for the rate group to apply. May only be empty for the last rate group of a service. Required. Defaults to `nil`.
- carrierRates (list(GoogleApi.Content.V2.Model.CarrierRate.t)): A list of carrier rates that can be referred to by mainTable or singleValue. Defaults to `nil`.
- mainTable (GoogleApi.Content.V2.Model.Table.t): A table defining the rate group, when singleValue is not expressive enough. Can only be set if singleValue is not set. Defaults to `nil`.
- name (String.t): Name of the rate group. Optional. If set has to be unique within shipping service. Defaults to `nil`.
- singleValue (GoogleApi.Content.V2.Model.Value.t): The value of the rate group (e.g. flat rate $10). Can only be set if mainTable and subtables are not set. Defaults to `nil`.
- subtables (list(GoogleApi.Content.V2.Model.Table.t)): A list of subtables referred to by mainTable. Can only be set if mainTable is set. Defaults to `nil`.
"""
use GoogleApi.Gax.ModelBase
@type t :: %__MODULE__{
:applicableShippingLabels => list(String.t()),
:carrierRates => list(GoogleApi.Content.V2.Model.CarrierRate.t()),
:mainTable => GoogleApi.Content.V2.Model.Table.t(),
:name => String.t(),
:singleValue => GoogleApi.Content.V2.Model.Value.t(),
:subtables => list(GoogleApi.Content.V2.Model.Table.t())
}
field(:applicableShippingLabels, type: :list)
field(:carrierRates, as: GoogleApi.Content.V2.Model.CarrierRate, type: :list)
field(:mainTable, as: GoogleApi.Content.V2.Model.Table)
field(:name)
field(:singleValue, as: GoogleApi.Content.V2.Model.Value)
field(:subtables, as: GoogleApi.Content.V2.Model.Table, type: :list)
end
defimpl Poison.Decoder, for: GoogleApi.Content.V2.Model.RateGroup do
def decode(value, options) do
GoogleApi.Content.V2.Model.RateGroup.decode(value, options)
end
end
defimpl Poison.Encoder, for: GoogleApi.Content.V2.Model.RateGroup do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end