# 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.GKEHub.V1.Model.IdentityServiceSamlConfig do
  @moduledoc """
  Configuration for the SAML Auth flow.

  ## Attributes

  *   `attributeMapping` (*type:* `map()`, *default:* `nil`) - Optional. The mapping of additional user attributes like nickname, birthday and address etc.. `key` is the name of this additional attribute. `value` is a string presenting as CEL(common expression language, go/cel) used for getting the value from the resources. Take nickname as an example, in this case, `key` is "attribute.nickname" and `value` is "assertion.nickname".
  *   `groupPrefix` (*type:* `String.t`, *default:* `nil`) - Optional. Prefix to prepend to group name.
  *   `groupsAttribute` (*type:* `String.t`, *default:* `nil`) - Optional. The SAML attribute to read groups from. This value is expected to be a string and will be passed along as-is (with the option of being prefixed by the `group_prefix`).
  *   `identityProviderCertificates` (*type:* `list(String.t)`, *default:* `nil`) - Required. The list of IdP certificates to validate the SAML response against.
  *   `identityProviderId` (*type:* `String.t`, *default:* `nil`) - Required. The entity ID of the SAML IdP.
  *   `identityProviderSsoUri` (*type:* `String.t`, *default:* `nil`) - Required. The URI where the SAML IdP exposes the SSO service.
  *   `userAttribute` (*type:* `String.t`, *default:* `nil`) - Optional. The SAML attribute to read username from. If unspecified, the username will be read from the NameID element of the assertion in SAML response. This value is expected to be a string and will be passed along as-is (with the option of being prefixed by the `user_prefix`).
  *   `userPrefix` (*type:* `String.t`, *default:* `nil`) - Optional. Prefix to prepend to user name.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attributeMapping => map() | nil,
          :groupPrefix => String.t() | nil,
          :groupsAttribute => String.t() | nil,
          :identityProviderCertificates => list(String.t()) | nil,
          :identityProviderId => String.t() | nil,
          :identityProviderSsoUri => String.t() | nil,
          :userAttribute => String.t() | nil,
          :userPrefix => String.t() | nil
        }

  field(:attributeMapping, type: :map)
  field(:groupPrefix)
  field(:groupsAttribute)
  field(:identityProviderCertificates, type: :list)
  field(:identityProviderId)
  field(:identityProviderSsoUri)
  field(:userAttribute)
  field(:userPrefix)
end

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

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