# 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.TagHold do
  @moduledoc """
  A TagHold represents the use of a TagValue that is not captured by TagBindings. If a TagValue has any TagHolds, deletion will be blocked. This resource is intended to be created in the same cloud location as the `holder`.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time this TagHold was created.
  *   `helpLink` (*type:* `String.t`, *default:* `nil`) - Optional. A URL where an end user can learn more about removing this hold. E.g. `https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing`
  *   `holder` (*type:* `String.t`, *default:* `nil`) - Required. The name of the resource where the TagValue is being used. Must be less than 200 characters. E.g. `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group`
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of a TagHold. This is a String of the form: `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}` (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by the server.
  *   `origin` (*type:* `String.t`, *default:* `nil`) - Optional. An optional string representing the origin of this request. This field should include human-understandable information to distinguish origins from each other. Must be less than 200 characters. E.g. `migs-35678234`
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :helpLink => String.t() | nil,
          :holder => String.t() | nil,
          :name => String.t() | nil,
          :origin => String.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:helpLink)
  field(:holder)
  field(:name)
  field(:origin)
end

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

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