{-# 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.SetTypeConfiguration
(
SetTypeConfiguration (..),
newSetTypeConfiguration,
setTypeConfiguration_typeName,
setTypeConfiguration_typeArn,
setTypeConfiguration_type,
setTypeConfiguration_configurationAlias,
setTypeConfiguration_configuration,
SetTypeConfigurationResponse (..),
newSetTypeConfigurationResponse,
setTypeConfigurationResponse_configurationArn,
setTypeConfigurationResponse_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 SetTypeConfiguration = SetTypeConfiguration'
{
SetTypeConfiguration -> Maybe Text
typeName :: Prelude.Maybe Prelude.Text,
SetTypeConfiguration -> Maybe Text
typeArn :: Prelude.Maybe Prelude.Text,
SetTypeConfiguration -> Maybe ThirdPartyType
type' :: Prelude.Maybe ThirdPartyType,
SetTypeConfiguration -> Maybe Text
configurationAlias :: Prelude.Maybe Prelude.Text,
SetTypeConfiguration -> Text
configuration :: Prelude.Text
}
deriving (SetTypeConfiguration -> SetTypeConfiguration -> Bool
(SetTypeConfiguration -> SetTypeConfiguration -> Bool)
-> (SetTypeConfiguration -> SetTypeConfiguration -> Bool)
-> Eq SetTypeConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetTypeConfiguration -> SetTypeConfiguration -> Bool
$c/= :: SetTypeConfiguration -> SetTypeConfiguration -> Bool
== :: SetTypeConfiguration -> SetTypeConfiguration -> Bool
$c== :: SetTypeConfiguration -> SetTypeConfiguration -> Bool
Prelude.Eq, ReadPrec [SetTypeConfiguration]
ReadPrec SetTypeConfiguration
Int -> ReadS SetTypeConfiguration
ReadS [SetTypeConfiguration]
(Int -> ReadS SetTypeConfiguration)
-> ReadS [SetTypeConfiguration]
-> ReadPrec SetTypeConfiguration
-> ReadPrec [SetTypeConfiguration]
-> Read SetTypeConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetTypeConfiguration]
$creadListPrec :: ReadPrec [SetTypeConfiguration]
readPrec :: ReadPrec SetTypeConfiguration
$creadPrec :: ReadPrec SetTypeConfiguration
readList :: ReadS [SetTypeConfiguration]
$creadList :: ReadS [SetTypeConfiguration]
readsPrec :: Int -> ReadS SetTypeConfiguration
$creadsPrec :: Int -> ReadS SetTypeConfiguration
Prelude.Read, Int -> SetTypeConfiguration -> ShowS
[SetTypeConfiguration] -> ShowS
SetTypeConfiguration -> String
(Int -> SetTypeConfiguration -> ShowS)
-> (SetTypeConfiguration -> String)
-> ([SetTypeConfiguration] -> ShowS)
-> Show SetTypeConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetTypeConfiguration] -> ShowS
$cshowList :: [SetTypeConfiguration] -> ShowS
show :: SetTypeConfiguration -> String
$cshow :: SetTypeConfiguration -> String
showsPrec :: Int -> SetTypeConfiguration -> ShowS
$cshowsPrec :: Int -> SetTypeConfiguration -> ShowS
Prelude.Show, (forall x. SetTypeConfiguration -> Rep SetTypeConfiguration x)
-> (forall x. Rep SetTypeConfiguration x -> SetTypeConfiguration)
-> Generic SetTypeConfiguration
forall x. Rep SetTypeConfiguration x -> SetTypeConfiguration
forall x. SetTypeConfiguration -> Rep SetTypeConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetTypeConfiguration x -> SetTypeConfiguration
$cfrom :: forall x. SetTypeConfiguration -> Rep SetTypeConfiguration x
Prelude.Generic)
newSetTypeConfiguration ::
Prelude.Text ->
SetTypeConfiguration
newSetTypeConfiguration :: Text -> SetTypeConfiguration
newSetTypeConfiguration Text
pConfiguration_ =
SetTypeConfiguration' :: Maybe Text
-> Maybe Text
-> Maybe ThirdPartyType
-> Maybe Text
-> Text
-> SetTypeConfiguration
SetTypeConfiguration'
{ $sel:typeName:SetTypeConfiguration' :: Maybe Text
typeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:typeArn:SetTypeConfiguration' :: Maybe Text
typeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':SetTypeConfiguration' :: Maybe ThirdPartyType
type' = Maybe ThirdPartyType
forall a. Maybe a
Prelude.Nothing,
$sel:configurationAlias:SetTypeConfiguration' :: Maybe Text
configurationAlias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configuration:SetTypeConfiguration' :: Text
configuration = Text
pConfiguration_
}
setTypeConfiguration_typeName :: Lens.Lens' SetTypeConfiguration (Prelude.Maybe Prelude.Text)
setTypeConfiguration_typeName :: (Maybe Text -> f (Maybe Text))
-> SetTypeConfiguration -> f SetTypeConfiguration
setTypeConfiguration_typeName = (SetTypeConfiguration -> Maybe Text)
-> (SetTypeConfiguration -> Maybe Text -> SetTypeConfiguration)
-> Lens
SetTypeConfiguration SetTypeConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeConfiguration' {Maybe Text
typeName :: Maybe Text
$sel:typeName:SetTypeConfiguration' :: SetTypeConfiguration -> Maybe Text
typeName} -> Maybe Text
typeName) (\s :: SetTypeConfiguration
s@SetTypeConfiguration' {} Maybe Text
a -> SetTypeConfiguration
s {$sel:typeName:SetTypeConfiguration' :: Maybe Text
typeName = Maybe Text
a} :: SetTypeConfiguration)
setTypeConfiguration_typeArn :: Lens.Lens' SetTypeConfiguration (Prelude.Maybe Prelude.Text)
setTypeConfiguration_typeArn :: (Maybe Text -> f (Maybe Text))
-> SetTypeConfiguration -> f SetTypeConfiguration
setTypeConfiguration_typeArn = (SetTypeConfiguration -> Maybe Text)
-> (SetTypeConfiguration -> Maybe Text -> SetTypeConfiguration)
-> Lens
SetTypeConfiguration SetTypeConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeConfiguration' {Maybe Text
typeArn :: Maybe Text
$sel:typeArn:SetTypeConfiguration' :: SetTypeConfiguration -> Maybe Text
typeArn} -> Maybe Text
typeArn) (\s :: SetTypeConfiguration
s@SetTypeConfiguration' {} Maybe Text
a -> SetTypeConfiguration
s {$sel:typeArn:SetTypeConfiguration' :: Maybe Text
typeArn = Maybe Text
a} :: SetTypeConfiguration)
setTypeConfiguration_type :: Lens.Lens' SetTypeConfiguration (Prelude.Maybe ThirdPartyType)
setTypeConfiguration_type :: (Maybe ThirdPartyType -> f (Maybe ThirdPartyType))
-> SetTypeConfiguration -> f SetTypeConfiguration
setTypeConfiguration_type = (SetTypeConfiguration -> Maybe ThirdPartyType)
-> (SetTypeConfiguration
-> Maybe ThirdPartyType -> SetTypeConfiguration)
-> Lens
SetTypeConfiguration
SetTypeConfiguration
(Maybe ThirdPartyType)
(Maybe ThirdPartyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeConfiguration' {Maybe ThirdPartyType
type' :: Maybe ThirdPartyType
$sel:type':SetTypeConfiguration' :: SetTypeConfiguration -> Maybe ThirdPartyType
type'} -> Maybe ThirdPartyType
type') (\s :: SetTypeConfiguration
s@SetTypeConfiguration' {} Maybe ThirdPartyType
a -> SetTypeConfiguration
s {$sel:type':SetTypeConfiguration' :: Maybe ThirdPartyType
type' = Maybe ThirdPartyType
a} :: SetTypeConfiguration)
setTypeConfiguration_configurationAlias :: Lens.Lens' SetTypeConfiguration (Prelude.Maybe Prelude.Text)
setTypeConfiguration_configurationAlias :: (Maybe Text -> f (Maybe Text))
-> SetTypeConfiguration -> f SetTypeConfiguration
setTypeConfiguration_configurationAlias = (SetTypeConfiguration -> Maybe Text)
-> (SetTypeConfiguration -> Maybe Text -> SetTypeConfiguration)
-> Lens
SetTypeConfiguration SetTypeConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeConfiguration' {Maybe Text
configurationAlias :: Maybe Text
$sel:configurationAlias:SetTypeConfiguration' :: SetTypeConfiguration -> Maybe Text
configurationAlias} -> Maybe Text
configurationAlias) (\s :: SetTypeConfiguration
s@SetTypeConfiguration' {} Maybe Text
a -> SetTypeConfiguration
s {$sel:configurationAlias:SetTypeConfiguration' :: Maybe Text
configurationAlias = Maybe Text
a} :: SetTypeConfiguration)
setTypeConfiguration_configuration :: Lens.Lens' SetTypeConfiguration Prelude.Text
setTypeConfiguration_configuration :: (Text -> f Text) -> SetTypeConfiguration -> f SetTypeConfiguration
setTypeConfiguration_configuration = (SetTypeConfiguration -> Text)
-> (SetTypeConfiguration -> Text -> SetTypeConfiguration)
-> Lens SetTypeConfiguration SetTypeConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeConfiguration' {Text
configuration :: Text
$sel:configuration:SetTypeConfiguration' :: SetTypeConfiguration -> Text
configuration} -> Text
configuration) (\s :: SetTypeConfiguration
s@SetTypeConfiguration' {} Text
a -> SetTypeConfiguration
s {$sel:configuration:SetTypeConfiguration' :: Text
configuration = Text
a} :: SetTypeConfiguration)
instance Core.AWSRequest SetTypeConfiguration where
type
AWSResponse SetTypeConfiguration =
SetTypeConfigurationResponse
request :: SetTypeConfiguration -> Request SetTypeConfiguration
request = Service -> SetTypeConfiguration -> Request SetTypeConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy SetTypeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetTypeConfiguration)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse SetTypeConfiguration))
-> Logger
-> Service
-> Proxy SetTypeConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetTypeConfiguration)))
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
"SetTypeConfigurationResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Int -> SetTypeConfigurationResponse
SetTypeConfigurationResponse'
(Maybe Text -> Int -> SetTypeConfigurationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> SetTypeConfigurationResponse)
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
"ConfigurationArn")
Either String (Int -> SetTypeConfigurationResponse)
-> Either String Int -> Either String SetTypeConfigurationResponse
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 SetTypeConfiguration
instance Prelude.NFData SetTypeConfiguration
instance Core.ToHeaders SetTypeConfiguration where
toHeaders :: SetTypeConfiguration -> ResponseHeaders
toHeaders = ResponseHeaders -> SetTypeConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath SetTypeConfiguration where
toPath :: SetTypeConfiguration -> ByteString
toPath = ByteString -> SetTypeConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetTypeConfiguration where
toQuery :: SetTypeConfiguration -> QueryString
toQuery SetTypeConfiguration' {Maybe Text
Maybe ThirdPartyType
Text
configuration :: Text
configurationAlias :: Maybe Text
type' :: Maybe ThirdPartyType
typeArn :: Maybe Text
typeName :: Maybe Text
$sel:configuration:SetTypeConfiguration' :: SetTypeConfiguration -> Text
$sel:configurationAlias:SetTypeConfiguration' :: SetTypeConfiguration -> Maybe Text
$sel:type':SetTypeConfiguration' :: SetTypeConfiguration -> Maybe ThirdPartyType
$sel:typeArn:SetTypeConfiguration' :: SetTypeConfiguration -> Maybe Text
$sel:typeName:SetTypeConfiguration' :: SetTypeConfiguration -> 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
"SetTypeConfiguration" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"TypeName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
typeName,
ByteString
"TypeArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
typeArn,
ByteString
"Type" ByteString -> Maybe ThirdPartyType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ThirdPartyType
type',
ByteString
"ConfigurationAlias" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
configurationAlias,
ByteString
"Configuration" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
configuration
]
data SetTypeConfigurationResponse = SetTypeConfigurationResponse'
{
SetTypeConfigurationResponse -> Maybe Text
configurationArn :: Prelude.Maybe Prelude.Text,
SetTypeConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SetTypeConfigurationResponse
-> SetTypeConfigurationResponse -> Bool
(SetTypeConfigurationResponse
-> SetTypeConfigurationResponse -> Bool)
-> (SetTypeConfigurationResponse
-> SetTypeConfigurationResponse -> Bool)
-> Eq SetTypeConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetTypeConfigurationResponse
-> SetTypeConfigurationResponse -> Bool
$c/= :: SetTypeConfigurationResponse
-> SetTypeConfigurationResponse -> Bool
== :: SetTypeConfigurationResponse
-> SetTypeConfigurationResponse -> Bool
$c== :: SetTypeConfigurationResponse
-> SetTypeConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [SetTypeConfigurationResponse]
ReadPrec SetTypeConfigurationResponse
Int -> ReadS SetTypeConfigurationResponse
ReadS [SetTypeConfigurationResponse]
(Int -> ReadS SetTypeConfigurationResponse)
-> ReadS [SetTypeConfigurationResponse]
-> ReadPrec SetTypeConfigurationResponse
-> ReadPrec [SetTypeConfigurationResponse]
-> Read SetTypeConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetTypeConfigurationResponse]
$creadListPrec :: ReadPrec [SetTypeConfigurationResponse]
readPrec :: ReadPrec SetTypeConfigurationResponse
$creadPrec :: ReadPrec SetTypeConfigurationResponse
readList :: ReadS [SetTypeConfigurationResponse]
$creadList :: ReadS [SetTypeConfigurationResponse]
readsPrec :: Int -> ReadS SetTypeConfigurationResponse
$creadsPrec :: Int -> ReadS SetTypeConfigurationResponse
Prelude.Read, Int -> SetTypeConfigurationResponse -> ShowS
[SetTypeConfigurationResponse] -> ShowS
SetTypeConfigurationResponse -> String
(Int -> SetTypeConfigurationResponse -> ShowS)
-> (SetTypeConfigurationResponse -> String)
-> ([SetTypeConfigurationResponse] -> ShowS)
-> Show SetTypeConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetTypeConfigurationResponse] -> ShowS
$cshowList :: [SetTypeConfigurationResponse] -> ShowS
show :: SetTypeConfigurationResponse -> String
$cshow :: SetTypeConfigurationResponse -> String
showsPrec :: Int -> SetTypeConfigurationResponse -> ShowS
$cshowsPrec :: Int -> SetTypeConfigurationResponse -> ShowS
Prelude.Show, (forall x.
SetTypeConfigurationResponse -> Rep SetTypeConfigurationResponse x)
-> (forall x.
Rep SetTypeConfigurationResponse x -> SetTypeConfigurationResponse)
-> Generic SetTypeConfigurationResponse
forall x.
Rep SetTypeConfigurationResponse x -> SetTypeConfigurationResponse
forall x.
SetTypeConfigurationResponse -> Rep SetTypeConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetTypeConfigurationResponse x -> SetTypeConfigurationResponse
$cfrom :: forall x.
SetTypeConfigurationResponse -> Rep SetTypeConfigurationResponse x
Prelude.Generic)
newSetTypeConfigurationResponse ::
Prelude.Int ->
SetTypeConfigurationResponse
newSetTypeConfigurationResponse :: Int -> SetTypeConfigurationResponse
newSetTypeConfigurationResponse Int
pHttpStatus_ =
SetTypeConfigurationResponse' :: Maybe Text -> Int -> SetTypeConfigurationResponse
SetTypeConfigurationResponse'
{ $sel:configurationArn:SetTypeConfigurationResponse' :: Maybe Text
configurationArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SetTypeConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
setTypeConfigurationResponse_configurationArn :: Lens.Lens' SetTypeConfigurationResponse (Prelude.Maybe Prelude.Text)
setTypeConfigurationResponse_configurationArn :: (Maybe Text -> f (Maybe Text))
-> SetTypeConfigurationResponse -> f SetTypeConfigurationResponse
setTypeConfigurationResponse_configurationArn = (SetTypeConfigurationResponse -> Maybe Text)
-> (SetTypeConfigurationResponse
-> Maybe Text -> SetTypeConfigurationResponse)
-> Lens
SetTypeConfigurationResponse
SetTypeConfigurationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeConfigurationResponse' {Maybe Text
configurationArn :: Maybe Text
$sel:configurationArn:SetTypeConfigurationResponse' :: SetTypeConfigurationResponse -> Maybe Text
configurationArn} -> Maybe Text
configurationArn) (\s :: SetTypeConfigurationResponse
s@SetTypeConfigurationResponse' {} Maybe Text
a -> SetTypeConfigurationResponse
s {$sel:configurationArn:SetTypeConfigurationResponse' :: Maybe Text
configurationArn = Maybe Text
a} :: SetTypeConfigurationResponse)
setTypeConfigurationResponse_httpStatus :: Lens.Lens' SetTypeConfigurationResponse Prelude.Int
setTypeConfigurationResponse_httpStatus :: (Int -> f Int)
-> SetTypeConfigurationResponse -> f SetTypeConfigurationResponse
setTypeConfigurationResponse_httpStatus = (SetTypeConfigurationResponse -> Int)
-> (SetTypeConfigurationResponse
-> Int -> SetTypeConfigurationResponse)
-> Lens
SetTypeConfigurationResponse SetTypeConfigurationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:SetTypeConfigurationResponse' :: SetTypeConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SetTypeConfigurationResponse
s@SetTypeConfigurationResponse' {} Int
a -> SetTypeConfigurationResponse
s {$sel:httpStatus:SetTypeConfigurationResponse' :: Int
httpStatus = Int
a} :: SetTypeConfigurationResponse)
instance Prelude.NFData SetTypeConfigurationResponse