# 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.AnywhereCache do
  @moduledoc """
  An Anywhere Cache instance.

  ## Attributes

  *   `admissionPolicy` (*type:* `String.t`, *default:* `nil`) - The cache-level entry admission policy.
  *   `anywhereCacheId` (*type:* `String.t`, *default:* `nil`) - The ID of the Anywhere cache instance.
  *   `bucket` (*type:* `String.t`, *default:* `nil`) - The name of the bucket containing this cache instance.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the cache instance in RFC 3339 format.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The ID of the resource, including the project number, bucket name and anywhere cache ID.
  *   `kind` (*type:* `String.t`, *default:* `storage#anywhereCache`) - The kind of item this is. For Anywhere Cache, this is always storage#anywhereCache.
  *   `pendingUpdate` (*type:* `boolean()`, *default:* `nil`) - True if the cache instance has an active Update long-running operation.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - The link to this cache instance.
  *   `state` (*type:* `String.t`, *default:* `nil`) - The current state of the cache instance.
  *   `ttl` (*type:* `String.t`, *default:* `nil`) - The TTL of all cache entries in whole seconds. e.g., "7200s". 
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The modification time of the cache instance metadata in RFC 3339 format.
  *   `zone` (*type:* `String.t`, *default:* `nil`) - The zone in which the cache instance is running. For example, us-central1-a.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :admissionPolicy => String.t() | nil,
          :anywhereCacheId => String.t() | nil,
          :bucket => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :pendingUpdate => boolean() | nil,
          :selfLink => String.t() | nil,
          :state => String.t() | nil,
          :ttl => String.t() | nil,
          :updateTime => DateTime.t() | nil,
          :zone => String.t() | nil
        }

  field(:admissionPolicy)
  field(:anywhereCacheId)
  field(:bucket)
  field(:createTime, as: DateTime)
  field(:id)
  field(:kind)
  field(:pendingUpdate)
  field(:selfLink)
  field(:state)
  field(:ttl)
  field(:updateTime, as: DateTime)
  field(:zone)
end

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

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