{-# 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 #-}
module Amazonka.CognitoIdentityProvider.DescribeUserPoolDomain
(
DescribeUserPoolDomain (..),
newDescribeUserPoolDomain,
describeUserPoolDomain_domain,
DescribeUserPoolDomainResponse (..),
newDescribeUserPoolDomainResponse,
describeUserPoolDomainResponse_domainDescription,
describeUserPoolDomainResponse_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
data DescribeUserPoolDomain = DescribeUserPoolDomain'
{
DescribeUserPoolDomain -> Text
domain :: Prelude.Text
}
deriving (DescribeUserPoolDomain -> DescribeUserPoolDomain -> Bool
(DescribeUserPoolDomain -> DescribeUserPoolDomain -> Bool)
-> (DescribeUserPoolDomain -> DescribeUserPoolDomain -> Bool)
-> Eq DescribeUserPoolDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUserPoolDomain -> DescribeUserPoolDomain -> Bool
$c/= :: DescribeUserPoolDomain -> DescribeUserPoolDomain -> Bool
== :: DescribeUserPoolDomain -> DescribeUserPoolDomain -> Bool
$c== :: DescribeUserPoolDomain -> DescribeUserPoolDomain -> Bool
Prelude.Eq, ReadPrec [DescribeUserPoolDomain]
ReadPrec DescribeUserPoolDomain
Int -> ReadS DescribeUserPoolDomain
ReadS [DescribeUserPoolDomain]
(Int -> ReadS DescribeUserPoolDomain)
-> ReadS [DescribeUserPoolDomain]
-> ReadPrec DescribeUserPoolDomain
-> ReadPrec [DescribeUserPoolDomain]
-> Read DescribeUserPoolDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUserPoolDomain]
$creadListPrec :: ReadPrec [DescribeUserPoolDomain]
readPrec :: ReadPrec DescribeUserPoolDomain
$creadPrec :: ReadPrec DescribeUserPoolDomain
readList :: ReadS [DescribeUserPoolDomain]
$creadList :: ReadS [DescribeUserPoolDomain]
readsPrec :: Int -> ReadS DescribeUserPoolDomain
$creadsPrec :: Int -> ReadS DescribeUserPoolDomain
Prelude.Read, Int -> DescribeUserPoolDomain -> ShowS
[DescribeUserPoolDomain] -> ShowS
DescribeUserPoolDomain -> String
(Int -> DescribeUserPoolDomain -> ShowS)
-> (DescribeUserPoolDomain -> String)
-> ([DescribeUserPoolDomain] -> ShowS)
-> Show DescribeUserPoolDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUserPoolDomain] -> ShowS
$cshowList :: [DescribeUserPoolDomain] -> ShowS
show :: DescribeUserPoolDomain -> String
$cshow :: DescribeUserPoolDomain -> String
showsPrec :: Int -> DescribeUserPoolDomain -> ShowS
$cshowsPrec :: Int -> DescribeUserPoolDomain -> ShowS
Prelude.Show, (forall x. DescribeUserPoolDomain -> Rep DescribeUserPoolDomain x)
-> (forall x.
Rep DescribeUserPoolDomain x -> DescribeUserPoolDomain)
-> Generic DescribeUserPoolDomain
forall x. Rep DescribeUserPoolDomain x -> DescribeUserPoolDomain
forall x. DescribeUserPoolDomain -> Rep DescribeUserPoolDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeUserPoolDomain x -> DescribeUserPoolDomain
$cfrom :: forall x. DescribeUserPoolDomain -> Rep DescribeUserPoolDomain x
Prelude.Generic)
newDescribeUserPoolDomain ::
Prelude.Text ->
DescribeUserPoolDomain
newDescribeUserPoolDomain :: Text -> DescribeUserPoolDomain
newDescribeUserPoolDomain Text
pDomain_ =
DescribeUserPoolDomain' :: Text -> DescribeUserPoolDomain
DescribeUserPoolDomain' {$sel:domain:DescribeUserPoolDomain' :: Text
domain = Text
pDomain_}
describeUserPoolDomain_domain :: Lens.Lens' DescribeUserPoolDomain Prelude.Text
describeUserPoolDomain_domain :: (Text -> f Text)
-> DescribeUserPoolDomain -> f DescribeUserPoolDomain
describeUserPoolDomain_domain = (DescribeUserPoolDomain -> Text)
-> (DescribeUserPoolDomain -> Text -> DescribeUserPoolDomain)
-> Lens DescribeUserPoolDomain DescribeUserPoolDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserPoolDomain' {Text
domain :: Text
$sel:domain:DescribeUserPoolDomain' :: DescribeUserPoolDomain -> Text
domain} -> Text
domain) (\s :: DescribeUserPoolDomain
s@DescribeUserPoolDomain' {} Text
a -> DescribeUserPoolDomain
s {$sel:domain:DescribeUserPoolDomain' :: Text
domain = Text
a} :: DescribeUserPoolDomain)
instance Core.AWSRequest DescribeUserPoolDomain where
type
AWSResponse DescribeUserPoolDomain =
DescribeUserPoolDomainResponse
request :: DescribeUserPoolDomain -> Request DescribeUserPoolDomain
request = Service -> DescribeUserPoolDomain -> Request DescribeUserPoolDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeUserPoolDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeUserPoolDomain)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeUserPoolDomain))
-> Logger
-> Service
-> Proxy DescribeUserPoolDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeUserPoolDomain)))
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 DomainDescriptionType
-> Int -> DescribeUserPoolDomainResponse
DescribeUserPoolDomainResponse'
(Maybe DomainDescriptionType
-> Int -> DescribeUserPoolDomainResponse)
-> Either String (Maybe DomainDescriptionType)
-> Either String (Int -> DescribeUserPoolDomainResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DomainDescriptionType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DomainDescription")
Either String (Int -> DescribeUserPoolDomainResponse)
-> Either String Int
-> Either String DescribeUserPoolDomainResponse
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 DescribeUserPoolDomain
instance Prelude.NFData DescribeUserPoolDomain
instance Core.ToHeaders DescribeUserPoolDomain where
toHeaders :: DescribeUserPoolDomain -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeUserPoolDomain -> 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.DescribeUserPoolDomain" ::
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 DescribeUserPoolDomain where
toJSON :: DescribeUserPoolDomain -> Value
toJSON DescribeUserPoolDomain' {Text
domain :: Text
$sel:domain:DescribeUserPoolDomain' :: DescribeUserPoolDomain -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Domain" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domain)]
)
instance Core.ToPath DescribeUserPoolDomain where
toPath :: DescribeUserPoolDomain -> ByteString
toPath = ByteString -> DescribeUserPoolDomain -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeUserPoolDomain where
toQuery :: DescribeUserPoolDomain -> QueryString
toQuery = QueryString -> DescribeUserPoolDomain -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeUserPoolDomainResponse = DescribeUserPoolDomainResponse'
{
DescribeUserPoolDomainResponse -> Maybe DomainDescriptionType
domainDescription :: Prelude.Maybe DomainDescriptionType,
DescribeUserPoolDomainResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeUserPoolDomainResponse
-> DescribeUserPoolDomainResponse -> Bool
(DescribeUserPoolDomainResponse
-> DescribeUserPoolDomainResponse -> Bool)
-> (DescribeUserPoolDomainResponse
-> DescribeUserPoolDomainResponse -> Bool)
-> Eq DescribeUserPoolDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUserPoolDomainResponse
-> DescribeUserPoolDomainResponse -> Bool
$c/= :: DescribeUserPoolDomainResponse
-> DescribeUserPoolDomainResponse -> Bool
== :: DescribeUserPoolDomainResponse
-> DescribeUserPoolDomainResponse -> Bool
$c== :: DescribeUserPoolDomainResponse
-> DescribeUserPoolDomainResponse -> Bool
Prelude.Eq, ReadPrec [DescribeUserPoolDomainResponse]
ReadPrec DescribeUserPoolDomainResponse
Int -> ReadS DescribeUserPoolDomainResponse
ReadS [DescribeUserPoolDomainResponse]
(Int -> ReadS DescribeUserPoolDomainResponse)
-> ReadS [DescribeUserPoolDomainResponse]
-> ReadPrec DescribeUserPoolDomainResponse
-> ReadPrec [DescribeUserPoolDomainResponse]
-> Read DescribeUserPoolDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUserPoolDomainResponse]
$creadListPrec :: ReadPrec [DescribeUserPoolDomainResponse]
readPrec :: ReadPrec DescribeUserPoolDomainResponse
$creadPrec :: ReadPrec DescribeUserPoolDomainResponse
readList :: ReadS [DescribeUserPoolDomainResponse]
$creadList :: ReadS [DescribeUserPoolDomainResponse]
readsPrec :: Int -> ReadS DescribeUserPoolDomainResponse
$creadsPrec :: Int -> ReadS DescribeUserPoolDomainResponse
Prelude.Read, Int -> DescribeUserPoolDomainResponse -> ShowS
[DescribeUserPoolDomainResponse] -> ShowS
DescribeUserPoolDomainResponse -> String
(Int -> DescribeUserPoolDomainResponse -> ShowS)
-> (DescribeUserPoolDomainResponse -> String)
-> ([DescribeUserPoolDomainResponse] -> ShowS)
-> Show DescribeUserPoolDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUserPoolDomainResponse] -> ShowS
$cshowList :: [DescribeUserPoolDomainResponse] -> ShowS
show :: DescribeUserPoolDomainResponse -> String
$cshow :: DescribeUserPoolDomainResponse -> String
showsPrec :: Int -> DescribeUserPoolDomainResponse -> ShowS
$cshowsPrec :: Int -> DescribeUserPoolDomainResponse -> ShowS
Prelude.Show, (forall x.
DescribeUserPoolDomainResponse
-> Rep DescribeUserPoolDomainResponse x)
-> (forall x.
Rep DescribeUserPoolDomainResponse x
-> DescribeUserPoolDomainResponse)
-> Generic DescribeUserPoolDomainResponse
forall x.
Rep DescribeUserPoolDomainResponse x
-> DescribeUserPoolDomainResponse
forall x.
DescribeUserPoolDomainResponse
-> Rep DescribeUserPoolDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeUserPoolDomainResponse x
-> DescribeUserPoolDomainResponse
$cfrom :: forall x.
DescribeUserPoolDomainResponse
-> Rep DescribeUserPoolDomainResponse x
Prelude.Generic)
newDescribeUserPoolDomainResponse ::
Prelude.Int ->
DescribeUserPoolDomainResponse
newDescribeUserPoolDomainResponse :: Int -> DescribeUserPoolDomainResponse
newDescribeUserPoolDomainResponse Int
pHttpStatus_ =
DescribeUserPoolDomainResponse' :: Maybe DomainDescriptionType
-> Int -> DescribeUserPoolDomainResponse
DescribeUserPoolDomainResponse'
{ $sel:domainDescription:DescribeUserPoolDomainResponse' :: Maybe DomainDescriptionType
domainDescription =
Maybe DomainDescriptionType
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeUserPoolDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeUserPoolDomainResponse_domainDescription :: Lens.Lens' DescribeUserPoolDomainResponse (Prelude.Maybe DomainDescriptionType)
describeUserPoolDomainResponse_domainDescription :: (Maybe DomainDescriptionType -> f (Maybe DomainDescriptionType))
-> DescribeUserPoolDomainResponse
-> f DescribeUserPoolDomainResponse
describeUserPoolDomainResponse_domainDescription = (DescribeUserPoolDomainResponse -> Maybe DomainDescriptionType)
-> (DescribeUserPoolDomainResponse
-> Maybe DomainDescriptionType -> DescribeUserPoolDomainResponse)
-> Lens
DescribeUserPoolDomainResponse
DescribeUserPoolDomainResponse
(Maybe DomainDescriptionType)
(Maybe DomainDescriptionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserPoolDomainResponse' {Maybe DomainDescriptionType
domainDescription :: Maybe DomainDescriptionType
$sel:domainDescription:DescribeUserPoolDomainResponse' :: DescribeUserPoolDomainResponse -> Maybe DomainDescriptionType
domainDescription} -> Maybe DomainDescriptionType
domainDescription) (\s :: DescribeUserPoolDomainResponse
s@DescribeUserPoolDomainResponse' {} Maybe DomainDescriptionType
a -> DescribeUserPoolDomainResponse
s {$sel:domainDescription:DescribeUserPoolDomainResponse' :: Maybe DomainDescriptionType
domainDescription = Maybe DomainDescriptionType
a} :: DescribeUserPoolDomainResponse)
describeUserPoolDomainResponse_httpStatus :: Lens.Lens' DescribeUserPoolDomainResponse Prelude.Int
describeUserPoolDomainResponse_httpStatus :: (Int -> f Int)
-> DescribeUserPoolDomainResponse
-> f DescribeUserPoolDomainResponse
describeUserPoolDomainResponse_httpStatus = (DescribeUserPoolDomainResponse -> Int)
-> (DescribeUserPoolDomainResponse
-> Int -> DescribeUserPoolDomainResponse)
-> Lens
DescribeUserPoolDomainResponse
DescribeUserPoolDomainResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserPoolDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeUserPoolDomainResponse' :: DescribeUserPoolDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeUserPoolDomainResponse
s@DescribeUserPoolDomainResponse' {} Int
a -> DescribeUserPoolDomainResponse
s {$sel:httpStatus:DescribeUserPoolDomainResponse' :: Int
httpStatus = Int
a} :: DescribeUserPoolDomainResponse)
instance
Prelude.NFData
DescribeUserPoolDomainResponse