{-# 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.PublishType
(
PublishType (..),
newPublishType,
publishType_typeName,
publishType_arn,
publishType_publicVersionNumber,
publishType_type,
PublishTypeResponse (..),
newPublishTypeResponse,
publishTypeResponse_publicTypeArn,
publishTypeResponse_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 PublishType = PublishType'
{
PublishType -> Maybe Text
typeName :: Prelude.Maybe Prelude.Text,
PublishType -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
PublishType -> Maybe Text
publicVersionNumber :: Prelude.Maybe Prelude.Text,
PublishType -> Maybe ThirdPartyType
type' :: Prelude.Maybe ThirdPartyType
}
deriving (PublishType -> PublishType -> Bool
(PublishType -> PublishType -> Bool)
-> (PublishType -> PublishType -> Bool) -> Eq PublishType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublishType -> PublishType -> Bool
$c/= :: PublishType -> PublishType -> Bool
== :: PublishType -> PublishType -> Bool
$c== :: PublishType -> PublishType -> Bool
Prelude.Eq, ReadPrec [PublishType]
ReadPrec PublishType
Int -> ReadS PublishType
ReadS [PublishType]
(Int -> ReadS PublishType)
-> ReadS [PublishType]
-> ReadPrec PublishType
-> ReadPrec [PublishType]
-> Read PublishType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PublishType]
$creadListPrec :: ReadPrec [PublishType]
readPrec :: ReadPrec PublishType
$creadPrec :: ReadPrec PublishType
readList :: ReadS [PublishType]
$creadList :: ReadS [PublishType]
readsPrec :: Int -> ReadS PublishType
$creadsPrec :: Int -> ReadS PublishType
Prelude.Read, Int -> PublishType -> ShowS
[PublishType] -> ShowS
PublishType -> String
(Int -> PublishType -> ShowS)
-> (PublishType -> String)
-> ([PublishType] -> ShowS)
-> Show PublishType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublishType] -> ShowS
$cshowList :: [PublishType] -> ShowS
show :: PublishType -> String
$cshow :: PublishType -> String
showsPrec :: Int -> PublishType -> ShowS
$cshowsPrec :: Int -> PublishType -> ShowS
Prelude.Show, (forall x. PublishType -> Rep PublishType x)
-> (forall x. Rep PublishType x -> PublishType)
-> Generic PublishType
forall x. Rep PublishType x -> PublishType
forall x. PublishType -> Rep PublishType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PublishType x -> PublishType
$cfrom :: forall x. PublishType -> Rep PublishType x
Prelude.Generic)
newPublishType ::
PublishType
newPublishType :: PublishType
newPublishType =
PublishType' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe ThirdPartyType -> PublishType
PublishType'
{ $sel:typeName:PublishType' :: Maybe Text
typeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:PublishType' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:publicVersionNumber:PublishType' :: Maybe Text
publicVersionNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':PublishType' :: Maybe ThirdPartyType
type' = Maybe ThirdPartyType
forall a. Maybe a
Prelude.Nothing
}
publishType_typeName :: Lens.Lens' PublishType (Prelude.Maybe Prelude.Text)
publishType_typeName :: (Maybe Text -> f (Maybe Text)) -> PublishType -> f PublishType
publishType_typeName = (PublishType -> Maybe Text)
-> (PublishType -> Maybe Text -> PublishType)
-> Lens PublishType PublishType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishType' {Maybe Text
typeName :: Maybe Text
$sel:typeName:PublishType' :: PublishType -> Maybe Text
typeName} -> Maybe Text
typeName) (\s :: PublishType
s@PublishType' {} Maybe Text
a -> PublishType
s {$sel:typeName:PublishType' :: Maybe Text
typeName = Maybe Text
a} :: PublishType)
publishType_arn :: Lens.Lens' PublishType (Prelude.Maybe Prelude.Text)
publishType_arn :: (Maybe Text -> f (Maybe Text)) -> PublishType -> f PublishType
publishType_arn = (PublishType -> Maybe Text)
-> (PublishType -> Maybe Text -> PublishType)
-> Lens PublishType PublishType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishType' {Maybe Text
arn :: Maybe Text
$sel:arn:PublishType' :: PublishType -> Maybe Text
arn} -> Maybe Text
arn) (\s :: PublishType
s@PublishType' {} Maybe Text
a -> PublishType
s {$sel:arn:PublishType' :: Maybe Text
arn = Maybe Text
a} :: PublishType)
publishType_publicVersionNumber :: Lens.Lens' PublishType (Prelude.Maybe Prelude.Text)
publishType_publicVersionNumber :: (Maybe Text -> f (Maybe Text)) -> PublishType -> f PublishType
publishType_publicVersionNumber = (PublishType -> Maybe Text)
-> (PublishType -> Maybe Text -> PublishType)
-> Lens PublishType PublishType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishType' {Maybe Text
publicVersionNumber :: Maybe Text
$sel:publicVersionNumber:PublishType' :: PublishType -> Maybe Text
publicVersionNumber} -> Maybe Text
publicVersionNumber) (\s :: PublishType
s@PublishType' {} Maybe Text
a -> PublishType
s {$sel:publicVersionNumber:PublishType' :: Maybe Text
publicVersionNumber = Maybe Text
a} :: PublishType)
publishType_type :: Lens.Lens' PublishType (Prelude.Maybe ThirdPartyType)
publishType_type :: (Maybe ThirdPartyType -> f (Maybe ThirdPartyType))
-> PublishType -> f PublishType
publishType_type = (PublishType -> Maybe ThirdPartyType)
-> (PublishType -> Maybe ThirdPartyType -> PublishType)
-> Lens
PublishType
PublishType
(Maybe ThirdPartyType)
(Maybe ThirdPartyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishType' {Maybe ThirdPartyType
type' :: Maybe ThirdPartyType
$sel:type':PublishType' :: PublishType -> Maybe ThirdPartyType
type'} -> Maybe ThirdPartyType
type') (\s :: PublishType
s@PublishType' {} Maybe ThirdPartyType
a -> PublishType
s {$sel:type':PublishType' :: Maybe ThirdPartyType
type' = Maybe ThirdPartyType
a} :: PublishType)
instance Core.AWSRequest PublishType where
type AWSResponse PublishType = PublishTypeResponse
request :: PublishType -> Request PublishType
request = Service -> PublishType -> Request PublishType
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy PublishType
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PublishType)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse PublishType))
-> Logger
-> Service
-> Proxy PublishType
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PublishType)))
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
"PublishTypeResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Int -> PublishTypeResponse
PublishTypeResponse'
(Maybe Text -> Int -> PublishTypeResponse)
-> Either String (Maybe Text)
-> Either String (Int -> PublishTypeResponse)
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
"PublicTypeArn")
Either String (Int -> PublishTypeResponse)
-> Either String Int -> Either String PublishTypeResponse
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 PublishType
instance Prelude.NFData PublishType
instance Core.ToHeaders PublishType where
toHeaders :: PublishType -> ResponseHeaders
toHeaders = ResponseHeaders -> PublishType -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath PublishType where
toPath :: PublishType -> ByteString
toPath = ByteString -> PublishType -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PublishType where
toQuery :: PublishType -> QueryString
toQuery PublishType' {Maybe Text
Maybe ThirdPartyType
type' :: Maybe ThirdPartyType
publicVersionNumber :: Maybe Text
arn :: Maybe Text
typeName :: Maybe Text
$sel:type':PublishType' :: PublishType -> Maybe ThirdPartyType
$sel:publicVersionNumber:PublishType' :: PublishType -> Maybe Text
$sel:arn:PublishType' :: PublishType -> Maybe Text
$sel:typeName:PublishType' :: PublishType -> 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
"PublishType" :: 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
"Arn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
arn,
ByteString
"PublicVersionNumber" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
publicVersionNumber,
ByteString
"Type" ByteString -> Maybe ThirdPartyType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ThirdPartyType
type'
]
data PublishTypeResponse = PublishTypeResponse'
{
PublishTypeResponse -> Maybe Text
publicTypeArn :: Prelude.Maybe Prelude.Text,
PublishTypeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PublishTypeResponse -> PublishTypeResponse -> Bool
(PublishTypeResponse -> PublishTypeResponse -> Bool)
-> (PublishTypeResponse -> PublishTypeResponse -> Bool)
-> Eq PublishTypeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublishTypeResponse -> PublishTypeResponse -> Bool
$c/= :: PublishTypeResponse -> PublishTypeResponse -> Bool
== :: PublishTypeResponse -> PublishTypeResponse -> Bool
$c== :: PublishTypeResponse -> PublishTypeResponse -> Bool
Prelude.Eq, ReadPrec [PublishTypeResponse]
ReadPrec PublishTypeResponse
Int -> ReadS PublishTypeResponse
ReadS [PublishTypeResponse]
(Int -> ReadS PublishTypeResponse)
-> ReadS [PublishTypeResponse]
-> ReadPrec PublishTypeResponse
-> ReadPrec [PublishTypeResponse]
-> Read PublishTypeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PublishTypeResponse]
$creadListPrec :: ReadPrec [PublishTypeResponse]
readPrec :: ReadPrec PublishTypeResponse
$creadPrec :: ReadPrec PublishTypeResponse
readList :: ReadS [PublishTypeResponse]
$creadList :: ReadS [PublishTypeResponse]
readsPrec :: Int -> ReadS PublishTypeResponse
$creadsPrec :: Int -> ReadS PublishTypeResponse
Prelude.Read, Int -> PublishTypeResponse -> ShowS
[PublishTypeResponse] -> ShowS
PublishTypeResponse -> String
(Int -> PublishTypeResponse -> ShowS)
-> (PublishTypeResponse -> String)
-> ([PublishTypeResponse] -> ShowS)
-> Show PublishTypeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublishTypeResponse] -> ShowS
$cshowList :: [PublishTypeResponse] -> ShowS
show :: PublishTypeResponse -> String
$cshow :: PublishTypeResponse -> String
showsPrec :: Int -> PublishTypeResponse -> ShowS
$cshowsPrec :: Int -> PublishTypeResponse -> ShowS
Prelude.Show, (forall x. PublishTypeResponse -> Rep PublishTypeResponse x)
-> (forall x. Rep PublishTypeResponse x -> PublishTypeResponse)
-> Generic PublishTypeResponse
forall x. Rep PublishTypeResponse x -> PublishTypeResponse
forall x. PublishTypeResponse -> Rep PublishTypeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PublishTypeResponse x -> PublishTypeResponse
$cfrom :: forall x. PublishTypeResponse -> Rep PublishTypeResponse x
Prelude.Generic)
newPublishTypeResponse ::
Prelude.Int ->
PublishTypeResponse
newPublishTypeResponse :: Int -> PublishTypeResponse
newPublishTypeResponse Int
pHttpStatus_ =
PublishTypeResponse' :: Maybe Text -> Int -> PublishTypeResponse
PublishTypeResponse'
{ $sel:publicTypeArn:PublishTypeResponse' :: Maybe Text
publicTypeArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PublishTypeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
publishTypeResponse_publicTypeArn :: Lens.Lens' PublishTypeResponse (Prelude.Maybe Prelude.Text)
publishTypeResponse_publicTypeArn :: (Maybe Text -> f (Maybe Text))
-> PublishTypeResponse -> f PublishTypeResponse
publishTypeResponse_publicTypeArn = (PublishTypeResponse -> Maybe Text)
-> (PublishTypeResponse -> Maybe Text -> PublishTypeResponse)
-> Lens
PublishTypeResponse PublishTypeResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishTypeResponse' {Maybe Text
publicTypeArn :: Maybe Text
$sel:publicTypeArn:PublishTypeResponse' :: PublishTypeResponse -> Maybe Text
publicTypeArn} -> Maybe Text
publicTypeArn) (\s :: PublishTypeResponse
s@PublishTypeResponse' {} Maybe Text
a -> PublishTypeResponse
s {$sel:publicTypeArn:PublishTypeResponse' :: Maybe Text
publicTypeArn = Maybe Text
a} :: PublishTypeResponse)
publishTypeResponse_httpStatus :: Lens.Lens' PublishTypeResponse Prelude.Int
publishTypeResponse_httpStatus :: (Int -> f Int) -> PublishTypeResponse -> f PublishTypeResponse
publishTypeResponse_httpStatus = (PublishTypeResponse -> Int)
-> (PublishTypeResponse -> Int -> PublishTypeResponse)
-> Lens PublishTypeResponse PublishTypeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishTypeResponse' {Int
httpStatus :: Int
$sel:httpStatus:PublishTypeResponse' :: PublishTypeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PublishTypeResponse
s@PublishTypeResponse' {} Int
a -> PublishTypeResponse
s {$sel:httpStatus:PublishTypeResponse' :: Int
httpStatus = Int
a} :: PublishTypeResponse)
instance Prelude.NFData PublishTypeResponse