{-# 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.QuickSight.CreateTemplate
(
CreateTemplate (..),
newCreateTemplate,
createTemplate_versionDescription,
createTemplate_name,
createTemplate_permissions,
createTemplate_tags,
createTemplate_awsAccountId,
createTemplate_templateId,
createTemplate_sourceEntity,
CreateTemplateResponse (..),
newCreateTemplateResponse,
createTemplateResponse_requestId,
createTemplateResponse_arn,
createTemplateResponse_creationStatus,
createTemplateResponse_templateId,
createTemplateResponse_versionArn,
createTemplateResponse_status,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateTemplate = CreateTemplate'
{
CreateTemplate -> Maybe Text
versionDescription :: Prelude.Maybe Prelude.Text,
CreateTemplate -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CreateTemplate -> Maybe (NonEmpty ResourcePermission)
permissions :: Prelude.Maybe (Prelude.NonEmpty ResourcePermission),
CreateTemplate -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateTemplate -> Text
awsAccountId :: Prelude.Text,
CreateTemplate -> Text
templateId :: Prelude.Text,
CreateTemplate -> TemplateSourceEntity
sourceEntity :: TemplateSourceEntity
}
deriving (CreateTemplate -> CreateTemplate -> Bool
(CreateTemplate -> CreateTemplate -> Bool)
-> (CreateTemplate -> CreateTemplate -> Bool) -> Eq CreateTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTemplate -> CreateTemplate -> Bool
$c/= :: CreateTemplate -> CreateTemplate -> Bool
== :: CreateTemplate -> CreateTemplate -> Bool
$c== :: CreateTemplate -> CreateTemplate -> Bool
Prelude.Eq, ReadPrec [CreateTemplate]
ReadPrec CreateTemplate
Int -> ReadS CreateTemplate
ReadS [CreateTemplate]
(Int -> ReadS CreateTemplate)
-> ReadS [CreateTemplate]
-> ReadPrec CreateTemplate
-> ReadPrec [CreateTemplate]
-> Read CreateTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTemplate]
$creadListPrec :: ReadPrec [CreateTemplate]
readPrec :: ReadPrec CreateTemplate
$creadPrec :: ReadPrec CreateTemplate
readList :: ReadS [CreateTemplate]
$creadList :: ReadS [CreateTemplate]
readsPrec :: Int -> ReadS CreateTemplate
$creadsPrec :: Int -> ReadS CreateTemplate
Prelude.Read, Int -> CreateTemplate -> ShowS
[CreateTemplate] -> ShowS
CreateTemplate -> String
(Int -> CreateTemplate -> ShowS)
-> (CreateTemplate -> String)
-> ([CreateTemplate] -> ShowS)
-> Show CreateTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTemplate] -> ShowS
$cshowList :: [CreateTemplate] -> ShowS
show :: CreateTemplate -> String
$cshow :: CreateTemplate -> String
showsPrec :: Int -> CreateTemplate -> ShowS
$cshowsPrec :: Int -> CreateTemplate -> ShowS
Prelude.Show, (forall x. CreateTemplate -> Rep CreateTemplate x)
-> (forall x. Rep CreateTemplate x -> CreateTemplate)
-> Generic CreateTemplate
forall x. Rep CreateTemplate x -> CreateTemplate
forall x. CreateTemplate -> Rep CreateTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTemplate x -> CreateTemplate
$cfrom :: forall x. CreateTemplate -> Rep CreateTemplate x
Prelude.Generic)
newCreateTemplate ::
Prelude.Text ->
Prelude.Text ->
TemplateSourceEntity ->
CreateTemplate
newCreateTemplate :: Text -> Text -> TemplateSourceEntity -> CreateTemplate
newCreateTemplate
Text
pAwsAccountId_
Text
pTemplateId_
TemplateSourceEntity
pSourceEntity_ =
CreateTemplate' :: Maybe Text
-> Maybe Text
-> Maybe (NonEmpty ResourcePermission)
-> Maybe (NonEmpty Tag)
-> Text
-> Text
-> TemplateSourceEntity
-> CreateTemplate
CreateTemplate'
{ $sel:versionDescription:CreateTemplate' :: Maybe Text
versionDescription =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateTemplate' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:permissions:CreateTemplate' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateTemplate' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:CreateTemplate' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:templateId:CreateTemplate' :: Text
templateId = Text
pTemplateId_,
$sel:sourceEntity:CreateTemplate' :: TemplateSourceEntity
sourceEntity = TemplateSourceEntity
pSourceEntity_
}
createTemplate_versionDescription :: Lens.Lens' CreateTemplate (Prelude.Maybe Prelude.Text)
createTemplate_versionDescription :: (Maybe Text -> f (Maybe Text))
-> CreateTemplate -> f CreateTemplate
createTemplate_versionDescription = (CreateTemplate -> Maybe Text)
-> (CreateTemplate -> Maybe Text -> CreateTemplate)
-> Lens CreateTemplate CreateTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplate' {Maybe Text
versionDescription :: Maybe Text
$sel:versionDescription:CreateTemplate' :: CreateTemplate -> Maybe Text
versionDescription} -> Maybe Text
versionDescription) (\s :: CreateTemplate
s@CreateTemplate' {} Maybe Text
a -> CreateTemplate
s {$sel:versionDescription:CreateTemplate' :: Maybe Text
versionDescription = Maybe Text
a} :: CreateTemplate)
createTemplate_name :: Lens.Lens' CreateTemplate (Prelude.Maybe Prelude.Text)
createTemplate_name :: (Maybe Text -> f (Maybe Text))
-> CreateTemplate -> f CreateTemplate
createTemplate_name = (CreateTemplate -> Maybe Text)
-> (CreateTemplate -> Maybe Text -> CreateTemplate)
-> Lens CreateTemplate CreateTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplate' {Maybe Text
name :: Maybe Text
$sel:name:CreateTemplate' :: CreateTemplate -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateTemplate
s@CreateTemplate' {} Maybe Text
a -> CreateTemplate
s {$sel:name:CreateTemplate' :: Maybe Text
name = Maybe Text
a} :: CreateTemplate)
createTemplate_permissions :: Lens.Lens' CreateTemplate (Prelude.Maybe (Prelude.NonEmpty ResourcePermission))
createTemplate_permissions :: (Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> CreateTemplate -> f CreateTemplate
createTemplate_permissions = (CreateTemplate -> Maybe (NonEmpty ResourcePermission))
-> (CreateTemplate
-> Maybe (NonEmpty ResourcePermission) -> CreateTemplate)
-> Lens
CreateTemplate
CreateTemplate
(Maybe (NonEmpty ResourcePermission))
(Maybe (NonEmpty ResourcePermission))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplate' {Maybe (NonEmpty ResourcePermission)
permissions :: Maybe (NonEmpty ResourcePermission)
$sel:permissions:CreateTemplate' :: CreateTemplate -> Maybe (NonEmpty ResourcePermission)
permissions} -> Maybe (NonEmpty ResourcePermission)
permissions) (\s :: CreateTemplate
s@CreateTemplate' {} Maybe (NonEmpty ResourcePermission)
a -> CreateTemplate
s {$sel:permissions:CreateTemplate' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
a} :: CreateTemplate) ((Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> CreateTemplate -> f CreateTemplate)
-> ((Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> (Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> CreateTemplate
-> f CreateTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
-> Iso
(Maybe (NonEmpty ResourcePermission))
(Maybe (NonEmpty ResourcePermission))
(Maybe (NonEmpty ResourcePermission))
(Maybe (NonEmpty ResourcePermission))
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
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createTemplate_tags :: Lens.Lens' CreateTemplate (Prelude.Maybe (Prelude.NonEmpty Tag))
createTemplate_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateTemplate -> f CreateTemplate
createTemplate_tags = (CreateTemplate -> Maybe (NonEmpty Tag))
-> (CreateTemplate -> Maybe (NonEmpty Tag) -> CreateTemplate)
-> Lens
CreateTemplate
CreateTemplate
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplate' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateTemplate' :: CreateTemplate -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateTemplate
s@CreateTemplate' {} Maybe (NonEmpty Tag)
a -> CreateTemplate
s {$sel:tags:CreateTemplate' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateTemplate) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateTemplate -> f CreateTemplate)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateTemplate
-> f CreateTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createTemplate_awsAccountId :: Lens.Lens' CreateTemplate Prelude.Text
createTemplate_awsAccountId :: (Text -> f Text) -> CreateTemplate -> f CreateTemplate
createTemplate_awsAccountId = (CreateTemplate -> Text)
-> (CreateTemplate -> Text -> CreateTemplate)
-> Lens CreateTemplate CreateTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplate' {Text
awsAccountId :: Text
$sel:awsAccountId:CreateTemplate' :: CreateTemplate -> Text
awsAccountId} -> Text
awsAccountId) (\s :: CreateTemplate
s@CreateTemplate' {} Text
a -> CreateTemplate
s {$sel:awsAccountId:CreateTemplate' :: Text
awsAccountId = Text
a} :: CreateTemplate)
createTemplate_templateId :: Lens.Lens' CreateTemplate Prelude.Text
createTemplate_templateId :: (Text -> f Text) -> CreateTemplate -> f CreateTemplate
createTemplate_templateId = (CreateTemplate -> Text)
-> (CreateTemplate -> Text -> CreateTemplate)
-> Lens CreateTemplate CreateTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplate' {Text
templateId :: Text
$sel:templateId:CreateTemplate' :: CreateTemplate -> Text
templateId} -> Text
templateId) (\s :: CreateTemplate
s@CreateTemplate' {} Text
a -> CreateTemplate
s {$sel:templateId:CreateTemplate' :: Text
templateId = Text
a} :: CreateTemplate)
createTemplate_sourceEntity :: Lens.Lens' CreateTemplate TemplateSourceEntity
createTemplate_sourceEntity :: (TemplateSourceEntity -> f TemplateSourceEntity)
-> CreateTemplate -> f CreateTemplate
createTemplate_sourceEntity = (CreateTemplate -> TemplateSourceEntity)
-> (CreateTemplate -> TemplateSourceEntity -> CreateTemplate)
-> Lens
CreateTemplate
CreateTemplate
TemplateSourceEntity
TemplateSourceEntity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplate' {TemplateSourceEntity
sourceEntity :: TemplateSourceEntity
$sel:sourceEntity:CreateTemplate' :: CreateTemplate -> TemplateSourceEntity
sourceEntity} -> TemplateSourceEntity
sourceEntity) (\s :: CreateTemplate
s@CreateTemplate' {} TemplateSourceEntity
a -> CreateTemplate
s {$sel:sourceEntity:CreateTemplate' :: TemplateSourceEntity
sourceEntity = TemplateSourceEntity
a} :: CreateTemplate)
instance Core.AWSRequest CreateTemplate where
type
AWSResponse CreateTemplate =
CreateTemplateResponse
request :: CreateTemplate -> Request CreateTemplate
request = Service -> CreateTemplate -> Request CreateTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateTemplate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateTemplate))
-> Logger
-> Service
-> Proxy CreateTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateTemplate)))
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 ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> CreateTemplateResponse
CreateTemplateResponse'
(Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> CreateTemplateResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> CreateTemplateResponse)
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
"RequestId")
Either
String
(Maybe Text
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> CreateTemplateResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe ResourceStatus
-> Maybe Text -> Maybe Text -> Int -> CreateTemplateResponse)
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
"Arn")
Either
String
(Maybe ResourceStatus
-> Maybe Text -> Maybe Text -> Int -> CreateTemplateResponse)
-> Either String (Maybe ResourceStatus)
-> Either
String (Maybe Text -> Maybe Text -> Int -> CreateTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ResourceStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationStatus")
Either
String (Maybe Text -> Maybe Text -> Int -> CreateTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateTemplateResponse)
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
"TemplateId")
Either String (Maybe Text -> Int -> CreateTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateTemplateResponse)
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
"VersionArn")
Either String (Int -> CreateTemplateResponse)
-> Either String Int -> Either String CreateTemplateResponse
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 CreateTemplate
instance Prelude.NFData CreateTemplate
instance Core.ToHeaders CreateTemplate where
toHeaders :: CreateTemplate -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateTemplate -> 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.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateTemplate where
toJSON :: CreateTemplate -> Value
toJSON CreateTemplate' {Maybe (NonEmpty ResourcePermission)
Maybe (NonEmpty Tag)
Maybe Text
Text
TemplateSourceEntity
sourceEntity :: TemplateSourceEntity
templateId :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
permissions :: Maybe (NonEmpty ResourcePermission)
name :: Maybe Text
versionDescription :: Maybe Text
$sel:sourceEntity:CreateTemplate' :: CreateTemplate -> TemplateSourceEntity
$sel:templateId:CreateTemplate' :: CreateTemplate -> Text
$sel:awsAccountId:CreateTemplate' :: CreateTemplate -> Text
$sel:tags:CreateTemplate' :: CreateTemplate -> Maybe (NonEmpty Tag)
$sel:permissions:CreateTemplate' :: CreateTemplate -> Maybe (NonEmpty ResourcePermission)
$sel:name:CreateTemplate' :: CreateTemplate -> Maybe Text
$sel:versionDescription:CreateTemplate' :: CreateTemplate -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"VersionDescription" 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
versionDescription,
(Text
"Name" 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
name,
(Text
"Permissions" Text -> NonEmpty ResourcePermission -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty ResourcePermission -> Pair)
-> Maybe (NonEmpty ResourcePermission) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ResourcePermission)
permissions,
(Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SourceEntity" Text -> TemplateSourceEntity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TemplateSourceEntity
sourceEntity)
]
)
instance Core.ToPath CreateTemplate where
toPath :: CreateTemplate -> ByteString
toPath CreateTemplate' {Maybe (NonEmpty ResourcePermission)
Maybe (NonEmpty Tag)
Maybe Text
Text
TemplateSourceEntity
sourceEntity :: TemplateSourceEntity
templateId :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
permissions :: Maybe (NonEmpty ResourcePermission)
name :: Maybe Text
versionDescription :: Maybe Text
$sel:sourceEntity:CreateTemplate' :: CreateTemplate -> TemplateSourceEntity
$sel:templateId:CreateTemplate' :: CreateTemplate -> Text
$sel:awsAccountId:CreateTemplate' :: CreateTemplate -> Text
$sel:tags:CreateTemplate' :: CreateTemplate -> Maybe (NonEmpty Tag)
$sel:permissions:CreateTemplate' :: CreateTemplate -> Maybe (NonEmpty ResourcePermission)
$sel:name:CreateTemplate' :: CreateTemplate -> Maybe Text
$sel:versionDescription:CreateTemplate' :: CreateTemplate -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
ByteString
"/templates/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateId
]
instance Core.ToQuery CreateTemplate where
toQuery :: CreateTemplate -> QueryString
toQuery = QueryString -> CreateTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateTemplateResponse = CreateTemplateResponse'
{
CreateTemplateResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
CreateTemplateResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CreateTemplateResponse -> Maybe ResourceStatus
creationStatus :: Prelude.Maybe ResourceStatus,
CreateTemplateResponse -> Maybe Text
templateId :: Prelude.Maybe Prelude.Text,
CreateTemplateResponse -> Maybe Text
versionArn :: Prelude.Maybe Prelude.Text,
CreateTemplateResponse -> Int
status :: Prelude.Int
}
deriving (CreateTemplateResponse -> CreateTemplateResponse -> Bool
(CreateTemplateResponse -> CreateTemplateResponse -> Bool)
-> (CreateTemplateResponse -> CreateTemplateResponse -> Bool)
-> Eq CreateTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTemplateResponse -> CreateTemplateResponse -> Bool
$c/= :: CreateTemplateResponse -> CreateTemplateResponse -> Bool
== :: CreateTemplateResponse -> CreateTemplateResponse -> Bool
$c== :: CreateTemplateResponse -> CreateTemplateResponse -> Bool
Prelude.Eq, ReadPrec [CreateTemplateResponse]
ReadPrec CreateTemplateResponse
Int -> ReadS CreateTemplateResponse
ReadS [CreateTemplateResponse]
(Int -> ReadS CreateTemplateResponse)
-> ReadS [CreateTemplateResponse]
-> ReadPrec CreateTemplateResponse
-> ReadPrec [CreateTemplateResponse]
-> Read CreateTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTemplateResponse]
$creadListPrec :: ReadPrec [CreateTemplateResponse]
readPrec :: ReadPrec CreateTemplateResponse
$creadPrec :: ReadPrec CreateTemplateResponse
readList :: ReadS [CreateTemplateResponse]
$creadList :: ReadS [CreateTemplateResponse]
readsPrec :: Int -> ReadS CreateTemplateResponse
$creadsPrec :: Int -> ReadS CreateTemplateResponse
Prelude.Read, Int -> CreateTemplateResponse -> ShowS
[CreateTemplateResponse] -> ShowS
CreateTemplateResponse -> String
(Int -> CreateTemplateResponse -> ShowS)
-> (CreateTemplateResponse -> String)
-> ([CreateTemplateResponse] -> ShowS)
-> Show CreateTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTemplateResponse] -> ShowS
$cshowList :: [CreateTemplateResponse] -> ShowS
show :: CreateTemplateResponse -> String
$cshow :: CreateTemplateResponse -> String
showsPrec :: Int -> CreateTemplateResponse -> ShowS
$cshowsPrec :: Int -> CreateTemplateResponse -> ShowS
Prelude.Show, (forall x. CreateTemplateResponse -> Rep CreateTemplateResponse x)
-> (forall x.
Rep CreateTemplateResponse x -> CreateTemplateResponse)
-> Generic CreateTemplateResponse
forall x. Rep CreateTemplateResponse x -> CreateTemplateResponse
forall x. CreateTemplateResponse -> Rep CreateTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTemplateResponse x -> CreateTemplateResponse
$cfrom :: forall x. CreateTemplateResponse -> Rep CreateTemplateResponse x
Prelude.Generic)
newCreateTemplateResponse ::
Prelude.Int ->
CreateTemplateResponse
newCreateTemplateResponse :: Int -> CreateTemplateResponse
newCreateTemplateResponse Int
pStatus_ =
CreateTemplateResponse' :: Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> CreateTemplateResponse
CreateTemplateResponse'
{ $sel:requestId:CreateTemplateResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:CreateTemplateResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationStatus:CreateTemplateResponse' :: Maybe ResourceStatus
creationStatus = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:templateId:CreateTemplateResponse' :: Maybe Text
templateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:versionArn:CreateTemplateResponse' :: Maybe Text
versionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:CreateTemplateResponse' :: Int
status = Int
pStatus_
}
createTemplateResponse_requestId :: Lens.Lens' CreateTemplateResponse (Prelude.Maybe Prelude.Text)
createTemplateResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateTemplateResponse -> f CreateTemplateResponse
createTemplateResponse_requestId = (CreateTemplateResponse -> Maybe Text)
-> (CreateTemplateResponse -> Maybe Text -> CreateTemplateResponse)
-> Lens
CreateTemplateResponse
CreateTemplateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplateResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateTemplateResponse' :: CreateTemplateResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateTemplateResponse
s@CreateTemplateResponse' {} Maybe Text
a -> CreateTemplateResponse
s {$sel:requestId:CreateTemplateResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateTemplateResponse)
createTemplateResponse_arn :: Lens.Lens' CreateTemplateResponse (Prelude.Maybe Prelude.Text)
createTemplateResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateTemplateResponse -> f CreateTemplateResponse
createTemplateResponse_arn = (CreateTemplateResponse -> Maybe Text)
-> (CreateTemplateResponse -> Maybe Text -> CreateTemplateResponse)
-> Lens
CreateTemplateResponse
CreateTemplateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplateResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateTemplateResponse' :: CreateTemplateResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateTemplateResponse
s@CreateTemplateResponse' {} Maybe Text
a -> CreateTemplateResponse
s {$sel:arn:CreateTemplateResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateTemplateResponse)
createTemplateResponse_creationStatus :: Lens.Lens' CreateTemplateResponse (Prelude.Maybe ResourceStatus)
createTemplateResponse_creationStatus :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> CreateTemplateResponse -> f CreateTemplateResponse
createTemplateResponse_creationStatus = (CreateTemplateResponse -> Maybe ResourceStatus)
-> (CreateTemplateResponse
-> Maybe ResourceStatus -> CreateTemplateResponse)
-> Lens
CreateTemplateResponse
CreateTemplateResponse
(Maybe ResourceStatus)
(Maybe ResourceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplateResponse' {Maybe ResourceStatus
creationStatus :: Maybe ResourceStatus
$sel:creationStatus:CreateTemplateResponse' :: CreateTemplateResponse -> Maybe ResourceStatus
creationStatus} -> Maybe ResourceStatus
creationStatus) (\s :: CreateTemplateResponse
s@CreateTemplateResponse' {} Maybe ResourceStatus
a -> CreateTemplateResponse
s {$sel:creationStatus:CreateTemplateResponse' :: Maybe ResourceStatus
creationStatus = Maybe ResourceStatus
a} :: CreateTemplateResponse)
createTemplateResponse_templateId :: Lens.Lens' CreateTemplateResponse (Prelude.Maybe Prelude.Text)
createTemplateResponse_templateId :: (Maybe Text -> f (Maybe Text))
-> CreateTemplateResponse -> f CreateTemplateResponse
createTemplateResponse_templateId = (CreateTemplateResponse -> Maybe Text)
-> (CreateTemplateResponse -> Maybe Text -> CreateTemplateResponse)
-> Lens
CreateTemplateResponse
CreateTemplateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplateResponse' {Maybe Text
templateId :: Maybe Text
$sel:templateId:CreateTemplateResponse' :: CreateTemplateResponse -> Maybe Text
templateId} -> Maybe Text
templateId) (\s :: CreateTemplateResponse
s@CreateTemplateResponse' {} Maybe Text
a -> CreateTemplateResponse
s {$sel:templateId:CreateTemplateResponse' :: Maybe Text
templateId = Maybe Text
a} :: CreateTemplateResponse)
createTemplateResponse_versionArn :: Lens.Lens' CreateTemplateResponse (Prelude.Maybe Prelude.Text)
createTemplateResponse_versionArn :: (Maybe Text -> f (Maybe Text))
-> CreateTemplateResponse -> f CreateTemplateResponse
createTemplateResponse_versionArn = (CreateTemplateResponse -> Maybe Text)
-> (CreateTemplateResponse -> Maybe Text -> CreateTemplateResponse)
-> Lens
CreateTemplateResponse
CreateTemplateResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplateResponse' {Maybe Text
versionArn :: Maybe Text
$sel:versionArn:CreateTemplateResponse' :: CreateTemplateResponse -> Maybe Text
versionArn} -> Maybe Text
versionArn) (\s :: CreateTemplateResponse
s@CreateTemplateResponse' {} Maybe Text
a -> CreateTemplateResponse
s {$sel:versionArn:CreateTemplateResponse' :: Maybe Text
versionArn = Maybe Text
a} :: CreateTemplateResponse)
createTemplateResponse_status :: Lens.Lens' CreateTemplateResponse Prelude.Int
createTemplateResponse_status :: (Int -> f Int)
-> CreateTemplateResponse -> f CreateTemplateResponse
createTemplateResponse_status = (CreateTemplateResponse -> Int)
-> (CreateTemplateResponse -> Int -> CreateTemplateResponse)
-> Lens CreateTemplateResponse CreateTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTemplateResponse' {Int
status :: Int
$sel:status:CreateTemplateResponse' :: CreateTemplateResponse -> Int
status} -> Int
status) (\s :: CreateTemplateResponse
s@CreateTemplateResponse' {} Int
a -> CreateTemplateResponse
s {$sel:status:CreateTemplateResponse' :: Int
status = Int
a} :: CreateTemplateResponse)
instance Prelude.NFData CreateTemplateResponse