{-# 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.CognitoIdentityProvider.VerifySoftwareToken
-- 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)
--
-- Use this API to register a user\'s entered TOTP code and mark the
-- user\'s software token MFA status as \"verified\" if successful. The
-- request takes an access token or a session string, but not both.
module Amazonka.CognitoIdentityProvider.VerifySoftwareToken
  ( -- * Creating a Request
    VerifySoftwareToken (..),
    newVerifySoftwareToken,

    -- * Request Lenses
    verifySoftwareToken_accessToken,
    verifySoftwareToken_friendlyDeviceName,
    verifySoftwareToken_session,
    verifySoftwareToken_userCode,

    -- * Destructuring the Response
    VerifySoftwareTokenResponse (..),
    newVerifySoftwareTokenResponse,

    -- * Response Lenses
    verifySoftwareTokenResponse_status,
    verifySoftwareTokenResponse_session,
    verifySoftwareTokenResponse_httpStatus,
  )
where

import Amazonka.CognitoIdentityProvider.Types
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

-- | /See:/ 'newVerifySoftwareToken' smart constructor.
data VerifySoftwareToken = VerifySoftwareToken'
  { -- | The access token.
    VerifySoftwareToken -> Maybe (Sensitive Text)
accessToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The friendly device name.
    VerifySoftwareToken -> Maybe Text
friendlyDeviceName :: Prelude.Maybe Prelude.Text,
    -- | The session which should be passed both ways in challenge-response calls
    -- to the service.
    VerifySoftwareToken -> Maybe Text
session :: Prelude.Maybe Prelude.Text,
    -- | The one time password computed using the secret code returned by
    -- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AssociateSoftwareToken.html AssociateSoftwareToken\">.
    VerifySoftwareToken -> Text
userCode :: Prelude.Text
  }
  deriving (VerifySoftwareToken -> VerifySoftwareToken -> Bool
(VerifySoftwareToken -> VerifySoftwareToken -> Bool)
-> (VerifySoftwareToken -> VerifySoftwareToken -> Bool)
-> Eq VerifySoftwareToken
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifySoftwareToken -> VerifySoftwareToken -> Bool
$c/= :: VerifySoftwareToken -> VerifySoftwareToken -> Bool
== :: VerifySoftwareToken -> VerifySoftwareToken -> Bool
$c== :: VerifySoftwareToken -> VerifySoftwareToken -> Bool
Prelude.Eq, Int -> VerifySoftwareToken -> ShowS
[VerifySoftwareToken] -> ShowS
VerifySoftwareToken -> String
(Int -> VerifySoftwareToken -> ShowS)
-> (VerifySoftwareToken -> String)
-> ([VerifySoftwareToken] -> ShowS)
-> Show VerifySoftwareToken
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifySoftwareToken] -> ShowS
$cshowList :: [VerifySoftwareToken] -> ShowS
show :: VerifySoftwareToken -> String
$cshow :: VerifySoftwareToken -> String
showsPrec :: Int -> VerifySoftwareToken -> ShowS
$cshowsPrec :: Int -> VerifySoftwareToken -> ShowS
Prelude.Show, (forall x. VerifySoftwareToken -> Rep VerifySoftwareToken x)
-> (forall x. Rep VerifySoftwareToken x -> VerifySoftwareToken)
-> Generic VerifySoftwareToken
forall x. Rep VerifySoftwareToken x -> VerifySoftwareToken
forall x. VerifySoftwareToken -> Rep VerifySoftwareToken x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VerifySoftwareToken x -> VerifySoftwareToken
$cfrom :: forall x. VerifySoftwareToken -> Rep VerifySoftwareToken x
Prelude.Generic)

-- |
-- Create a value of 'VerifySoftwareToken' 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:
--
-- 'accessToken', 'verifySoftwareToken_accessToken' - The access token.
--
-- 'friendlyDeviceName', 'verifySoftwareToken_friendlyDeviceName' - The friendly device name.
--
-- 'session', 'verifySoftwareToken_session' - The session which should be passed both ways in challenge-response calls
-- to the service.
--
-- 'userCode', 'verifySoftwareToken_userCode' - The one time password computed using the secret code returned by
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AssociateSoftwareToken.html AssociateSoftwareToken\">.
newVerifySoftwareToken ::
  -- | 'userCode'
  Prelude.Text ->
  VerifySoftwareToken
newVerifySoftwareToken :: Text -> VerifySoftwareToken
newVerifySoftwareToken Text
pUserCode_ =
  VerifySoftwareToken' :: Maybe (Sensitive Text)
-> Maybe Text -> Maybe Text -> Text -> VerifySoftwareToken
VerifySoftwareToken'
    { $sel:accessToken:VerifySoftwareToken' :: Maybe (Sensitive Text)
accessToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:friendlyDeviceName:VerifySoftwareToken' :: Maybe Text
friendlyDeviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:session:VerifySoftwareToken' :: Maybe Text
session = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userCode:VerifySoftwareToken' :: Text
userCode = Text
pUserCode_
    }

-- | The access token.
verifySoftwareToken_accessToken :: Lens.Lens' VerifySoftwareToken (Prelude.Maybe Prelude.Text)
verifySoftwareToken_accessToken :: (Maybe Text -> f (Maybe Text))
-> VerifySoftwareToken -> f VerifySoftwareToken
verifySoftwareToken_accessToken = (VerifySoftwareToken -> Maybe (Sensitive Text))
-> (VerifySoftwareToken
    -> Maybe (Sensitive Text) -> VerifySoftwareToken)
-> Lens
     VerifySoftwareToken
     VerifySoftwareToken
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifySoftwareToken' {Maybe (Sensitive Text)
accessToken :: Maybe (Sensitive Text)
$sel:accessToken:VerifySoftwareToken' :: VerifySoftwareToken -> Maybe (Sensitive Text)
accessToken} -> Maybe (Sensitive Text)
accessToken) (\s :: VerifySoftwareToken
s@VerifySoftwareToken' {} Maybe (Sensitive Text)
a -> VerifySoftwareToken
s {$sel:accessToken:VerifySoftwareToken' :: Maybe (Sensitive Text)
accessToken = Maybe (Sensitive Text)
a} :: VerifySoftwareToken) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> VerifySoftwareToken -> f VerifySoftwareToken)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> VerifySoftwareToken
-> f VerifySoftwareToken
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 friendly device name.
verifySoftwareToken_friendlyDeviceName :: Lens.Lens' VerifySoftwareToken (Prelude.Maybe Prelude.Text)
verifySoftwareToken_friendlyDeviceName :: (Maybe Text -> f (Maybe Text))
-> VerifySoftwareToken -> f VerifySoftwareToken
verifySoftwareToken_friendlyDeviceName = (VerifySoftwareToken -> Maybe Text)
-> (VerifySoftwareToken -> Maybe Text -> VerifySoftwareToken)
-> Lens
     VerifySoftwareToken VerifySoftwareToken (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifySoftwareToken' {Maybe Text
friendlyDeviceName :: Maybe Text
$sel:friendlyDeviceName:VerifySoftwareToken' :: VerifySoftwareToken -> Maybe Text
friendlyDeviceName} -> Maybe Text
friendlyDeviceName) (\s :: VerifySoftwareToken
s@VerifySoftwareToken' {} Maybe Text
a -> VerifySoftwareToken
s {$sel:friendlyDeviceName:VerifySoftwareToken' :: Maybe Text
friendlyDeviceName = Maybe Text
a} :: VerifySoftwareToken)

-- | The session which should be passed both ways in challenge-response calls
-- to the service.
verifySoftwareToken_session :: Lens.Lens' VerifySoftwareToken (Prelude.Maybe Prelude.Text)
verifySoftwareToken_session :: (Maybe Text -> f (Maybe Text))
-> VerifySoftwareToken -> f VerifySoftwareToken
verifySoftwareToken_session = (VerifySoftwareToken -> Maybe Text)
-> (VerifySoftwareToken -> Maybe Text -> VerifySoftwareToken)
-> Lens
     VerifySoftwareToken VerifySoftwareToken (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifySoftwareToken' {Maybe Text
session :: Maybe Text
$sel:session:VerifySoftwareToken' :: VerifySoftwareToken -> Maybe Text
session} -> Maybe Text
session) (\s :: VerifySoftwareToken
s@VerifySoftwareToken' {} Maybe Text
a -> VerifySoftwareToken
s {$sel:session:VerifySoftwareToken' :: Maybe Text
session = Maybe Text
a} :: VerifySoftwareToken)

-- | The one time password computed using the secret code returned by
-- <https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AssociateSoftwareToken.html AssociateSoftwareToken\">.
verifySoftwareToken_userCode :: Lens.Lens' VerifySoftwareToken Prelude.Text
verifySoftwareToken_userCode :: (Text -> f Text) -> VerifySoftwareToken -> f VerifySoftwareToken
verifySoftwareToken_userCode = (VerifySoftwareToken -> Text)
-> (VerifySoftwareToken -> Text -> VerifySoftwareToken)
-> Lens VerifySoftwareToken VerifySoftwareToken Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifySoftwareToken' {Text
userCode :: Text
$sel:userCode:VerifySoftwareToken' :: VerifySoftwareToken -> Text
userCode} -> Text
userCode) (\s :: VerifySoftwareToken
s@VerifySoftwareToken' {} Text
a -> VerifySoftwareToken
s {$sel:userCode:VerifySoftwareToken' :: Text
userCode = Text
a} :: VerifySoftwareToken)

instance Core.AWSRequest VerifySoftwareToken where
  type
    AWSResponse VerifySoftwareToken =
      VerifySoftwareTokenResponse
  request :: VerifySoftwareToken -> Request VerifySoftwareToken
request = Service -> VerifySoftwareToken -> Request VerifySoftwareToken
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy VerifySoftwareToken
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse VerifySoftwareToken)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse VerifySoftwareToken))
-> Logger
-> Service
-> Proxy VerifySoftwareToken
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse VerifySoftwareToken)))
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 VerifySoftwareTokenResponseType
-> Maybe Text -> Int -> VerifySoftwareTokenResponse
VerifySoftwareTokenResponse'
            (Maybe VerifySoftwareTokenResponseType
 -> Maybe Text -> Int -> VerifySoftwareTokenResponse)
-> Either String (Maybe VerifySoftwareTokenResponseType)
-> Either String (Maybe Text -> Int -> VerifySoftwareTokenResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe VerifySoftwareTokenResponseType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either String (Maybe Text -> Int -> VerifySoftwareTokenResponse)
-> Either String (Maybe Text)
-> Either String (Int -> VerifySoftwareTokenResponse)
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
"Session")
            Either String (Int -> VerifySoftwareTokenResponse)
-> Either String Int -> Either String VerifySoftwareTokenResponse
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))
      )

instance Prelude.Hashable VerifySoftwareToken

instance Prelude.NFData VerifySoftwareToken

instance Core.ToHeaders VerifySoftwareToken where
  toHeaders :: VerifySoftwareToken -> ResponseHeaders
toHeaders =
    ResponseHeaders -> VerifySoftwareToken -> 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
"AWSCognitoIdentityProviderService.VerifySoftwareToken" ::
                          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 VerifySoftwareToken where
  toJSON :: VerifySoftwareToken -> Value
toJSON VerifySoftwareToken' {Maybe Text
Maybe (Sensitive Text)
Text
userCode :: Text
session :: Maybe Text
friendlyDeviceName :: Maybe Text
accessToken :: Maybe (Sensitive Text)
$sel:userCode:VerifySoftwareToken' :: VerifySoftwareToken -> Text
$sel:session:VerifySoftwareToken' :: VerifySoftwareToken -> Maybe Text
$sel:friendlyDeviceName:VerifySoftwareToken' :: VerifySoftwareToken -> Maybe Text
$sel:accessToken:VerifySoftwareToken' :: VerifySoftwareToken -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AccessToken" 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)
accessToken,
            (Text
"FriendlyDeviceName" 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
friendlyDeviceName,
            (Text
"Session" 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
session,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userCode)
          ]
      )

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

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

-- | /See:/ 'newVerifySoftwareTokenResponse' smart constructor.
data VerifySoftwareTokenResponse = VerifySoftwareTokenResponse'
  { -- | The status of the verify software token.
    VerifySoftwareTokenResponse
-> Maybe VerifySoftwareTokenResponseType
status :: Prelude.Maybe VerifySoftwareTokenResponseType,
    -- | The session which should be passed both ways in challenge-response calls
    -- to the service.
    VerifySoftwareTokenResponse -> Maybe Text
session :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    VerifySoftwareTokenResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (VerifySoftwareTokenResponse -> VerifySoftwareTokenResponse -> Bool
(VerifySoftwareTokenResponse
 -> VerifySoftwareTokenResponse -> Bool)
-> (VerifySoftwareTokenResponse
    -> VerifySoftwareTokenResponse -> Bool)
-> Eq VerifySoftwareTokenResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifySoftwareTokenResponse -> VerifySoftwareTokenResponse -> Bool
$c/= :: VerifySoftwareTokenResponse -> VerifySoftwareTokenResponse -> Bool
== :: VerifySoftwareTokenResponse -> VerifySoftwareTokenResponse -> Bool
$c== :: VerifySoftwareTokenResponse -> VerifySoftwareTokenResponse -> Bool
Prelude.Eq, ReadPrec [VerifySoftwareTokenResponse]
ReadPrec VerifySoftwareTokenResponse
Int -> ReadS VerifySoftwareTokenResponse
ReadS [VerifySoftwareTokenResponse]
(Int -> ReadS VerifySoftwareTokenResponse)
-> ReadS [VerifySoftwareTokenResponse]
-> ReadPrec VerifySoftwareTokenResponse
-> ReadPrec [VerifySoftwareTokenResponse]
-> Read VerifySoftwareTokenResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifySoftwareTokenResponse]
$creadListPrec :: ReadPrec [VerifySoftwareTokenResponse]
readPrec :: ReadPrec VerifySoftwareTokenResponse
$creadPrec :: ReadPrec VerifySoftwareTokenResponse
readList :: ReadS [VerifySoftwareTokenResponse]
$creadList :: ReadS [VerifySoftwareTokenResponse]
readsPrec :: Int -> ReadS VerifySoftwareTokenResponse
$creadsPrec :: Int -> ReadS VerifySoftwareTokenResponse
Prelude.Read, Int -> VerifySoftwareTokenResponse -> ShowS
[VerifySoftwareTokenResponse] -> ShowS
VerifySoftwareTokenResponse -> String
(Int -> VerifySoftwareTokenResponse -> ShowS)
-> (VerifySoftwareTokenResponse -> String)
-> ([VerifySoftwareTokenResponse] -> ShowS)
-> Show VerifySoftwareTokenResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifySoftwareTokenResponse] -> ShowS
$cshowList :: [VerifySoftwareTokenResponse] -> ShowS
show :: VerifySoftwareTokenResponse -> String
$cshow :: VerifySoftwareTokenResponse -> String
showsPrec :: Int -> VerifySoftwareTokenResponse -> ShowS
$cshowsPrec :: Int -> VerifySoftwareTokenResponse -> ShowS
Prelude.Show, (forall x.
 VerifySoftwareTokenResponse -> Rep VerifySoftwareTokenResponse x)
-> (forall x.
    Rep VerifySoftwareTokenResponse x -> VerifySoftwareTokenResponse)
-> Generic VerifySoftwareTokenResponse
forall x.
Rep VerifySoftwareTokenResponse x -> VerifySoftwareTokenResponse
forall x.
VerifySoftwareTokenResponse -> Rep VerifySoftwareTokenResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VerifySoftwareTokenResponse x -> VerifySoftwareTokenResponse
$cfrom :: forall x.
VerifySoftwareTokenResponse -> Rep VerifySoftwareTokenResponse x
Prelude.Generic)

-- |
-- Create a value of 'VerifySoftwareTokenResponse' 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:
--
-- 'status', 'verifySoftwareTokenResponse_status' - The status of the verify software token.
--
-- 'session', 'verifySoftwareTokenResponse_session' - The session which should be passed both ways in challenge-response calls
-- to the service.
--
-- 'httpStatus', 'verifySoftwareTokenResponse_httpStatus' - The response's http status code.
newVerifySoftwareTokenResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  VerifySoftwareTokenResponse
newVerifySoftwareTokenResponse :: Int -> VerifySoftwareTokenResponse
newVerifySoftwareTokenResponse Int
pHttpStatus_ =
  VerifySoftwareTokenResponse' :: Maybe VerifySoftwareTokenResponseType
-> Maybe Text -> Int -> VerifySoftwareTokenResponse
VerifySoftwareTokenResponse'
    { $sel:status:VerifySoftwareTokenResponse' :: Maybe VerifySoftwareTokenResponseType
status =
        Maybe VerifySoftwareTokenResponseType
forall a. Maybe a
Prelude.Nothing,
      $sel:session:VerifySoftwareTokenResponse' :: Maybe Text
session = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:VerifySoftwareTokenResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the verify software token.
verifySoftwareTokenResponse_status :: Lens.Lens' VerifySoftwareTokenResponse (Prelude.Maybe VerifySoftwareTokenResponseType)
verifySoftwareTokenResponse_status :: (Maybe VerifySoftwareTokenResponseType
 -> f (Maybe VerifySoftwareTokenResponseType))
-> VerifySoftwareTokenResponse -> f VerifySoftwareTokenResponse
verifySoftwareTokenResponse_status = (VerifySoftwareTokenResponse
 -> Maybe VerifySoftwareTokenResponseType)
-> (VerifySoftwareTokenResponse
    -> Maybe VerifySoftwareTokenResponseType
    -> VerifySoftwareTokenResponse)
-> Lens
     VerifySoftwareTokenResponse
     VerifySoftwareTokenResponse
     (Maybe VerifySoftwareTokenResponseType)
     (Maybe VerifySoftwareTokenResponseType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifySoftwareTokenResponse' {Maybe VerifySoftwareTokenResponseType
status :: Maybe VerifySoftwareTokenResponseType
$sel:status:VerifySoftwareTokenResponse' :: VerifySoftwareTokenResponse
-> Maybe VerifySoftwareTokenResponseType
status} -> Maybe VerifySoftwareTokenResponseType
status) (\s :: VerifySoftwareTokenResponse
s@VerifySoftwareTokenResponse' {} Maybe VerifySoftwareTokenResponseType
a -> VerifySoftwareTokenResponse
s {$sel:status:VerifySoftwareTokenResponse' :: Maybe VerifySoftwareTokenResponseType
status = Maybe VerifySoftwareTokenResponseType
a} :: VerifySoftwareTokenResponse)

-- | The session which should be passed both ways in challenge-response calls
-- to the service.
verifySoftwareTokenResponse_session :: Lens.Lens' VerifySoftwareTokenResponse (Prelude.Maybe Prelude.Text)
verifySoftwareTokenResponse_session :: (Maybe Text -> f (Maybe Text))
-> VerifySoftwareTokenResponse -> f VerifySoftwareTokenResponse
verifySoftwareTokenResponse_session = (VerifySoftwareTokenResponse -> Maybe Text)
-> (VerifySoftwareTokenResponse
    -> Maybe Text -> VerifySoftwareTokenResponse)
-> Lens
     VerifySoftwareTokenResponse
     VerifySoftwareTokenResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifySoftwareTokenResponse' {Maybe Text
session :: Maybe Text
$sel:session:VerifySoftwareTokenResponse' :: VerifySoftwareTokenResponse -> Maybe Text
session} -> Maybe Text
session) (\s :: VerifySoftwareTokenResponse
s@VerifySoftwareTokenResponse' {} Maybe Text
a -> VerifySoftwareTokenResponse
s {$sel:session:VerifySoftwareTokenResponse' :: Maybe Text
session = Maybe Text
a} :: VerifySoftwareTokenResponse)

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

instance Prelude.NFData VerifySoftwareTokenResponse