{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EC2.Types.FederatedAuthenticationRequest
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.FederatedAuthenticationRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | The IAM SAML identity provider used for federated authentication.
--
-- /See:/ 'newFederatedAuthenticationRequest' smart constructor.
data FederatedAuthenticationRequest = FederatedAuthenticationRequest'
  { -- | The Amazon Resource Name (ARN) of the IAM SAML identity provider.
    FederatedAuthenticationRequest -> Maybe Text
sAMLProviderArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the IAM SAML identity provider for the
    -- self-service portal.
    FederatedAuthenticationRequest -> Maybe Text
selfServiceSAMLProviderArn :: Prelude.Maybe Prelude.Text
  }
  deriving (FederatedAuthenticationRequest
-> FederatedAuthenticationRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FederatedAuthenticationRequest
-> FederatedAuthenticationRequest -> Bool
$c/= :: FederatedAuthenticationRequest
-> FederatedAuthenticationRequest -> Bool
== :: FederatedAuthenticationRequest
-> FederatedAuthenticationRequest -> Bool
$c== :: FederatedAuthenticationRequest
-> FederatedAuthenticationRequest -> Bool
Prelude.Eq, ReadPrec [FederatedAuthenticationRequest]
ReadPrec FederatedAuthenticationRequest
Int -> ReadS FederatedAuthenticationRequest
ReadS [FederatedAuthenticationRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FederatedAuthenticationRequest]
$creadListPrec :: ReadPrec [FederatedAuthenticationRequest]
readPrec :: ReadPrec FederatedAuthenticationRequest
$creadPrec :: ReadPrec FederatedAuthenticationRequest
readList :: ReadS [FederatedAuthenticationRequest]
$creadList :: ReadS [FederatedAuthenticationRequest]
readsPrec :: Int -> ReadS FederatedAuthenticationRequest
$creadsPrec :: Int -> ReadS FederatedAuthenticationRequest
Prelude.Read, Int -> FederatedAuthenticationRequest -> ShowS
[FederatedAuthenticationRequest] -> ShowS
FederatedAuthenticationRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FederatedAuthenticationRequest] -> ShowS
$cshowList :: [FederatedAuthenticationRequest] -> ShowS
show :: FederatedAuthenticationRequest -> String
$cshow :: FederatedAuthenticationRequest -> String
showsPrec :: Int -> FederatedAuthenticationRequest -> ShowS
$cshowsPrec :: Int -> FederatedAuthenticationRequest -> ShowS
Prelude.Show, forall x.
Rep FederatedAuthenticationRequest x
-> FederatedAuthenticationRequest
forall x.
FederatedAuthenticationRequest
-> Rep FederatedAuthenticationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FederatedAuthenticationRequest x
-> FederatedAuthenticationRequest
$cfrom :: forall x.
FederatedAuthenticationRequest
-> Rep FederatedAuthenticationRequest x
Prelude.Generic)

-- |
-- Create a value of 'FederatedAuthenticationRequest' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'sAMLProviderArn', 'federatedAuthenticationRequest_sAMLProviderArn' - The Amazon Resource Name (ARN) of the IAM SAML identity provider.
--
-- 'selfServiceSAMLProviderArn', 'federatedAuthenticationRequest_selfServiceSAMLProviderArn' - The Amazon Resource Name (ARN) of the IAM SAML identity provider for the
-- self-service portal.
newFederatedAuthenticationRequest ::
  FederatedAuthenticationRequest
newFederatedAuthenticationRequest :: FederatedAuthenticationRequest
newFederatedAuthenticationRequest =
  FederatedAuthenticationRequest'
    { $sel:sAMLProviderArn:FederatedAuthenticationRequest' :: Maybe Text
sAMLProviderArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:selfServiceSAMLProviderArn:FederatedAuthenticationRequest' :: Maybe Text
selfServiceSAMLProviderArn =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the IAM SAML identity provider.
federatedAuthenticationRequest_sAMLProviderArn :: Lens.Lens' FederatedAuthenticationRequest (Prelude.Maybe Prelude.Text)
federatedAuthenticationRequest_sAMLProviderArn :: Lens' FederatedAuthenticationRequest (Maybe Text)
federatedAuthenticationRequest_sAMLProviderArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FederatedAuthenticationRequest' {Maybe Text
sAMLProviderArn :: Maybe Text
$sel:sAMLProviderArn:FederatedAuthenticationRequest' :: FederatedAuthenticationRequest -> Maybe Text
sAMLProviderArn} -> Maybe Text
sAMLProviderArn) (\s :: FederatedAuthenticationRequest
s@FederatedAuthenticationRequest' {} Maybe Text
a -> FederatedAuthenticationRequest
s {$sel:sAMLProviderArn:FederatedAuthenticationRequest' :: Maybe Text
sAMLProviderArn = Maybe Text
a} :: FederatedAuthenticationRequest)

-- | The Amazon Resource Name (ARN) of the IAM SAML identity provider for the
-- self-service portal.
federatedAuthenticationRequest_selfServiceSAMLProviderArn :: Lens.Lens' FederatedAuthenticationRequest (Prelude.Maybe Prelude.Text)
federatedAuthenticationRequest_selfServiceSAMLProviderArn :: Lens' FederatedAuthenticationRequest (Maybe Text)
federatedAuthenticationRequest_selfServiceSAMLProviderArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FederatedAuthenticationRequest' {Maybe Text
selfServiceSAMLProviderArn :: Maybe Text
$sel:selfServiceSAMLProviderArn:FederatedAuthenticationRequest' :: FederatedAuthenticationRequest -> Maybe Text
selfServiceSAMLProviderArn} -> Maybe Text
selfServiceSAMLProviderArn) (\s :: FederatedAuthenticationRequest
s@FederatedAuthenticationRequest' {} Maybe Text
a -> FederatedAuthenticationRequest
s {$sel:selfServiceSAMLProviderArn:FederatedAuthenticationRequest' :: Maybe Text
selfServiceSAMLProviderArn = Maybe Text
a} :: FederatedAuthenticationRequest)

instance
  Prelude.Hashable
    FederatedAuthenticationRequest
  where
  hashWithSalt :: Int -> FederatedAuthenticationRequest -> Int
hashWithSalt
    Int
_salt
    FederatedAuthenticationRequest' {Maybe Text
selfServiceSAMLProviderArn :: Maybe Text
sAMLProviderArn :: Maybe Text
$sel:selfServiceSAMLProviderArn:FederatedAuthenticationRequest' :: FederatedAuthenticationRequest -> Maybe Text
$sel:sAMLProviderArn:FederatedAuthenticationRequest' :: FederatedAuthenticationRequest -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sAMLProviderArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
selfServiceSAMLProviderArn

instance
  Prelude.NFData
    FederatedAuthenticationRequest
  where
  rnf :: FederatedAuthenticationRequest -> ()
rnf FederatedAuthenticationRequest' {Maybe Text
selfServiceSAMLProviderArn :: Maybe Text
sAMLProviderArn :: Maybe Text
$sel:selfServiceSAMLProviderArn:FederatedAuthenticationRequest' :: FederatedAuthenticationRequest -> Maybe Text
$sel:sAMLProviderArn:FederatedAuthenticationRequest' :: FederatedAuthenticationRequest -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sAMLProviderArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
selfServiceSAMLProviderArn

instance Data.ToQuery FederatedAuthenticationRequest where
  toQuery :: FederatedAuthenticationRequest -> QueryString
toQuery FederatedAuthenticationRequest' {Maybe Text
selfServiceSAMLProviderArn :: Maybe Text
sAMLProviderArn :: Maybe Text
$sel:selfServiceSAMLProviderArn:FederatedAuthenticationRequest' :: FederatedAuthenticationRequest -> Maybe Text
$sel:sAMLProviderArn:FederatedAuthenticationRequest' :: FederatedAuthenticationRequest -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"SAMLProviderArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
sAMLProviderArn,
        ByteString
"SelfServiceSAMLProviderArn"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
selfServiceSAMLProviderArn
      ]