{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:domain:DescribeUserPoolDomain' :: Text
domain = Text
pDomain_}
describeUserPoolDomain_domain :: Lens.Lens' DescribeUserPoolDomain Prelude.Text
describeUserPoolDomain_domain :: Lens' DescribeUserPoolDomain Text
describeUserPoolDomain_domain = 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 :: (Service -> Service)
-> DescribeUserPoolDomain -> Request DescribeUserPoolDomain
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeUserPoolDomain
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeUserPoolDomain)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe DomainDescriptionType
-> Int -> DescribeUserPoolDomainResponse
DescribeUserPoolDomainResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DomainDescription")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeUserPoolDomain where
hashWithSalt :: Int -> DescribeUserPoolDomain -> Int
hashWithSalt Int
_salt DescribeUserPoolDomain' {Text
domain :: Text
$sel:domain:DescribeUserPoolDomain' :: DescribeUserPoolDomain -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domain
instance Prelude.NFData DescribeUserPoolDomain where
rnf :: DescribeUserPoolDomain -> ()
rnf DescribeUserPoolDomain' {Text
domain :: Text
$sel:domain:DescribeUserPoolDomain' :: DescribeUserPoolDomain -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
domain
instance Data.ToHeaders DescribeUserPoolDomain where
toHeaders :: DescribeUserPoolDomain -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSCognitoIdentityProviderService.DescribeUserPoolDomain" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DescribeUserPoolDomain where
toJSON :: DescribeUserPoolDomain -> Value
toJSON DescribeUserPoolDomain' {Text
domain :: Text
$sel:domain:DescribeUserPoolDomain' :: DescribeUserPoolDomain -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Domain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
domain)]
)
instance Data.ToPath DescribeUserPoolDomain where
toPath :: DescribeUserPoolDomain -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeUserPoolDomain where
toQuery :: DescribeUserPoolDomain -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:domainDescription:DescribeUserPoolDomainResponse' :: Maybe DomainDescriptionType
domainDescription =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeUserPoolDomainResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeUserPoolDomainResponse_domainDescription :: Lens.Lens' DescribeUserPoolDomainResponse (Prelude.Maybe DomainDescriptionType)
describeUserPoolDomainResponse_domainDescription :: Lens' DescribeUserPoolDomainResponse (Maybe DomainDescriptionType)
describeUserPoolDomainResponse_domainDescription = 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 :: Lens' DescribeUserPoolDomainResponse Int
describeUserPoolDomainResponse_httpStatus = 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
where
rnf :: DescribeUserPoolDomainResponse -> ()
rnf DescribeUserPoolDomainResponse' {Int
Maybe DomainDescriptionType
httpStatus :: Int
domainDescription :: Maybe DomainDescriptionType
$sel:httpStatus:DescribeUserPoolDomainResponse' :: DescribeUserPoolDomainResponse -> Int
$sel:domainDescription:DescribeUserPoolDomainResponse' :: DescribeUserPoolDomainResponse -> Maybe DomainDescriptionType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DomainDescriptionType
domainDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus