# 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.RealTimeBidding.V1.Model.CreativeServingDecision do
  @moduledoc """
  Top level status and detected attributes of a creative.

  ## Attributes

  *   `adTechnologyProviders` (*type:* `GoogleApi.RealTimeBidding.V1.Model.AdTechnologyProviders.t`, *default:* `nil`) - The detected ad technology providers.
  *   `chinaPolicyCompliance` (*type:* `GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance.t`, *default:* `nil`) - The policy compliance of this creative in China. When approved or disapproved, this applies to both deals and open auction in China. When pending review, this creative is allowed to serve for deals but not for open auction.
  *   `dealsPolicyCompliance` (*type:* `GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance.t`, *default:* `nil`) - Policy compliance of this creative when bidding on Programmatic Guaranteed and Preferred Deals (outside of Russia and China).
  *   `detectedAdvertisers` (*type:* `list(GoogleApi.RealTimeBidding.V1.Model.AdvertiserAndBrand.t)`, *default:* `nil`) - Detected advertisers and brands.
  *   `detectedAttributes` (*type:* `list(String.t)`, *default:* `nil`) - Publisher-excludable attributes that were detected for this creative. Can be used to filter the response of the creatives.list method. If the `excluded_attribute` field of a [bid request](https://developers.google.com/authorized-buyers/rtb/downloads/realtime-bidding-proto) contains one of the attributes that were declared or detected for a given creative, and a bid is submitted with that creative, the bid will be filtered before the auction.
  *   `detectedCategories` (*type:* `list(String.t)`, *default:* `nil`) - Output only. IDs of the detected categories. The taxonomy in which the categories are expressed is specified by the detected_categories_taxonomy field. Use this in conjunction with BidRequest.bcat to avoid bidding on impressions where a given ad category is blocked, or to troubleshoot filtered bids. Can be used to filter the response of the creatives.list method.
  *   `detectedCategoriesTaxonomy` (*type:* `String.t`, *default:* `nil`) - Output only. The taxonomy in which the detected_categories field is expressed.
  *   `detectedClickThroughUrls` (*type:* `list(String.t)`, *default:* `nil`) - The set of detected destination URLs for the creative. Can be used to filter the response of the creatives.list method.
  *   `detectedDomains` (*type:* `list(String.t)`, *default:* `nil`) - The detected domains for this creative.
  *   `detectedLanguages` (*type:* `list(String.t)`, *default:* `nil`) - The detected languages for this creative. The order is arbitrary. The codes are 2 or 5 characters and are documented at https://developers.google.com/adwords/api/docs/appendix/languagecodes. Can be used to filter the response of the creatives.list method.
  *   `detectedProductCategories` (*type:* `list(integer())`, *default:* `nil`) - Detected product categories, if any. See the ad-product-categories.txt file in the technical documentation for a list of IDs. Can be used to filter the response of the creatives.list method.
  *   `detectedSensitiveCategories` (*type:* `list(integer())`, *default:* `nil`) - Detected sensitive categories, if any. Can be used to filter the response of the creatives.list method. See the ad-sensitive-categories.txt file in the technical documentation for a list of IDs. You should use these IDs along with the excluded-sensitive-category field in the bid request to filter your bids.
  *   `detectedVendorIds` (*type:* `list(integer())`, *default:* `nil`) - IDs of the ad technology vendors that were detected to be used by this creative. See https://storage.googleapis.com/adx-rtb-dictionaries/vendors.txt for possible values. Can be used to filter the response of the creatives.list method. If the `allowed_vendor_type` field of a [bid request](https://developers.google.com/authorized-buyers/rtb/downloads/realtime-bidding-proto) does not contain one of the vendor type IDs that were declared or detected for a given creative, and a bid is submitted with that creative, the bid will be filtered before the auction.
  *   `lastStatusUpdate` (*type:* `DateTime.t`, *default:* `nil`) - The last time the creative status was updated. Can be used to filter the response of the creatives.list method.
  *   `networkPolicyCompliance` (*type:* `GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance.t`, *default:* `nil`) - Policy compliance of this creative when bidding in open auction, private auction, or auction packages (outside of Russia and China).
  *   `platformPolicyCompliance` (*type:* `GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance.t`, *default:* `nil`) - Policy compliance of this creative when bidding in Open Bidding (outside of Russia and China). For the list of platform policies, see: https://support.google.com/platformspolicy/answer/3013851.
  *   `russiaPolicyCompliance` (*type:* `GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance.t`, *default:* `nil`) - The policy compliance of this creative in Russia. When approved or disapproved, this applies to both deals and open auction in Russia. When pending review, this creative is allowed to serve for deals but not for open auction.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :adTechnologyProviders =>
            GoogleApi.RealTimeBidding.V1.Model.AdTechnologyProviders.t() | nil,
          :chinaPolicyCompliance => GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance.t() | nil,
          :dealsPolicyCompliance => GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance.t() | nil,
          :detectedAdvertisers =>
            list(GoogleApi.RealTimeBidding.V1.Model.AdvertiserAndBrand.t()) | nil,
          :detectedAttributes => list(String.t()) | nil,
          :detectedCategories => list(String.t()) | nil,
          :detectedCategoriesTaxonomy => String.t() | nil,
          :detectedClickThroughUrls => list(String.t()) | nil,
          :detectedDomains => list(String.t()) | nil,
          :detectedLanguages => list(String.t()) | nil,
          :detectedProductCategories => list(integer()) | nil,
          :detectedSensitiveCategories => list(integer()) | nil,
          :detectedVendorIds => list(integer()) | nil,
          :lastStatusUpdate => DateTime.t() | nil,
          :networkPolicyCompliance =>
            GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance.t() | nil,
          :platformPolicyCompliance =>
            GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance.t() | nil,
          :russiaPolicyCompliance => GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance.t() | nil
        }

  field(:adTechnologyProviders, as: GoogleApi.RealTimeBidding.V1.Model.AdTechnologyProviders)
  field(:chinaPolicyCompliance, as: GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance)
  field(:dealsPolicyCompliance, as: GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance)

  field(:detectedAdvertisers,
    as: GoogleApi.RealTimeBidding.V1.Model.AdvertiserAndBrand,
    type: :list
  )

  field(:detectedAttributes, type: :list)
  field(:detectedCategories, type: :list)
  field(:detectedCategoriesTaxonomy)
  field(:detectedClickThroughUrls, type: :list)
  field(:detectedDomains, type: :list)
  field(:detectedLanguages, type: :list)
  field(:detectedProductCategories, type: :list)
  field(:detectedSensitiveCategories, type: :list)
  field(:detectedVendorIds, type: :list)
  field(:lastStatusUpdate, as: DateTime)
  field(:networkPolicyCompliance, as: GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance)
  field(:platformPolicyCompliance, as: GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance)
  field(:russiaPolicyCompliance, as: GoogleApi.RealTimeBidding.V1.Model.PolicyCompliance)
end

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

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