# 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.TagManager.V2.Model.Tag do
  @moduledoc """
  Represents a Google Tag Manager Tag.

  ## Attributes

  *   `accountId` (*type:* `String.t`, *default:* `nil`) - GTM Account ID.
  *   `blockingTriggerId` (*type:* `list(String.t)`, *default:* `nil`) - Blocking trigger IDs. If any of the listed triggers evaluate to true, the tag will not fire.
  *   `consentSettings` (*type:* `GoogleApi.TagManager.V2.Model.TagConsentSetting.t`, *default:* `nil`) - Consent settings of a tag.
  *   `containerId` (*type:* `String.t`, *default:* `nil`) - GTM Container ID.
  *   `fingerprint` (*type:* `String.t`, *default:* `nil`) - The fingerprint of the GTM Tag as computed at storage time. This value is recomputed whenever the tag is modified.
  *   `firingTriggerId` (*type:* `list(String.t)`, *default:* `nil`) - Firing trigger IDs. A tag will fire when any of the listed triggers are true and all of its blockingTriggerIds (if any specified) are false.
  *   `liveOnly` (*type:* `boolean()`, *default:* `nil`) - If set to true, this tag will only fire in the live environment (e.g. not in preview or debug mode).
  *   `monitoringMetadata` (*type:* `GoogleApi.TagManager.V2.Model.Parameter.t`, *default:* `nil`) - A map of key-value pairs of tag metadata to be included in the event data for tag monitoring. Notes: - This parameter must be type MAP. - Each parameter in the map are type TEMPLATE, however cannot contain variable references. 
  *   `monitoringMetadataTagNameKey` (*type:* `String.t`, *default:* `nil`) - If non-empty, then the tag display name will be included in the monitoring metadata map using the key specified.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Tag display name.
  *   `notes` (*type:* `String.t`, *default:* `nil`) - User notes on how to apply this tag in the container.
  *   `parameter` (*type:* `list(GoogleApi.TagManager.V2.Model.Parameter.t)`, *default:* `nil`) - The tag's parameters.
  *   `parentFolderId` (*type:* `String.t`, *default:* `nil`) - Parent folder id.
  *   `path` (*type:* `String.t`, *default:* `nil`) - GTM Tag's API relative path.
  *   `paused` (*type:* `boolean()`, *default:* `nil`) - Indicates whether the tag is paused, which prevents the tag from firing.
  *   `priority` (*type:* `GoogleApi.TagManager.V2.Model.Parameter.t`, *default:* `nil`) - User defined numeric priority of the tag. Tags are fired asynchronously in order of priority. Tags with higher numeric value fire first. A tag's priority can be a positive or negative value. The default value is 0.
  *   `scheduleEndMs` (*type:* `String.t`, *default:* `nil`) - The end timestamp in milliseconds to schedule a tag.
  *   `scheduleStartMs` (*type:* `String.t`, *default:* `nil`) - The start timestamp in milliseconds to schedule a tag.
  *   `setupTag` (*type:* `list(GoogleApi.TagManager.V2.Model.SetupTag.t)`, *default:* `nil`) - The list of setup tags. Currently we only allow one.
  *   `tagFiringOption` (*type:* `String.t`, *default:* `nil`) - Option to fire this tag.
  *   `tagId` (*type:* `String.t`, *default:* `nil`) - The Tag ID uniquely identifies the GTM Tag.
  *   `tagManagerUrl` (*type:* `String.t`, *default:* `nil`) - Auto generated link to the tag manager UI
  *   `teardownTag` (*type:* `list(GoogleApi.TagManager.V2.Model.TeardownTag.t)`, *default:* `nil`) - The list of teardown tags. Currently we only allow one.
  *   `type` (*type:* `String.t`, *default:* `nil`) - GTM Tag Type.
  *   `workspaceId` (*type:* `String.t`, *default:* `nil`) - GTM Workspace ID.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountId => String.t() | nil,
          :blockingTriggerId => list(String.t()) | nil,
          :consentSettings => GoogleApi.TagManager.V2.Model.TagConsentSetting.t() | nil,
          :containerId => String.t() | nil,
          :fingerprint => String.t() | nil,
          :firingTriggerId => list(String.t()) | nil,
          :liveOnly => boolean() | nil,
          :monitoringMetadata => GoogleApi.TagManager.V2.Model.Parameter.t() | nil,
          :monitoringMetadataTagNameKey => String.t() | nil,
          :name => String.t() | nil,
          :notes => String.t() | nil,
          :parameter => list(GoogleApi.TagManager.V2.Model.Parameter.t()) | nil,
          :parentFolderId => String.t() | nil,
          :path => String.t() | nil,
          :paused => boolean() | nil,
          :priority => GoogleApi.TagManager.V2.Model.Parameter.t() | nil,
          :scheduleEndMs => String.t() | nil,
          :scheduleStartMs => String.t() | nil,
          :setupTag => list(GoogleApi.TagManager.V2.Model.SetupTag.t()) | nil,
          :tagFiringOption => String.t() | nil,
          :tagId => String.t() | nil,
          :tagManagerUrl => String.t() | nil,
          :teardownTag => list(GoogleApi.TagManager.V2.Model.TeardownTag.t()) | nil,
          :type => String.t() | nil,
          :workspaceId => String.t() | nil
        }

  field(:accountId)
  field(:blockingTriggerId, type: :list)
  field(:consentSettings, as: GoogleApi.TagManager.V2.Model.TagConsentSetting)
  field(:containerId)
  field(:fingerprint)
  field(:firingTriggerId, type: :list)
  field(:liveOnly)
  field(:monitoringMetadata, as: GoogleApi.TagManager.V2.Model.Parameter)
  field(:monitoringMetadataTagNameKey)
  field(:name)
  field(:notes)
  field(:parameter, as: GoogleApi.TagManager.V2.Model.Parameter, type: :list)
  field(:parentFolderId)
  field(:path)
  field(:paused)
  field(:priority, as: GoogleApi.TagManager.V2.Model.Parameter)
  field(:scheduleEndMs)
  field(:scheduleStartMs)
  field(:setupTag, as: GoogleApi.TagManager.V2.Model.SetupTag, type: :list)
  field(:tagFiringOption)
  field(:tagId)
  field(:tagManagerUrl)
  field(:teardownTag, as: GoogleApi.TagManager.V2.Model.TeardownTag, type: :list)
  field(:type)
  field(:workspaceId)
end

defimpl Poison.Decoder, for: GoogleApi.TagManager.V2.Model.Tag do
  def decode(value, options) do
    GoogleApi.TagManager.V2.Model.Tag.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.TagManager.V2.Model.Tag do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
