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

  ## Attributes

  *   `advertiserId` (*type:* `String.t`, *default:* `nil`) - Output only. The unique ID of the advertiser the line item belongs to.
  *   `bidStrategy` (*type:* `GoogleApi.DisplayVideo.V3.Model.BiddingStrategy.t`, *default:* `nil`) - Required. The bidding strategy of the line item.
  *   `budget` (*type:* `GoogleApi.DisplayVideo.V3.Model.LineItemBudget.t`, *default:* `nil`) - Required. The budget allocation setting of the line item.
  *   `campaignId` (*type:* `String.t`, *default:* `nil`) - Output only. The unique ID of the campaign that the line item belongs to.
  *   `conversionCounting` (*type:* `GoogleApi.DisplayVideo.V3.Model.ConversionCountingConfig.t`, *default:* `nil`) - The conversion tracking setting of the line item. *Warning*: Starting **April 1, 2025**, the floodlight_activity_configs field will no longer be writable while a custom bidding algorithm is assigned to the line item. If you set this field and assign a custom bidding algorithm in the same request, the floodlight activities must match the ones used by the custom bidding algorithm. [Read more about this announced change](/display-video/api/deprecations#features.custom_bidding_floodlight).
  *   `creativeIds` (*type:* `list(String.t)`, *default:* `nil`) - The IDs of the creatives associated with the line item.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. The display name of the line item. Must be UTF-8 encoded with a maximum size of 240 bytes.
  *   `entityStatus` (*type:* `String.t`, *default:* `nil`) - Required. Controls whether or not the line item can spend its budget and bid on inventory. * For CreateLineItem method, only `ENTITY_STATUS_DRAFT` is allowed. To activate a line item, use UpdateLineItem method and update the status to `ENTITY_STATUS_ACTIVE` after creation. * A line item cannot be changed back to `ENTITY_STATUS_DRAFT` status from any other status. * If the line item's parent insertion order is not active, the line item can't spend its budget even if its own status is `ENTITY_STATUS_ACTIVE`.
  *   `excludeNewExchanges` (*type:* `boolean()`, *default:* `nil`) - Whether to exclude new exchanges from automatically being targeted by the line item. This field is false by default.
  *   `flight` (*type:* `GoogleApi.DisplayVideo.V3.Model.LineItemFlight.t`, *default:* `nil`) - Required. The start and end time of the line item's flight.
  *   `frequencyCap` (*type:* `GoogleApi.DisplayVideo.V3.Model.FrequencyCap.t`, *default:* `nil`) - Required. The impression frequency cap settings of the line item. The max_impressions field in this settings object must be used if assigning a limited cap.
  *   `insertionOrderId` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. The unique ID of the insertion order that the line item belongs to.
  *   `integrationDetails` (*type:* `GoogleApi.DisplayVideo.V3.Model.IntegrationDetails.t`, *default:* `nil`) - Integration details of the line item.
  *   `lineItemId` (*type:* `String.t`, *default:* `nil`) - Output only. The unique ID of the line item. Assigned by the system.
  *   `lineItemType` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. The type of the line item.
  *   `mobileApp` (*type:* `GoogleApi.DisplayVideo.V3.Model.MobileApp.t`, *default:* `nil`) - The mobile app promoted by the line item. This is applicable only when line_item_type is either `LINE_ITEM_TYPE_DISPLAY_MOBILE_APP_INSTALL` or `LINE_ITEM_TYPE_VIDEO_MOBILE_APP_INSTALL`.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the line item.
  *   `pacing` (*type:* `GoogleApi.DisplayVideo.V3.Model.Pacing.t`, *default:* `nil`) - Required. The budget spending speed setting of the line item.
  *   `partnerCosts` (*type:* `list(GoogleApi.DisplayVideo.V3.Model.PartnerCost.t)`, *default:* `nil`) - The partner costs associated with the line item. If absent or empty in CreateLineItem method, the newly created line item will inherit partner costs from its parent insertion order.
  *   `partnerRevenueModel` (*type:* `GoogleApi.DisplayVideo.V3.Model.PartnerRevenueModel.t`, *default:* `nil`) - Required. The partner revenue model setting of the line item.
  *   `reservationType` (*type:* `String.t`, *default:* `nil`) - Output only. The reservation type of the line item.
  *   `targetingExpansion` (*type:* `GoogleApi.DisplayVideo.V3.Model.TargetingExpansionConfig.t`, *default:* `nil`) - The [optimized targeting](//support.google.com/displayvideo/answer/12060859) settings of the line item. This config is only applicable for display, video, or audio line items that use automated bidding and positively target eligible audience lists.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the line item was last updated. Assigned by the system.
  *   `warningMessages` (*type:* `list(String.t)`, *default:* `nil`) - Output only. The warning messages generated by the line item. These warnings do not block saving the line item, but some may block the line item from running.
  *   `youtubeAndPartnersSettings` (*type:* `GoogleApi.DisplayVideo.V3.Model.YoutubeAndPartnersSettings.t`, *default:* `nil`) - Output only. Settings specific to YouTube and Partners line items.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :advertiserId => String.t() | nil,
          :bidStrategy => GoogleApi.DisplayVideo.V3.Model.BiddingStrategy.t() | nil,
          :budget => GoogleApi.DisplayVideo.V3.Model.LineItemBudget.t() | nil,
          :campaignId => String.t() | nil,
          :conversionCounting =>
            GoogleApi.DisplayVideo.V3.Model.ConversionCountingConfig.t() | nil,
          :creativeIds => list(String.t()) | nil,
          :displayName => String.t() | nil,
          :entityStatus => String.t() | nil,
          :excludeNewExchanges => boolean() | nil,
          :flight => GoogleApi.DisplayVideo.V3.Model.LineItemFlight.t() | nil,
          :frequencyCap => GoogleApi.DisplayVideo.V3.Model.FrequencyCap.t() | nil,
          :insertionOrderId => String.t() | nil,
          :integrationDetails => GoogleApi.DisplayVideo.V3.Model.IntegrationDetails.t() | nil,
          :lineItemId => String.t() | nil,
          :lineItemType => String.t() | nil,
          :mobileApp => GoogleApi.DisplayVideo.V3.Model.MobileApp.t() | nil,
          :name => String.t() | nil,
          :pacing => GoogleApi.DisplayVideo.V3.Model.Pacing.t() | nil,
          :partnerCosts => list(GoogleApi.DisplayVideo.V3.Model.PartnerCost.t()) | nil,
          :partnerRevenueModel => GoogleApi.DisplayVideo.V3.Model.PartnerRevenueModel.t() | nil,
          :reservationType => String.t() | nil,
          :targetingExpansion =>
            GoogleApi.DisplayVideo.V3.Model.TargetingExpansionConfig.t() | nil,
          :updateTime => DateTime.t() | nil,
          :warningMessages => list(String.t()) | nil,
          :youtubeAndPartnersSettings =>
            GoogleApi.DisplayVideo.V3.Model.YoutubeAndPartnersSettings.t() | nil
        }

  field(:advertiserId)
  field(:bidStrategy, as: GoogleApi.DisplayVideo.V3.Model.BiddingStrategy)
  field(:budget, as: GoogleApi.DisplayVideo.V3.Model.LineItemBudget)
  field(:campaignId)
  field(:conversionCounting, as: GoogleApi.DisplayVideo.V3.Model.ConversionCountingConfig)
  field(:creativeIds, type: :list)
  field(:displayName)
  field(:entityStatus)
  field(:excludeNewExchanges)
  field(:flight, as: GoogleApi.DisplayVideo.V3.Model.LineItemFlight)
  field(:frequencyCap, as: GoogleApi.DisplayVideo.V3.Model.FrequencyCap)
  field(:insertionOrderId)
  field(:integrationDetails, as: GoogleApi.DisplayVideo.V3.Model.IntegrationDetails)
  field(:lineItemId)
  field(:lineItemType)
  field(:mobileApp, as: GoogleApi.DisplayVideo.V3.Model.MobileApp)
  field(:name)
  field(:pacing, as: GoogleApi.DisplayVideo.V3.Model.Pacing)
  field(:partnerCosts, as: GoogleApi.DisplayVideo.V3.Model.PartnerCost, type: :list)
  field(:partnerRevenueModel, as: GoogleApi.DisplayVideo.V3.Model.PartnerRevenueModel)
  field(:reservationType)
  field(:targetingExpansion, as: GoogleApi.DisplayVideo.V3.Model.TargetingExpansionConfig)
  field(:updateTime, as: DateTime)
  field(:warningMessages, type: :list)

  field(:youtubeAndPartnersSettings,
    as: GoogleApi.DisplayVideo.V3.Model.YoutubeAndPartnersSettings
  )
end

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

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