{-# 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.CognitoIdentity.LookupDeveloperIdentity
-- 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)
--
-- Retrieves the @IdentityID@ associated with a @DeveloperUserIdentifier@
-- or the list of @DeveloperUserIdentifier@ values associated with an
-- @IdentityId@ for an existing identity. Either @IdentityID@ or
-- @DeveloperUserIdentifier@ must not be null. If you supply only one of
-- these values, the other value will be searched in the database and
-- returned as a part of the response. If you supply both,
-- @DeveloperUserIdentifier@ will be matched against @IdentityID@. If the
-- values are verified against the database, the response returns both
-- values and is the same as the request. Otherwise a
-- @ResourceConflictException@ is thrown.
--
-- @LookupDeveloperIdentity@ is intended for low-throughput control plane
-- operations: for example, to enable customer service to locate an
-- identity ID by username. If you are using it for higher-volume
-- operations such as user authentication, your requests are likely to be
-- throttled. GetOpenIdTokenForDeveloperIdentity is a better option for
-- higher-volume operations for user authentication.
--
-- You must use AWS Developer credentials to call this API.
module Amazonka.CognitoIdentity.LookupDeveloperIdentity
  ( -- * Creating a Request
    LookupDeveloperIdentity (..),
    newLookupDeveloperIdentity,

    -- * Request Lenses
    lookupDeveloperIdentity_developerUserIdentifier,
    lookupDeveloperIdentity_nextToken,
    lookupDeveloperIdentity_identityId,
    lookupDeveloperIdentity_maxResults,
    lookupDeveloperIdentity_identityPoolId,

    -- * Destructuring the Response
    LookupDeveloperIdentityResponse (..),
    newLookupDeveloperIdentityResponse,

    -- * Response Lenses
    lookupDeveloperIdentityResponse_nextToken,
    lookupDeveloperIdentityResponse_identityId,
    lookupDeveloperIdentityResponse_developerUserIdentifierList,
    lookupDeveloperIdentityResponse_httpStatus,
  )
where

import Amazonka.CognitoIdentity.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

-- | Input to the @LookupDeveloperIdentityInput@ action.
--
-- /See:/ 'newLookupDeveloperIdentity' smart constructor.
data LookupDeveloperIdentity = LookupDeveloperIdentity'
  { -- | A unique ID used by your backend authentication process to identify a
    -- user. Typically, a developer identity provider would issue many
    -- developer user identifiers, in keeping with the number of users.
    LookupDeveloperIdentity -> Maybe Text
developerUserIdentifier :: Prelude.Maybe Prelude.Text,
    -- | A pagination token. The first call you make will have @NextToken@ set to
    -- null. After that the service will return @NextToken@ values as needed.
    -- For example, let\'s say you make a request with @MaxResults@ set to 10,
    -- and there are 20 matches in the database. The service will return a
    -- pagination token as a part of the response. This token can be used to
    -- call the API again and get results starting from the 11th match.
    LookupDeveloperIdentity -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier in the format REGION:GUID.
    LookupDeveloperIdentity -> Maybe Text
identityId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of identities to return.
    LookupDeveloperIdentity -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | An identity pool ID in the format REGION:GUID.
    LookupDeveloperIdentity -> Text
identityPoolId :: Prelude.Text
  }
  deriving (LookupDeveloperIdentity -> LookupDeveloperIdentity -> Bool
(LookupDeveloperIdentity -> LookupDeveloperIdentity -> Bool)
-> (LookupDeveloperIdentity -> LookupDeveloperIdentity -> Bool)
-> Eq LookupDeveloperIdentity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LookupDeveloperIdentity -> LookupDeveloperIdentity -> Bool
$c/= :: LookupDeveloperIdentity -> LookupDeveloperIdentity -> Bool
== :: LookupDeveloperIdentity -> LookupDeveloperIdentity -> Bool
$c== :: LookupDeveloperIdentity -> LookupDeveloperIdentity -> Bool
Prelude.Eq, ReadPrec [LookupDeveloperIdentity]
ReadPrec LookupDeveloperIdentity
Int -> ReadS LookupDeveloperIdentity
ReadS [LookupDeveloperIdentity]
(Int -> ReadS LookupDeveloperIdentity)
-> ReadS [LookupDeveloperIdentity]
-> ReadPrec LookupDeveloperIdentity
-> ReadPrec [LookupDeveloperIdentity]
-> Read LookupDeveloperIdentity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LookupDeveloperIdentity]
$creadListPrec :: ReadPrec [LookupDeveloperIdentity]
readPrec :: ReadPrec LookupDeveloperIdentity
$creadPrec :: ReadPrec LookupDeveloperIdentity
readList :: ReadS [LookupDeveloperIdentity]
$creadList :: ReadS [LookupDeveloperIdentity]
readsPrec :: Int -> ReadS LookupDeveloperIdentity
$creadsPrec :: Int -> ReadS LookupDeveloperIdentity
Prelude.Read, Int -> LookupDeveloperIdentity -> ShowS
[LookupDeveloperIdentity] -> ShowS
LookupDeveloperIdentity -> String
(Int -> LookupDeveloperIdentity -> ShowS)
-> (LookupDeveloperIdentity -> String)
-> ([LookupDeveloperIdentity] -> ShowS)
-> Show LookupDeveloperIdentity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LookupDeveloperIdentity] -> ShowS
$cshowList :: [LookupDeveloperIdentity] -> ShowS
show :: LookupDeveloperIdentity -> String
$cshow :: LookupDeveloperIdentity -> String
showsPrec :: Int -> LookupDeveloperIdentity -> ShowS
$cshowsPrec :: Int -> LookupDeveloperIdentity -> ShowS
Prelude.Show, (forall x.
 LookupDeveloperIdentity -> Rep LookupDeveloperIdentity x)
-> (forall x.
    Rep LookupDeveloperIdentity x -> LookupDeveloperIdentity)
-> Generic LookupDeveloperIdentity
forall x. Rep LookupDeveloperIdentity x -> LookupDeveloperIdentity
forall x. LookupDeveloperIdentity -> Rep LookupDeveloperIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LookupDeveloperIdentity x -> LookupDeveloperIdentity
$cfrom :: forall x. LookupDeveloperIdentity -> Rep LookupDeveloperIdentity x
Prelude.Generic)

-- |
-- Create a value of 'LookupDeveloperIdentity' 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:
--
-- 'developerUserIdentifier', 'lookupDeveloperIdentity_developerUserIdentifier' - A unique ID used by your backend authentication process to identify a
-- user. Typically, a developer identity provider would issue many
-- developer user identifiers, in keeping with the number of users.
--
-- 'nextToken', 'lookupDeveloperIdentity_nextToken' - A pagination token. The first call you make will have @NextToken@ set to
-- null. After that the service will return @NextToken@ values as needed.
-- For example, let\'s say you make a request with @MaxResults@ set to 10,
-- and there are 20 matches in the database. The service will return a
-- pagination token as a part of the response. This token can be used to
-- call the API again and get results starting from the 11th match.
--
-- 'identityId', 'lookupDeveloperIdentity_identityId' - A unique identifier in the format REGION:GUID.
--
-- 'maxResults', 'lookupDeveloperIdentity_maxResults' - The maximum number of identities to return.
--
-- 'identityPoolId', 'lookupDeveloperIdentity_identityPoolId' - An identity pool ID in the format REGION:GUID.
newLookupDeveloperIdentity ::
  -- | 'identityPoolId'
  Prelude.Text ->
  LookupDeveloperIdentity
newLookupDeveloperIdentity :: Text -> LookupDeveloperIdentity
newLookupDeveloperIdentity Text
pIdentityPoolId_ =
  LookupDeveloperIdentity' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Text
-> LookupDeveloperIdentity
LookupDeveloperIdentity'
    { $sel:developerUserIdentifier:LookupDeveloperIdentity' :: Maybe Text
developerUserIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:LookupDeveloperIdentity' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityId:LookupDeveloperIdentity' :: Maybe Text
identityId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:LookupDeveloperIdentity' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:identityPoolId:LookupDeveloperIdentity' :: Text
identityPoolId = Text
pIdentityPoolId_
    }

-- | A unique ID used by your backend authentication process to identify a
-- user. Typically, a developer identity provider would issue many
-- developer user identifiers, in keeping with the number of users.
lookupDeveloperIdentity_developerUserIdentifier :: Lens.Lens' LookupDeveloperIdentity (Prelude.Maybe Prelude.Text)
lookupDeveloperIdentity_developerUserIdentifier :: (Maybe Text -> f (Maybe Text))
-> LookupDeveloperIdentity -> f LookupDeveloperIdentity
lookupDeveloperIdentity_developerUserIdentifier = (LookupDeveloperIdentity -> Maybe Text)
-> (LookupDeveloperIdentity
    -> Maybe Text -> LookupDeveloperIdentity)
-> Lens
     LookupDeveloperIdentity
     LookupDeveloperIdentity
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupDeveloperIdentity' {Maybe Text
developerUserIdentifier :: Maybe Text
$sel:developerUserIdentifier:LookupDeveloperIdentity' :: LookupDeveloperIdentity -> Maybe Text
developerUserIdentifier} -> Maybe Text
developerUserIdentifier) (\s :: LookupDeveloperIdentity
s@LookupDeveloperIdentity' {} Maybe Text
a -> LookupDeveloperIdentity
s {$sel:developerUserIdentifier:LookupDeveloperIdentity' :: Maybe Text
developerUserIdentifier = Maybe Text
a} :: LookupDeveloperIdentity)

-- | A pagination token. The first call you make will have @NextToken@ set to
-- null. After that the service will return @NextToken@ values as needed.
-- For example, let\'s say you make a request with @MaxResults@ set to 10,
-- and there are 20 matches in the database. The service will return a
-- pagination token as a part of the response. This token can be used to
-- call the API again and get results starting from the 11th match.
lookupDeveloperIdentity_nextToken :: Lens.Lens' LookupDeveloperIdentity (Prelude.Maybe Prelude.Text)
lookupDeveloperIdentity_nextToken :: (Maybe Text -> f (Maybe Text))
-> LookupDeveloperIdentity -> f LookupDeveloperIdentity
lookupDeveloperIdentity_nextToken = (LookupDeveloperIdentity -> Maybe Text)
-> (LookupDeveloperIdentity
    -> Maybe Text -> LookupDeveloperIdentity)
-> Lens
     LookupDeveloperIdentity
     LookupDeveloperIdentity
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupDeveloperIdentity' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:LookupDeveloperIdentity' :: LookupDeveloperIdentity -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: LookupDeveloperIdentity
s@LookupDeveloperIdentity' {} Maybe Text
a -> LookupDeveloperIdentity
s {$sel:nextToken:LookupDeveloperIdentity' :: Maybe Text
nextToken = Maybe Text
a} :: LookupDeveloperIdentity)

-- | A unique identifier in the format REGION:GUID.
lookupDeveloperIdentity_identityId :: Lens.Lens' LookupDeveloperIdentity (Prelude.Maybe Prelude.Text)
lookupDeveloperIdentity_identityId :: (Maybe Text -> f (Maybe Text))
-> LookupDeveloperIdentity -> f LookupDeveloperIdentity
lookupDeveloperIdentity_identityId = (LookupDeveloperIdentity -> Maybe Text)
-> (LookupDeveloperIdentity
    -> Maybe Text -> LookupDeveloperIdentity)
-> Lens
     LookupDeveloperIdentity
     LookupDeveloperIdentity
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupDeveloperIdentity' {Maybe Text
identityId :: Maybe Text
$sel:identityId:LookupDeveloperIdentity' :: LookupDeveloperIdentity -> Maybe Text
identityId} -> Maybe Text
identityId) (\s :: LookupDeveloperIdentity
s@LookupDeveloperIdentity' {} Maybe Text
a -> LookupDeveloperIdentity
s {$sel:identityId:LookupDeveloperIdentity' :: Maybe Text
identityId = Maybe Text
a} :: LookupDeveloperIdentity)

-- | The maximum number of identities to return.
lookupDeveloperIdentity_maxResults :: Lens.Lens' LookupDeveloperIdentity (Prelude.Maybe Prelude.Natural)
lookupDeveloperIdentity_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> LookupDeveloperIdentity -> f LookupDeveloperIdentity
lookupDeveloperIdentity_maxResults = (LookupDeveloperIdentity -> Maybe Natural)
-> (LookupDeveloperIdentity
    -> Maybe Natural -> LookupDeveloperIdentity)
-> Lens
     LookupDeveloperIdentity
     LookupDeveloperIdentity
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupDeveloperIdentity' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:LookupDeveloperIdentity' :: LookupDeveloperIdentity -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: LookupDeveloperIdentity
s@LookupDeveloperIdentity' {} Maybe Natural
a -> LookupDeveloperIdentity
s {$sel:maxResults:LookupDeveloperIdentity' :: Maybe Natural
maxResults = Maybe Natural
a} :: LookupDeveloperIdentity)

-- | An identity pool ID in the format REGION:GUID.
lookupDeveloperIdentity_identityPoolId :: Lens.Lens' LookupDeveloperIdentity Prelude.Text
lookupDeveloperIdentity_identityPoolId :: (Text -> f Text)
-> LookupDeveloperIdentity -> f LookupDeveloperIdentity
lookupDeveloperIdentity_identityPoolId = (LookupDeveloperIdentity -> Text)
-> (LookupDeveloperIdentity -> Text -> LookupDeveloperIdentity)
-> Lens LookupDeveloperIdentity LookupDeveloperIdentity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupDeveloperIdentity' {Text
identityPoolId :: Text
$sel:identityPoolId:LookupDeveloperIdentity' :: LookupDeveloperIdentity -> Text
identityPoolId} -> Text
identityPoolId) (\s :: LookupDeveloperIdentity
s@LookupDeveloperIdentity' {} Text
a -> LookupDeveloperIdentity
s {$sel:identityPoolId:LookupDeveloperIdentity' :: Text
identityPoolId = Text
a} :: LookupDeveloperIdentity)

instance Core.AWSRequest LookupDeveloperIdentity where
  type
    AWSResponse LookupDeveloperIdentity =
      LookupDeveloperIdentityResponse
  request :: LookupDeveloperIdentity -> Request LookupDeveloperIdentity
request = Service
-> LookupDeveloperIdentity -> Request LookupDeveloperIdentity
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy LookupDeveloperIdentity
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse LookupDeveloperIdentity)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse LookupDeveloperIdentity))
-> Logger
-> Service
-> Proxy LookupDeveloperIdentity
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse LookupDeveloperIdentity)))
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 [Text]
-> Int
-> LookupDeveloperIdentityResponse
LookupDeveloperIdentityResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Int
 -> LookupDeveloperIdentityResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [Text] -> Int -> LookupDeveloperIdentityResponse)
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
"NextToken")
            Either
  String
  (Maybe Text
   -> Maybe [Text] -> Int -> LookupDeveloperIdentityResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Text] -> Int -> LookupDeveloperIdentityResponse)
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
"IdentityId")
            Either
  String (Maybe [Text] -> Int -> LookupDeveloperIdentityResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> LookupDeveloperIdentityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DeveloperUserIdentifierList"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> LookupDeveloperIdentityResponse)
-> Either String Int
-> Either String LookupDeveloperIdentityResponse
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 LookupDeveloperIdentity

instance Prelude.NFData LookupDeveloperIdentity

instance Core.ToHeaders LookupDeveloperIdentity where
  toHeaders :: LookupDeveloperIdentity -> ResponseHeaders
toHeaders =
    ResponseHeaders -> LookupDeveloperIdentity -> 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
"AWSCognitoIdentityService.LookupDeveloperIdentity" ::
                          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 LookupDeveloperIdentity where
  toJSON :: LookupDeveloperIdentity -> Value
toJSON LookupDeveloperIdentity' {Maybe Natural
Maybe Text
Text
identityPoolId :: Text
maxResults :: Maybe Natural
identityId :: Maybe Text
nextToken :: Maybe Text
developerUserIdentifier :: Maybe Text
$sel:identityPoolId:LookupDeveloperIdentity' :: LookupDeveloperIdentity -> Text
$sel:maxResults:LookupDeveloperIdentity' :: LookupDeveloperIdentity -> Maybe Natural
$sel:identityId:LookupDeveloperIdentity' :: LookupDeveloperIdentity -> Maybe Text
$sel:nextToken:LookupDeveloperIdentity' :: LookupDeveloperIdentity -> Maybe Text
$sel:developerUserIdentifier:LookupDeveloperIdentity' :: LookupDeveloperIdentity -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DeveloperUserIdentifier" 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
developerUserIdentifier,
            (Text
"NextToken" 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
nextToken,
            (Text
"IdentityId" 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
identityId,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"IdentityPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
identityPoolId)
          ]
      )

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

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

-- | Returned in response to a successful @LookupDeveloperIdentity@ action.
--
-- /See:/ 'newLookupDeveloperIdentityResponse' smart constructor.
data LookupDeveloperIdentityResponse = LookupDeveloperIdentityResponse'
  { -- | A pagination token. The first call you make will have @NextToken@ set to
    -- null. After that the service will return @NextToken@ values as needed.
    -- For example, let\'s say you make a request with @MaxResults@ set to 10,
    -- and there are 20 matches in the database. The service will return a
    -- pagination token as a part of the response. This token can be used to
    -- call the API again and get results starting from the 11th match.
    LookupDeveloperIdentityResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier in the format REGION:GUID.
    LookupDeveloperIdentityResponse -> Maybe Text
identityId :: Prelude.Maybe Prelude.Text,
    -- | This is the list of developer user identifiers associated with an
    -- identity ID. Cognito supports the association of multiple developer user
    -- identifiers with an identity ID.
    LookupDeveloperIdentityResponse -> Maybe [Text]
developerUserIdentifierList :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    LookupDeveloperIdentityResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (LookupDeveloperIdentityResponse
-> LookupDeveloperIdentityResponse -> Bool
(LookupDeveloperIdentityResponse
 -> LookupDeveloperIdentityResponse -> Bool)
-> (LookupDeveloperIdentityResponse
    -> LookupDeveloperIdentityResponse -> Bool)
-> Eq LookupDeveloperIdentityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LookupDeveloperIdentityResponse
-> LookupDeveloperIdentityResponse -> Bool
$c/= :: LookupDeveloperIdentityResponse
-> LookupDeveloperIdentityResponse -> Bool
== :: LookupDeveloperIdentityResponse
-> LookupDeveloperIdentityResponse -> Bool
$c== :: LookupDeveloperIdentityResponse
-> LookupDeveloperIdentityResponse -> Bool
Prelude.Eq, ReadPrec [LookupDeveloperIdentityResponse]
ReadPrec LookupDeveloperIdentityResponse
Int -> ReadS LookupDeveloperIdentityResponse
ReadS [LookupDeveloperIdentityResponse]
(Int -> ReadS LookupDeveloperIdentityResponse)
-> ReadS [LookupDeveloperIdentityResponse]
-> ReadPrec LookupDeveloperIdentityResponse
-> ReadPrec [LookupDeveloperIdentityResponse]
-> Read LookupDeveloperIdentityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LookupDeveloperIdentityResponse]
$creadListPrec :: ReadPrec [LookupDeveloperIdentityResponse]
readPrec :: ReadPrec LookupDeveloperIdentityResponse
$creadPrec :: ReadPrec LookupDeveloperIdentityResponse
readList :: ReadS [LookupDeveloperIdentityResponse]
$creadList :: ReadS [LookupDeveloperIdentityResponse]
readsPrec :: Int -> ReadS LookupDeveloperIdentityResponse
$creadsPrec :: Int -> ReadS LookupDeveloperIdentityResponse
Prelude.Read, Int -> LookupDeveloperIdentityResponse -> ShowS
[LookupDeveloperIdentityResponse] -> ShowS
LookupDeveloperIdentityResponse -> String
(Int -> LookupDeveloperIdentityResponse -> ShowS)
-> (LookupDeveloperIdentityResponse -> String)
-> ([LookupDeveloperIdentityResponse] -> ShowS)
-> Show LookupDeveloperIdentityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LookupDeveloperIdentityResponse] -> ShowS
$cshowList :: [LookupDeveloperIdentityResponse] -> ShowS
show :: LookupDeveloperIdentityResponse -> String
$cshow :: LookupDeveloperIdentityResponse -> String
showsPrec :: Int -> LookupDeveloperIdentityResponse -> ShowS
$cshowsPrec :: Int -> LookupDeveloperIdentityResponse -> ShowS
Prelude.Show, (forall x.
 LookupDeveloperIdentityResponse
 -> Rep LookupDeveloperIdentityResponse x)
-> (forall x.
    Rep LookupDeveloperIdentityResponse x
    -> LookupDeveloperIdentityResponse)
-> Generic LookupDeveloperIdentityResponse
forall x.
Rep LookupDeveloperIdentityResponse x
-> LookupDeveloperIdentityResponse
forall x.
LookupDeveloperIdentityResponse
-> Rep LookupDeveloperIdentityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LookupDeveloperIdentityResponse x
-> LookupDeveloperIdentityResponse
$cfrom :: forall x.
LookupDeveloperIdentityResponse
-> Rep LookupDeveloperIdentityResponse x
Prelude.Generic)

-- |
-- Create a value of 'LookupDeveloperIdentityResponse' 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:
--
-- 'nextToken', 'lookupDeveloperIdentityResponse_nextToken' - A pagination token. The first call you make will have @NextToken@ set to
-- null. After that the service will return @NextToken@ values as needed.
-- For example, let\'s say you make a request with @MaxResults@ set to 10,
-- and there are 20 matches in the database. The service will return a
-- pagination token as a part of the response. This token can be used to
-- call the API again and get results starting from the 11th match.
--
-- 'identityId', 'lookupDeveloperIdentityResponse_identityId' - A unique identifier in the format REGION:GUID.
--
-- 'developerUserIdentifierList', 'lookupDeveloperIdentityResponse_developerUserIdentifierList' - This is the list of developer user identifiers associated with an
-- identity ID. Cognito supports the association of multiple developer user
-- identifiers with an identity ID.
--
-- 'httpStatus', 'lookupDeveloperIdentityResponse_httpStatus' - The response's http status code.
newLookupDeveloperIdentityResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  LookupDeveloperIdentityResponse
newLookupDeveloperIdentityResponse :: Int -> LookupDeveloperIdentityResponse
newLookupDeveloperIdentityResponse Int
pHttpStatus_ =
  LookupDeveloperIdentityResponse' :: Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Int
-> LookupDeveloperIdentityResponse
LookupDeveloperIdentityResponse'
    { $sel:nextToken:LookupDeveloperIdentityResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityId:LookupDeveloperIdentityResponse' :: Maybe Text
identityId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:developerUserIdentifierList:LookupDeveloperIdentityResponse' :: Maybe [Text]
developerUserIdentifierList =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:LookupDeveloperIdentityResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A pagination token. The first call you make will have @NextToken@ set to
-- null. After that the service will return @NextToken@ values as needed.
-- For example, let\'s say you make a request with @MaxResults@ set to 10,
-- and there are 20 matches in the database. The service will return a
-- pagination token as a part of the response. This token can be used to
-- call the API again and get results starting from the 11th match.
lookupDeveloperIdentityResponse_nextToken :: Lens.Lens' LookupDeveloperIdentityResponse (Prelude.Maybe Prelude.Text)
lookupDeveloperIdentityResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> LookupDeveloperIdentityResponse
-> f LookupDeveloperIdentityResponse
lookupDeveloperIdentityResponse_nextToken = (LookupDeveloperIdentityResponse -> Maybe Text)
-> (LookupDeveloperIdentityResponse
    -> Maybe Text -> LookupDeveloperIdentityResponse)
-> Lens
     LookupDeveloperIdentityResponse
     LookupDeveloperIdentityResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupDeveloperIdentityResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:LookupDeveloperIdentityResponse' :: LookupDeveloperIdentityResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: LookupDeveloperIdentityResponse
s@LookupDeveloperIdentityResponse' {} Maybe Text
a -> LookupDeveloperIdentityResponse
s {$sel:nextToken:LookupDeveloperIdentityResponse' :: Maybe Text
nextToken = Maybe Text
a} :: LookupDeveloperIdentityResponse)

-- | A unique identifier in the format REGION:GUID.
lookupDeveloperIdentityResponse_identityId :: Lens.Lens' LookupDeveloperIdentityResponse (Prelude.Maybe Prelude.Text)
lookupDeveloperIdentityResponse_identityId :: (Maybe Text -> f (Maybe Text))
-> LookupDeveloperIdentityResponse
-> f LookupDeveloperIdentityResponse
lookupDeveloperIdentityResponse_identityId = (LookupDeveloperIdentityResponse -> Maybe Text)
-> (LookupDeveloperIdentityResponse
    -> Maybe Text -> LookupDeveloperIdentityResponse)
-> Lens
     LookupDeveloperIdentityResponse
     LookupDeveloperIdentityResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupDeveloperIdentityResponse' {Maybe Text
identityId :: Maybe Text
$sel:identityId:LookupDeveloperIdentityResponse' :: LookupDeveloperIdentityResponse -> Maybe Text
identityId} -> Maybe Text
identityId) (\s :: LookupDeveloperIdentityResponse
s@LookupDeveloperIdentityResponse' {} Maybe Text
a -> LookupDeveloperIdentityResponse
s {$sel:identityId:LookupDeveloperIdentityResponse' :: Maybe Text
identityId = Maybe Text
a} :: LookupDeveloperIdentityResponse)

-- | This is the list of developer user identifiers associated with an
-- identity ID. Cognito supports the association of multiple developer user
-- identifiers with an identity ID.
lookupDeveloperIdentityResponse_developerUserIdentifierList :: Lens.Lens' LookupDeveloperIdentityResponse (Prelude.Maybe [Prelude.Text])
lookupDeveloperIdentityResponse_developerUserIdentifierList :: (Maybe [Text] -> f (Maybe [Text]))
-> LookupDeveloperIdentityResponse
-> f LookupDeveloperIdentityResponse
lookupDeveloperIdentityResponse_developerUserIdentifierList = (LookupDeveloperIdentityResponse -> Maybe [Text])
-> (LookupDeveloperIdentityResponse
    -> Maybe [Text] -> LookupDeveloperIdentityResponse)
-> Lens
     LookupDeveloperIdentityResponse
     LookupDeveloperIdentityResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupDeveloperIdentityResponse' {Maybe [Text]
developerUserIdentifierList :: Maybe [Text]
$sel:developerUserIdentifierList:LookupDeveloperIdentityResponse' :: LookupDeveloperIdentityResponse -> Maybe [Text]
developerUserIdentifierList} -> Maybe [Text]
developerUserIdentifierList) (\s :: LookupDeveloperIdentityResponse
s@LookupDeveloperIdentityResponse' {} Maybe [Text]
a -> LookupDeveloperIdentityResponse
s {$sel:developerUserIdentifierList:LookupDeveloperIdentityResponse' :: Maybe [Text]
developerUserIdentifierList = Maybe [Text]
a} :: LookupDeveloperIdentityResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> LookupDeveloperIdentityResponse
 -> f LookupDeveloperIdentityResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> LookupDeveloperIdentityResponse
-> f LookupDeveloperIdentityResponse
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 response's http status code.
lookupDeveloperIdentityResponse_httpStatus :: Lens.Lens' LookupDeveloperIdentityResponse Prelude.Int
lookupDeveloperIdentityResponse_httpStatus :: (Int -> f Int)
-> LookupDeveloperIdentityResponse
-> f LookupDeveloperIdentityResponse
lookupDeveloperIdentityResponse_httpStatus = (LookupDeveloperIdentityResponse -> Int)
-> (LookupDeveloperIdentityResponse
    -> Int -> LookupDeveloperIdentityResponse)
-> Lens
     LookupDeveloperIdentityResponse
     LookupDeveloperIdentityResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupDeveloperIdentityResponse' {Int
httpStatus :: Int
$sel:httpStatus:LookupDeveloperIdentityResponse' :: LookupDeveloperIdentityResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: LookupDeveloperIdentityResponse
s@LookupDeveloperIdentityResponse' {} Int
a -> LookupDeveloperIdentityResponse
s {$sel:httpStatus:LookupDeveloperIdentityResponse' :: Int
httpStatus = Int
a} :: LookupDeveloperIdentityResponse)

instance
  Prelude.NFData
    LookupDeveloperIdentityResponse