# 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.DisplayVideo.V3.Model.CustomBiddingAlgorithmRules do
  @moduledoc """
  A single custom bidding algorithm rules.

  ## Attributes

  *   `active` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the rules resource is currently being used for scoring by the parent algorithm.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the rules resource was created.
  *   `customBiddingAlgorithmId` (*type:* `String.t`, *default:* `nil`) - Output only. The unique ID of the custom bidding algorithm that the rules resource belongs to.
  *   `customBiddingAlgorithmRulesId` (*type:* `String.t`, *default:* `nil`) - Output only. The unique ID of the rules resource.
  *   `error` (*type:* `GoogleApi.DisplayVideo.V3.Model.CustomBiddingAlgorithmRulesError.t`, *default:* `nil`) - Output only. Error code of the rejected rules resource. This field will only be populated when the state is `REJECTED`.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the rules resource.
  *   `rules` (*type:* `GoogleApi.DisplayVideo.V3.Model.CustomBiddingAlgorithmRulesRef.t`, *default:* `nil`) - Required. Immutable. The reference to the uploaded AlgorithmRules file.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The state of the rules resource.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :active => boolean() | nil,
          :createTime => DateTime.t() | nil,
          :customBiddingAlgorithmId => String.t() | nil,
          :customBiddingAlgorithmRulesId => String.t() | nil,
          :error => GoogleApi.DisplayVideo.V3.Model.CustomBiddingAlgorithmRulesError.t() | nil,
          :name => String.t() | nil,
          :rules => GoogleApi.DisplayVideo.V3.Model.CustomBiddingAlgorithmRulesRef.t() | nil,
          :state => String.t() | nil
        }

  field(:active)
  field(:createTime, as: DateTime)
  field(:customBiddingAlgorithmId)
  field(:customBiddingAlgorithmRulesId)
  field(:error, as: GoogleApi.DisplayVideo.V3.Model.CustomBiddingAlgorithmRulesError)
  field(:name)
  field(:rules, as: GoogleApi.DisplayVideo.V3.Model.CustomBiddingAlgorithmRulesRef)
  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.DisplayVideo.V3.Model.CustomBiddingAlgorithmRules do
  def decode(value, options) do
    GoogleApi.DisplayVideo.V3.Model.CustomBiddingAlgorithmRules.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DisplayVideo.V3.Model.CustomBiddingAlgorithmRules do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
