# 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.Creative do
  @moduledoc """
  A single Creative.

  ## Attributes

  *   `skippable` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether the user can choose to skip a video creative. This field is only supported for the following creative_type: * `CREATIVE_TYPE_VIDEO`
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the creative was created. Assigned by the system.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the creative.
  *   `cmPlacementId` (*type:* `String.t`, *default:* `nil`) - Output only. The unique ID of the Campaign Manager 360 placement associated with the creative. This field is only applicable for creatives that are synced from Campaign Manager.
  *   `dimensions` (*type:* `GoogleApi.DisplayVideo.V3.Model.Dimensions.t`, *default:* `nil`) - Required. Primary dimensions of the creative. Applicable to all creative types. The value of width_pixels and height_pixels defaults to `0` when creative_type is one of: * `CREATIVE_TYPE_VIDEO` * `CREATIVE_TYPE_AUDIO` * `CREATIVE_TYPE_NATIVE_VIDEO`
  *   `jsTrackerUrl` (*type:* `String.t`, *default:* `nil`) - Optional. JavaScript measurement URL from supported third-party verification providers (ComScore, DoubleVerify, IAS, Moat). HTML script tags are not supported. This field is only writeable in the following creative_type: * `CREATIVE_TYPE_NATIVE` * `CREATIVE_TYPE_NATIVE_SITE_SQUARE` * `CREATIVE_TYPE_NATIVE_VIDEO`
  *   `thirdPartyTag` (*type:* `String.t`, *default:* `nil`) - Optional. The original third-party tag used for the creative. Required and only valid for third-party tag creatives. Third-party tag creatives are creatives with following hosting_source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_STANDARD` * `CREATIVE_TYPE_EXPANDABLE`
  *   `html5Video` (*type:* `boolean()`, *default:* `nil`) - Output only. Indicates the third-party VAST tag creative requires HTML5 Video support. Output only and only valid for third-party VAST tag creatives. Third-party VAST tag creatives are creatives with following hosting_source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_VIDEO`
  *   `advertiserId` (*type:* `String.t`, *default:* `nil`) - Output only. The unique ID of the advertiser the creative belongs to.
  *   `timerEvents` (*type:* `list(GoogleApi.DisplayVideo.V3.Model.TimerEvent.t)`, *default:* `nil`) - Optional. Timer custom events for a rich media creative. Timers track the time during which a user views and interacts with a specified part of a rich media creative. A creative can have multiple timer events, each timed independently. Leave it empty or unset for creatives containing image assets only.
  *   `mediaDuration` (*type:* `String.t`, *default:* `nil`) - Output only. Media duration of the creative. Applicable when creative_type is one of: * `CREATIVE_TYPE_VIDEO` * `CREATIVE_TYPE_AUDIO` * `CREATIVE_TYPE_NATIVE_VIDEO` * `CREATIVE_TYPE_PUBLISHER_HOSTED`
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. The display name of the creative. Must be UTF-8 encoded with a maximum size of 240 bytes.
  *   `dynamic` (*type:* `boolean()`, *default:* `nil`) - Output only. Indicates whether the creative is dynamic.
  *   `hostingSource` (*type:* `String.t`, *default:* `nil`) - Required. Indicates where the creative is hosted.
  *   `thirdPartyUrls` (*type:* `list(GoogleApi.DisplayVideo.V3.Model.ThirdPartyUrl.t)`, *default:* `nil`) - Optional. Tracking URLs from third parties to track interactions with a video creative. This field is only supported for the following creative_type: * `CREATIVE_TYPE_AUDIO` * `CREATIVE_TYPE_VIDEO` * `CREATIVE_TYPE_NATIVE_VIDEO`
  *   `creativeType` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. The type of the creative.
  *   `notes` (*type:* `String.t`, *default:* `nil`) - Optional. User notes for this creative. Must be UTF-8 encoded with a length of no more than 20,000 characters.
  *   `oggAudio` (*type:* `boolean()`, *default:* `nil`) - Output only. Indicates the third-party audio creative supports OGG. Output only and only valid for third-party audio creatives. Third-party audio creatives are creatives with following hosting_source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_AUDIO`
  *   `requirePingForAttribution` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates that the creative will wait for a return ping for attribution. Only valid when using a Campaign Manager 360 tracking ad with a third-party ad server parameter and the ${DC_DBM_TOKEN} macro. Optional and only valid for third-party tag creatives or third-party VAST tag creatives. Third-party tag creatives are creatives with following hosting_source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_STANDARD` * `CREATIVE_TYPE_EXPANDABLE` Third-party VAST tag creatives are creatives with following hosting_source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_AUDIO` * `CREATIVE_TYPE_VIDEO`
  *   `companionCreativeIds` (*type:* `list(String.t)`, *default:* `nil`) - Optional. The IDs of companion creatives for a video creative. You can assign existing display creatives (with image or HTML5 assets) to serve surrounding the publisher's video player. Companions display around the video player while the video is playing and remain after the video has completed. Creatives contain additional dimensions can not be companion creatives. This field is only supported for the following creative_type: * `CREATIVE_TYPE_AUDIO` * `CREATIVE_TYPE_VIDEO`
  *   `cmTrackingAd` (*type:* `GoogleApi.DisplayVideo.V3.Model.CmTrackingAd.t`, *default:* `nil`) - Optional. The Campaign Manager 360 tracking ad associated with the creative. Optional for the following creative_type when created by an advertiser that uses both Campaign Manager 360 and third-party ad serving: * `CREATIVE_TYPE_NATIVE` * `CREATIVE_TYPE_NATIVE_SITE_SQUARE` Output only for other cases.
  *   `universalAdId` (*type:* `GoogleApi.DisplayVideo.V3.Model.UniversalAdId.t`, *default:* `nil`) - Optional. An optional creative identifier provided by a registry that is unique across all platforms. Universal Ad ID is part of the VAST 4.0 standard. It can be modified after the creative is created. This field is only supported for the following creative_type: * `CREATIVE_TYPE_VIDEO`
  *   `obaIcon` (*type:* `GoogleApi.DisplayVideo.V3.Model.ObaIcon.t`, *default:* `nil`) - Optional. Specifies the OBA icon for a video creative. This field is only supported in the following creative_type: * `CREATIVE_TYPE_VIDEO`
  *   `vastTagUrl` (*type:* `String.t`, *default:* `nil`) - Optional. The URL of the VAST tag for a third-party VAST tag creative. Required and only valid for third-party VAST tag creatives. Third-party VAST tag creatives are creatives with following hosting_source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_AUDIO` * `CREATIVE_TYPE_VIDEO`
  *   `iasCampaignMonitoring` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates whether Integral Ad Science (IAS) campaign monitoring is enabled. To enable this for the creative, make sure the Advertiser.creative_config.ias_client_id has been set to your IAS client ID.
  *   `expandingDirection` (*type:* `String.t`, *default:* `nil`) - Optional. Specifies the expanding direction of the creative. Required and only valid for third-party expandable creatives. Third-party expandable creatives are creatives with following hosting source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_EXPANDABLE`
  *   `creativeId` (*type:* `String.t`, *default:* `nil`) - Output only. The unique ID of the creative. Assigned by the system.
  *   `skipOffset` (*type:* `GoogleApi.DisplayVideo.V3.Model.AudioVideoOffset.t`, *default:* `nil`) - Optional. Amount of time to play the video before the skip button appears. This field is required when skippable is true. This field is only supported for the following creative_type: * `CREATIVE_TYPE_VIDEO`
  *   `entityStatus` (*type:* `String.t`, *default:* `nil`) - Required. Controls whether or not the creative can serve. Accepted values are: * `ENTITY_STATUS_ACTIVE` * `ENTITY_STATUS_ARCHIVED` * `ENTITY_STATUS_PAUSED`
  *   `requireHtml5` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates that the creative relies on HTML5 to render properly. Optional and only valid for third-party tag creatives. Third-party tag creatives are creatives with following hosting_source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_STANDARD` * `CREATIVE_TYPE_EXPANDABLE`
  *   `counterEvents` (*type:* `list(GoogleApi.DisplayVideo.V3.Model.CounterEvent.t)`, *default:* `nil`) - Optional. Counter events for a rich media creative. Counters track the number of times that a user interacts with any part of a rich media creative in a specified way (mouse-overs, mouse-outs, clicks, taps, data loading, keyboard entries, etc.). Any event that can be captured in the creative can be recorded as a counter. Leave it empty or unset for creatives containing image assets only.
  *   `requireMraid` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates that the creative requires MRAID (Mobile Rich Media Ad Interface Definitions system). Set this if the creative relies on mobile gestures for interactivity, such as swiping or tapping. Optional and only valid for third-party tag creatives. Third-party tag creatives are creatives with following hosting_source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_STANDARD` * `CREATIVE_TYPE_EXPANDABLE`
  *   `vpaid` (*type:* `boolean()`, *default:* `nil`) - Output only. Indicates the third-party VAST tag creative requires VPAID (Digital Video Player-Ad Interface). Output only and only valid for third-party VAST tag creatives. Third-party VAST tag creatives are creatives with following hosting_source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_VIDEO`
  *   `lineItemIds` (*type:* `list(String.t)`, *default:* `nil`) - Output only. The IDs of the line items this creative is associated with. To associate a creative to a line item, use LineItem.creative_ids instead.
  *   `mp3Audio` (*type:* `boolean()`, *default:* `nil`) - Output only. Indicates the third-party audio creative supports MP3. Output only and only valid for third-party audio creatives. Third-party audio creatives are creatives with following hosting_source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_AUDIO`
  *   `appendedTag` (*type:* `String.t`, *default:* `nil`) - Optional. Third-party HTML tracking tag to be appended to the creative tag.
  *   `reviewStatus` (*type:* `GoogleApi.DisplayVideo.V3.Model.ReviewStatusInfo.t`, *default:* `nil`) - Output only. The current status of the creative review process.
  *   `integrationCode` (*type:* `String.t`, *default:* `nil`) - Optional. ID information used to link this creative to an external system. Must be UTF-8 encoded with a length of no more than 10,000 characters.
  *   `exitEvents` (*type:* `list(GoogleApi.DisplayVideo.V3.Model.ExitEvent.t)`, *default:* `nil`) - Required. Exit events for this creative. An exit (also known as a click tag) is any area in your creative that someone can click or tap to open an advertiser's landing page. Every creative must include at least one exit. You can add an exit to your creative in any of the following ways: * Use Google Web Designer's tap area. * Define a JavaScript variable called "clickTag". * Use the Enabler (Enabler.exit()) to track exits in rich media formats.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the creative was last updated, either by the user or system (e.g. creative review). Assigned by the system.
  *   `progressOffset` (*type:* `GoogleApi.DisplayVideo.V3.Model.AudioVideoOffset.t`, *default:* `nil`) - Optional. Amount of time to play the video before counting a view. This field is required when skippable is true. This field is only supported for the following creative_type: * `CREATIVE_TYPE_VIDEO`
  *   `assets` (*type:* `list(GoogleApi.DisplayVideo.V3.Model.AssetAssociation.t)`, *default:* `nil`) - Required. Assets associated to this creative.
  *   `creativeAttributes` (*type:* `list(String.t)`, *default:* `nil`) - Output only. A list of attributes of the creative that is generated by the system.
  *   `expandOnHover` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates the creative will automatically expand on hover. Optional and only valid for third-party expandable creatives. Third-party expandable creatives are creatives with following hosting source: * `HOSTING_SOURCE_THIRD_PARTY` combined with following creative_type: * `CREATIVE_TYPE_EXPANDABLE`
  *   `transcodes` (*type:* `list(GoogleApi.DisplayVideo.V3.Model.Transcode.t)`, *default:* `nil`) - Output only. Audio/Video transcodes. Display & Video 360 transcodes the main asset into a number of alternative versions that use different file formats or have different properties (resolution, audio bit rate, and video bit rate), each designed for specific video players or bandwidths. These transcodes give a publisher's system more options to choose from for each impression on your video and ensures that the appropriate file serves based on the viewer’s connection and screen size. This field is only supported in the following creative_type: * `CREATIVE_TYPE_VIDEO` * `CREATIVE_TYPE_NATIVE_VIDEO` * `CREATIVE_TYPE_AUDIO`
  *   `trackerUrls` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Tracking URLs for analytics providers or third-party ad technology vendors. The URLs must start with `https:` (except on inventory that doesn't require SSL compliance). If using macros in your URL, use only macros supported by Display & Video 360. Standard URLs only, no IMG or SCRIPT tags. This field is only writeable in the following creative_type: * `CREATIVE_TYPE_NATIVE` * `CREATIVE_TYPE_NATIVE_SITE_SQUARE` * `CREATIVE_TYPE_NATIVE_VIDEO`
  *   `additionalDimensions` (*type:* `list(GoogleApi.DisplayVideo.V3.Model.Dimensions.t)`, *default:* `nil`) - Optional. Additional dimensions. Applicable when creative_type is one of: * `CREATIVE_TYPE_STANDARD` * `CREATIVE_TYPE_EXPANDABLE` * `CREATIVE_TYPE_NATIVE` * `CREATIVE_TYPE_NATIVE_SITE_SQUARE` * `CREATIVE_TYPE_LIGHTBOX` * `CREATIVE_TYPE_PUBLISHER_HOSTED` If this field is specified, width_pixels and height_pixels are both required and must be greater than or equal to 0.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :skippable => boolean() | nil,
          :createTime => DateTime.t() | nil,
          :name => String.t() | nil,
          :cmPlacementId => String.t() | nil,
          :dimensions => GoogleApi.DisplayVideo.V3.Model.Dimensions.t() | nil,
          :jsTrackerUrl => String.t() | nil,
          :thirdPartyTag => String.t() | nil,
          :html5Video => boolean() | nil,
          :advertiserId => String.t() | nil,
          :timerEvents => list(GoogleApi.DisplayVideo.V3.Model.TimerEvent.t()) | nil,
          :mediaDuration => String.t() | nil,
          :displayName => String.t() | nil,
          :dynamic => boolean() | nil,
          :hostingSource => String.t() | nil,
          :thirdPartyUrls => list(GoogleApi.DisplayVideo.V3.Model.ThirdPartyUrl.t()) | nil,
          :creativeType => String.t() | nil,
          :notes => String.t() | nil,
          :oggAudio => boolean() | nil,
          :requirePingForAttribution => boolean() | nil,
          :companionCreativeIds => list(String.t()) | nil,
          :cmTrackingAd => GoogleApi.DisplayVideo.V3.Model.CmTrackingAd.t() | nil,
          :universalAdId => GoogleApi.DisplayVideo.V3.Model.UniversalAdId.t() | nil,
          :obaIcon => GoogleApi.DisplayVideo.V3.Model.ObaIcon.t() | nil,
          :vastTagUrl => String.t() | nil,
          :iasCampaignMonitoring => boolean() | nil,
          :expandingDirection => String.t() | nil,
          :creativeId => String.t() | nil,
          :skipOffset => GoogleApi.DisplayVideo.V3.Model.AudioVideoOffset.t() | nil,
          :entityStatus => String.t() | nil,
          :requireHtml5 => boolean() | nil,
          :counterEvents => list(GoogleApi.DisplayVideo.V3.Model.CounterEvent.t()) | nil,
          :requireMraid => boolean() | nil,
          :vpaid => boolean() | nil,
          :lineItemIds => list(String.t()) | nil,
          :mp3Audio => boolean() | nil,
          :appendedTag => String.t() | nil,
          :reviewStatus => GoogleApi.DisplayVideo.V3.Model.ReviewStatusInfo.t() | nil,
          :integrationCode => String.t() | nil,
          :exitEvents => list(GoogleApi.DisplayVideo.V3.Model.ExitEvent.t()) | nil,
          :updateTime => DateTime.t() | nil,
          :progressOffset => GoogleApi.DisplayVideo.V3.Model.AudioVideoOffset.t() | nil,
          :assets => list(GoogleApi.DisplayVideo.V3.Model.AssetAssociation.t()) | nil,
          :creativeAttributes => list(String.t()) | nil,
          :expandOnHover => boolean() | nil,
          :transcodes => list(GoogleApi.DisplayVideo.V3.Model.Transcode.t()) | nil,
          :trackerUrls => list(String.t()) | nil,
          :additionalDimensions => list(GoogleApi.DisplayVideo.V3.Model.Dimensions.t()) | nil
        }

  field(:skippable)
  field(:createTime, as: DateTime)
  field(:name)
  field(:cmPlacementId)
  field(:dimensions, as: GoogleApi.DisplayVideo.V3.Model.Dimensions)
  field(:jsTrackerUrl)
  field(:thirdPartyTag)
  field(:html5Video)
  field(:advertiserId)
  field(:timerEvents, as: GoogleApi.DisplayVideo.V3.Model.TimerEvent, type: :list)
  field(:mediaDuration)
  field(:displayName)
  field(:dynamic)
  field(:hostingSource)
  field(:thirdPartyUrls, as: GoogleApi.DisplayVideo.V3.Model.ThirdPartyUrl, type: :list)
  field(:creativeType)
  field(:notes)
  field(:oggAudio)
  field(:requirePingForAttribution)
  field(:companionCreativeIds, type: :list)
  field(:cmTrackingAd, as: GoogleApi.DisplayVideo.V3.Model.CmTrackingAd)
  field(:universalAdId, as: GoogleApi.DisplayVideo.V3.Model.UniversalAdId)
  field(:obaIcon, as: GoogleApi.DisplayVideo.V3.Model.ObaIcon)
  field(:vastTagUrl)
  field(:iasCampaignMonitoring)
  field(:expandingDirection)
  field(:creativeId)
  field(:skipOffset, as: GoogleApi.DisplayVideo.V3.Model.AudioVideoOffset)
  field(:entityStatus)
  field(:requireHtml5)
  field(:counterEvents, as: GoogleApi.DisplayVideo.V3.Model.CounterEvent, type: :list)
  field(:requireMraid)
  field(:vpaid)
  field(:lineItemIds, type: :list)
  field(:mp3Audio)
  field(:appendedTag)
  field(:reviewStatus, as: GoogleApi.DisplayVideo.V3.Model.ReviewStatusInfo)
  field(:integrationCode)
  field(:exitEvents, as: GoogleApi.DisplayVideo.V3.Model.ExitEvent, type: :list)
  field(:updateTime, as: DateTime)
  field(:progressOffset, as: GoogleApi.DisplayVideo.V3.Model.AudioVideoOffset)
  field(:assets, as: GoogleApi.DisplayVideo.V3.Model.AssetAssociation, type: :list)
  field(:creativeAttributes, type: :list)
  field(:expandOnHover)
  field(:transcodes, as: GoogleApi.DisplayVideo.V3.Model.Transcode, type: :list)
  field(:trackerUrls, type: :list)
  field(:additionalDimensions, as: GoogleApi.DisplayVideo.V3.Model.Dimensions, type: :list)
end

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

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