# 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.V1.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.V1.Model.BiddingStrategy.t`, *default:* `nil`) - Required. The bidding strategy of the line item.
  *   `budget` (*type:* `GoogleApi.DisplayVideo.V1.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.V1.Model.ConversionCountingConfig.t`, *default:* `nil`) - The conversion tracking setting of the line item.
  *   `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.V1.Model.LineItemFlight.t`, *default:* `nil`) - Required. The start and end time of the line item's flight.
  *   `frequencyCap` (*type:* `GoogleApi.DisplayVideo.V1.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.V1.Model.IntegrationDetails.t`, *default:* `nil`) - Integration details of the line item.
  *   `inventorySourceIds` (*type:* `list(String.t)`, *default:* `nil`) - The IDs of the private inventory sources assigned to 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.V1.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.V1.Model.Pacing.t`, *default:* `nil`) - Required. The budget spending speed setting of the line item.
  *   `partnerCosts` (*type:* `list(GoogleApi.DisplayVideo.V1.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.V1.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.V1.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.
  """

  use GoogleApi.Gax.ModelBase

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

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

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

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