{-# 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.DescribePublisher
(
DescribePublisher (..),
newDescribePublisher,
describePublisher_publisherId,
DescribePublisherResponse (..),
newDescribePublisherResponse,
describePublisherResponse_identityProvider,
describePublisherResponse_publisherId,
describePublisherResponse_publisherProfile,
describePublisherResponse_publisherStatus,
describePublisherResponse_httpStatus,
)
where
import Amazonka.CloudFormation.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribePublisher = DescribePublisher'
{
DescribePublisher -> Maybe Text
publisherId :: Prelude.Maybe Prelude.Text
}
deriving (DescribePublisher -> DescribePublisher -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePublisher -> DescribePublisher -> Bool
$c/= :: DescribePublisher -> DescribePublisher -> Bool
== :: DescribePublisher -> DescribePublisher -> Bool
$c== :: DescribePublisher -> DescribePublisher -> Bool
Prelude.Eq, ReadPrec [DescribePublisher]
ReadPrec DescribePublisher
Int -> ReadS DescribePublisher
ReadS [DescribePublisher]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePublisher]
$creadListPrec :: ReadPrec [DescribePublisher]
readPrec :: ReadPrec DescribePublisher
$creadPrec :: ReadPrec DescribePublisher
readList :: ReadS [DescribePublisher]
$creadList :: ReadS [DescribePublisher]
readsPrec :: Int -> ReadS DescribePublisher
$creadsPrec :: Int -> ReadS DescribePublisher
Prelude.Read, Int -> DescribePublisher -> ShowS
[DescribePublisher] -> ShowS
DescribePublisher -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePublisher] -> ShowS
$cshowList :: [DescribePublisher] -> ShowS
show :: DescribePublisher -> String
$cshow :: DescribePublisher -> String
showsPrec :: Int -> DescribePublisher -> ShowS
$cshowsPrec :: Int -> DescribePublisher -> ShowS
Prelude.Show, forall x. Rep DescribePublisher x -> DescribePublisher
forall x. DescribePublisher -> Rep DescribePublisher x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribePublisher x -> DescribePublisher
$cfrom :: forall x. DescribePublisher -> Rep DescribePublisher x
Prelude.Generic)
newDescribePublisher ::
DescribePublisher
newDescribePublisher :: DescribePublisher
newDescribePublisher =
DescribePublisher' {$sel:publisherId:DescribePublisher' :: Maybe Text
publisherId = forall a. Maybe a
Prelude.Nothing}
describePublisher_publisherId :: Lens.Lens' DescribePublisher (Prelude.Maybe Prelude.Text)
describePublisher_publisherId :: Lens' DescribePublisher (Maybe Text)
describePublisher_publisherId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePublisher' {Maybe Text
publisherId :: Maybe Text
$sel:publisherId:DescribePublisher' :: DescribePublisher -> Maybe Text
publisherId} -> Maybe Text
publisherId) (\s :: DescribePublisher
s@DescribePublisher' {} Maybe Text
a -> DescribePublisher
s {$sel:publisherId:DescribePublisher' :: Maybe Text
publisherId = Maybe Text
a} :: DescribePublisher)
instance Core.AWSRequest DescribePublisher where
type
AWSResponse DescribePublisher =
DescribePublisherResponse
request :: (Service -> Service)
-> DescribePublisher -> Request DescribePublisher
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribePublisher
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribePublisher)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DescribePublisherResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe IdentityProvider
-> Maybe Text
-> Maybe Text
-> Maybe PublisherStatus
-> Int
-> DescribePublisherResponse
DescribePublisherResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IdentityProvider")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"PublisherId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"PublisherProfile")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"PublisherStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribePublisher where
hashWithSalt :: Int -> DescribePublisher -> Int
hashWithSalt Int
_salt DescribePublisher' {Maybe Text
publisherId :: Maybe Text
$sel:publisherId:DescribePublisher' :: DescribePublisher -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
publisherId
instance Prelude.NFData DescribePublisher where
rnf :: DescribePublisher -> ()
rnf DescribePublisher' {Maybe Text
publisherId :: Maybe Text
$sel:publisherId:DescribePublisher' :: DescribePublisher -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
publisherId
instance Data.ToHeaders DescribePublisher where
toHeaders :: DescribePublisher -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DescribePublisher where
toPath :: DescribePublisher -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribePublisher where
toQuery :: DescribePublisher -> QueryString
toQuery DescribePublisher' {Maybe Text
publisherId :: Maybe Text
$sel:publisherId:DescribePublisher' :: DescribePublisher -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribePublisher" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
ByteString
"PublisherId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
publisherId
]
data DescribePublisherResponse = DescribePublisherResponse'
{
DescribePublisherResponse -> Maybe IdentityProvider
identityProvider :: Prelude.Maybe IdentityProvider,
DescribePublisherResponse -> Maybe Text
publisherId :: Prelude.Maybe Prelude.Text,
DescribePublisherResponse -> Maybe Text
publisherProfile :: Prelude.Maybe Prelude.Text,
DescribePublisherResponse -> Maybe PublisherStatus
publisherStatus :: Prelude.Maybe PublisherStatus,
DescribePublisherResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribePublisherResponse -> DescribePublisherResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePublisherResponse -> DescribePublisherResponse -> Bool
$c/= :: DescribePublisherResponse -> DescribePublisherResponse -> Bool
== :: DescribePublisherResponse -> DescribePublisherResponse -> Bool
$c== :: DescribePublisherResponse -> DescribePublisherResponse -> Bool
Prelude.Eq, ReadPrec [DescribePublisherResponse]
ReadPrec DescribePublisherResponse
Int -> ReadS DescribePublisherResponse
ReadS [DescribePublisherResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePublisherResponse]
$creadListPrec :: ReadPrec [DescribePublisherResponse]
readPrec :: ReadPrec DescribePublisherResponse
$creadPrec :: ReadPrec DescribePublisherResponse
readList :: ReadS [DescribePublisherResponse]
$creadList :: ReadS [DescribePublisherResponse]
readsPrec :: Int -> ReadS DescribePublisherResponse
$creadsPrec :: Int -> ReadS DescribePublisherResponse
Prelude.Read, Int -> DescribePublisherResponse -> ShowS
[DescribePublisherResponse] -> ShowS
DescribePublisherResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePublisherResponse] -> ShowS
$cshowList :: [DescribePublisherResponse] -> ShowS
show :: DescribePublisherResponse -> String
$cshow :: DescribePublisherResponse -> String
showsPrec :: Int -> DescribePublisherResponse -> ShowS
$cshowsPrec :: Int -> DescribePublisherResponse -> ShowS
Prelude.Show, forall x.
Rep DescribePublisherResponse x -> DescribePublisherResponse
forall x.
DescribePublisherResponse -> Rep DescribePublisherResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePublisherResponse x -> DescribePublisherResponse
$cfrom :: forall x.
DescribePublisherResponse -> Rep DescribePublisherResponse x
Prelude.Generic)
newDescribePublisherResponse ::
Prelude.Int ->
DescribePublisherResponse
newDescribePublisherResponse :: Int -> DescribePublisherResponse
newDescribePublisherResponse Int
pHttpStatus_ =
DescribePublisherResponse'
{ $sel:identityProvider:DescribePublisherResponse' :: Maybe IdentityProvider
identityProvider =
forall a. Maybe a
Prelude.Nothing,
$sel:publisherId:DescribePublisherResponse' :: Maybe Text
publisherId = forall a. Maybe a
Prelude.Nothing,
$sel:publisherProfile:DescribePublisherResponse' :: Maybe Text
publisherProfile = forall a. Maybe a
Prelude.Nothing,
$sel:publisherStatus:DescribePublisherResponse' :: Maybe PublisherStatus
publisherStatus = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribePublisherResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describePublisherResponse_identityProvider :: Lens.Lens' DescribePublisherResponse (Prelude.Maybe IdentityProvider)
describePublisherResponse_identityProvider :: Lens' DescribePublisherResponse (Maybe IdentityProvider)
describePublisherResponse_identityProvider = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePublisherResponse' {Maybe IdentityProvider
identityProvider :: Maybe IdentityProvider
$sel:identityProvider:DescribePublisherResponse' :: DescribePublisherResponse -> Maybe IdentityProvider
identityProvider} -> Maybe IdentityProvider
identityProvider) (\s :: DescribePublisherResponse
s@DescribePublisherResponse' {} Maybe IdentityProvider
a -> DescribePublisherResponse
s {$sel:identityProvider:DescribePublisherResponse' :: Maybe IdentityProvider
identityProvider = Maybe IdentityProvider
a} :: DescribePublisherResponse)
describePublisherResponse_publisherId :: Lens.Lens' DescribePublisherResponse (Prelude.Maybe Prelude.Text)
describePublisherResponse_publisherId :: Lens' DescribePublisherResponse (Maybe Text)
describePublisherResponse_publisherId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePublisherResponse' {Maybe Text
publisherId :: Maybe Text
$sel:publisherId:DescribePublisherResponse' :: DescribePublisherResponse -> Maybe Text
publisherId} -> Maybe Text
publisherId) (\s :: DescribePublisherResponse
s@DescribePublisherResponse' {} Maybe Text
a -> DescribePublisherResponse
s {$sel:publisherId:DescribePublisherResponse' :: Maybe Text
publisherId = Maybe Text
a} :: DescribePublisherResponse)
describePublisherResponse_publisherProfile :: Lens.Lens' DescribePublisherResponse (Prelude.Maybe Prelude.Text)
describePublisherResponse_publisherProfile :: Lens' DescribePublisherResponse (Maybe Text)
describePublisherResponse_publisherProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePublisherResponse' {Maybe Text
publisherProfile :: Maybe Text
$sel:publisherProfile:DescribePublisherResponse' :: DescribePublisherResponse -> Maybe Text
publisherProfile} -> Maybe Text
publisherProfile) (\s :: DescribePublisherResponse
s@DescribePublisherResponse' {} Maybe Text
a -> DescribePublisherResponse
s {$sel:publisherProfile:DescribePublisherResponse' :: Maybe Text
publisherProfile = Maybe Text
a} :: DescribePublisherResponse)
describePublisherResponse_publisherStatus :: Lens.Lens' DescribePublisherResponse (Prelude.Maybe PublisherStatus)
describePublisherResponse_publisherStatus :: Lens' DescribePublisherResponse (Maybe PublisherStatus)
describePublisherResponse_publisherStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePublisherResponse' {Maybe PublisherStatus
publisherStatus :: Maybe PublisherStatus
$sel:publisherStatus:DescribePublisherResponse' :: DescribePublisherResponse -> Maybe PublisherStatus
publisherStatus} -> Maybe PublisherStatus
publisherStatus) (\s :: DescribePublisherResponse
s@DescribePublisherResponse' {} Maybe PublisherStatus
a -> DescribePublisherResponse
s {$sel:publisherStatus:DescribePublisherResponse' :: Maybe PublisherStatus
publisherStatus = Maybe PublisherStatus
a} :: DescribePublisherResponse)
describePublisherResponse_httpStatus :: Lens.Lens' DescribePublisherResponse Prelude.Int
describePublisherResponse_httpStatus :: Lens' DescribePublisherResponse Int
describePublisherResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePublisherResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribePublisherResponse' :: DescribePublisherResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribePublisherResponse
s@DescribePublisherResponse' {} Int
a -> DescribePublisherResponse
s {$sel:httpStatus:DescribePublisherResponse' :: Int
httpStatus = Int
a} :: DescribePublisherResponse)
instance Prelude.NFData DescribePublisherResponse where
rnf :: DescribePublisherResponse -> ()
rnf DescribePublisherResponse' {Int
Maybe Text
Maybe IdentityProvider
Maybe PublisherStatus
httpStatus :: Int
publisherStatus :: Maybe PublisherStatus
publisherProfile :: Maybe Text
publisherId :: Maybe Text
identityProvider :: Maybe IdentityProvider
$sel:httpStatus:DescribePublisherResponse' :: DescribePublisherResponse -> Int
$sel:publisherStatus:DescribePublisherResponse' :: DescribePublisherResponse -> Maybe PublisherStatus
$sel:publisherProfile:DescribePublisherResponse' :: DescribePublisherResponse -> Maybe Text
$sel:publisherId:DescribePublisherResponse' :: DescribePublisherResponse -> Maybe Text
$sel:identityProvider:DescribePublisherResponse' :: DescribePublisherResponse -> Maybe IdentityProvider
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe IdentityProvider
identityProvider
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
publisherId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
publisherProfile
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PublisherStatus
publisherStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus