# 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.AdExchangeBuyer.V2beta1.Model.ImpressionMetricsRow do
  @moduledoc """
  The set of metrics that are measured in numbers of impressions, representing how many impressions with the specified dimension values were considered eligible at each stage of the bidding funnel.

  ## Attributes

  *   `availableImpressions` (*type:* `GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue.t`, *default:* `nil`) - The number of impressions available to the buyer on Ad Exchange. In some cases this value may be unavailable.
  *   `bidRequests` (*type:* `GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue.t`, *default:* `nil`) - The number of impressions for which Ad Exchange sent the buyer a bid request.
  *   `inventoryMatches` (*type:* `GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue.t`, *default:* `nil`) - The number of impressions that match the buyer's inventory pretargeting.
  *   `responsesWithBids` (*type:* `GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue.t`, *default:* `nil`) - The number of impressions for which Ad Exchange received a response from the buyer that contained at least one applicable bid.
  *   `rowDimensions` (*type:* `GoogleApi.AdExchangeBuyer.V2beta1.Model.RowDimensions.t`, *default:* `nil`) - The values of all dimensions associated with metric values in this row.
  *   `successfulResponses` (*type:* `GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue.t`, *default:* `nil`) - The number of impressions for which the buyer successfully sent a response to Ad Exchange.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :availableImpressions => GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue.t() | nil,
          :bidRequests => GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue.t() | nil,
          :inventoryMatches => GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue.t() | nil,
          :responsesWithBids => GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue.t() | nil,
          :rowDimensions => GoogleApi.AdExchangeBuyer.V2beta1.Model.RowDimensions.t() | nil,
          :successfulResponses => GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue.t() | nil
        }

  field(:availableImpressions, as: GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue)
  field(:bidRequests, as: GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue)
  field(:inventoryMatches, as: GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue)
  field(:responsesWithBids, as: GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue)
  field(:rowDimensions, as: GoogleApi.AdExchangeBuyer.V2beta1.Model.RowDimensions)
  field(:successfulResponses, as: GoogleApi.AdExchangeBuyer.V2beta1.Model.MetricValue)
end

defimpl Poison.Decoder, for: GoogleApi.AdExchangeBuyer.V2beta1.Model.ImpressionMetricsRow do
  def decode(value, options) do
    GoogleApi.AdExchangeBuyer.V2beta1.Model.ImpressionMetricsRow.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AdExchangeBuyer.V2beta1.Model.ImpressionMetricsRow do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
