{-# 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.SSOOIDC.RegisterClient
-- 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)
--
-- Registers a client with AWS SSO. This allows clients to initiate device
-- authorization. The output should be persisted for reuse through many
-- authentication requests.
module Amazonka.SSOOIDC.RegisterClient
  ( -- * Creating a Request
    RegisterClient (..),
    newRegisterClient,

    -- * Request Lenses
    registerClient_scopes,
    registerClient_clientName,
    registerClient_clientType,

    -- * Destructuring the Response
    RegisterClientResponse (..),
    newRegisterClientResponse,

    -- * Response Lenses
    registerClientResponse_clientId,
    registerClientResponse_clientSecret,
    registerClientResponse_clientIdIssuedAt,
    registerClientResponse_clientSecretExpiresAt,
    registerClientResponse_tokenEndpoint,
    registerClientResponse_authorizationEndpoint,
    registerClientResponse_httpStatus,
  )
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.SSOOIDC.Types

-- | /See:/ 'newRegisterClient' smart constructor.
data RegisterClient = RegisterClient'
  { -- | The list of scopes that are defined by the client. Upon authorization,
    -- this list is used to restrict permissions when granting an access token.
    RegisterClient -> Maybe [Text]
scopes :: Prelude.Maybe [Prelude.Text],
    -- | The friendly name of the client.
    RegisterClient -> Text
clientName :: Prelude.Text,
    -- | The type of client. The service supports only @public@ as a client type.
    -- Anything other than public will be rejected by the service.
    RegisterClient -> Text
clientType :: Prelude.Text
  }
  deriving (RegisterClient -> RegisterClient -> Bool
(RegisterClient -> RegisterClient -> Bool)
-> (RegisterClient -> RegisterClient -> Bool) -> Eq RegisterClient
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterClient -> RegisterClient -> Bool
$c/= :: RegisterClient -> RegisterClient -> Bool
== :: RegisterClient -> RegisterClient -> Bool
$c== :: RegisterClient -> RegisterClient -> Bool
Prelude.Eq, ReadPrec [RegisterClient]
ReadPrec RegisterClient
Int -> ReadS RegisterClient
ReadS [RegisterClient]
(Int -> ReadS RegisterClient)
-> ReadS [RegisterClient]
-> ReadPrec RegisterClient
-> ReadPrec [RegisterClient]
-> Read RegisterClient
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterClient]
$creadListPrec :: ReadPrec [RegisterClient]
readPrec :: ReadPrec RegisterClient
$creadPrec :: ReadPrec RegisterClient
readList :: ReadS [RegisterClient]
$creadList :: ReadS [RegisterClient]
readsPrec :: Int -> ReadS RegisterClient
$creadsPrec :: Int -> ReadS RegisterClient
Prelude.Read, Int -> RegisterClient -> ShowS
[RegisterClient] -> ShowS
RegisterClient -> String
(Int -> RegisterClient -> ShowS)
-> (RegisterClient -> String)
-> ([RegisterClient] -> ShowS)
-> Show RegisterClient
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterClient] -> ShowS
$cshowList :: [RegisterClient] -> ShowS
show :: RegisterClient -> String
$cshow :: RegisterClient -> String
showsPrec :: Int -> RegisterClient -> ShowS
$cshowsPrec :: Int -> RegisterClient -> ShowS
Prelude.Show, (forall x. RegisterClient -> Rep RegisterClient x)
-> (forall x. Rep RegisterClient x -> RegisterClient)
-> Generic RegisterClient
forall x. Rep RegisterClient x -> RegisterClient
forall x. RegisterClient -> Rep RegisterClient x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterClient x -> RegisterClient
$cfrom :: forall x. RegisterClient -> Rep RegisterClient x
Prelude.Generic)

-- |
-- Create a value of 'RegisterClient' 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:
--
-- 'scopes', 'registerClient_scopes' - The list of scopes that are defined by the client. Upon authorization,
-- this list is used to restrict permissions when granting an access token.
--
-- 'clientName', 'registerClient_clientName' - The friendly name of the client.
--
-- 'clientType', 'registerClient_clientType' - The type of client. The service supports only @public@ as a client type.
-- Anything other than public will be rejected by the service.
newRegisterClient ::
  -- | 'clientName'
  Prelude.Text ->
  -- | 'clientType'
  Prelude.Text ->
  RegisterClient
newRegisterClient :: Text -> Text -> RegisterClient
newRegisterClient Text
pClientName_ Text
pClientType_ =
  RegisterClient' :: Maybe [Text] -> Text -> Text -> RegisterClient
RegisterClient'
    { $sel:scopes:RegisterClient' :: Maybe [Text]
scopes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:clientName:RegisterClient' :: Text
clientName = Text
pClientName_,
      $sel:clientType:RegisterClient' :: Text
clientType = Text
pClientType_
    }

-- | The list of scopes that are defined by the client. Upon authorization,
-- this list is used to restrict permissions when granting an access token.
registerClient_scopes :: Lens.Lens' RegisterClient (Prelude.Maybe [Prelude.Text])
registerClient_scopes :: (Maybe [Text] -> f (Maybe [Text]))
-> RegisterClient -> f RegisterClient
registerClient_scopes = (RegisterClient -> Maybe [Text])
-> (RegisterClient -> Maybe [Text] -> RegisterClient)
-> Lens RegisterClient RegisterClient (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterClient' {Maybe [Text]
scopes :: Maybe [Text]
$sel:scopes:RegisterClient' :: RegisterClient -> Maybe [Text]
scopes} -> Maybe [Text]
scopes) (\s :: RegisterClient
s@RegisterClient' {} Maybe [Text]
a -> RegisterClient
s {$sel:scopes:RegisterClient' :: Maybe [Text]
scopes = Maybe [Text]
a} :: RegisterClient) ((Maybe [Text] -> f (Maybe [Text]))
 -> RegisterClient -> f RegisterClient)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> RegisterClient
-> f RegisterClient
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The friendly name of the client.
registerClient_clientName :: Lens.Lens' RegisterClient Prelude.Text
registerClient_clientName :: (Text -> f Text) -> RegisterClient -> f RegisterClient
registerClient_clientName = (RegisterClient -> Text)
-> (RegisterClient -> Text -> RegisterClient)
-> Lens RegisterClient RegisterClient Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterClient' {Text
clientName :: Text
$sel:clientName:RegisterClient' :: RegisterClient -> Text
clientName} -> Text
clientName) (\s :: RegisterClient
s@RegisterClient' {} Text
a -> RegisterClient
s {$sel:clientName:RegisterClient' :: Text
clientName = Text
a} :: RegisterClient)

-- | The type of client. The service supports only @public@ as a client type.
-- Anything other than public will be rejected by the service.
registerClient_clientType :: Lens.Lens' RegisterClient Prelude.Text
registerClient_clientType :: (Text -> f Text) -> RegisterClient -> f RegisterClient
registerClient_clientType = (RegisterClient -> Text)
-> (RegisterClient -> Text -> RegisterClient)
-> Lens RegisterClient RegisterClient Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterClient' {Text
clientType :: Text
$sel:clientType:RegisterClient' :: RegisterClient -> Text
clientType} -> Text
clientType) (\s :: RegisterClient
s@RegisterClient' {} Text
a -> RegisterClient
s {$sel:clientType:RegisterClient' :: Text
clientType = Text
a} :: RegisterClient)

instance Core.AWSRequest RegisterClient where
  type
    AWSResponse RegisterClient =
      RegisterClientResponse
  request :: RegisterClient -> Request RegisterClient
request = Service -> RegisterClient -> Request RegisterClient
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy RegisterClient
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterClient)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse RegisterClient))
-> Logger
-> Service
-> Proxy RegisterClient
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterClient)))
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
-> Maybe Integer
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Int
-> RegisterClientResponse
RegisterClientResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> RegisterClientResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> RegisterClientResponse)
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
"clientId")
            Either
  String
  (Maybe Text
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> RegisterClientResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Integer
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> RegisterClientResponse)
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
"clientSecret")
            Either
  String
  (Maybe Integer
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> RegisterClientResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe Integer
      -> Maybe Text -> Maybe Text -> Int -> RegisterClientResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"clientIdIssuedAt")
            Either
  String
  (Maybe Integer
   -> Maybe Text -> Maybe Text -> Int -> RegisterClientResponse)
-> Either String (Maybe Integer)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> RegisterClientResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"clientSecretExpiresAt")
            Either
  String (Maybe Text -> Maybe Text -> Int -> RegisterClientResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> RegisterClientResponse)
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
"tokenEndpoint")
            Either String (Maybe Text -> Int -> RegisterClientResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RegisterClientResponse)
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
"authorizationEndpoint")
            Either String (Int -> RegisterClientResponse)
-> Either String Int -> Either String RegisterClientResponse
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 RegisterClient

instance Prelude.NFData RegisterClient

instance Core.ToHeaders RegisterClient where
  toHeaders :: RegisterClient -> ResponseHeaders
toHeaders =
    ResponseHeaders -> RegisterClient -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 RegisterClient where
  toJSON :: RegisterClient -> Value
toJSON RegisterClient' {Maybe [Text]
Text
clientType :: Text
clientName :: Text
scopes :: Maybe [Text]
$sel:clientType:RegisterClient' :: RegisterClient -> Text
$sel:clientName:RegisterClient' :: RegisterClient -> Text
$sel:scopes:RegisterClient' :: RegisterClient -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"scopes" 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]
scopes,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientType)
          ]
      )

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

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

-- | /See:/ 'newRegisterClientResponse' smart constructor.
data RegisterClientResponse = RegisterClientResponse'
  { -- | The unique identifier string for each client. This client uses this
    -- identifier to get authenticated by the service in subsequent calls.
    RegisterClientResponse -> Maybe Text
clientId :: Prelude.Maybe Prelude.Text,
    -- | A secret string generated for the client. The client will use this
    -- string to get authenticated by the service in subsequent calls.
    RegisterClientResponse -> Maybe Text
clientSecret :: Prelude.Maybe Prelude.Text,
    -- | Indicates the time at which the @clientId@ and @clientSecret@ were
    -- issued.
    RegisterClientResponse -> Maybe Integer
clientIdIssuedAt :: Prelude.Maybe Prelude.Integer,
    -- | Indicates the time at which the @clientId@ and @clientSecret@ will
    -- become invalid.
    RegisterClientResponse -> Maybe Integer
clientSecretExpiresAt :: Prelude.Maybe Prelude.Integer,
    -- | The endpoint where the client can get an access token.
    RegisterClientResponse -> Maybe Text
tokenEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The endpoint where the client can request authorization.
    RegisterClientResponse -> Maybe Text
authorizationEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    RegisterClientResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (RegisterClientResponse -> RegisterClientResponse -> Bool
(RegisterClientResponse -> RegisterClientResponse -> Bool)
-> (RegisterClientResponse -> RegisterClientResponse -> Bool)
-> Eq RegisterClientResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterClientResponse -> RegisterClientResponse -> Bool
$c/= :: RegisterClientResponse -> RegisterClientResponse -> Bool
== :: RegisterClientResponse -> RegisterClientResponse -> Bool
$c== :: RegisterClientResponse -> RegisterClientResponse -> Bool
Prelude.Eq, ReadPrec [RegisterClientResponse]
ReadPrec RegisterClientResponse
Int -> ReadS RegisterClientResponse
ReadS [RegisterClientResponse]
(Int -> ReadS RegisterClientResponse)
-> ReadS [RegisterClientResponse]
-> ReadPrec RegisterClientResponse
-> ReadPrec [RegisterClientResponse]
-> Read RegisterClientResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterClientResponse]
$creadListPrec :: ReadPrec [RegisterClientResponse]
readPrec :: ReadPrec RegisterClientResponse
$creadPrec :: ReadPrec RegisterClientResponse
readList :: ReadS [RegisterClientResponse]
$creadList :: ReadS [RegisterClientResponse]
readsPrec :: Int -> ReadS RegisterClientResponse
$creadsPrec :: Int -> ReadS RegisterClientResponse
Prelude.Read, Int -> RegisterClientResponse -> ShowS
[RegisterClientResponse] -> ShowS
RegisterClientResponse -> String
(Int -> RegisterClientResponse -> ShowS)
-> (RegisterClientResponse -> String)
-> ([RegisterClientResponse] -> ShowS)
-> Show RegisterClientResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterClientResponse] -> ShowS
$cshowList :: [RegisterClientResponse] -> ShowS
show :: RegisterClientResponse -> String
$cshow :: RegisterClientResponse -> String
showsPrec :: Int -> RegisterClientResponse -> ShowS
$cshowsPrec :: Int -> RegisterClientResponse -> ShowS
Prelude.Show, (forall x. RegisterClientResponse -> Rep RegisterClientResponse x)
-> (forall x.
    Rep RegisterClientResponse x -> RegisterClientResponse)
-> Generic RegisterClientResponse
forall x. Rep RegisterClientResponse x -> RegisterClientResponse
forall x. RegisterClientResponse -> Rep RegisterClientResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterClientResponse x -> RegisterClientResponse
$cfrom :: forall x. RegisterClientResponse -> Rep RegisterClientResponse x
Prelude.Generic)

-- |
-- Create a value of 'RegisterClientResponse' 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:
--
-- 'clientId', 'registerClientResponse_clientId' - The unique identifier string for each client. This client uses this
-- identifier to get authenticated by the service in subsequent calls.
--
-- 'clientSecret', 'registerClientResponse_clientSecret' - A secret string generated for the client. The client will use this
-- string to get authenticated by the service in subsequent calls.
--
-- 'clientIdIssuedAt', 'registerClientResponse_clientIdIssuedAt' - Indicates the time at which the @clientId@ and @clientSecret@ were
-- issued.
--
-- 'clientSecretExpiresAt', 'registerClientResponse_clientSecretExpiresAt' - Indicates the time at which the @clientId@ and @clientSecret@ will
-- become invalid.
--
-- 'tokenEndpoint', 'registerClientResponse_tokenEndpoint' - The endpoint where the client can get an access token.
--
-- 'authorizationEndpoint', 'registerClientResponse_authorizationEndpoint' - The endpoint where the client can request authorization.
--
-- 'httpStatus', 'registerClientResponse_httpStatus' - The response's http status code.
newRegisterClientResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RegisterClientResponse
newRegisterClientResponse :: Int -> RegisterClientResponse
newRegisterClientResponse Int
pHttpStatus_ =
  RegisterClientResponse' :: Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Int
-> RegisterClientResponse
RegisterClientResponse'
    { $sel:clientId:RegisterClientResponse' :: Maybe Text
clientId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientSecret:RegisterClientResponse' :: Maybe Text
clientSecret = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientIdIssuedAt:RegisterClientResponse' :: Maybe Integer
clientIdIssuedAt = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:clientSecretExpiresAt:RegisterClientResponse' :: Maybe Integer
clientSecretExpiresAt = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:tokenEndpoint:RegisterClientResponse' :: Maybe Text
tokenEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizationEndpoint:RegisterClientResponse' :: Maybe Text
authorizationEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:RegisterClientResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique identifier string for each client. This client uses this
-- identifier to get authenticated by the service in subsequent calls.
registerClientResponse_clientId :: Lens.Lens' RegisterClientResponse (Prelude.Maybe Prelude.Text)
registerClientResponse_clientId :: (Maybe Text -> f (Maybe Text))
-> RegisterClientResponse -> f RegisterClientResponse
registerClientResponse_clientId = (RegisterClientResponse -> Maybe Text)
-> (RegisterClientResponse -> Maybe Text -> RegisterClientResponse)
-> Lens
     RegisterClientResponse
     RegisterClientResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterClientResponse' {Maybe Text
clientId :: Maybe Text
$sel:clientId:RegisterClientResponse' :: RegisterClientResponse -> Maybe Text
clientId} -> Maybe Text
clientId) (\s :: RegisterClientResponse
s@RegisterClientResponse' {} Maybe Text
a -> RegisterClientResponse
s {$sel:clientId:RegisterClientResponse' :: Maybe Text
clientId = Maybe Text
a} :: RegisterClientResponse)

-- | A secret string generated for the client. The client will use this
-- string to get authenticated by the service in subsequent calls.
registerClientResponse_clientSecret :: Lens.Lens' RegisterClientResponse (Prelude.Maybe Prelude.Text)
registerClientResponse_clientSecret :: (Maybe Text -> f (Maybe Text))
-> RegisterClientResponse -> f RegisterClientResponse
registerClientResponse_clientSecret = (RegisterClientResponse -> Maybe Text)
-> (RegisterClientResponse -> Maybe Text -> RegisterClientResponse)
-> Lens
     RegisterClientResponse
     RegisterClientResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterClientResponse' {Maybe Text
clientSecret :: Maybe Text
$sel:clientSecret:RegisterClientResponse' :: RegisterClientResponse -> Maybe Text
clientSecret} -> Maybe Text
clientSecret) (\s :: RegisterClientResponse
s@RegisterClientResponse' {} Maybe Text
a -> RegisterClientResponse
s {$sel:clientSecret:RegisterClientResponse' :: Maybe Text
clientSecret = Maybe Text
a} :: RegisterClientResponse)

-- | Indicates the time at which the @clientId@ and @clientSecret@ were
-- issued.
registerClientResponse_clientIdIssuedAt :: Lens.Lens' RegisterClientResponse (Prelude.Maybe Prelude.Integer)
registerClientResponse_clientIdIssuedAt :: (Maybe Integer -> f (Maybe Integer))
-> RegisterClientResponse -> f RegisterClientResponse
registerClientResponse_clientIdIssuedAt = (RegisterClientResponse -> Maybe Integer)
-> (RegisterClientResponse
    -> Maybe Integer -> RegisterClientResponse)
-> Lens
     RegisterClientResponse
     RegisterClientResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterClientResponse' {Maybe Integer
clientIdIssuedAt :: Maybe Integer
$sel:clientIdIssuedAt:RegisterClientResponse' :: RegisterClientResponse -> Maybe Integer
clientIdIssuedAt} -> Maybe Integer
clientIdIssuedAt) (\s :: RegisterClientResponse
s@RegisterClientResponse' {} Maybe Integer
a -> RegisterClientResponse
s {$sel:clientIdIssuedAt:RegisterClientResponse' :: Maybe Integer
clientIdIssuedAt = Maybe Integer
a} :: RegisterClientResponse)

-- | Indicates the time at which the @clientId@ and @clientSecret@ will
-- become invalid.
registerClientResponse_clientSecretExpiresAt :: Lens.Lens' RegisterClientResponse (Prelude.Maybe Prelude.Integer)
registerClientResponse_clientSecretExpiresAt :: (Maybe Integer -> f (Maybe Integer))
-> RegisterClientResponse -> f RegisterClientResponse
registerClientResponse_clientSecretExpiresAt = (RegisterClientResponse -> Maybe Integer)
-> (RegisterClientResponse
    -> Maybe Integer -> RegisterClientResponse)
-> Lens
     RegisterClientResponse
     RegisterClientResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterClientResponse' {Maybe Integer
clientSecretExpiresAt :: Maybe Integer
$sel:clientSecretExpiresAt:RegisterClientResponse' :: RegisterClientResponse -> Maybe Integer
clientSecretExpiresAt} -> Maybe Integer
clientSecretExpiresAt) (\s :: RegisterClientResponse
s@RegisterClientResponse' {} Maybe Integer
a -> RegisterClientResponse
s {$sel:clientSecretExpiresAt:RegisterClientResponse' :: Maybe Integer
clientSecretExpiresAt = Maybe Integer
a} :: RegisterClientResponse)

-- | The endpoint where the client can get an access token.
registerClientResponse_tokenEndpoint :: Lens.Lens' RegisterClientResponse (Prelude.Maybe Prelude.Text)
registerClientResponse_tokenEndpoint :: (Maybe Text -> f (Maybe Text))
-> RegisterClientResponse -> f RegisterClientResponse
registerClientResponse_tokenEndpoint = (RegisterClientResponse -> Maybe Text)
-> (RegisterClientResponse -> Maybe Text -> RegisterClientResponse)
-> Lens
     RegisterClientResponse
     RegisterClientResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterClientResponse' {Maybe Text
tokenEndpoint :: Maybe Text
$sel:tokenEndpoint:RegisterClientResponse' :: RegisterClientResponse -> Maybe Text
tokenEndpoint} -> Maybe Text
tokenEndpoint) (\s :: RegisterClientResponse
s@RegisterClientResponse' {} Maybe Text
a -> RegisterClientResponse
s {$sel:tokenEndpoint:RegisterClientResponse' :: Maybe Text
tokenEndpoint = Maybe Text
a} :: RegisterClientResponse)

-- | The endpoint where the client can request authorization.
registerClientResponse_authorizationEndpoint :: Lens.Lens' RegisterClientResponse (Prelude.Maybe Prelude.Text)
registerClientResponse_authorizationEndpoint :: (Maybe Text -> f (Maybe Text))
-> RegisterClientResponse -> f RegisterClientResponse
registerClientResponse_authorizationEndpoint = (RegisterClientResponse -> Maybe Text)
-> (RegisterClientResponse -> Maybe Text -> RegisterClientResponse)
-> Lens
     RegisterClientResponse
     RegisterClientResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterClientResponse' {Maybe Text
authorizationEndpoint :: Maybe Text
$sel:authorizationEndpoint:RegisterClientResponse' :: RegisterClientResponse -> Maybe Text
authorizationEndpoint} -> Maybe Text
authorizationEndpoint) (\s :: RegisterClientResponse
s@RegisterClientResponse' {} Maybe Text
a -> RegisterClientResponse
s {$sel:authorizationEndpoint:RegisterClientResponse' :: Maybe Text
authorizationEndpoint = Maybe Text
a} :: RegisterClientResponse)

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

instance Prelude.NFData RegisterClientResponse