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

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

-- |
-- Module      : Amazonka.Transfer.TestIdentityProvider
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- If the @IdentityProviderType@ of a file transfer protocol-enabled server
-- is @AWS_DIRECTORY_SERVICE@ or @API_Gateway@, tests whether your identity
-- provider is set up successfully. We highly recommend that you call this
-- operation to test your authentication method as soon as you create your
-- server. By doing so, you can troubleshoot issues with the identity
-- provider integration to ensure that your users can successfully use the
-- service.
--
-- The @ServerId@ and @UserName@ parameters are required. The
-- @ServerProtocol@, @SourceIp@, and @UserPassword@ are all optional.
--
-- You cannot use @TestIdentityProvider@ if the @IdentityProviderType@ of
-- your server is @SERVICE_MANAGED@.
--
-- -   If you provide any incorrect values for any parameters, the
--     @Response@ field is empty.
--
-- -   If you provide a server ID for a server that uses service-managed
--     users, you get an error:
--
--     @ An error occurred (InvalidRequestException) when calling the TestIdentityProvider operation: s-server-ID not configured for external auth @
--
-- -   If you enter a Server ID for the @--server-id@ parameter that does
--     not identify an actual Transfer server, you receive the following
--     error:
--
--     @An error occurred (ResourceNotFoundException) when calling the TestIdentityProvider operation: Unknown server@
module Amazonka.Transfer.TestIdentityProvider
  ( -- * Creating a Request
    TestIdentityProvider (..),
    newTestIdentityProvider,

    -- * Request Lenses
    testIdentityProvider_serverProtocol,
    testIdentityProvider_userPassword,
    testIdentityProvider_sourceIp,
    testIdentityProvider_serverId,
    testIdentityProvider_userName,

    -- * Destructuring the Response
    TestIdentityProviderResponse (..),
    newTestIdentityProviderResponse,

    -- * Response Lenses
    testIdentityProviderResponse_response,
    testIdentityProviderResponse_message,
    testIdentityProviderResponse_httpStatus,
    testIdentityProviderResponse_statusCode,
    testIdentityProviderResponse_url,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transfer.Types

-- | /See:/ 'newTestIdentityProvider' smart constructor.
data TestIdentityProvider = TestIdentityProvider'
  { -- | The type of file transfer protocol to be tested.
    --
    -- The available protocols are:
    --
    -- -   Secure Shell (SSH) File Transfer Protocol (SFTP)
    --
    -- -   File Transfer Protocol Secure (FTPS)
    --
    -- -   File Transfer Protocol (FTP)
    TestIdentityProvider -> Maybe Protocol
serverProtocol :: Prelude.Maybe Protocol,
    -- | The password of the user account to be tested.
    TestIdentityProvider -> Maybe (Sensitive Text)
userPassword :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The source IP address of the user account to be tested.
    TestIdentityProvider -> Maybe Text
sourceIp :: Prelude.Maybe Prelude.Text,
    -- | A system-assigned identifier for a specific server. That server\'s user
    -- authentication method is tested with a user name and password.
    TestIdentityProvider -> Text
serverId :: Prelude.Text,
    -- | The name of the user account to be tested.
    TestIdentityProvider -> Text
userName :: Prelude.Text
  }
  deriving (TestIdentityProvider -> TestIdentityProvider -> Bool
(TestIdentityProvider -> TestIdentityProvider -> Bool)
-> (TestIdentityProvider -> TestIdentityProvider -> Bool)
-> Eq TestIdentityProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestIdentityProvider -> TestIdentityProvider -> Bool
$c/= :: TestIdentityProvider -> TestIdentityProvider -> Bool
== :: TestIdentityProvider -> TestIdentityProvider -> Bool
$c== :: TestIdentityProvider -> TestIdentityProvider -> Bool
Prelude.Eq, Int -> TestIdentityProvider -> ShowS
[TestIdentityProvider] -> ShowS
TestIdentityProvider -> String
(Int -> TestIdentityProvider -> ShowS)
-> (TestIdentityProvider -> String)
-> ([TestIdentityProvider] -> ShowS)
-> Show TestIdentityProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestIdentityProvider] -> ShowS
$cshowList :: [TestIdentityProvider] -> ShowS
show :: TestIdentityProvider -> String
$cshow :: TestIdentityProvider -> String
showsPrec :: Int -> TestIdentityProvider -> ShowS
$cshowsPrec :: Int -> TestIdentityProvider -> ShowS
Prelude.Show, (forall x. TestIdentityProvider -> Rep TestIdentityProvider x)
-> (forall x. Rep TestIdentityProvider x -> TestIdentityProvider)
-> Generic TestIdentityProvider
forall x. Rep TestIdentityProvider x -> TestIdentityProvider
forall x. TestIdentityProvider -> Rep TestIdentityProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestIdentityProvider x -> TestIdentityProvider
$cfrom :: forall x. TestIdentityProvider -> Rep TestIdentityProvider x
Prelude.Generic)

-- |
-- Create a value of 'TestIdentityProvider' 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:
--
-- 'serverProtocol', 'testIdentityProvider_serverProtocol' - The type of file transfer protocol to be tested.
--
-- The available protocols are:
--
-- -   Secure Shell (SSH) File Transfer Protocol (SFTP)
--
-- -   File Transfer Protocol Secure (FTPS)
--
-- -   File Transfer Protocol (FTP)
--
-- 'userPassword', 'testIdentityProvider_userPassword' - The password of the user account to be tested.
--
-- 'sourceIp', 'testIdentityProvider_sourceIp' - The source IP address of the user account to be tested.
--
-- 'serverId', 'testIdentityProvider_serverId' - A system-assigned identifier for a specific server. That server\'s user
-- authentication method is tested with a user name and password.
--
-- 'userName', 'testIdentityProvider_userName' - The name of the user account to be tested.
newTestIdentityProvider ::
  -- | 'serverId'
  Prelude.Text ->
  -- | 'userName'
  Prelude.Text ->
  TestIdentityProvider
newTestIdentityProvider :: Text -> Text -> TestIdentityProvider
newTestIdentityProvider Text
pServerId_ Text
pUserName_ =
  TestIdentityProvider' :: Maybe Protocol
-> Maybe (Sensitive Text)
-> Maybe Text
-> Text
-> Text
-> TestIdentityProvider
TestIdentityProvider'
    { $sel:serverProtocol:TestIdentityProvider' :: Maybe Protocol
serverProtocol =
        Maybe Protocol
forall a. Maybe a
Prelude.Nothing,
      $sel:userPassword:TestIdentityProvider' :: Maybe (Sensitive Text)
userPassword = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceIp:TestIdentityProvider' :: Maybe Text
sourceIp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serverId:TestIdentityProvider' :: Text
serverId = Text
pServerId_,
      $sel:userName:TestIdentityProvider' :: Text
userName = Text
pUserName_
    }

-- | The type of file transfer protocol to be tested.
--
-- The available protocols are:
--
-- -   Secure Shell (SSH) File Transfer Protocol (SFTP)
--
-- -   File Transfer Protocol Secure (FTPS)
--
-- -   File Transfer Protocol (FTP)
testIdentityProvider_serverProtocol :: Lens.Lens' TestIdentityProvider (Prelude.Maybe Protocol)
testIdentityProvider_serverProtocol :: (Maybe Protocol -> f (Maybe Protocol))
-> TestIdentityProvider -> f TestIdentityProvider
testIdentityProvider_serverProtocol = (TestIdentityProvider -> Maybe Protocol)
-> (TestIdentityProvider -> Maybe Protocol -> TestIdentityProvider)
-> Lens
     TestIdentityProvider
     TestIdentityProvider
     (Maybe Protocol)
     (Maybe Protocol)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestIdentityProvider' {Maybe Protocol
serverProtocol :: Maybe Protocol
$sel:serverProtocol:TestIdentityProvider' :: TestIdentityProvider -> Maybe Protocol
serverProtocol} -> Maybe Protocol
serverProtocol) (\s :: TestIdentityProvider
s@TestIdentityProvider' {} Maybe Protocol
a -> TestIdentityProvider
s {$sel:serverProtocol:TestIdentityProvider' :: Maybe Protocol
serverProtocol = Maybe Protocol
a} :: TestIdentityProvider)

-- | The password of the user account to be tested.
testIdentityProvider_userPassword :: Lens.Lens' TestIdentityProvider (Prelude.Maybe Prelude.Text)
testIdentityProvider_userPassword :: (Maybe Text -> f (Maybe Text))
-> TestIdentityProvider -> f TestIdentityProvider
testIdentityProvider_userPassword = (TestIdentityProvider -> Maybe (Sensitive Text))
-> (TestIdentityProvider
    -> Maybe (Sensitive Text) -> TestIdentityProvider)
-> Lens
     TestIdentityProvider
     TestIdentityProvider
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestIdentityProvider' {Maybe (Sensitive Text)
userPassword :: Maybe (Sensitive Text)
$sel:userPassword:TestIdentityProvider' :: TestIdentityProvider -> Maybe (Sensitive Text)
userPassword} -> Maybe (Sensitive Text)
userPassword) (\s :: TestIdentityProvider
s@TestIdentityProvider' {} Maybe (Sensitive Text)
a -> TestIdentityProvider
s {$sel:userPassword:TestIdentityProvider' :: Maybe (Sensitive Text)
userPassword = Maybe (Sensitive Text)
a} :: TestIdentityProvider) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> TestIdentityProvider -> f TestIdentityProvider)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> TestIdentityProvider
-> f TestIdentityProvider
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The source IP address of the user account to be tested.
testIdentityProvider_sourceIp :: Lens.Lens' TestIdentityProvider (Prelude.Maybe Prelude.Text)
testIdentityProvider_sourceIp :: (Maybe Text -> f (Maybe Text))
-> TestIdentityProvider -> f TestIdentityProvider
testIdentityProvider_sourceIp = (TestIdentityProvider -> Maybe Text)
-> (TestIdentityProvider -> Maybe Text -> TestIdentityProvider)
-> Lens
     TestIdentityProvider TestIdentityProvider (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestIdentityProvider' {Maybe Text
sourceIp :: Maybe Text
$sel:sourceIp:TestIdentityProvider' :: TestIdentityProvider -> Maybe Text
sourceIp} -> Maybe Text
sourceIp) (\s :: TestIdentityProvider
s@TestIdentityProvider' {} Maybe Text
a -> TestIdentityProvider
s {$sel:sourceIp:TestIdentityProvider' :: Maybe Text
sourceIp = Maybe Text
a} :: TestIdentityProvider)

-- | A system-assigned identifier for a specific server. That server\'s user
-- authentication method is tested with a user name and password.
testIdentityProvider_serverId :: Lens.Lens' TestIdentityProvider Prelude.Text
testIdentityProvider_serverId :: (Text -> f Text) -> TestIdentityProvider -> f TestIdentityProvider
testIdentityProvider_serverId = (TestIdentityProvider -> Text)
-> (TestIdentityProvider -> Text -> TestIdentityProvider)
-> Lens TestIdentityProvider TestIdentityProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestIdentityProvider' {Text
serverId :: Text
$sel:serverId:TestIdentityProvider' :: TestIdentityProvider -> Text
serverId} -> Text
serverId) (\s :: TestIdentityProvider
s@TestIdentityProvider' {} Text
a -> TestIdentityProvider
s {$sel:serverId:TestIdentityProvider' :: Text
serverId = Text
a} :: TestIdentityProvider)

-- | The name of the user account to be tested.
testIdentityProvider_userName :: Lens.Lens' TestIdentityProvider Prelude.Text
testIdentityProvider_userName :: (Text -> f Text) -> TestIdentityProvider -> f TestIdentityProvider
testIdentityProvider_userName = (TestIdentityProvider -> Text)
-> (TestIdentityProvider -> Text -> TestIdentityProvider)
-> Lens TestIdentityProvider TestIdentityProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestIdentityProvider' {Text
userName :: Text
$sel:userName:TestIdentityProvider' :: TestIdentityProvider -> Text
userName} -> Text
userName) (\s :: TestIdentityProvider
s@TestIdentityProvider' {} Text
a -> TestIdentityProvider
s {$sel:userName:TestIdentityProvider' :: Text
userName = Text
a} :: TestIdentityProvider)

instance Core.AWSRequest TestIdentityProvider where
  type
    AWSResponse TestIdentityProvider =
      TestIdentityProviderResponse
  request :: TestIdentityProvider -> Request TestIdentityProvider
request = Service -> TestIdentityProvider -> Request TestIdentityProvider
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy TestIdentityProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse TestIdentityProvider)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse TestIdentityProvider))
-> Logger
-> Service
-> Proxy TestIdentityProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse TestIdentityProvider)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text -> Int -> Int -> Text -> TestIdentityProviderResponse
TestIdentityProviderResponse'
            (Maybe Text
 -> Maybe Text
 -> Int
 -> Int
 -> Text
 -> TestIdentityProviderResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Int -> Int -> Text -> TestIdentityProviderResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Response")
            Either
  String
  (Maybe Text -> Int -> Int -> Text -> TestIdentityProviderResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> Int -> Text -> TestIdentityProviderResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Message")
            Either String (Int -> Int -> Text -> TestIdentityProviderResponse)
-> Either String Int
-> Either String (Int -> Text -> TestIdentityProviderResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String (Int -> Text -> TestIdentityProviderResponse)
-> Either String Int
-> Either String (Text -> TestIdentityProviderResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Int
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"StatusCode")
            Either String (Text -> TestIdentityProviderResponse)
-> Either String Text -> Either String TestIdentityProviderResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"Url")
      )

instance Prelude.Hashable TestIdentityProvider

instance Prelude.NFData TestIdentityProvider

instance Core.ToHeaders TestIdentityProvider where
  toHeaders :: TestIdentityProvider -> ResponseHeaders
toHeaders =
    ResponseHeaders -> TestIdentityProvider -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"TransferService.TestIdentityProvider" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON TestIdentityProvider where
  toJSON :: TestIdentityProvider -> Value
toJSON TestIdentityProvider' {Maybe Text
Maybe (Sensitive Text)
Maybe Protocol
Text
userName :: Text
serverId :: Text
sourceIp :: Maybe Text
userPassword :: Maybe (Sensitive Text)
serverProtocol :: Maybe Protocol
$sel:userName:TestIdentityProvider' :: TestIdentityProvider -> Text
$sel:serverId:TestIdentityProvider' :: TestIdentityProvider -> Text
$sel:sourceIp:TestIdentityProvider' :: TestIdentityProvider -> Maybe Text
$sel:userPassword:TestIdentityProvider' :: TestIdentityProvider -> Maybe (Sensitive Text)
$sel:serverProtocol:TestIdentityProvider' :: TestIdentityProvider -> Maybe Protocol
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ServerProtocol" Text -> Protocol -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Protocol -> Pair) -> Maybe Protocol -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Protocol
serverProtocol,
            (Text
"UserPassword" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
userPassword,
            (Text
"SourceIp" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceIp,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userName)
          ]
      )

instance Core.ToPath TestIdentityProvider where
  toPath :: TestIdentityProvider -> ByteString
toPath = ByteString -> TestIdentityProvider -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery TestIdentityProvider where
  toQuery :: TestIdentityProvider -> QueryString
toQuery = QueryString -> TestIdentityProvider -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newTestIdentityProviderResponse' smart constructor.
data TestIdentityProviderResponse = TestIdentityProviderResponse'
  { -- | The response that is returned from your API Gateway.
    TestIdentityProviderResponse -> Maybe Text
response :: Prelude.Maybe Prelude.Text,
    -- | A message that indicates whether the test was successful or not.
    TestIdentityProviderResponse -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    TestIdentityProviderResponse -> Int
httpStatus :: Prelude.Int,
    -- | The HTTP status code that is the response from your API Gateway.
    TestIdentityProviderResponse -> Int
statusCode :: Prelude.Int,
    -- | The endpoint of the service used to authenticate a user.
    TestIdentityProviderResponse -> Text
url :: Prelude.Text
  }
  deriving (TestIdentityProviderResponse
-> TestIdentityProviderResponse -> Bool
(TestIdentityProviderResponse
 -> TestIdentityProviderResponse -> Bool)
-> (TestIdentityProviderResponse
    -> TestIdentityProviderResponse -> Bool)
-> Eq TestIdentityProviderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestIdentityProviderResponse
-> TestIdentityProviderResponse -> Bool
$c/= :: TestIdentityProviderResponse
-> TestIdentityProviderResponse -> Bool
== :: TestIdentityProviderResponse
-> TestIdentityProviderResponse -> Bool
$c== :: TestIdentityProviderResponse
-> TestIdentityProviderResponse -> Bool
Prelude.Eq, ReadPrec [TestIdentityProviderResponse]
ReadPrec TestIdentityProviderResponse
Int -> ReadS TestIdentityProviderResponse
ReadS [TestIdentityProviderResponse]
(Int -> ReadS TestIdentityProviderResponse)
-> ReadS [TestIdentityProviderResponse]
-> ReadPrec TestIdentityProviderResponse
-> ReadPrec [TestIdentityProviderResponse]
-> Read TestIdentityProviderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestIdentityProviderResponse]
$creadListPrec :: ReadPrec [TestIdentityProviderResponse]
readPrec :: ReadPrec TestIdentityProviderResponse
$creadPrec :: ReadPrec TestIdentityProviderResponse
readList :: ReadS [TestIdentityProviderResponse]
$creadList :: ReadS [TestIdentityProviderResponse]
readsPrec :: Int -> ReadS TestIdentityProviderResponse
$creadsPrec :: Int -> ReadS TestIdentityProviderResponse
Prelude.Read, Int -> TestIdentityProviderResponse -> ShowS
[TestIdentityProviderResponse] -> ShowS
TestIdentityProviderResponse -> String
(Int -> TestIdentityProviderResponse -> ShowS)
-> (TestIdentityProviderResponse -> String)
-> ([TestIdentityProviderResponse] -> ShowS)
-> Show TestIdentityProviderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestIdentityProviderResponse] -> ShowS
$cshowList :: [TestIdentityProviderResponse] -> ShowS
show :: TestIdentityProviderResponse -> String
$cshow :: TestIdentityProviderResponse -> String
showsPrec :: Int -> TestIdentityProviderResponse -> ShowS
$cshowsPrec :: Int -> TestIdentityProviderResponse -> ShowS
Prelude.Show, (forall x.
 TestIdentityProviderResponse -> Rep TestIdentityProviderResponse x)
-> (forall x.
    Rep TestIdentityProviderResponse x -> TestIdentityProviderResponse)
-> Generic TestIdentityProviderResponse
forall x.
Rep TestIdentityProviderResponse x -> TestIdentityProviderResponse
forall x.
TestIdentityProviderResponse -> Rep TestIdentityProviderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TestIdentityProviderResponse x -> TestIdentityProviderResponse
$cfrom :: forall x.
TestIdentityProviderResponse -> Rep TestIdentityProviderResponse x
Prelude.Generic)

-- |
-- Create a value of 'TestIdentityProviderResponse' 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:
--
-- 'response', 'testIdentityProviderResponse_response' - The response that is returned from your API Gateway.
--
-- 'message', 'testIdentityProviderResponse_message' - A message that indicates whether the test was successful or not.
--
-- 'httpStatus', 'testIdentityProviderResponse_httpStatus' - The response's http status code.
--
-- 'statusCode', 'testIdentityProviderResponse_statusCode' - The HTTP status code that is the response from your API Gateway.
--
-- 'url', 'testIdentityProviderResponse_url' - The endpoint of the service used to authenticate a user.
newTestIdentityProviderResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'statusCode'
  Prelude.Int ->
  -- | 'url'
  Prelude.Text ->
  TestIdentityProviderResponse
newTestIdentityProviderResponse :: Int -> Int -> Text -> TestIdentityProviderResponse
newTestIdentityProviderResponse
  Int
pHttpStatus_
  Int
pStatusCode_
  Text
pUrl_ =
    TestIdentityProviderResponse' :: Maybe Text
-> Maybe Text -> Int -> Int -> Text -> TestIdentityProviderResponse
TestIdentityProviderResponse'
      { $sel:response:TestIdentityProviderResponse' :: Maybe Text
response =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:message:TestIdentityProviderResponse' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:TestIdentityProviderResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:statusCode:TestIdentityProviderResponse' :: Int
statusCode = Int
pStatusCode_,
        $sel:url:TestIdentityProviderResponse' :: Text
url = Text
pUrl_
      }

-- | The response that is returned from your API Gateway.
testIdentityProviderResponse_response :: Lens.Lens' TestIdentityProviderResponse (Prelude.Maybe Prelude.Text)
testIdentityProviderResponse_response :: (Maybe Text -> f (Maybe Text))
-> TestIdentityProviderResponse -> f TestIdentityProviderResponse
testIdentityProviderResponse_response = (TestIdentityProviderResponse -> Maybe Text)
-> (TestIdentityProviderResponse
    -> Maybe Text -> TestIdentityProviderResponse)
-> Lens
     TestIdentityProviderResponse
     TestIdentityProviderResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestIdentityProviderResponse' {Maybe Text
response :: Maybe Text
$sel:response:TestIdentityProviderResponse' :: TestIdentityProviderResponse -> Maybe Text
response} -> Maybe Text
response) (\s :: TestIdentityProviderResponse
s@TestIdentityProviderResponse' {} Maybe Text
a -> TestIdentityProviderResponse
s {$sel:response:TestIdentityProviderResponse' :: Maybe Text
response = Maybe Text
a} :: TestIdentityProviderResponse)

-- | A message that indicates whether the test was successful or not.
testIdentityProviderResponse_message :: Lens.Lens' TestIdentityProviderResponse (Prelude.Maybe Prelude.Text)
testIdentityProviderResponse_message :: (Maybe Text -> f (Maybe Text))
-> TestIdentityProviderResponse -> f TestIdentityProviderResponse
testIdentityProviderResponse_message = (TestIdentityProviderResponse -> Maybe Text)
-> (TestIdentityProviderResponse
    -> Maybe Text -> TestIdentityProviderResponse)
-> Lens
     TestIdentityProviderResponse
     TestIdentityProviderResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestIdentityProviderResponse' {Maybe Text
message :: Maybe Text
$sel:message:TestIdentityProviderResponse' :: TestIdentityProviderResponse -> Maybe Text
message} -> Maybe Text
message) (\s :: TestIdentityProviderResponse
s@TestIdentityProviderResponse' {} Maybe Text
a -> TestIdentityProviderResponse
s {$sel:message:TestIdentityProviderResponse' :: Maybe Text
message = Maybe Text
a} :: TestIdentityProviderResponse)

-- | The response's http status code.
testIdentityProviderResponse_httpStatus :: Lens.Lens' TestIdentityProviderResponse Prelude.Int
testIdentityProviderResponse_httpStatus :: (Int -> f Int)
-> TestIdentityProviderResponse -> f TestIdentityProviderResponse
testIdentityProviderResponse_httpStatus = (TestIdentityProviderResponse -> Int)
-> (TestIdentityProviderResponse
    -> Int -> TestIdentityProviderResponse)
-> Lens
     TestIdentityProviderResponse TestIdentityProviderResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestIdentityProviderResponse' {Int
httpStatus :: Int
$sel:httpStatus:TestIdentityProviderResponse' :: TestIdentityProviderResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: TestIdentityProviderResponse
s@TestIdentityProviderResponse' {} Int
a -> TestIdentityProviderResponse
s {$sel:httpStatus:TestIdentityProviderResponse' :: Int
httpStatus = Int
a} :: TestIdentityProviderResponse)

-- | The HTTP status code that is the response from your API Gateway.
testIdentityProviderResponse_statusCode :: Lens.Lens' TestIdentityProviderResponse Prelude.Int
testIdentityProviderResponse_statusCode :: (Int -> f Int)
-> TestIdentityProviderResponse -> f TestIdentityProviderResponse
testIdentityProviderResponse_statusCode = (TestIdentityProviderResponse -> Int)
-> (TestIdentityProviderResponse
    -> Int -> TestIdentityProviderResponse)
-> Lens
     TestIdentityProviderResponse TestIdentityProviderResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestIdentityProviderResponse' {Int
statusCode :: Int
$sel:statusCode:TestIdentityProviderResponse' :: TestIdentityProviderResponse -> Int
statusCode} -> Int
statusCode) (\s :: TestIdentityProviderResponse
s@TestIdentityProviderResponse' {} Int
a -> TestIdentityProviderResponse
s {$sel:statusCode:TestIdentityProviderResponse' :: Int
statusCode = Int
a} :: TestIdentityProviderResponse)

-- | The endpoint of the service used to authenticate a user.
testIdentityProviderResponse_url :: Lens.Lens' TestIdentityProviderResponse Prelude.Text
testIdentityProviderResponse_url :: (Text -> f Text)
-> TestIdentityProviderResponse -> f TestIdentityProviderResponse
testIdentityProviderResponse_url = (TestIdentityProviderResponse -> Text)
-> (TestIdentityProviderResponse
    -> Text -> TestIdentityProviderResponse)
-> Lens
     TestIdentityProviderResponse TestIdentityProviderResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestIdentityProviderResponse' {Text
url :: Text
$sel:url:TestIdentityProviderResponse' :: TestIdentityProviderResponse -> Text
url} -> Text
url) (\s :: TestIdentityProviderResponse
s@TestIdentityProviderResponse' {} Text
a -> TestIdentityProviderResponse
s {$sel:url:TestIdentityProviderResponse' :: Text
url = Text
a} :: TestIdentityProviderResponse)

instance Prelude.NFData TestIdentityProviderResponse