# 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.RepricingRuleRestriction do
@moduledoc """
Definition of a rule restriction. At least one of the following needs to be true: (1) use_auto_pricing_min_price is true (2) floor.price_delta exists (3) floor.percentage_delta exists If floor.price_delta and floor.percentage_delta are both set on a rule, the highest value will be chosen by the Repricer. In other words, for a product with a price of $50, if the `floor.percentage_delta` is "-10" and the floor.price_delta is "-12", the offer price will only be lowered $5 (10% lower than the original offer price).
## Attributes
* `floor` (*type:* `GoogleApi.Content.V21.Model.RepricingRuleRestrictionBoundary.t`, *default:* `nil`) - The inclusive floor lower bound. The repricing rule only applies when new price >= floor.
* `useAutoPricingMinPrice` (*type:* `boolean()`, *default:* `nil`) - If true, use the AUTO_PRICING_MIN_PRICE offer attribute as the lower bound of the rule. If use_auto_pricing_min_price is true, then only offers with `AUTO_PRICING_MIN_PRICE` existing on the offer will get Repricer treatment, even if a floor value is set on the rule. Also, if use_auto_pricing_min_price is true, the floor restriction will be ignored.
"""
use GoogleApi.Gax.ModelBase
@type t :: %__MODULE__{
:floor => GoogleApi.Content.V21.Model.RepricingRuleRestrictionBoundary.t() | nil,
:useAutoPricingMinPrice => boolean() | nil
}
field(:floor, as: GoogleApi.Content.V21.Model.RepricingRuleRestrictionBoundary)
field(:useAutoPricingMinPrice)
end
defimpl Poison.Decoder, for: GoogleApi.Content.V21.Model.RepricingRuleRestriction do
def decode(value, options) do
GoogleApi.Content.V21.Model.RepricingRuleRestriction.decode(value, options)
end
end
defimpl Poison.Encoder, for: GoogleApi.Content.V21.Model.RepricingRuleRestriction do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end