{-# 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.SWF.RegisterDomain
(
RegisterDomain (..),
newRegisterDomain,
registerDomain_description,
registerDomain_tags,
registerDomain_name,
registerDomain_workflowExecutionRetentionPeriodInDays,
RegisterDomainResponse (..),
newRegisterDomainResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SWF.Types
data RegisterDomain = RegisterDomain'
{
RegisterDomain -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
RegisterDomain -> Maybe [ResourceTag]
tags :: Prelude.Maybe [ResourceTag],
RegisterDomain -> Text
name :: Prelude.Text,
RegisterDomain -> Text
workflowExecutionRetentionPeriodInDays :: Prelude.Text
}
deriving (RegisterDomain -> RegisterDomain -> Bool
(RegisterDomain -> RegisterDomain -> Bool)
-> (RegisterDomain -> RegisterDomain -> Bool) -> Eq RegisterDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterDomain -> RegisterDomain -> Bool
$c/= :: RegisterDomain -> RegisterDomain -> Bool
== :: RegisterDomain -> RegisterDomain -> Bool
$c== :: RegisterDomain -> RegisterDomain -> Bool
Prelude.Eq, ReadPrec [RegisterDomain]
ReadPrec RegisterDomain
Int -> ReadS RegisterDomain
ReadS [RegisterDomain]
(Int -> ReadS RegisterDomain)
-> ReadS [RegisterDomain]
-> ReadPrec RegisterDomain
-> ReadPrec [RegisterDomain]
-> Read RegisterDomain
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterDomain]
$creadListPrec :: ReadPrec [RegisterDomain]
readPrec :: ReadPrec RegisterDomain
$creadPrec :: ReadPrec RegisterDomain
readList :: ReadS [RegisterDomain]
$creadList :: ReadS [RegisterDomain]
readsPrec :: Int -> ReadS RegisterDomain
$creadsPrec :: Int -> ReadS RegisterDomain
Prelude.Read, Int -> RegisterDomain -> ShowS
[RegisterDomain] -> ShowS
RegisterDomain -> String
(Int -> RegisterDomain -> ShowS)
-> (RegisterDomain -> String)
-> ([RegisterDomain] -> ShowS)
-> Show RegisterDomain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterDomain] -> ShowS
$cshowList :: [RegisterDomain] -> ShowS
show :: RegisterDomain -> String
$cshow :: RegisterDomain -> String
showsPrec :: Int -> RegisterDomain -> ShowS
$cshowsPrec :: Int -> RegisterDomain -> ShowS
Prelude.Show, (forall x. RegisterDomain -> Rep RegisterDomain x)
-> (forall x. Rep RegisterDomain x -> RegisterDomain)
-> Generic RegisterDomain
forall x. Rep RegisterDomain x -> RegisterDomain
forall x. RegisterDomain -> Rep RegisterDomain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterDomain x -> RegisterDomain
$cfrom :: forall x. RegisterDomain -> Rep RegisterDomain x
Prelude.Generic)
newRegisterDomain ::
Prelude.Text ->
Prelude.Text ->
RegisterDomain
newRegisterDomain :: Text -> Text -> RegisterDomain
newRegisterDomain
Text
pName_
Text
pWorkflowExecutionRetentionPeriodInDays_ =
RegisterDomain' :: Maybe Text -> Maybe [ResourceTag] -> Text -> Text -> RegisterDomain
RegisterDomain'
{ $sel:description:RegisterDomain' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:RegisterDomain' :: Maybe [ResourceTag]
tags = Maybe [ResourceTag]
forall a. Maybe a
Prelude.Nothing,
$sel:name:RegisterDomain' :: Text
name = Text
pName_,
$sel:workflowExecutionRetentionPeriodInDays:RegisterDomain' :: Text
workflowExecutionRetentionPeriodInDays =
Text
pWorkflowExecutionRetentionPeriodInDays_
}
registerDomain_description :: Lens.Lens' RegisterDomain (Prelude.Maybe Prelude.Text)
registerDomain_description :: (Maybe Text -> f (Maybe Text))
-> RegisterDomain -> f RegisterDomain
registerDomain_description = (RegisterDomain -> Maybe Text)
-> (RegisterDomain -> Maybe Text -> RegisterDomain)
-> Lens RegisterDomain RegisterDomain (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterDomain' {Maybe Text
description :: Maybe Text
$sel:description:RegisterDomain' :: RegisterDomain -> Maybe Text
description} -> Maybe Text
description) (\s :: RegisterDomain
s@RegisterDomain' {} Maybe Text
a -> RegisterDomain
s {$sel:description:RegisterDomain' :: Maybe Text
description = Maybe Text
a} :: RegisterDomain)
registerDomain_tags :: Lens.Lens' RegisterDomain (Prelude.Maybe [ResourceTag])
registerDomain_tags :: (Maybe [ResourceTag] -> f (Maybe [ResourceTag]))
-> RegisterDomain -> f RegisterDomain
registerDomain_tags = (RegisterDomain -> Maybe [ResourceTag])
-> (RegisterDomain -> Maybe [ResourceTag] -> RegisterDomain)
-> Lens
RegisterDomain
RegisterDomain
(Maybe [ResourceTag])
(Maybe [ResourceTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterDomain' {Maybe [ResourceTag]
tags :: Maybe [ResourceTag]
$sel:tags:RegisterDomain' :: RegisterDomain -> Maybe [ResourceTag]
tags} -> Maybe [ResourceTag]
tags) (\s :: RegisterDomain
s@RegisterDomain' {} Maybe [ResourceTag]
a -> RegisterDomain
s {$sel:tags:RegisterDomain' :: Maybe [ResourceTag]
tags = Maybe [ResourceTag]
a} :: RegisterDomain) ((Maybe [ResourceTag] -> f (Maybe [ResourceTag]))
-> RegisterDomain -> f RegisterDomain)
-> ((Maybe [ResourceTag] -> f (Maybe [ResourceTag]))
-> Maybe [ResourceTag] -> f (Maybe [ResourceTag]))
-> (Maybe [ResourceTag] -> f (Maybe [ResourceTag]))
-> RegisterDomain
-> f RegisterDomain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ResourceTag] [ResourceTag] [ResourceTag] [ResourceTag]
-> Iso
(Maybe [ResourceTag])
(Maybe [ResourceTag])
(Maybe [ResourceTag])
(Maybe [ResourceTag])
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 [ResourceTag] [ResourceTag] [ResourceTag] [ResourceTag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
registerDomain_name :: Lens.Lens' RegisterDomain Prelude.Text
registerDomain_name :: (Text -> f Text) -> RegisterDomain -> f RegisterDomain
registerDomain_name = (RegisterDomain -> Text)
-> (RegisterDomain -> Text -> RegisterDomain)
-> Lens RegisterDomain RegisterDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterDomain' {Text
name :: Text
$sel:name:RegisterDomain' :: RegisterDomain -> Text
name} -> Text
name) (\s :: RegisterDomain
s@RegisterDomain' {} Text
a -> RegisterDomain
s {$sel:name:RegisterDomain' :: Text
name = Text
a} :: RegisterDomain)
registerDomain_workflowExecutionRetentionPeriodInDays :: Lens.Lens' RegisterDomain Prelude.Text
registerDomain_workflowExecutionRetentionPeriodInDays :: (Text -> f Text) -> RegisterDomain -> f RegisterDomain
registerDomain_workflowExecutionRetentionPeriodInDays = (RegisterDomain -> Text)
-> (RegisterDomain -> Text -> RegisterDomain)
-> Lens RegisterDomain RegisterDomain Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterDomain' {Text
workflowExecutionRetentionPeriodInDays :: Text
$sel:workflowExecutionRetentionPeriodInDays:RegisterDomain' :: RegisterDomain -> Text
workflowExecutionRetentionPeriodInDays} -> Text
workflowExecutionRetentionPeriodInDays) (\s :: RegisterDomain
s@RegisterDomain' {} Text
a -> RegisterDomain
s {$sel:workflowExecutionRetentionPeriodInDays:RegisterDomain' :: Text
workflowExecutionRetentionPeriodInDays = Text
a} :: RegisterDomain)
instance Core.AWSRequest RegisterDomain where
type
AWSResponse RegisterDomain =
RegisterDomainResponse
request :: RegisterDomain -> Request RegisterDomain
request = Service -> RegisterDomain -> Request RegisterDomain
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RegisterDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterDomain)))
response =
AWSResponse RegisterDomain
-> Logger
-> Service
-> Proxy RegisterDomain
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterDomain)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse RegisterDomain
RegisterDomainResponse
RegisterDomainResponse'
instance Prelude.Hashable RegisterDomain
instance Prelude.NFData RegisterDomain
instance Core.ToHeaders RegisterDomain where
toHeaders :: RegisterDomain -> [Header]
toHeaders =
[Header] -> RegisterDomain -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"SimpleWorkflowService.RegisterDomain" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON RegisterDomain where
toJSON :: RegisterDomain -> Value
toJSON RegisterDomain' {Maybe [ResourceTag]
Maybe Text
Text
workflowExecutionRetentionPeriodInDays :: Text
name :: Text
tags :: Maybe [ResourceTag]
description :: Maybe Text
$sel:workflowExecutionRetentionPeriodInDays:RegisterDomain' :: RegisterDomain -> Text
$sel:name:RegisterDomain' :: RegisterDomain -> Text
$sel:tags:RegisterDomain' :: RegisterDomain -> Maybe [ResourceTag]
$sel:description:RegisterDomain' :: RegisterDomain -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"description" 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
description,
(Text
"tags" Text -> [ResourceTag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ResourceTag] -> Pair) -> Maybe [ResourceTag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ResourceTag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"workflowExecutionRetentionPeriodInDays"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workflowExecutionRetentionPeriodInDays
)
]
)
instance Core.ToPath RegisterDomain where
toPath :: RegisterDomain -> ByteString
toPath = ByteString -> RegisterDomain -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RegisterDomain where
toQuery :: RegisterDomain -> QueryString
toQuery = QueryString -> RegisterDomain -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RegisterDomainResponse = RegisterDomainResponse'
{
}
deriving (RegisterDomainResponse -> RegisterDomainResponse -> Bool
(RegisterDomainResponse -> RegisterDomainResponse -> Bool)
-> (RegisterDomainResponse -> RegisterDomainResponse -> Bool)
-> Eq RegisterDomainResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterDomainResponse -> RegisterDomainResponse -> Bool
$c/= :: RegisterDomainResponse -> RegisterDomainResponse -> Bool
== :: RegisterDomainResponse -> RegisterDomainResponse -> Bool
$c== :: RegisterDomainResponse -> RegisterDomainResponse -> Bool
Prelude.Eq, ReadPrec [RegisterDomainResponse]
ReadPrec RegisterDomainResponse
Int -> ReadS RegisterDomainResponse
ReadS [RegisterDomainResponse]
(Int -> ReadS RegisterDomainResponse)
-> ReadS [RegisterDomainResponse]
-> ReadPrec RegisterDomainResponse
-> ReadPrec [RegisterDomainResponse]
-> Read RegisterDomainResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterDomainResponse]
$creadListPrec :: ReadPrec [RegisterDomainResponse]
readPrec :: ReadPrec RegisterDomainResponse
$creadPrec :: ReadPrec RegisterDomainResponse
readList :: ReadS [RegisterDomainResponse]
$creadList :: ReadS [RegisterDomainResponse]
readsPrec :: Int -> ReadS RegisterDomainResponse
$creadsPrec :: Int -> ReadS RegisterDomainResponse
Prelude.Read, Int -> RegisterDomainResponse -> ShowS
[RegisterDomainResponse] -> ShowS
RegisterDomainResponse -> String
(Int -> RegisterDomainResponse -> ShowS)
-> (RegisterDomainResponse -> String)
-> ([RegisterDomainResponse] -> ShowS)
-> Show RegisterDomainResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterDomainResponse] -> ShowS
$cshowList :: [RegisterDomainResponse] -> ShowS
show :: RegisterDomainResponse -> String
$cshow :: RegisterDomainResponse -> String
showsPrec :: Int -> RegisterDomainResponse -> ShowS
$cshowsPrec :: Int -> RegisterDomainResponse -> ShowS
Prelude.Show, (forall x. RegisterDomainResponse -> Rep RegisterDomainResponse x)
-> (forall x.
Rep RegisterDomainResponse x -> RegisterDomainResponse)
-> Generic RegisterDomainResponse
forall x. Rep RegisterDomainResponse x -> RegisterDomainResponse
forall x. RegisterDomainResponse -> Rep RegisterDomainResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterDomainResponse x -> RegisterDomainResponse
$cfrom :: forall x. RegisterDomainResponse -> Rep RegisterDomainResponse x
Prelude.Generic)
newRegisterDomainResponse ::
RegisterDomainResponse
newRegisterDomainResponse :: RegisterDomainResponse
newRegisterDomainResponse = RegisterDomainResponse
RegisterDomainResponse'
instance Prelude.NFData RegisterDomainResponse