lib/google_api/compute/v1/model/metadata.ex

# 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.Compute.V1.Model.Metadata do
  @moduledoc """
  A metadata key/value entry.

  ## Attributes

  *   `fingerprint` (*type:* `String.t`, *default:* `nil`) - Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource.
  *   `items` (*type:* `list(GoogleApi.Compute.V1.Model.MetadataItems.t)`, *default:* `nil`) - Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
  *   `kind` (*type:* `String.t`, *default:* `compute#metadata`) - [Output Only] Type of the resource. Always compute#metadata for metadata.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :fingerprint => String.t() | nil,
          :items => list(GoogleApi.Compute.V1.Model.MetadataItems.t()) | nil,
          :kind => String.t() | nil
        }

  field(:fingerprint)
  field(:items, as: GoogleApi.Compute.V1.Model.MetadataItems, type: :list)
  field(:kind)
end

defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.Metadata do
  def decode(value, options) do
    GoogleApi.Compute.V1.Model.Metadata.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.Metadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end