# 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.Storage.V1.Model.HmacKeyMetadata do
  @moduledoc """
  JSON template to produce a JSON-style HMAC Key metadata resource.

  ## Attributes

  *   `accessId` (*type:* `String.t`, *default:* `nil`) - The ID of the HMAC Key.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - HTTP 1.1 Entity tag for the HMAC key.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The ID of the HMAC key, including the Project ID and the Access ID.
  *   `kind` (*type:* `String.t`, *default:* `storage#hmacKeyMetadata`) - The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.
  *   `projectId` (*type:* `String.t`, *default:* `nil`) - Project ID owning the service account to which the key authenticates.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - The link to this resource.
  *   `serviceAccountEmail` (*type:* `String.t`, *default:* `nil`) - The email address of the key's associated service account.
  *   `state` (*type:* `String.t`, *default:* `nil`) - The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED.
  *   `timeCreated` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the HMAC key in RFC 3339 format.
  *   `updated` (*type:* `DateTime.t`, *default:* `nil`) - The last modification time of the HMAC key metadata in RFC 3339 format.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accessId => String.t() | nil,
          :etag => String.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :projectId => String.t() | nil,
          :selfLink => String.t() | nil,
          :serviceAccountEmail => String.t() | nil,
          :state => String.t() | nil,
          :timeCreated => DateTime.t() | nil,
          :updated => DateTime.t() | nil
        }

  field(:accessId)
  field(:etag)
  field(:id)
  field(:kind)
  field(:projectId)
  field(:selfLink)
  field(:serviceAccountEmail)
  field(:state)
  field(:timeCreated, as: DateTime)
  field(:updated, as: DateTime)
end

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

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