# 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.CloudResourceManager.V3.Model.EffectiveTag do
  @moduledoc """
  An EffectiveTag represents a tag that applies to a resource during policy evaluation. Tags can be either directly bound to a resource or inherited from its ancestor. EffectiveTag contains the name and namespaced_name of the tag value and tag key, with additional fields of `inherited` to indicate the inheritance status of the effective tag.

  ## Attributes

  *   `inherited` (*type:* `boolean()`, *default:* `nil`) - Indicates the inheritance status of a tag value attached to the given resource. If the tag value is inherited from one of the resource's ancestors, inherited will be true. If false, then the tag value is directly attached to the resource, inherited will be false.
  *   `namespacedTagKey` (*type:* `String.t`, *default:* `nil`) - The namespaced name of the TagKey. Can be in the form `{organization_id}/{tag_key_short_name}` or `{project_id}/{tag_key_short_name}` or `{project_number}/{tag_key_short_name}`.
  *   `namespacedTagValue` (*type:* `String.t`, *default:* `nil`) - The namespaced name of the TagValue. Can be in the form `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or `{project_number}/{tag_key_short_name}/{tag_value_short_name}`.
  *   `tagKey` (*type:* `String.t`, *default:* `nil`) - The name of the TagKey, in the format `tagKeys/{id}`, such as `tagKeys/123`.
  *   `tagKeyParentName` (*type:* `String.t`, *default:* `nil`) - The parent name of the tag key. Must be in the format `organizations/{organization_id}` or `projects/{project_number}`
  *   `tagValue` (*type:* `String.t`, *default:* `nil`) - Resource name for TagValue in the format `tagValues/456`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :inherited => boolean() | nil,
          :namespacedTagKey => String.t() | nil,
          :namespacedTagValue => String.t() | nil,
          :tagKey => String.t() | nil,
          :tagKeyParentName => String.t() | nil,
          :tagValue => String.t() | nil
        }

  field(:inherited)
  field(:namespacedTagKey)
  field(:namespacedTagValue)
  field(:tagKey)
  field(:tagKeyParentName)
  field(:tagValue)
end

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

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