# 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.CloudSearch.V1.Model.EnterpriseTopazSidekickRankingParams do
  @moduledoc """
  Ranking params.

  ## Attributes

  *   `endTimeMs` (*type:* `String.t`, *default:* `nil`) - The end-time that this object will expect to occur. If the type is marked as FIXED, then this end-time will persist after bidding. If the type is marked as FLEXIBLE, this field is NOT expected to be filled and will be filled in after it has won a bid. Expected to be set when type is set to FIXED.
  *   `priority` (*type:* `String.t`, *default:* `nil`) - The priority to determine between objects that have the same start_time_ms The lower-value of priority == ranked higher. Max-priority = 0. Expected to be set for all types.
  *   `score` (*type:* `number()`, *default:* `nil`) - The score of the card to be used to break priority-ties
  *   `spanMs` (*type:* `String.t`, *default:* `nil`) - The span that this card will take in the stream Expected to be set when type is set to FLEXIBLE.
  *   `startTimeMs` (*type:* `String.t`, *default:* `nil`) - The start-time that this object will bid-for If the type is marked as FIXED, then this start-time will persist after bidding. If the type is marked as FLEXIBLE, then it will occur at the given time or sometime after the requested time. Expected to be set for all types.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The packing type of this object.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :endTimeMs => String.t() | nil,
          :priority => String.t() | nil,
          :score => number() | nil,
          :spanMs => String.t() | nil,
          :startTimeMs => String.t() | nil,
          :type => String.t() | nil
        }

  field(:endTimeMs)
  field(:priority)
  field(:score)
  field(:spanMs)
  field(:startTimeMs)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickRankingParams do
  def decode(value, options) do
    GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickRankingParams.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickRankingParams do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
