# 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.AnalyticsAdmin.V1alpha.Model.GoogleAnalyticsAdminV1alphaDisplayVideo360AdvertiserLink do
  @moduledoc """
  A link between a Google Analytics property and a Display & Video 360 advertiser.

  ## Attributes

  *   `adsPersonalizationEnabled` (*type:* `boolean()`, *default:* `nil`) - Enables personalized advertising features with this integration. If this field is not set on create/update, it will be defaulted to true.
  *   `advertiserDisplayName` (*type:* `String.t`, *default:* `nil`) - Output only. The display name of the Display & Video 360 Advertiser.
  *   `advertiserId` (*type:* `String.t`, *default:* `nil`) - Immutable. The Display & Video 360 Advertiser's advertiser ID.
  *   `campaignDataSharingEnabled` (*type:* `boolean()`, *default:* `nil`) - Immutable. Enables the import of campaign data from Display & Video 360 into the Google Analytics property. After link creation, this can only be updated from the Display & Video 360 product. If this field is not set on create, it will be defaulted to true.
  *   `costDataSharingEnabled` (*type:* `boolean()`, *default:* `nil`) - Immutable. Enables the import of cost data from Display & Video 360 into the Google Analytics property. This can only be enabled if `campaign_data_sharing_enabled` is true. After link creation, this can only be updated from the Display & Video 360 product. If this field is not set on create, it will be defaulted to true.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name for this DisplayVideo360AdvertiserLink resource. Format: properties/{propertyId}/displayVideo360AdvertiserLinks/{linkId} Note: linkId is not the Display & Video 360 Advertiser ID
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :adsPersonalizationEnabled => boolean() | nil,
          :advertiserDisplayName => String.t() | nil,
          :advertiserId => String.t() | nil,
          :campaignDataSharingEnabled => boolean() | nil,
          :costDataSharingEnabled => boolean() | nil,
          :name => String.t() | nil
        }

  field(:adsPersonalizationEnabled)
  field(:advertiserDisplayName)
  field(:advertiserId)
  field(:campaignDataSharingEnabled)
  field(:costDataSharingEnabled)
  field(:name)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.AnalyticsAdmin.V1alpha.Model.GoogleAnalyticsAdminV1alphaDisplayVideo360AdvertiserLink do
  def decode(value, options) do
    GoogleApi.AnalyticsAdmin.V1alpha.Model.GoogleAnalyticsAdminV1alphaDisplayVideo360AdvertiserLink.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.AnalyticsAdmin.V1alpha.Model.GoogleAnalyticsAdminV1alphaDisplayVideo360AdvertiserLink do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
