{-# 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.CloudFormation.RegisterType
(
RegisterType (..),
newRegisterType,
registerType_executionRoleArn,
registerType_type,
registerType_clientRequestToken,
registerType_loggingConfig,
registerType_typeName,
registerType_schemaHandlerPackage,
RegisterTypeResponse (..),
newRegisterTypeResponse,
registerTypeResponse_registrationToken,
registerTypeResponse_httpStatus,
)
where
import Amazonka.CloudFormation.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 RegisterType = RegisterType'
{
RegisterType -> Maybe Text
executionRoleArn :: Prelude.Maybe Prelude.Text,
RegisterType -> Maybe RegistryType
type' :: Prelude.Maybe RegistryType,
RegisterType -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
RegisterType -> Maybe LoggingConfig
loggingConfig :: Prelude.Maybe LoggingConfig,
RegisterType -> Text
typeName :: Prelude.Text,
RegisterType -> Text
schemaHandlerPackage :: Prelude.Text
}
deriving (RegisterType -> RegisterType -> Bool
(RegisterType -> RegisterType -> Bool)
-> (RegisterType -> RegisterType -> Bool) -> Eq RegisterType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterType -> RegisterType -> Bool
$c/= :: RegisterType -> RegisterType -> Bool
== :: RegisterType -> RegisterType -> Bool
$c== :: RegisterType -> RegisterType -> Bool
Prelude.Eq, ReadPrec [RegisterType]
ReadPrec RegisterType
Int -> ReadS RegisterType
ReadS [RegisterType]
(Int -> ReadS RegisterType)
-> ReadS [RegisterType]
-> ReadPrec RegisterType
-> ReadPrec [RegisterType]
-> Read RegisterType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterType]
$creadListPrec :: ReadPrec [RegisterType]
readPrec :: ReadPrec RegisterType
$creadPrec :: ReadPrec RegisterType
readList :: ReadS [RegisterType]
$creadList :: ReadS [RegisterType]
readsPrec :: Int -> ReadS RegisterType
$creadsPrec :: Int -> ReadS RegisterType
Prelude.Read, Int -> RegisterType -> ShowS
[RegisterType] -> ShowS
RegisterType -> String
(Int -> RegisterType -> ShowS)
-> (RegisterType -> String)
-> ([RegisterType] -> ShowS)
-> Show RegisterType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterType] -> ShowS
$cshowList :: [RegisterType] -> ShowS
show :: RegisterType -> String
$cshow :: RegisterType -> String
showsPrec :: Int -> RegisterType -> ShowS
$cshowsPrec :: Int -> RegisterType -> ShowS
Prelude.Show, (forall x. RegisterType -> Rep RegisterType x)
-> (forall x. Rep RegisterType x -> RegisterType)
-> Generic RegisterType
forall x. Rep RegisterType x -> RegisterType
forall x. RegisterType -> Rep RegisterType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterType x -> RegisterType
$cfrom :: forall x. RegisterType -> Rep RegisterType x
Prelude.Generic)
newRegisterType ::
Prelude.Text ->
Prelude.Text ->
RegisterType
newRegisterType :: Text -> Text -> RegisterType
newRegisterType Text
pTypeName_ Text
pSchemaHandlerPackage_ =
RegisterType' :: Maybe Text
-> Maybe RegistryType
-> Maybe Text
-> Maybe LoggingConfig
-> Text
-> Text
-> RegisterType
RegisterType'
{ $sel:executionRoleArn:RegisterType' :: Maybe Text
executionRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':RegisterType' :: Maybe RegistryType
type' = Maybe RegistryType
forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:RegisterType' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:loggingConfig:RegisterType' :: Maybe LoggingConfig
loggingConfig = Maybe LoggingConfig
forall a. Maybe a
Prelude.Nothing,
$sel:typeName:RegisterType' :: Text
typeName = Text
pTypeName_,
$sel:schemaHandlerPackage:RegisterType' :: Text
schemaHandlerPackage = Text
pSchemaHandlerPackage_
}
registerType_executionRoleArn :: Lens.Lens' RegisterType (Prelude.Maybe Prelude.Text)
registerType_executionRoleArn :: (Maybe Text -> f (Maybe Text)) -> RegisterType -> f RegisterType
registerType_executionRoleArn = (RegisterType -> Maybe Text)
-> (RegisterType -> Maybe Text -> RegisterType)
-> Lens RegisterType RegisterType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterType' {Maybe Text
executionRoleArn :: Maybe Text
$sel:executionRoleArn:RegisterType' :: RegisterType -> Maybe Text
executionRoleArn} -> Maybe Text
executionRoleArn) (\s :: RegisterType
s@RegisterType' {} Maybe Text
a -> RegisterType
s {$sel:executionRoleArn:RegisterType' :: Maybe Text
executionRoleArn = Maybe Text
a} :: RegisterType)
registerType_type :: Lens.Lens' RegisterType (Prelude.Maybe RegistryType)
registerType_type :: (Maybe RegistryType -> f (Maybe RegistryType))
-> RegisterType -> f RegisterType
registerType_type = (RegisterType -> Maybe RegistryType)
-> (RegisterType -> Maybe RegistryType -> RegisterType)
-> Lens
RegisterType RegisterType (Maybe RegistryType) (Maybe RegistryType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterType' {Maybe RegistryType
type' :: Maybe RegistryType
$sel:type':RegisterType' :: RegisterType -> Maybe RegistryType
type'} -> Maybe RegistryType
type') (\s :: RegisterType
s@RegisterType' {} Maybe RegistryType
a -> RegisterType
s {$sel:type':RegisterType' :: Maybe RegistryType
type' = Maybe RegistryType
a} :: RegisterType)
registerType_clientRequestToken :: Lens.Lens' RegisterType (Prelude.Maybe Prelude.Text)
registerType_clientRequestToken :: (Maybe Text -> f (Maybe Text)) -> RegisterType -> f RegisterType
registerType_clientRequestToken = (RegisterType -> Maybe Text)
-> (RegisterType -> Maybe Text -> RegisterType)
-> Lens RegisterType RegisterType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterType' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:RegisterType' :: RegisterType -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: RegisterType
s@RegisterType' {} Maybe Text
a -> RegisterType
s {$sel:clientRequestToken:RegisterType' :: Maybe Text
clientRequestToken = Maybe Text
a} :: RegisterType)
registerType_loggingConfig :: Lens.Lens' RegisterType (Prelude.Maybe LoggingConfig)
registerType_loggingConfig :: (Maybe LoggingConfig -> f (Maybe LoggingConfig))
-> RegisterType -> f RegisterType
registerType_loggingConfig = (RegisterType -> Maybe LoggingConfig)
-> (RegisterType -> Maybe LoggingConfig -> RegisterType)
-> Lens
RegisterType
RegisterType
(Maybe LoggingConfig)
(Maybe LoggingConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterType' {Maybe LoggingConfig
loggingConfig :: Maybe LoggingConfig
$sel:loggingConfig:RegisterType' :: RegisterType -> Maybe LoggingConfig
loggingConfig} -> Maybe LoggingConfig
loggingConfig) (\s :: RegisterType
s@RegisterType' {} Maybe LoggingConfig
a -> RegisterType
s {$sel:loggingConfig:RegisterType' :: Maybe LoggingConfig
loggingConfig = Maybe LoggingConfig
a} :: RegisterType)
registerType_typeName :: Lens.Lens' RegisterType Prelude.Text
registerType_typeName :: (Text -> f Text) -> RegisterType -> f RegisterType
registerType_typeName = (RegisterType -> Text)
-> (RegisterType -> Text -> RegisterType)
-> Lens RegisterType RegisterType Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterType' {Text
typeName :: Text
$sel:typeName:RegisterType' :: RegisterType -> Text
typeName} -> Text
typeName) (\s :: RegisterType
s@RegisterType' {} Text
a -> RegisterType
s {$sel:typeName:RegisterType' :: Text
typeName = Text
a} :: RegisterType)
registerType_schemaHandlerPackage :: Lens.Lens' RegisterType Prelude.Text
registerType_schemaHandlerPackage :: (Text -> f Text) -> RegisterType -> f RegisterType
registerType_schemaHandlerPackage = (RegisterType -> Text)
-> (RegisterType -> Text -> RegisterType)
-> Lens RegisterType RegisterType Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterType' {Text
schemaHandlerPackage :: Text
$sel:schemaHandlerPackage:RegisterType' :: RegisterType -> Text
schemaHandlerPackage} -> Text
schemaHandlerPackage) (\s :: RegisterType
s@RegisterType' {} Text
a -> RegisterType
s {$sel:schemaHandlerPackage:RegisterType' :: Text
schemaHandlerPackage = Text
a} :: RegisterType)
instance Core.AWSRequest RegisterType where
type AWSResponse RegisterType = RegisterTypeResponse
request :: RegisterType -> Request RegisterType
request = Service -> RegisterType -> Request RegisterType
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy RegisterType
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterType)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse RegisterType))
-> Logger
-> Service
-> Proxy RegisterType
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RegisterType)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"RegisterTypeResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Int -> RegisterTypeResponse
RegisterTypeResponse'
(Maybe Text -> Int -> RegisterTypeResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RegisterTypeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RegistrationToken")
Either String (Int -> RegisterTypeResponse)
-> Either String Int -> Either String RegisterTypeResponse
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 RegisterType
instance Prelude.NFData RegisterType
instance Core.ToHeaders RegisterType where
toHeaders :: RegisterType -> ResponseHeaders
toHeaders = ResponseHeaders -> RegisterType -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath RegisterType where
toPath :: RegisterType -> ByteString
toPath = ByteString -> RegisterType -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RegisterType where
toQuery :: RegisterType -> QueryString
toQuery RegisterType' {Maybe Text
Maybe LoggingConfig
Maybe RegistryType
Text
schemaHandlerPackage :: Text
typeName :: Text
loggingConfig :: Maybe LoggingConfig
clientRequestToken :: Maybe Text
type' :: Maybe RegistryType
executionRoleArn :: Maybe Text
$sel:schemaHandlerPackage:RegisterType' :: RegisterType -> Text
$sel:typeName:RegisterType' :: RegisterType -> Text
$sel:loggingConfig:RegisterType' :: RegisterType -> Maybe LoggingConfig
$sel:clientRequestToken:RegisterType' :: RegisterType -> Maybe Text
$sel:type':RegisterType' :: RegisterType -> Maybe RegistryType
$sel:executionRoleArn:RegisterType' :: RegisterType -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"RegisterType" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"ExecutionRoleArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
executionRoleArn,
ByteString
"Type" ByteString -> Maybe RegistryType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe RegistryType
type',
ByteString
"ClientRequestToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientRequestToken,
ByteString
"LoggingConfig" ByteString -> Maybe LoggingConfig -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe LoggingConfig
loggingConfig,
ByteString
"TypeName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
typeName,
ByteString
"SchemaHandlerPackage" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
schemaHandlerPackage
]
data RegisterTypeResponse = RegisterTypeResponse'
{
RegisterTypeResponse -> Maybe Text
registrationToken :: Prelude.Maybe Prelude.Text,
RegisterTypeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RegisterTypeResponse -> RegisterTypeResponse -> Bool
(RegisterTypeResponse -> RegisterTypeResponse -> Bool)
-> (RegisterTypeResponse -> RegisterTypeResponse -> Bool)
-> Eq RegisterTypeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterTypeResponse -> RegisterTypeResponse -> Bool
$c/= :: RegisterTypeResponse -> RegisterTypeResponse -> Bool
== :: RegisterTypeResponse -> RegisterTypeResponse -> Bool
$c== :: RegisterTypeResponse -> RegisterTypeResponse -> Bool
Prelude.Eq, ReadPrec [RegisterTypeResponse]
ReadPrec RegisterTypeResponse
Int -> ReadS RegisterTypeResponse
ReadS [RegisterTypeResponse]
(Int -> ReadS RegisterTypeResponse)
-> ReadS [RegisterTypeResponse]
-> ReadPrec RegisterTypeResponse
-> ReadPrec [RegisterTypeResponse]
-> Read RegisterTypeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterTypeResponse]
$creadListPrec :: ReadPrec [RegisterTypeResponse]
readPrec :: ReadPrec RegisterTypeResponse
$creadPrec :: ReadPrec RegisterTypeResponse
readList :: ReadS [RegisterTypeResponse]
$creadList :: ReadS [RegisterTypeResponse]
readsPrec :: Int -> ReadS RegisterTypeResponse
$creadsPrec :: Int -> ReadS RegisterTypeResponse
Prelude.Read, Int -> RegisterTypeResponse -> ShowS
[RegisterTypeResponse] -> ShowS
RegisterTypeResponse -> String
(Int -> RegisterTypeResponse -> ShowS)
-> (RegisterTypeResponse -> String)
-> ([RegisterTypeResponse] -> ShowS)
-> Show RegisterTypeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterTypeResponse] -> ShowS
$cshowList :: [RegisterTypeResponse] -> ShowS
show :: RegisterTypeResponse -> String
$cshow :: RegisterTypeResponse -> String
showsPrec :: Int -> RegisterTypeResponse -> ShowS
$cshowsPrec :: Int -> RegisterTypeResponse -> ShowS
Prelude.Show, (forall x. RegisterTypeResponse -> Rep RegisterTypeResponse x)
-> (forall x. Rep RegisterTypeResponse x -> RegisterTypeResponse)
-> Generic RegisterTypeResponse
forall x. Rep RegisterTypeResponse x -> RegisterTypeResponse
forall x. RegisterTypeResponse -> Rep RegisterTypeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterTypeResponse x -> RegisterTypeResponse
$cfrom :: forall x. RegisterTypeResponse -> Rep RegisterTypeResponse x
Prelude.Generic)
newRegisterTypeResponse ::
Prelude.Int ->
RegisterTypeResponse
newRegisterTypeResponse :: Int -> RegisterTypeResponse
newRegisterTypeResponse Int
pHttpStatus_ =
RegisterTypeResponse' :: Maybe Text -> Int -> RegisterTypeResponse
RegisterTypeResponse'
{ $sel:registrationToken:RegisterTypeResponse' :: Maybe Text
registrationToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RegisterTypeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
registerTypeResponse_registrationToken :: Lens.Lens' RegisterTypeResponse (Prelude.Maybe Prelude.Text)
registerTypeResponse_registrationToken :: (Maybe Text -> f (Maybe Text))
-> RegisterTypeResponse -> f RegisterTypeResponse
registerTypeResponse_registrationToken = (RegisterTypeResponse -> Maybe Text)
-> (RegisterTypeResponse -> Maybe Text -> RegisterTypeResponse)
-> Lens
RegisterTypeResponse RegisterTypeResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTypeResponse' {Maybe Text
registrationToken :: Maybe Text
$sel:registrationToken:RegisterTypeResponse' :: RegisterTypeResponse -> Maybe Text
registrationToken} -> Maybe Text
registrationToken) (\s :: RegisterTypeResponse
s@RegisterTypeResponse' {} Maybe Text
a -> RegisterTypeResponse
s {$sel:registrationToken:RegisterTypeResponse' :: Maybe Text
registrationToken = Maybe Text
a} :: RegisterTypeResponse)
registerTypeResponse_httpStatus :: Lens.Lens' RegisterTypeResponse Prelude.Int
registerTypeResponse_httpStatus :: (Int -> f Int) -> RegisterTypeResponse -> f RegisterTypeResponse
registerTypeResponse_httpStatus = (RegisterTypeResponse -> Int)
-> (RegisterTypeResponse -> Int -> RegisterTypeResponse)
-> Lens RegisterTypeResponse RegisterTypeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterTypeResponse' {Int
httpStatus :: Int
$sel:httpStatus:RegisterTypeResponse' :: RegisterTypeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RegisterTypeResponse
s@RegisterTypeResponse' {} Int
a -> RegisterTypeResponse
s {$sel:httpStatus:RegisterTypeResponse' :: Int
httpStatus = Int
a} :: RegisterTypeResponse)
instance Prelude.NFData RegisterTypeResponse