# 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.AudienceGroupAssignedTargetingOptionDetails do
  @moduledoc """
  Assigned audience group targeting option details. This will be populated in the details field of an AssignedTargetingOption when targeting_type is `TARGETING_TYPE_AUDIENCE_GROUP`. The relation between each group is UNION, except for excluded_first_and_third_party_audience_group and excluded_google_audience_group, of which COMPLEMENT is used as an INTERSECTION with other groups.

  ## Attributes

  *   `excludedFirstAndThirdPartyAudienceGroup` (*type:* `GoogleApi.DisplayVideo.V3.Model.FirstAndThirdPartyAudienceGroup.t`, *default:* `nil`) - Optional. The first and third party audience ids and recencies of the excluded first and third party audience group. Used for negative targeting. The COMPLEMENT of the UNION of this group and other excluded audience groups is used as an INTERSECTION to any positive audience targeting. All items are logically ‘OR’ of each other.
  *   `excludedGoogleAudienceGroup` (*type:* `GoogleApi.DisplayVideo.V3.Model.GoogleAudienceGroup.t`, *default:* `nil`) - Optional. The Google audience ids of the excluded Google audience group. Used for negative targeting. The COMPLEMENT of the UNION of this group and other excluded audience groups is used as an INTERSECTION to any positive audience targeting. Only contains Affinity, In-market and Installed-apps type Google audiences. All items are logically ‘OR’ of each other.
  *   `includedCombinedAudienceGroup` (*type:* `GoogleApi.DisplayVideo.V3.Model.CombinedAudienceGroup.t`, *default:* `nil`) - Optional. The combined audience ids of the included combined audience group. Contains combined audience ids only.
  *   `includedCustomListGroup` (*type:* `GoogleApi.DisplayVideo.V3.Model.CustomListGroup.t`, *default:* `nil`) - Optional. The custom list ids of the included custom list group. Contains custom list ids only.
  *   `includedFirstAndThirdPartyAudienceGroups` (*type:* `list(GoogleApi.DisplayVideo.V3.Model.FirstAndThirdPartyAudienceGroup.t)`, *default:* `nil`) - Optional. The first and third party audience ids and recencies of included first and third party audience groups. Each first and third party audience group contains first and third party audience ids only. The relation between each first and third party audience group is INTERSECTION, and the result is UNION'ed with other audience groups. Repeated groups with the same settings will be ignored.
  *   `includedGoogleAudienceGroup` (*type:* `GoogleApi.DisplayVideo.V3.Model.GoogleAudienceGroup.t`, *default:* `nil`) - Optional. The Google audience ids of the included Google audience group. Contains Google audience ids only.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :excludedFirstAndThirdPartyAudienceGroup =>
            GoogleApi.DisplayVideo.V3.Model.FirstAndThirdPartyAudienceGroup.t() | nil,
          :excludedGoogleAudienceGroup =>
            GoogleApi.DisplayVideo.V3.Model.GoogleAudienceGroup.t() | nil,
          :includedCombinedAudienceGroup =>
            GoogleApi.DisplayVideo.V3.Model.CombinedAudienceGroup.t() | nil,
          :includedCustomListGroup => GoogleApi.DisplayVideo.V3.Model.CustomListGroup.t() | nil,
          :includedFirstAndThirdPartyAudienceGroups =>
            list(GoogleApi.DisplayVideo.V3.Model.FirstAndThirdPartyAudienceGroup.t()) | nil,
          :includedGoogleAudienceGroup =>
            GoogleApi.DisplayVideo.V3.Model.GoogleAudienceGroup.t() | nil
        }

  field(:excludedFirstAndThirdPartyAudienceGroup,
    as: GoogleApi.DisplayVideo.V3.Model.FirstAndThirdPartyAudienceGroup
  )

  field(:excludedGoogleAudienceGroup, as: GoogleApi.DisplayVideo.V3.Model.GoogleAudienceGroup)
  field(:includedCombinedAudienceGroup, as: GoogleApi.DisplayVideo.V3.Model.CombinedAudienceGroup)
  field(:includedCustomListGroup, as: GoogleApi.DisplayVideo.V3.Model.CustomListGroup)

  field(:includedFirstAndThirdPartyAudienceGroups,
    as: GoogleApi.DisplayVideo.V3.Model.FirstAndThirdPartyAudienceGroup,
    type: :list
  )

  field(:includedGoogleAudienceGroup, as: GoogleApi.DisplayVideo.V3.Model.GoogleAudienceGroup)
end

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

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