# 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.Admin.Directory_v1.Model.Role do
  @moduledoc """


  ## Attributes

  *   `etag` (*type:* `String.t`, *default:* `nil`) - ETag of the resource.
  *   `isSuperAdminRole` (*type:* `boolean()`, *default:* `nil`) - Returns `true` if the role is a super admin role.
  *   `isSystemRole` (*type:* `boolean()`, *default:* `nil`) - Returns `true` if this is a pre-defined system role.
  *   `kind` (*type:* `String.t`, *default:* `admin#directory#role`) - The type of the API resource. This is always `admin#directory#role`.
  *   `roleDescription` (*type:* `String.t`, *default:* `nil`) - A short description of the role.
  *   `roleId` (*type:* `String.t`, *default:* `nil`) - ID of the role.
  *   `roleName` (*type:* `String.t`, *default:* `nil`) - Name of the role.
  *   `rolePrivileges` (*type:* `list(GoogleApi.Admin.Directory_v1.Model.RoleRolePrivileges.t)`, *default:* `nil`) - The set of privileges that are granted to this role.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :etag => String.t() | nil,
          :isSuperAdminRole => boolean() | nil,
          :isSystemRole => boolean() | nil,
          :kind => String.t() | nil,
          :roleDescription => String.t() | nil,
          :roleId => String.t() | nil,
          :roleName => String.t() | nil,
          :rolePrivileges => list(GoogleApi.Admin.Directory_v1.Model.RoleRolePrivileges.t()) | nil
        }

  field(:etag)
  field(:isSuperAdminRole)
  field(:isSystemRole)
  field(:kind)
  field(:roleDescription)
  field(:roleId)
  field(:roleName)
  field(:rolePrivileges, as: GoogleApi.Admin.Directory_v1.Model.RoleRolePrivileges, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Admin.Directory_v1.Model.Role do
  def decode(value, options) do
    GoogleApi.Admin.Directory_v1.Model.Role.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Admin.Directory_v1.Model.Role do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
