# 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.SecurityCenter.V1.Model.AccessReview do
  @moduledoc """
  Conveys information about a Kubernetes access review (such as one returned by a [`kubectl auth can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) command) that was involved in a finding.

  ## Attributes

  *   `group` (*type:* `String.t`, *default:* `nil`) - The API group of the resource. "*" means all.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of the resource being requested. Empty means all.
  *   `ns` (*type:* `String.t`, *default:* `nil`) - Namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces. Both are represented by "" (empty).
  *   `resource` (*type:* `String.t`, *default:* `nil`) - The optional resource type requested. "*" means all.
  *   `subresource` (*type:* `String.t`, *default:* `nil`) - The optional subresource type.
  *   `verb` (*type:* `String.t`, *default:* `nil`) - A Kubernetes resource API verb, like get, list, watch, create, update, delete, proxy. "*" means all.
  *   `version` (*type:* `String.t`, *default:* `nil`) - The API version of the resource. "*" means all.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :group => String.t() | nil,
          :name => String.t() | nil,
          :ns => String.t() | nil,
          :resource => String.t() | nil,
          :subresource => String.t() | nil,
          :verb => String.t() | nil,
          :version => String.t() | nil
        }

  field(:group)
  field(:name)
  field(:ns)
  field(:resource)
  field(:subresource)
  field(:verb)
  field(:version)
end

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

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