{-# 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.RegisterPublisher
(
RegisterPublisher (..),
newRegisterPublisher,
registerPublisher_connectionArn,
registerPublisher_acceptTermsAndConditions,
RegisterPublisherResponse (..),
newRegisterPublisherResponse,
registerPublisherResponse_publisherId,
registerPublisherResponse_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 RegisterPublisher = RegisterPublisher'
{
RegisterPublisher -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
RegisterPublisher -> Maybe Bool
acceptTermsAndConditions :: Prelude.Maybe Prelude.Bool
}
deriving (RegisterPublisher -> RegisterPublisher -> Bool
(RegisterPublisher -> RegisterPublisher -> Bool)
-> (RegisterPublisher -> RegisterPublisher -> Bool)
-> Eq RegisterPublisher
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterPublisher -> RegisterPublisher -> Bool
$c/= :: RegisterPublisher -> RegisterPublisher -> Bool
== :: RegisterPublisher -> RegisterPublisher -> Bool
$c== :: RegisterPublisher -> RegisterPublisher -> Bool
Prelude.Eq, ReadPrec [RegisterPublisher]
ReadPrec RegisterPublisher
Int -> ReadS RegisterPublisher
ReadS [RegisterPublisher]
(Int -> ReadS RegisterPublisher)
-> ReadS [RegisterPublisher]
-> ReadPrec RegisterPublisher
-> ReadPrec [RegisterPublisher]
-> Read RegisterPublisher
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterPublisher]
$creadListPrec :: ReadPrec [RegisterPublisher]
readPrec :: ReadPrec RegisterPublisher
$creadPrec :: ReadPrec RegisterPublisher
readList :: ReadS [RegisterPublisher]
$creadList :: ReadS [RegisterPublisher]
readsPrec :: Int -> ReadS RegisterPublisher
$creadsPrec :: Int -> ReadS RegisterPublisher
Prelude.Read, Int -> RegisterPublisher -> ShowS
[RegisterPublisher] -> ShowS
RegisterPublisher -> String
(Int -> RegisterPublisher -> ShowS)
-> (RegisterPublisher -> String)
-> ([RegisterPublisher] -> ShowS)
-> Show RegisterPublisher
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterPublisher] -> ShowS
$cshowList :: [RegisterPublisher] -> ShowS
show :: RegisterPublisher -> String
$cshow :: RegisterPublisher -> String
showsPrec :: Int -> RegisterPublisher -> ShowS
$cshowsPrec :: Int -> RegisterPublisher -> ShowS
Prelude.Show, (forall x. RegisterPublisher -> Rep RegisterPublisher x)
-> (forall x. Rep RegisterPublisher x -> RegisterPublisher)
-> Generic RegisterPublisher
forall x. Rep RegisterPublisher x -> RegisterPublisher
forall x. RegisterPublisher -> Rep RegisterPublisher x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterPublisher x -> RegisterPublisher
$cfrom :: forall x. RegisterPublisher -> Rep RegisterPublisher x
Prelude.Generic)
newRegisterPublisher ::
RegisterPublisher
newRegisterPublisher :: RegisterPublisher
newRegisterPublisher =
RegisterPublisher' :: Maybe Text -> Maybe Bool -> RegisterPublisher
RegisterPublisher'
{ $sel:connectionArn:RegisterPublisher' :: Maybe Text
connectionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:acceptTermsAndConditions:RegisterPublisher' :: Maybe Bool
acceptTermsAndConditions = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
registerPublisher_connectionArn :: Lens.Lens' RegisterPublisher (Prelude.Maybe Prelude.Text)
registerPublisher_connectionArn :: (Maybe Text -> f (Maybe Text))
-> RegisterPublisher -> f RegisterPublisher
registerPublisher_connectionArn = (RegisterPublisher -> Maybe Text)
-> (RegisterPublisher -> Maybe Text -> RegisterPublisher)
-> Lens
RegisterPublisher RegisterPublisher (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterPublisher' {Maybe Text
connectionArn :: Maybe Text
$sel:connectionArn:RegisterPublisher' :: RegisterPublisher -> Maybe Text
connectionArn} -> Maybe Text
connectionArn) (\s :: RegisterPublisher
s@RegisterPublisher' {} Maybe Text
a -> RegisterPublisher
s {$sel:connectionArn:RegisterPublisher' :: Maybe Text
connectionArn = Maybe Text
a} :: RegisterPublisher)
registerPublisher_acceptTermsAndConditions :: Lens.Lens' RegisterPublisher (Prelude.Maybe Prelude.Bool)
registerPublisher_acceptTermsAndConditions :: (Maybe Bool -> f (Maybe Bool))
-> RegisterPublisher -> f RegisterPublisher
registerPublisher_acceptTermsAndConditions = (RegisterPublisher -> Maybe Bool)
-> (RegisterPublisher -> Maybe Bool -> RegisterPublisher)
-> Lens
RegisterPublisher RegisterPublisher (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterPublisher' {Maybe Bool
acceptTermsAndConditions :: Maybe Bool
$sel:acceptTermsAndConditions:RegisterPublisher' :: RegisterPublisher -> Maybe Bool
acceptTermsAndConditions} -> Maybe Bool
acceptTermsAndConditions) (\s :: RegisterPublisher
s@RegisterPublisher' {} Maybe Bool
a -> RegisterPublisher
s {$sel:acceptTermsAndConditions:RegisterPublisher' :: Maybe Bool
acceptTermsAndConditions = Maybe Bool
a} :: RegisterPublisher)
instance Core.AWSRequest RegisterPublisher where
type
AWSResponse RegisterPublisher =
RegisterPublisherResponse
request :: RegisterPublisher -> Request RegisterPublisher
request = Service -> RegisterPublisher -> Request RegisterPublisher
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy RegisterPublisher
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RegisterPublisher)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse RegisterPublisher))
-> Logger
-> Service
-> Proxy RegisterPublisher
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RegisterPublisher)))
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
"RegisterPublisherResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Int -> RegisterPublisherResponse
RegisterPublisherResponse'
(Maybe Text -> Int -> RegisterPublisherResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RegisterPublisherResponse)
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
"PublisherId")
Either String (Int -> RegisterPublisherResponse)
-> Either String Int -> Either String RegisterPublisherResponse
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 RegisterPublisher
instance Prelude.NFData RegisterPublisher
instance Core.ToHeaders RegisterPublisher where
toHeaders :: RegisterPublisher -> ResponseHeaders
toHeaders = ResponseHeaders -> RegisterPublisher -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath RegisterPublisher where
toPath :: RegisterPublisher -> ByteString
toPath = ByteString -> RegisterPublisher -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RegisterPublisher where
toQuery :: RegisterPublisher -> QueryString
toQuery RegisterPublisher' {Maybe Bool
Maybe Text
acceptTermsAndConditions :: Maybe Bool
connectionArn :: Maybe Text
$sel:acceptTermsAndConditions:RegisterPublisher' :: RegisterPublisher -> Maybe Bool
$sel:connectionArn:RegisterPublisher' :: RegisterPublisher -> 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
"RegisterPublisher" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"ConnectionArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
connectionArn,
ByteString
"AcceptTermsAndConditions"
ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
acceptTermsAndConditions
]
data RegisterPublisherResponse = RegisterPublisherResponse'
{
RegisterPublisherResponse -> Maybe Text
publisherId :: Prelude.Maybe Prelude.Text,
RegisterPublisherResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RegisterPublisherResponse -> RegisterPublisherResponse -> Bool
(RegisterPublisherResponse -> RegisterPublisherResponse -> Bool)
-> (RegisterPublisherResponse -> RegisterPublisherResponse -> Bool)
-> Eq RegisterPublisherResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterPublisherResponse -> RegisterPublisherResponse -> Bool
$c/= :: RegisterPublisherResponse -> RegisterPublisherResponse -> Bool
== :: RegisterPublisherResponse -> RegisterPublisherResponse -> Bool
$c== :: RegisterPublisherResponse -> RegisterPublisherResponse -> Bool
Prelude.Eq, ReadPrec [RegisterPublisherResponse]
ReadPrec RegisterPublisherResponse
Int -> ReadS RegisterPublisherResponse
ReadS [RegisterPublisherResponse]
(Int -> ReadS RegisterPublisherResponse)
-> ReadS [RegisterPublisherResponse]
-> ReadPrec RegisterPublisherResponse
-> ReadPrec [RegisterPublisherResponse]
-> Read RegisterPublisherResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterPublisherResponse]
$creadListPrec :: ReadPrec [RegisterPublisherResponse]
readPrec :: ReadPrec RegisterPublisherResponse
$creadPrec :: ReadPrec RegisterPublisherResponse
readList :: ReadS [RegisterPublisherResponse]
$creadList :: ReadS [RegisterPublisherResponse]
readsPrec :: Int -> ReadS RegisterPublisherResponse
$creadsPrec :: Int -> ReadS RegisterPublisherResponse
Prelude.Read, Int -> RegisterPublisherResponse -> ShowS
[RegisterPublisherResponse] -> ShowS
RegisterPublisherResponse -> String
(Int -> RegisterPublisherResponse -> ShowS)
-> (RegisterPublisherResponse -> String)
-> ([RegisterPublisherResponse] -> ShowS)
-> Show RegisterPublisherResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterPublisherResponse] -> ShowS
$cshowList :: [RegisterPublisherResponse] -> ShowS
show :: RegisterPublisherResponse -> String
$cshow :: RegisterPublisherResponse -> String
showsPrec :: Int -> RegisterPublisherResponse -> ShowS
$cshowsPrec :: Int -> RegisterPublisherResponse -> ShowS
Prelude.Show, (forall x.
RegisterPublisherResponse -> Rep RegisterPublisherResponse x)
-> (forall x.
Rep RegisterPublisherResponse x -> RegisterPublisherResponse)
-> Generic RegisterPublisherResponse
forall x.
Rep RegisterPublisherResponse x -> RegisterPublisherResponse
forall x.
RegisterPublisherResponse -> Rep RegisterPublisherResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterPublisherResponse x -> RegisterPublisherResponse
$cfrom :: forall x.
RegisterPublisherResponse -> Rep RegisterPublisherResponse x
Prelude.Generic)
newRegisterPublisherResponse ::
Prelude.Int ->
RegisterPublisherResponse
newRegisterPublisherResponse :: Int -> RegisterPublisherResponse
newRegisterPublisherResponse Int
pHttpStatus_ =
RegisterPublisherResponse' :: Maybe Text -> Int -> RegisterPublisherResponse
RegisterPublisherResponse'
{ $sel:publisherId:RegisterPublisherResponse' :: Maybe Text
publisherId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RegisterPublisherResponse' :: Int
httpStatus = Int
pHttpStatus_
}
registerPublisherResponse_publisherId :: Lens.Lens' RegisterPublisherResponse (Prelude.Maybe Prelude.Text)
registerPublisherResponse_publisherId :: (Maybe Text -> f (Maybe Text))
-> RegisterPublisherResponse -> f RegisterPublisherResponse
registerPublisherResponse_publisherId = (RegisterPublisherResponse -> Maybe Text)
-> (RegisterPublisherResponse
-> Maybe Text -> RegisterPublisherResponse)
-> Lens
RegisterPublisherResponse
RegisterPublisherResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterPublisherResponse' {Maybe Text
publisherId :: Maybe Text
$sel:publisherId:RegisterPublisherResponse' :: RegisterPublisherResponse -> Maybe Text
publisherId} -> Maybe Text
publisherId) (\s :: RegisterPublisherResponse
s@RegisterPublisherResponse' {} Maybe Text
a -> RegisterPublisherResponse
s {$sel:publisherId:RegisterPublisherResponse' :: Maybe Text
publisherId = Maybe Text
a} :: RegisterPublisherResponse)
registerPublisherResponse_httpStatus :: Lens.Lens' RegisterPublisherResponse Prelude.Int
registerPublisherResponse_httpStatus :: (Int -> f Int)
-> RegisterPublisherResponse -> f RegisterPublisherResponse
registerPublisherResponse_httpStatus = (RegisterPublisherResponse -> Int)
-> (RegisterPublisherResponse -> Int -> RegisterPublisherResponse)
-> Lens RegisterPublisherResponse RegisterPublisherResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterPublisherResponse' {Int
httpStatus :: Int
$sel:httpStatus:RegisterPublisherResponse' :: RegisterPublisherResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RegisterPublisherResponse
s@RegisterPublisherResponse' {} Int
a -> RegisterPublisherResponse
s {$sel:httpStatus:RegisterPublisherResponse' :: Int
httpStatus = Int
a} :: RegisterPublisherResponse)
instance Prelude.NFData RegisterPublisherResponse