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

  ## Attributes

  *   `isWeakReference` (*type:* `boolean()`, *default:* `nil`) - Whether or not a reference type parameter is strongly or weakly referenced. Only used by Transformations.
  *   `key` (*type:* `String.t`, *default:* `nil`) - The named key that uniquely identifies a parameter. Required for top-level parameters, as well as map values. Ignored for list values.
  *   `list` (*type:* `list(GoogleApi.TagManager.V2.Model.Parameter.t)`, *default:* `nil`) - This list parameter's parameters (keys will be ignored).
  *   `map` (*type:* `list(GoogleApi.TagManager.V2.Model.Parameter.t)`, *default:* `nil`) - This map parameter's parameters (must have keys; keys must be unique).
  *   `type` (*type:* `String.t`, *default:* `nil`) - The parameter type. Valid values are: - boolean: The value represents a boolean, represented as 'true' or 'false' - integer: The value represents a 64-bit signed integer value, in base 10 - list: A list of parameters should be specified - map: A map of parameters should be specified - template: The value represents any text; this can include variable references (even variable references that might return non-string types) - trigger_reference: The value represents a trigger, represented as the trigger id - tag_reference: The value represents a tag, represented as the tag name 
  *   `value` (*type:* `String.t`, *default:* `nil`) - A parameter's value (may contain variable references). as appropriate to the specified type.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :isWeakReference => boolean() | nil,
          :key => String.t() | nil,
          :list => list(GoogleApi.TagManager.V2.Model.Parameter.t()) | nil,
          :map => list(GoogleApi.TagManager.V2.Model.Parameter.t()) | nil,
          :type => String.t() | nil,
          :value => String.t() | nil
        }

  field(:isWeakReference)
  field(:key)
  field(:list, as: GoogleApi.TagManager.V2.Model.Parameter, type: :list)
  field(:map, as: GoogleApi.TagManager.V2.Model.Parameter, type: :list)
  field(:type)
  field(:value)
end

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

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