# 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.ServiceControl.V2.Model.ResourceInfo do
  @moduledoc """
  Describes a resource referenced in the request.

  ## Attributes

  *   `container` (*type:* `String.t`, *default:* `nil`) - Optional. The identifier of the container of this resource. For Google Cloud APIs, the resource container must be one of the following formats: - `projects/` - `folders/` - `organizations/` Required for the policy enforcement on the container level (e.g. VPCSC, Location Policy check, Org Policy check).
  *   `location` (*type:* `String.t`, *default:* `nil`) - Optional. The location of the resource, it must be a valid zone, region or multiregion, for example: "europe-west4", "northamerica-northeast1-a". Required for location policy check.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of the resource referenced in the request.
  *   `permission` (*type:* `String.t`, *default:* `nil`) - The resource permission needed for this request. The format must be "{service}/{plural}.{verb}".
  *   `type` (*type:* `String.t`, *default:* `nil`) - The resource type in the format of "{service}/{kind}".
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :container => String.t() | nil,
          :location => String.t() | nil,
          :name => String.t() | nil,
          :permission => String.t() | nil,
          :type => String.t() | nil
        }

  field(:container)
  field(:location)
  field(:name)
  field(:permission)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.ServiceControl.V2.Model.ResourceInfo do
  def decode(value, options) do
    GoogleApi.ServiceControl.V2.Model.ResourceInfo.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ServiceControl.V2.Model.ResourceInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
