{-# 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.CustomerProfiles.CreateDomain
(
CreateDomain (..),
newCreateDomain,
createDomain_defaultEncryptionKey,
createDomain_matching,
createDomain_deadLetterQueueUrl,
createDomain_tags,
createDomain_domainName,
createDomain_defaultExpirationDays,
CreateDomainResponse (..),
newCreateDomainResponse,
createDomainResponse_defaultEncryptionKey,
createDomainResponse_matching,
createDomainResponse_deadLetterQueueUrl,
createDomainResponse_tags,
createDomainResponse_httpStatus,
createDomainResponse_domainName,
createDomainResponse_defaultExpirationDays,
createDomainResponse_createdAt,
createDomainResponse_lastUpdatedAt,
)
where
import qualified Amazonka.Core as Core
import Amazonka.CustomerProfiles.Types
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 CreateDomain = CreateDomain'
{
CreateDomain -> Maybe Text
defaultEncryptionKey :: Prelude.Maybe Prelude.Text,
CreateDomain -> Maybe MatchingRequest
matching :: Prelude.Maybe MatchingRequest,
CreateDomain -> Maybe Text
deadLetterQueueUrl :: Prelude.Maybe Prelude.Text,
CreateDomain -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateDomain -> Text
domainName :: Prelude.Text,
CreateDomain -> Natural
defaultExpirationDays :: Prelude.Natural
}
deriving (CreateDomain -> CreateDomain -> Bool
(CreateDomain -> CreateDomain -> Bool)
-> (CreateDomain -> CreateDomain -> Bool) -> Eq CreateDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDomain -> CreateDomain -> Bool
$c/= :: CreateDomain -> CreateDomain -> Bool
== :: CreateDomain -> CreateDomain -> Bool
$c== :: CreateDomain -> CreateDomain -> Bool
Prelude.Eq, ReadPrec [CreateDomain]
ReadPrec CreateDomain
Int -> ReadS CreateDomain
ReadS [CreateDomain]
(Int -> ReadS CreateDomain)
-> ReadS [CreateDomain]
-> ReadPrec CreateDomain
-> ReadPrec [CreateDomain]
-> Read CreateDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDomain]
$creadListPrec :: ReadPrec [CreateDomain]
readPrec :: ReadPrec CreateDomain
$creadPrec :: ReadPrec CreateDomain
readList :: ReadS [CreateDomain]
$creadList :: ReadS [CreateDomain]
readsPrec :: Int -> ReadS CreateDomain
$creadsPrec :: Int -> ReadS CreateDomain
Prelude.Read, Int -> CreateDomain -> ShowS
[CreateDomain] -> ShowS
CreateDomain -> String
(Int -> CreateDomain -> ShowS)
-> (CreateDomain -> String)
-> ([CreateDomain] -> ShowS)
-> Show CreateDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDomain] -> ShowS
$cshowList :: [CreateDomain] -> ShowS
show :: CreateDomain -> String
$cshow :: CreateDomain -> String
showsPrec :: Int -> CreateDomain -> ShowS
$cshowsPrec :: Int -> CreateDomain -> ShowS
Prelude.Show, (forall x. CreateDomain -> Rep CreateDomain x)
-> (forall x. Rep CreateDomain x -> CreateDomain)
-> Generic CreateDomain
forall x. Rep CreateDomain x -> CreateDomain
forall x. CreateDomain -> Rep CreateDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDomain x -> CreateDomain
$cfrom :: forall x. CreateDomain -> Rep CreateDomain x
Prelude.Generic)
newCreateDomain ::
Prelude.Text ->
Prelude.Natural ->
CreateDomain
newCreateDomain :: Text -> Natural -> CreateDomain
newCreateDomain Text
pDomainName_ Natural
pDefaultExpirationDays_ =
CreateDomain' :: Maybe Text
-> Maybe MatchingRequest
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Natural
-> CreateDomain
CreateDomain'
{ $sel:defaultEncryptionKey:CreateDomain' :: Maybe Text
defaultEncryptionKey =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:matching:CreateDomain' :: Maybe MatchingRequest
matching = Maybe MatchingRequest
forall a. Maybe a
Prelude.Nothing,
$sel:deadLetterQueueUrl:CreateDomain' :: Maybe Text
deadLetterQueueUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateDomain' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:CreateDomain' :: Text
domainName = Text
pDomainName_,
$sel:defaultExpirationDays:CreateDomain' :: Natural
defaultExpirationDays = Natural
pDefaultExpirationDays_
}
createDomain_defaultEncryptionKey :: Lens.Lens' CreateDomain (Prelude.Maybe Prelude.Text)
createDomain_defaultEncryptionKey :: (Maybe Text -> f (Maybe Text)) -> CreateDomain -> f CreateDomain
createDomain_defaultEncryptionKey = (CreateDomain -> Maybe Text)
-> (CreateDomain -> Maybe Text -> CreateDomain)
-> Lens CreateDomain CreateDomain (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe Text
defaultEncryptionKey :: Maybe Text
$sel:defaultEncryptionKey:CreateDomain' :: CreateDomain -> Maybe Text
defaultEncryptionKey} -> Maybe Text
defaultEncryptionKey) (\s :: CreateDomain
s@CreateDomain' {} Maybe Text
a -> CreateDomain
s {$sel:defaultEncryptionKey:CreateDomain' :: Maybe Text
defaultEncryptionKey = Maybe Text
a} :: CreateDomain)
createDomain_matching :: Lens.Lens' CreateDomain (Prelude.Maybe MatchingRequest)
createDomain_matching :: (Maybe MatchingRequest -> f (Maybe MatchingRequest))
-> CreateDomain -> f CreateDomain
createDomain_matching = (CreateDomain -> Maybe MatchingRequest)
-> (CreateDomain -> Maybe MatchingRequest -> CreateDomain)
-> Lens
CreateDomain
CreateDomain
(Maybe MatchingRequest)
(Maybe MatchingRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe MatchingRequest
matching :: Maybe MatchingRequest
$sel:matching:CreateDomain' :: CreateDomain -> Maybe MatchingRequest
matching} -> Maybe MatchingRequest
matching) (\s :: CreateDomain
s@CreateDomain' {} Maybe MatchingRequest
a -> CreateDomain
s {$sel:matching:CreateDomain' :: Maybe MatchingRequest
matching = Maybe MatchingRequest
a} :: CreateDomain)
createDomain_deadLetterQueueUrl :: Lens.Lens' CreateDomain (Prelude.Maybe Prelude.Text)
createDomain_deadLetterQueueUrl :: (Maybe Text -> f (Maybe Text)) -> CreateDomain -> f CreateDomain
createDomain_deadLetterQueueUrl = (CreateDomain -> Maybe Text)
-> (CreateDomain -> Maybe Text -> CreateDomain)
-> Lens CreateDomain CreateDomain (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe Text
deadLetterQueueUrl :: Maybe Text
$sel:deadLetterQueueUrl:CreateDomain' :: CreateDomain -> Maybe Text
deadLetterQueueUrl} -> Maybe Text
deadLetterQueueUrl) (\s :: CreateDomain
s@CreateDomain' {} Maybe Text
a -> CreateDomain
s {$sel:deadLetterQueueUrl:CreateDomain' :: Maybe Text
deadLetterQueueUrl = Maybe Text
a} :: CreateDomain)
createDomain_tags :: Lens.Lens' CreateDomain (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createDomain_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDomain -> f CreateDomain
createDomain_tags = (CreateDomain -> Maybe (HashMap Text Text))
-> (CreateDomain -> Maybe (HashMap Text Text) -> CreateDomain)
-> Lens
CreateDomain
CreateDomain
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateDomain' :: CreateDomain -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateDomain
s@CreateDomain' {} Maybe (HashMap Text Text)
a -> CreateDomain
s {$sel:tags:CreateDomain' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateDomain) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDomain -> f CreateDomain)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDomain
-> f CreateDomain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDomain_domainName :: Lens.Lens' CreateDomain Prelude.Text
createDomain_domainName :: (Text -> f Text) -> CreateDomain -> f CreateDomain
createDomain_domainName = (CreateDomain -> Text)
-> (CreateDomain -> Text -> CreateDomain)
-> Lens CreateDomain CreateDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Text
domainName :: Text
$sel:domainName:CreateDomain' :: CreateDomain -> Text
domainName} -> Text
domainName) (\s :: CreateDomain
s@CreateDomain' {} Text
a -> CreateDomain
s {$sel:domainName:CreateDomain' :: Text
domainName = Text
a} :: CreateDomain)
createDomain_defaultExpirationDays :: Lens.Lens' CreateDomain Prelude.Natural
createDomain_defaultExpirationDays :: (Natural -> f Natural) -> CreateDomain -> f CreateDomain
createDomain_defaultExpirationDays = (CreateDomain -> Natural)
-> (CreateDomain -> Natural -> CreateDomain)
-> Lens CreateDomain CreateDomain Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomain' {Natural
defaultExpirationDays :: Natural
$sel:defaultExpirationDays:CreateDomain' :: CreateDomain -> Natural
defaultExpirationDays} -> Natural
defaultExpirationDays) (\s :: CreateDomain
s@CreateDomain' {} Natural
a -> CreateDomain
s {$sel:defaultExpirationDays:CreateDomain' :: Natural
defaultExpirationDays = Natural
a} :: CreateDomain)
instance Core.AWSRequest CreateDomain where
type AWSResponse CreateDomain = CreateDomainResponse
request :: CreateDomain -> Request CreateDomain
request = Service -> CreateDomain -> Request CreateDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDomain)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateDomain))
-> Logger
-> Service
-> Proxy CreateDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDomain)))
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 MatchingResponse
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse
CreateDomainResponse'
(Maybe Text
-> Maybe MatchingResponse
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe MatchingResponse
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse)
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
"DefaultEncryptionKey")
Either
String
(Maybe MatchingResponse
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse)
-> Either String (Maybe MatchingResponse)
-> Either
String
(Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe MatchingResponse)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Matching")
Either
String
(Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse)
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
"DeadLetterQueueUrl")
Either
String
(Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
String
(Int -> Text -> Natural -> POSIX -> POSIX -> CreateDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Either
String
(Int -> Text -> Natural -> POSIX -> POSIX -> CreateDomainResponse)
-> Either String Int
-> Either
String (Text -> Natural -> POSIX -> POSIX -> CreateDomainResponse)
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))
Either
String (Text -> Natural -> POSIX -> POSIX -> CreateDomainResponse)
-> Either String Text
-> Either
String (Natural -> POSIX -> POSIX -> CreateDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DomainName")
Either String (Natural -> POSIX -> POSIX -> CreateDomainResponse)
-> Either String Natural
-> Either String (POSIX -> POSIX -> CreateDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Natural
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DefaultExpirationDays")
Either String (POSIX -> POSIX -> CreateDomainResponse)
-> Either String POSIX
-> Either String (POSIX -> CreateDomainResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"CreatedAt")
Either String (POSIX -> CreateDomainResponse)
-> Either String POSIX -> Either String CreateDomainResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"LastUpdatedAt")
)
instance Prelude.Hashable CreateDomain
instance Prelude.NFData CreateDomain
instance Core.ToHeaders CreateDomain where
toHeaders :: CreateDomain -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateDomain -> 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 CreateDomain where
toJSON :: CreateDomain -> Value
toJSON CreateDomain' {Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe MatchingRequest
Text
defaultExpirationDays :: Natural
domainName :: Text
tags :: Maybe (HashMap Text Text)
deadLetterQueueUrl :: Maybe Text
matching :: Maybe MatchingRequest
defaultEncryptionKey :: Maybe Text
$sel:defaultExpirationDays:CreateDomain' :: CreateDomain -> Natural
$sel:domainName:CreateDomain' :: CreateDomain -> Text
$sel:tags:CreateDomain' :: CreateDomain -> Maybe (HashMap Text Text)
$sel:deadLetterQueueUrl:CreateDomain' :: CreateDomain -> Maybe Text
$sel:matching:CreateDomain' :: CreateDomain -> Maybe MatchingRequest
$sel:defaultEncryptionKey:CreateDomain' :: CreateDomain -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DefaultEncryptionKey" 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
defaultEncryptionKey,
(Text
"Matching" Text -> MatchingRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MatchingRequest -> Pair) -> Maybe MatchingRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MatchingRequest
matching,
(Text
"DeadLetterQueueUrl" 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
deadLetterQueueUrl,
(Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"DefaultExpirationDays"
Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
defaultExpirationDays
)
]
)
instance Core.ToPath CreateDomain where
toPath :: CreateDomain -> ByteString
toPath CreateDomain' {Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe MatchingRequest
Text
defaultExpirationDays :: Natural
domainName :: Text
tags :: Maybe (HashMap Text Text)
deadLetterQueueUrl :: Maybe Text
matching :: Maybe MatchingRequest
defaultEncryptionKey :: Maybe Text
$sel:defaultExpirationDays:CreateDomain' :: CreateDomain -> Natural
$sel:domainName:CreateDomain' :: CreateDomain -> Text
$sel:tags:CreateDomain' :: CreateDomain -> Maybe (HashMap Text Text)
$sel:deadLetterQueueUrl:CreateDomain' :: CreateDomain -> Maybe Text
$sel:matching:CreateDomain' :: CreateDomain -> Maybe MatchingRequest
$sel:defaultEncryptionKey:CreateDomain' :: CreateDomain -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/domains/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName]
instance Core.ToQuery CreateDomain where
toQuery :: CreateDomain -> QueryString
toQuery = QueryString -> CreateDomain -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateDomainResponse = CreateDomainResponse'
{
CreateDomainResponse -> Maybe Text
defaultEncryptionKey :: Prelude.Maybe Prelude.Text,
CreateDomainResponse -> Maybe MatchingResponse
matching :: Prelude.Maybe MatchingResponse,
CreateDomainResponse -> Maybe Text
deadLetterQueueUrl :: Prelude.Maybe Prelude.Text,
CreateDomainResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateDomainResponse -> Int
httpStatus :: Prelude.Int,
CreateDomainResponse -> Text
domainName :: Prelude.Text,
CreateDomainResponse -> Natural
defaultExpirationDays :: Prelude.Natural,
CreateDomainResponse -> POSIX
createdAt :: Core.POSIX,
CreateDomainResponse -> POSIX
lastUpdatedAt :: Core.POSIX
}
deriving (CreateDomainResponse -> CreateDomainResponse -> Bool
(CreateDomainResponse -> CreateDomainResponse -> Bool)
-> (CreateDomainResponse -> CreateDomainResponse -> Bool)
-> Eq CreateDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDomainResponse -> CreateDomainResponse -> Bool
$c/= :: CreateDomainResponse -> CreateDomainResponse -> Bool
== :: CreateDomainResponse -> CreateDomainResponse -> Bool
$c== :: CreateDomainResponse -> CreateDomainResponse -> Bool
Prelude.Eq, ReadPrec [CreateDomainResponse]
ReadPrec CreateDomainResponse
Int -> ReadS CreateDomainResponse
ReadS [CreateDomainResponse]
(Int -> ReadS CreateDomainResponse)
-> ReadS [CreateDomainResponse]
-> ReadPrec CreateDomainResponse
-> ReadPrec [CreateDomainResponse]
-> Read CreateDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDomainResponse]
$creadListPrec :: ReadPrec [CreateDomainResponse]
readPrec :: ReadPrec CreateDomainResponse
$creadPrec :: ReadPrec CreateDomainResponse
readList :: ReadS [CreateDomainResponse]
$creadList :: ReadS [CreateDomainResponse]
readsPrec :: Int -> ReadS CreateDomainResponse
$creadsPrec :: Int -> ReadS CreateDomainResponse
Prelude.Read, Int -> CreateDomainResponse -> ShowS
[CreateDomainResponse] -> ShowS
CreateDomainResponse -> String
(Int -> CreateDomainResponse -> ShowS)
-> (CreateDomainResponse -> String)
-> ([CreateDomainResponse] -> ShowS)
-> Show CreateDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDomainResponse] -> ShowS
$cshowList :: [CreateDomainResponse] -> ShowS
show :: CreateDomainResponse -> String
$cshow :: CreateDomainResponse -> String
showsPrec :: Int -> CreateDomainResponse -> ShowS
$cshowsPrec :: Int -> CreateDomainResponse -> ShowS
Prelude.Show, (forall x. CreateDomainResponse -> Rep CreateDomainResponse x)
-> (forall x. Rep CreateDomainResponse x -> CreateDomainResponse)
-> Generic CreateDomainResponse
forall x. Rep CreateDomainResponse x -> CreateDomainResponse
forall x. CreateDomainResponse -> Rep CreateDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDomainResponse x -> CreateDomainResponse
$cfrom :: forall x. CreateDomainResponse -> Rep CreateDomainResponse x
Prelude.Generic)
newCreateDomainResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Natural ->
Prelude.UTCTime ->
Prelude.UTCTime ->
CreateDomainResponse
newCreateDomainResponse :: Int
-> Text -> Natural -> UTCTime -> UTCTime -> CreateDomainResponse
newCreateDomainResponse
Int
pHttpStatus_
Text
pDomainName_
Natural
pDefaultExpirationDays_
UTCTime
pCreatedAt_
UTCTime
pLastUpdatedAt_ =
CreateDomainResponse' :: Maybe Text
-> Maybe MatchingResponse
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> Text
-> Natural
-> POSIX
-> POSIX
-> CreateDomainResponse
CreateDomainResponse'
{ $sel:defaultEncryptionKey:CreateDomainResponse' :: Maybe Text
defaultEncryptionKey =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:matching:CreateDomainResponse' :: Maybe MatchingResponse
matching = Maybe MatchingResponse
forall a. Maybe a
Prelude.Nothing,
$sel:deadLetterQueueUrl:CreateDomainResponse' :: Maybe Text
deadLetterQueueUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateDomainResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateDomainResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:domainName:CreateDomainResponse' :: Text
domainName = Text
pDomainName_,
$sel:defaultExpirationDays:CreateDomainResponse' :: Natural
defaultExpirationDays = Natural
pDefaultExpirationDays_,
$sel:createdAt:CreateDomainResponse' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
$sel:lastUpdatedAt:CreateDomainResponse' :: POSIX
lastUpdatedAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUpdatedAt_
}
createDomainResponse_defaultEncryptionKey :: Lens.Lens' CreateDomainResponse (Prelude.Maybe Prelude.Text)
createDomainResponse_defaultEncryptionKey :: (Maybe Text -> f (Maybe Text))
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_defaultEncryptionKey = (CreateDomainResponse -> Maybe Text)
-> (CreateDomainResponse -> Maybe Text -> CreateDomainResponse)
-> Lens
CreateDomainResponse CreateDomainResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Maybe Text
defaultEncryptionKey :: Maybe Text
$sel:defaultEncryptionKey:CreateDomainResponse' :: CreateDomainResponse -> Maybe Text
defaultEncryptionKey} -> Maybe Text
defaultEncryptionKey) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Maybe Text
a -> CreateDomainResponse
s {$sel:defaultEncryptionKey:CreateDomainResponse' :: Maybe Text
defaultEncryptionKey = Maybe Text
a} :: CreateDomainResponse)
createDomainResponse_matching :: Lens.Lens' CreateDomainResponse (Prelude.Maybe MatchingResponse)
createDomainResponse_matching :: (Maybe MatchingResponse -> f (Maybe MatchingResponse))
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_matching = (CreateDomainResponse -> Maybe MatchingResponse)
-> (CreateDomainResponse
-> Maybe MatchingResponse -> CreateDomainResponse)
-> Lens
CreateDomainResponse
CreateDomainResponse
(Maybe MatchingResponse)
(Maybe MatchingResponse)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Maybe MatchingResponse
matching :: Maybe MatchingResponse
$sel:matching:CreateDomainResponse' :: CreateDomainResponse -> Maybe MatchingResponse
matching} -> Maybe MatchingResponse
matching) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Maybe MatchingResponse
a -> CreateDomainResponse
s {$sel:matching:CreateDomainResponse' :: Maybe MatchingResponse
matching = Maybe MatchingResponse
a} :: CreateDomainResponse)
createDomainResponse_deadLetterQueueUrl :: Lens.Lens' CreateDomainResponse (Prelude.Maybe Prelude.Text)
createDomainResponse_deadLetterQueueUrl :: (Maybe Text -> f (Maybe Text))
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_deadLetterQueueUrl = (CreateDomainResponse -> Maybe Text)
-> (CreateDomainResponse -> Maybe Text -> CreateDomainResponse)
-> Lens
CreateDomainResponse CreateDomainResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Maybe Text
deadLetterQueueUrl :: Maybe Text
$sel:deadLetterQueueUrl:CreateDomainResponse' :: CreateDomainResponse -> Maybe Text
deadLetterQueueUrl} -> Maybe Text
deadLetterQueueUrl) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Maybe Text
a -> CreateDomainResponse
s {$sel:deadLetterQueueUrl:CreateDomainResponse' :: Maybe Text
deadLetterQueueUrl = Maybe Text
a} :: CreateDomainResponse)
createDomainResponse_tags :: Lens.Lens' CreateDomainResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createDomainResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_tags = (CreateDomainResponse -> Maybe (HashMap Text Text))
-> (CreateDomainResponse
-> Maybe (HashMap Text Text) -> CreateDomainResponse)
-> Lens
CreateDomainResponse
CreateDomainResponse
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateDomainResponse' :: CreateDomainResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Maybe (HashMap Text Text)
a -> CreateDomainResponse
s {$sel:tags:CreateDomainResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateDomainResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDomainResponse -> f CreateDomainResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDomainResponse
-> f CreateDomainResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDomainResponse_httpStatus :: Lens.Lens' CreateDomainResponse Prelude.Int
createDomainResponse_httpStatus :: (Int -> f Int) -> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_httpStatus = (CreateDomainResponse -> Int)
-> (CreateDomainResponse -> Int -> CreateDomainResponse)
-> Lens CreateDomainResponse CreateDomainResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDomainResponse' :: CreateDomainResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Int
a -> CreateDomainResponse
s {$sel:httpStatus:CreateDomainResponse' :: Int
httpStatus = Int
a} :: CreateDomainResponse)
createDomainResponse_domainName :: Lens.Lens' CreateDomainResponse Prelude.Text
createDomainResponse_domainName :: (Text -> f Text) -> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_domainName = (CreateDomainResponse -> Text)
-> (CreateDomainResponse -> Text -> CreateDomainResponse)
-> Lens CreateDomainResponse CreateDomainResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Text
domainName :: Text
$sel:domainName:CreateDomainResponse' :: CreateDomainResponse -> Text
domainName} -> Text
domainName) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Text
a -> CreateDomainResponse
s {$sel:domainName:CreateDomainResponse' :: Text
domainName = Text
a} :: CreateDomainResponse)
createDomainResponse_defaultExpirationDays :: Lens.Lens' CreateDomainResponse Prelude.Natural
createDomainResponse_defaultExpirationDays :: (Natural -> f Natural)
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_defaultExpirationDays = (CreateDomainResponse -> Natural)
-> (CreateDomainResponse -> Natural -> CreateDomainResponse)
-> Lens CreateDomainResponse CreateDomainResponse Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {Natural
defaultExpirationDays :: Natural
$sel:defaultExpirationDays:CreateDomainResponse' :: CreateDomainResponse -> Natural
defaultExpirationDays} -> Natural
defaultExpirationDays) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} Natural
a -> CreateDomainResponse
s {$sel:defaultExpirationDays:CreateDomainResponse' :: Natural
defaultExpirationDays = Natural
a} :: CreateDomainResponse)
createDomainResponse_createdAt :: Lens.Lens' CreateDomainResponse Prelude.UTCTime
createDomainResponse_createdAt :: (UTCTime -> f UTCTime)
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_createdAt = (CreateDomainResponse -> POSIX)
-> (CreateDomainResponse -> POSIX -> CreateDomainResponse)
-> Lens CreateDomainResponse CreateDomainResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {POSIX
createdAt :: POSIX
$sel:createdAt:CreateDomainResponse' :: CreateDomainResponse -> POSIX
createdAt} -> POSIX
createdAt) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} POSIX
a -> CreateDomainResponse
s {$sel:createdAt:CreateDomainResponse' :: POSIX
createdAt = POSIX
a} :: CreateDomainResponse) ((POSIX -> f POSIX)
-> CreateDomainResponse -> f CreateDomainResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> CreateDomainResponse
-> f CreateDomainResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
createDomainResponse_lastUpdatedAt :: Lens.Lens' CreateDomainResponse Prelude.UTCTime
createDomainResponse_lastUpdatedAt :: (UTCTime -> f UTCTime)
-> CreateDomainResponse -> f CreateDomainResponse
createDomainResponse_lastUpdatedAt = (CreateDomainResponse -> POSIX)
-> (CreateDomainResponse -> POSIX -> CreateDomainResponse)
-> Lens CreateDomainResponse CreateDomainResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDomainResponse' {POSIX
lastUpdatedAt :: POSIX
$sel:lastUpdatedAt:CreateDomainResponse' :: CreateDomainResponse -> POSIX
lastUpdatedAt} -> POSIX
lastUpdatedAt) (\s :: CreateDomainResponse
s@CreateDomainResponse' {} POSIX
a -> CreateDomainResponse
s {$sel:lastUpdatedAt:CreateDomainResponse' :: POSIX
lastUpdatedAt = POSIX
a} :: CreateDomainResponse) ((POSIX -> f POSIX)
-> CreateDomainResponse -> f CreateDomainResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> CreateDomainResponse
-> f CreateDomainResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Prelude.NFData CreateDomainResponse