# 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.GoogleAnalyticsAdminV1alphaSearchAds360Link do
  @moduledoc """
  A link between a Google Analytics property and a Search Ads 360 entity.

  ## Attributes

  *   `adsPersonalizationEnabled` (*type:* `boolean()`, *default:* `nil`) - Enables personalized advertising features with this integration. If this field is not set on create, it will be defaulted to true.
  *   `advertiserDisplayName` (*type:* `String.t`, *default:* `nil`) - Output only. The display name of the Search Ads 360 Advertiser. Allows users to easily identify the linked resource.
  *   `advertiserId` (*type:* `String.t`, *default:* `nil`) - Immutable. This field represents the Advertiser ID of the Search Ads 360 Advertiser. that has been linked.
  *   `campaignDataSharingEnabled` (*type:* `boolean()`, *default:* `nil`) - Immutable. Enables the import of campaign data from Search Ads 360 into the Google Analytics property. After link creation, this can only be updated from the Search Ads 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 Search Ads 360 to the Google Analytics property. This can only be enabled if campaign_data_sharing_enabled is enabled. After link creation, this can only be updated from the Search Ads 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 SearchAds360Link resource. Format: properties/{propertyId}/searchAds360Links/{linkId} Note: linkId is not the Search Ads 360 advertiser ID
  *   `siteStatsSharingEnabled` (*type:* `boolean()`, *default:* `nil`) - Enables export of site stats with this integration. If this field is not set on create, it will be defaulted to true.
  """

  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,
          :siteStatsSharingEnabled => boolean() | nil
        }

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

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

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