# 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.V14.Model.PerformanceReport do
  @moduledoc """
  The configuration data for an Ad Exchange performance report list.

  ## Attributes

  *   `bidRate` (*type:* `float()`, *default:* `nil`) - The number of bid responses with an ad.
  *   `bidRequestRate` (*type:* `float()`, *default:* `nil`) - The number of bid requests sent to your bidder.
  *   `calloutStatusRate` (*type:* `list(any())`, *default:* `nil`) - Rate of various prefiltering statuses per match. Please refer to the callout-status-codes.txt file for different statuses.
  *   `cookieMatcherStatusRate` (*type:* `list(any())`, *default:* `nil`) - Average QPS for cookie matcher operations.
  *   `creativeStatusRate` (*type:* `list(any())`, *default:* `nil`) - Rate of ads with a given status. Please refer to the creative-status-codes.txt file for different statuses.
  *   `filteredBidRate` (*type:* `float()`, *default:* `nil`) - The number of bid responses that were filtered due to a policy violation or other errors.
  *   `hostedMatchStatusRate` (*type:* `list(any())`, *default:* `nil`) - Average QPS for hosted match operations.
  *   `inventoryMatchRate` (*type:* `float()`, *default:* `nil`) - The number of potential queries based on your pretargeting settings.
  *   `kind` (*type:* `String.t`, *default:* `adexchangebuyer#performanceReport`) - Resource type.
  *   `latency50thPercentile` (*type:* `float()`, *default:* `nil`) - The 50th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report.
  *   `latency85thPercentile` (*type:* `float()`, *default:* `nil`) - The 85th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report.
  *   `latency95thPercentile` (*type:* `float()`, *default:* `nil`) - The 95th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report.
  *   `noQuotaInRegion` (*type:* `float()`, *default:* `nil`) - Rate of various quota account statuses per quota check.
  *   `outOfQuota` (*type:* `float()`, *default:* `nil`) - Rate of various quota account statuses per quota check.
  *   `pixelMatchRequests` (*type:* `float()`, *default:* `nil`) - Average QPS for pixel match requests from clients.
  *   `pixelMatchResponses` (*type:* `float()`, *default:* `nil`) - Average QPS for pixel match responses from clients.
  *   `quotaConfiguredLimit` (*type:* `float()`, *default:* `nil`) - The configured quota limits for this account.
  *   `quotaThrottledLimit` (*type:* `float()`, *default:* `nil`) - The throttled quota limits for this account.
  *   `region` (*type:* `String.t`, *default:* `nil`) - The trading location of this data.
  *   `successfulRequestRate` (*type:* `float()`, *default:* `nil`) - The number of properly formed bid responses received by our servers within the deadline.
  *   `timestamp` (*type:* `String.t`, *default:* `nil`) - The unix timestamp of the starting time of this performance data.
  *   `unsuccessfulRequestRate` (*type:* `float()`, *default:* `nil`) - The number of bid responses that were unsuccessful due to timeouts, incorrect formatting, etc.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bidRate => float() | nil,
          :bidRequestRate => float() | nil,
          :calloutStatusRate => list(any()) | nil,
          :cookieMatcherStatusRate => list(any()) | nil,
          :creativeStatusRate => list(any()) | nil,
          :filteredBidRate => float() | nil,
          :hostedMatchStatusRate => list(any()) | nil,
          :inventoryMatchRate => float() | nil,
          :kind => String.t() | nil,
          :latency50thPercentile => float() | nil,
          :latency85thPercentile => float() | nil,
          :latency95thPercentile => float() | nil,
          :noQuotaInRegion => float() | nil,
          :outOfQuota => float() | nil,
          :pixelMatchRequests => float() | nil,
          :pixelMatchResponses => float() | nil,
          :quotaConfiguredLimit => float() | nil,
          :quotaThrottledLimit => float() | nil,
          :region => String.t() | nil,
          :successfulRequestRate => float() | nil,
          :timestamp => String.t() | nil,
          :unsuccessfulRequestRate => float() | nil
        }

  field(:bidRate)
  field(:bidRequestRate)
  field(:calloutStatusRate, type: :list)
  field(:cookieMatcherStatusRate, type: :list)
  field(:creativeStatusRate, type: :list)
  field(:filteredBidRate)
  field(:hostedMatchStatusRate, type: :list)
  field(:inventoryMatchRate)
  field(:kind)
  field(:latency50thPercentile)
  field(:latency85thPercentile)
  field(:latency95thPercentile)
  field(:noQuotaInRegion)
  field(:outOfQuota)
  field(:pixelMatchRequests)
  field(:pixelMatchResponses)
  field(:quotaConfiguredLimit)
  field(:quotaThrottledLimit)
  field(:region)
  field(:successfulRequestRate)
  field(:timestamp)
  field(:unsuccessfulRequestRate)
end

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

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