# 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.IdentityServiceAuthMethod do
  @moduledoc """
  Configuration of an auth method for a member/cluster. Only one authentication method (e.g., OIDC and LDAP) can be set per AuthMethod.

  ## Attributes

  *   `azureadConfig` (*type:* `GoogleApi.GKEHub.V1.Model.IdentityServiceAzureADConfig.t`, *default:* `nil`) - AzureAD specific Configuration.
  *   `googleConfig` (*type:* `GoogleApi.GKEHub.V1.Model.IdentityServiceGoogleConfig.t`, *default:* `nil`) - GoogleConfig specific configuration.
  *   `ldapConfig` (*type:* `GoogleApi.GKEHub.V1.Model.IdentityServiceLdapConfig.t`, *default:* `nil`) - LDAP specific configuration.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier for auth config.
  *   `oidcConfig` (*type:* `GoogleApi.GKEHub.V1.Model.IdentityServiceOidcConfig.t`, *default:* `nil`) - OIDC specific configuration.
  *   `proxy` (*type:* `String.t`, *default:* `nil`) - Proxy server address to use for auth method.
  *   `samlConfig` (*type:* `GoogleApi.GKEHub.V1.Model.IdentityServiceSamlConfig.t`, *default:* `nil`) - SAML specific configuration.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :azureadConfig => GoogleApi.GKEHub.V1.Model.IdentityServiceAzureADConfig.t() | nil,
          :googleConfig => GoogleApi.GKEHub.V1.Model.IdentityServiceGoogleConfig.t() | nil,
          :ldapConfig => GoogleApi.GKEHub.V1.Model.IdentityServiceLdapConfig.t() | nil,
          :name => String.t() | nil,
          :oidcConfig => GoogleApi.GKEHub.V1.Model.IdentityServiceOidcConfig.t() | nil,
          :proxy => String.t() | nil,
          :samlConfig => GoogleApi.GKEHub.V1.Model.IdentityServiceSamlConfig.t() | nil
        }

  field(:azureadConfig, as: GoogleApi.GKEHub.V1.Model.IdentityServiceAzureADConfig)
  field(:googleConfig, as: GoogleApi.GKEHub.V1.Model.IdentityServiceGoogleConfig)
  field(:ldapConfig, as: GoogleApi.GKEHub.V1.Model.IdentityServiceLdapConfig)
  field(:name)
  field(:oidcConfig, as: GoogleApi.GKEHub.V1.Model.IdentityServiceOidcConfig)
  field(:proxy)
  field(:samlConfig, as: GoogleApi.GKEHub.V1.Model.IdentityServiceSamlConfig)
end

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

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