{-# 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.SetTypeDefaultVersion
(
SetTypeDefaultVersion (..),
newSetTypeDefaultVersion,
setTypeDefaultVersion_versionId,
setTypeDefaultVersion_typeName,
setTypeDefaultVersion_arn,
setTypeDefaultVersion_type,
SetTypeDefaultVersionResponse (..),
newSetTypeDefaultVersionResponse,
setTypeDefaultVersionResponse_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 SetTypeDefaultVersion = SetTypeDefaultVersion'
{
SetTypeDefaultVersion -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text,
SetTypeDefaultVersion -> Maybe Text
typeName :: Prelude.Maybe Prelude.Text,
SetTypeDefaultVersion -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
SetTypeDefaultVersion -> Maybe RegistryType
type' :: Prelude.Maybe RegistryType
}
deriving (SetTypeDefaultVersion -> SetTypeDefaultVersion -> Bool
(SetTypeDefaultVersion -> SetTypeDefaultVersion -> Bool)
-> (SetTypeDefaultVersion -> SetTypeDefaultVersion -> Bool)
-> Eq SetTypeDefaultVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetTypeDefaultVersion -> SetTypeDefaultVersion -> Bool
$c/= :: SetTypeDefaultVersion -> SetTypeDefaultVersion -> Bool
== :: SetTypeDefaultVersion -> SetTypeDefaultVersion -> Bool
$c== :: SetTypeDefaultVersion -> SetTypeDefaultVersion -> Bool
Prelude.Eq, ReadPrec [SetTypeDefaultVersion]
ReadPrec SetTypeDefaultVersion
Int -> ReadS SetTypeDefaultVersion
ReadS [SetTypeDefaultVersion]
(Int -> ReadS SetTypeDefaultVersion)
-> ReadS [SetTypeDefaultVersion]
-> ReadPrec SetTypeDefaultVersion
-> ReadPrec [SetTypeDefaultVersion]
-> Read SetTypeDefaultVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetTypeDefaultVersion]
$creadListPrec :: ReadPrec [SetTypeDefaultVersion]
readPrec :: ReadPrec SetTypeDefaultVersion
$creadPrec :: ReadPrec SetTypeDefaultVersion
readList :: ReadS [SetTypeDefaultVersion]
$creadList :: ReadS [SetTypeDefaultVersion]
readsPrec :: Int -> ReadS SetTypeDefaultVersion
$creadsPrec :: Int -> ReadS SetTypeDefaultVersion
Prelude.Read, Int -> SetTypeDefaultVersion -> ShowS
[SetTypeDefaultVersion] -> ShowS
SetTypeDefaultVersion -> String
(Int -> SetTypeDefaultVersion -> ShowS)
-> (SetTypeDefaultVersion -> String)
-> ([SetTypeDefaultVersion] -> ShowS)
-> Show SetTypeDefaultVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetTypeDefaultVersion] -> ShowS
$cshowList :: [SetTypeDefaultVersion] -> ShowS
show :: SetTypeDefaultVersion -> String
$cshow :: SetTypeDefaultVersion -> String
showsPrec :: Int -> SetTypeDefaultVersion -> ShowS
$cshowsPrec :: Int -> SetTypeDefaultVersion -> ShowS
Prelude.Show, (forall x. SetTypeDefaultVersion -> Rep SetTypeDefaultVersion x)
-> (forall x. Rep SetTypeDefaultVersion x -> SetTypeDefaultVersion)
-> Generic SetTypeDefaultVersion
forall x. Rep SetTypeDefaultVersion x -> SetTypeDefaultVersion
forall x. SetTypeDefaultVersion -> Rep SetTypeDefaultVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetTypeDefaultVersion x -> SetTypeDefaultVersion
$cfrom :: forall x. SetTypeDefaultVersion -> Rep SetTypeDefaultVersion x
Prelude.Generic)
newSetTypeDefaultVersion ::
SetTypeDefaultVersion
newSetTypeDefaultVersion :: SetTypeDefaultVersion
newSetTypeDefaultVersion =
SetTypeDefaultVersion' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe RegistryType
-> SetTypeDefaultVersion
SetTypeDefaultVersion'
{ $sel:versionId:SetTypeDefaultVersion' :: Maybe Text
versionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:typeName:SetTypeDefaultVersion' :: Maybe Text
typeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:SetTypeDefaultVersion' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':SetTypeDefaultVersion' :: Maybe RegistryType
type' = Maybe RegistryType
forall a. Maybe a
Prelude.Nothing
}
setTypeDefaultVersion_versionId :: Lens.Lens' SetTypeDefaultVersion (Prelude.Maybe Prelude.Text)
setTypeDefaultVersion_versionId :: (Maybe Text -> f (Maybe Text))
-> SetTypeDefaultVersion -> f SetTypeDefaultVersion
setTypeDefaultVersion_versionId = (SetTypeDefaultVersion -> Maybe Text)
-> (SetTypeDefaultVersion -> Maybe Text -> SetTypeDefaultVersion)
-> Lens
SetTypeDefaultVersion
SetTypeDefaultVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeDefaultVersion' {Maybe Text
versionId :: Maybe Text
$sel:versionId:SetTypeDefaultVersion' :: SetTypeDefaultVersion -> Maybe Text
versionId} -> Maybe Text
versionId) (\s :: SetTypeDefaultVersion
s@SetTypeDefaultVersion' {} Maybe Text
a -> SetTypeDefaultVersion
s {$sel:versionId:SetTypeDefaultVersion' :: Maybe Text
versionId = Maybe Text
a} :: SetTypeDefaultVersion)
setTypeDefaultVersion_typeName :: Lens.Lens' SetTypeDefaultVersion (Prelude.Maybe Prelude.Text)
setTypeDefaultVersion_typeName :: (Maybe Text -> f (Maybe Text))
-> SetTypeDefaultVersion -> f SetTypeDefaultVersion
setTypeDefaultVersion_typeName = (SetTypeDefaultVersion -> Maybe Text)
-> (SetTypeDefaultVersion -> Maybe Text -> SetTypeDefaultVersion)
-> Lens
SetTypeDefaultVersion
SetTypeDefaultVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeDefaultVersion' {Maybe Text
typeName :: Maybe Text
$sel:typeName:SetTypeDefaultVersion' :: SetTypeDefaultVersion -> Maybe Text
typeName} -> Maybe Text
typeName) (\s :: SetTypeDefaultVersion
s@SetTypeDefaultVersion' {} Maybe Text
a -> SetTypeDefaultVersion
s {$sel:typeName:SetTypeDefaultVersion' :: Maybe Text
typeName = Maybe Text
a} :: SetTypeDefaultVersion)
setTypeDefaultVersion_arn :: Lens.Lens' SetTypeDefaultVersion (Prelude.Maybe Prelude.Text)
setTypeDefaultVersion_arn :: (Maybe Text -> f (Maybe Text))
-> SetTypeDefaultVersion -> f SetTypeDefaultVersion
setTypeDefaultVersion_arn = (SetTypeDefaultVersion -> Maybe Text)
-> (SetTypeDefaultVersion -> Maybe Text -> SetTypeDefaultVersion)
-> Lens
SetTypeDefaultVersion
SetTypeDefaultVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeDefaultVersion' {Maybe Text
arn :: Maybe Text
$sel:arn:SetTypeDefaultVersion' :: SetTypeDefaultVersion -> Maybe Text
arn} -> Maybe Text
arn) (\s :: SetTypeDefaultVersion
s@SetTypeDefaultVersion' {} Maybe Text
a -> SetTypeDefaultVersion
s {$sel:arn:SetTypeDefaultVersion' :: Maybe Text
arn = Maybe Text
a} :: SetTypeDefaultVersion)
setTypeDefaultVersion_type :: Lens.Lens' SetTypeDefaultVersion (Prelude.Maybe RegistryType)
setTypeDefaultVersion_type :: (Maybe RegistryType -> f (Maybe RegistryType))
-> SetTypeDefaultVersion -> f SetTypeDefaultVersion
setTypeDefaultVersion_type = (SetTypeDefaultVersion -> Maybe RegistryType)
-> (SetTypeDefaultVersion
-> Maybe RegistryType -> SetTypeDefaultVersion)
-> Lens
SetTypeDefaultVersion
SetTypeDefaultVersion
(Maybe RegistryType)
(Maybe RegistryType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeDefaultVersion' {Maybe RegistryType
type' :: Maybe RegistryType
$sel:type':SetTypeDefaultVersion' :: SetTypeDefaultVersion -> Maybe RegistryType
type'} -> Maybe RegistryType
type') (\s :: SetTypeDefaultVersion
s@SetTypeDefaultVersion' {} Maybe RegistryType
a -> SetTypeDefaultVersion
s {$sel:type':SetTypeDefaultVersion' :: Maybe RegistryType
type' = Maybe RegistryType
a} :: SetTypeDefaultVersion)
instance Core.AWSRequest SetTypeDefaultVersion where
type
AWSResponse SetTypeDefaultVersion =
SetTypeDefaultVersionResponse
request :: SetTypeDefaultVersion -> Request SetTypeDefaultVersion
request = Service -> SetTypeDefaultVersion -> Request SetTypeDefaultVersion
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy SetTypeDefaultVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetTypeDefaultVersion)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse SetTypeDefaultVersion))
-> Logger
-> Service
-> Proxy SetTypeDefaultVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetTypeDefaultVersion)))
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
"SetTypeDefaultVersionResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> SetTypeDefaultVersionResponse
SetTypeDefaultVersionResponse'
(Int -> SetTypeDefaultVersionResponse)
-> Either String Int -> Either String SetTypeDefaultVersionResponse
forall (f :: * -> *) a b. Functor 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 SetTypeDefaultVersion
instance Prelude.NFData SetTypeDefaultVersion
instance Core.ToHeaders SetTypeDefaultVersion where
toHeaders :: SetTypeDefaultVersion -> ResponseHeaders
toHeaders = ResponseHeaders -> SetTypeDefaultVersion -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath SetTypeDefaultVersion where
toPath :: SetTypeDefaultVersion -> ByteString
toPath = ByteString -> SetTypeDefaultVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetTypeDefaultVersion where
toQuery :: SetTypeDefaultVersion -> QueryString
toQuery SetTypeDefaultVersion' {Maybe Text
Maybe RegistryType
type' :: Maybe RegistryType
arn :: Maybe Text
typeName :: Maybe Text
versionId :: Maybe Text
$sel:type':SetTypeDefaultVersion' :: SetTypeDefaultVersion -> Maybe RegistryType
$sel:arn:SetTypeDefaultVersion' :: SetTypeDefaultVersion -> Maybe Text
$sel:typeName:SetTypeDefaultVersion' :: SetTypeDefaultVersion -> Maybe Text
$sel:versionId:SetTypeDefaultVersion' :: SetTypeDefaultVersion -> 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
"SetTypeDefaultVersion" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"VersionId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
versionId,
ByteString
"TypeName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
typeName,
ByteString
"Arn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
arn,
ByteString
"Type" ByteString -> Maybe RegistryType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe RegistryType
type'
]
data SetTypeDefaultVersionResponse = SetTypeDefaultVersionResponse'
{
SetTypeDefaultVersionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SetTypeDefaultVersionResponse
-> SetTypeDefaultVersionResponse -> Bool
(SetTypeDefaultVersionResponse
-> SetTypeDefaultVersionResponse -> Bool)
-> (SetTypeDefaultVersionResponse
-> SetTypeDefaultVersionResponse -> Bool)
-> Eq SetTypeDefaultVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetTypeDefaultVersionResponse
-> SetTypeDefaultVersionResponse -> Bool
$c/= :: SetTypeDefaultVersionResponse
-> SetTypeDefaultVersionResponse -> Bool
== :: SetTypeDefaultVersionResponse
-> SetTypeDefaultVersionResponse -> Bool
$c== :: SetTypeDefaultVersionResponse
-> SetTypeDefaultVersionResponse -> Bool
Prelude.Eq, ReadPrec [SetTypeDefaultVersionResponse]
ReadPrec SetTypeDefaultVersionResponse
Int -> ReadS SetTypeDefaultVersionResponse
ReadS [SetTypeDefaultVersionResponse]
(Int -> ReadS SetTypeDefaultVersionResponse)
-> ReadS [SetTypeDefaultVersionResponse]
-> ReadPrec SetTypeDefaultVersionResponse
-> ReadPrec [SetTypeDefaultVersionResponse]
-> Read SetTypeDefaultVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetTypeDefaultVersionResponse]
$creadListPrec :: ReadPrec [SetTypeDefaultVersionResponse]
readPrec :: ReadPrec SetTypeDefaultVersionResponse
$creadPrec :: ReadPrec SetTypeDefaultVersionResponse
readList :: ReadS [SetTypeDefaultVersionResponse]
$creadList :: ReadS [SetTypeDefaultVersionResponse]
readsPrec :: Int -> ReadS SetTypeDefaultVersionResponse
$creadsPrec :: Int -> ReadS SetTypeDefaultVersionResponse
Prelude.Read, Int -> SetTypeDefaultVersionResponse -> ShowS
[SetTypeDefaultVersionResponse] -> ShowS
SetTypeDefaultVersionResponse -> String
(Int -> SetTypeDefaultVersionResponse -> ShowS)
-> (SetTypeDefaultVersionResponse -> String)
-> ([SetTypeDefaultVersionResponse] -> ShowS)
-> Show SetTypeDefaultVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetTypeDefaultVersionResponse] -> ShowS
$cshowList :: [SetTypeDefaultVersionResponse] -> ShowS
show :: SetTypeDefaultVersionResponse -> String
$cshow :: SetTypeDefaultVersionResponse -> String
showsPrec :: Int -> SetTypeDefaultVersionResponse -> ShowS
$cshowsPrec :: Int -> SetTypeDefaultVersionResponse -> ShowS
Prelude.Show, (forall x.
SetTypeDefaultVersionResponse
-> Rep SetTypeDefaultVersionResponse x)
-> (forall x.
Rep SetTypeDefaultVersionResponse x
-> SetTypeDefaultVersionResponse)
-> Generic SetTypeDefaultVersionResponse
forall x.
Rep SetTypeDefaultVersionResponse x
-> SetTypeDefaultVersionResponse
forall x.
SetTypeDefaultVersionResponse
-> Rep SetTypeDefaultVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetTypeDefaultVersionResponse x
-> SetTypeDefaultVersionResponse
$cfrom :: forall x.
SetTypeDefaultVersionResponse
-> Rep SetTypeDefaultVersionResponse x
Prelude.Generic)
newSetTypeDefaultVersionResponse ::
Prelude.Int ->
SetTypeDefaultVersionResponse
newSetTypeDefaultVersionResponse :: Int -> SetTypeDefaultVersionResponse
newSetTypeDefaultVersionResponse Int
pHttpStatus_ =
SetTypeDefaultVersionResponse' :: Int -> SetTypeDefaultVersionResponse
SetTypeDefaultVersionResponse'
{ $sel:httpStatus:SetTypeDefaultVersionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
setTypeDefaultVersionResponse_httpStatus :: Lens.Lens' SetTypeDefaultVersionResponse Prelude.Int
setTypeDefaultVersionResponse_httpStatus :: (Int -> f Int)
-> SetTypeDefaultVersionResponse -> f SetTypeDefaultVersionResponse
setTypeDefaultVersionResponse_httpStatus = (SetTypeDefaultVersionResponse -> Int)
-> (SetTypeDefaultVersionResponse
-> Int -> SetTypeDefaultVersionResponse)
-> Lens
SetTypeDefaultVersionResponse SetTypeDefaultVersionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTypeDefaultVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:SetTypeDefaultVersionResponse' :: SetTypeDefaultVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SetTypeDefaultVersionResponse
s@SetTypeDefaultVersionResponse' {} Int
a -> SetTypeDefaultVersionResponse
s {$sel:httpStatus:SetTypeDefaultVersionResponse' :: Int
httpStatus = Int
a} :: SetTypeDefaultVersionResponse)
instance Prelude.NFData SetTypeDefaultVersionResponse