{-# 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.SNS.GetPlatformApplicationAttributes
(
GetPlatformApplicationAttributes (..),
newGetPlatformApplicationAttributes,
getPlatformApplicationAttributes_platformApplicationArn,
GetPlatformApplicationAttributesResponse (..),
newGetPlatformApplicationAttributesResponse,
getPlatformApplicationAttributesResponse_attributes,
getPlatformApplicationAttributesResponse_httpStatus,
)
where
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
import Amazonka.SNS.Types
data GetPlatformApplicationAttributes = GetPlatformApplicationAttributes'
{
GetPlatformApplicationAttributes -> Text
platformApplicationArn :: Prelude.Text
}
deriving (GetPlatformApplicationAttributes
-> GetPlatformApplicationAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPlatformApplicationAttributes
-> GetPlatformApplicationAttributes -> Bool
$c/= :: GetPlatformApplicationAttributes
-> GetPlatformApplicationAttributes -> Bool
== :: GetPlatformApplicationAttributes
-> GetPlatformApplicationAttributes -> Bool
$c== :: GetPlatformApplicationAttributes
-> GetPlatformApplicationAttributes -> Bool
Prelude.Eq, ReadPrec [GetPlatformApplicationAttributes]
ReadPrec GetPlatformApplicationAttributes
Int -> ReadS GetPlatformApplicationAttributes
ReadS [GetPlatformApplicationAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPlatformApplicationAttributes]
$creadListPrec :: ReadPrec [GetPlatformApplicationAttributes]
readPrec :: ReadPrec GetPlatformApplicationAttributes
$creadPrec :: ReadPrec GetPlatformApplicationAttributes
readList :: ReadS [GetPlatformApplicationAttributes]
$creadList :: ReadS [GetPlatformApplicationAttributes]
readsPrec :: Int -> ReadS GetPlatformApplicationAttributes
$creadsPrec :: Int -> ReadS GetPlatformApplicationAttributes
Prelude.Read, Int -> GetPlatformApplicationAttributes -> ShowS
[GetPlatformApplicationAttributes] -> ShowS
GetPlatformApplicationAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPlatformApplicationAttributes] -> ShowS
$cshowList :: [GetPlatformApplicationAttributes] -> ShowS
show :: GetPlatformApplicationAttributes -> String
$cshow :: GetPlatformApplicationAttributes -> String
showsPrec :: Int -> GetPlatformApplicationAttributes -> ShowS
$cshowsPrec :: Int -> GetPlatformApplicationAttributes -> ShowS
Prelude.Show, forall x.
Rep GetPlatformApplicationAttributes x
-> GetPlatformApplicationAttributes
forall x.
GetPlatformApplicationAttributes
-> Rep GetPlatformApplicationAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetPlatformApplicationAttributes x
-> GetPlatformApplicationAttributes
$cfrom :: forall x.
GetPlatformApplicationAttributes
-> Rep GetPlatformApplicationAttributes x
Prelude.Generic)
newGetPlatformApplicationAttributes ::
Prelude.Text ->
GetPlatformApplicationAttributes
newGetPlatformApplicationAttributes :: Text -> GetPlatformApplicationAttributes
newGetPlatformApplicationAttributes
Text
pPlatformApplicationArn_ =
GetPlatformApplicationAttributes'
{ $sel:platformApplicationArn:GetPlatformApplicationAttributes' :: Text
platformApplicationArn =
Text
pPlatformApplicationArn_
}
getPlatformApplicationAttributes_platformApplicationArn :: Lens.Lens' GetPlatformApplicationAttributes Prelude.Text
getPlatformApplicationAttributes_platformApplicationArn :: Lens' GetPlatformApplicationAttributes Text
getPlatformApplicationAttributes_platformApplicationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPlatformApplicationAttributes' {Text
platformApplicationArn :: Text
$sel:platformApplicationArn:GetPlatformApplicationAttributes' :: GetPlatformApplicationAttributes -> Text
platformApplicationArn} -> Text
platformApplicationArn) (\s :: GetPlatformApplicationAttributes
s@GetPlatformApplicationAttributes' {} Text
a -> GetPlatformApplicationAttributes
s {$sel:platformApplicationArn:GetPlatformApplicationAttributes' :: Text
platformApplicationArn = Text
a} :: GetPlatformApplicationAttributes)
instance
Core.AWSRequest
GetPlatformApplicationAttributes
where
type
AWSResponse GetPlatformApplicationAttributes =
GetPlatformApplicationAttributesResponse
request :: (Service -> Service)
-> GetPlatformApplicationAttributes
-> Request GetPlatformApplicationAttributes
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 GetPlatformApplicationAttributes
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetPlatformApplicationAttributes)))
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
"GetPlatformApplicationAttributesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe (HashMap Text Text)
-> Int -> GetPlatformApplicationAttributesResponse
GetPlatformApplicationAttributesResponse'
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
"Attributes"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall k v.
(Eq k, Hashable k, FromText k, FromXML v) =>
Text -> Text -> Text -> [Node] -> Either String (HashMap k v)
Data.parseXMLMap Text
"entry" Text
"key" Text
"value")
)
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
GetPlatformApplicationAttributes
where
hashWithSalt :: Int -> GetPlatformApplicationAttributes -> Int
hashWithSalt
Int
_salt
GetPlatformApplicationAttributes' {Text
platformApplicationArn :: Text
$sel:platformApplicationArn:GetPlatformApplicationAttributes' :: GetPlatformApplicationAttributes -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
platformApplicationArn
instance
Prelude.NFData
GetPlatformApplicationAttributes
where
rnf :: GetPlatformApplicationAttributes -> ()
rnf GetPlatformApplicationAttributes' {Text
platformApplicationArn :: Text
$sel:platformApplicationArn:GetPlatformApplicationAttributes' :: GetPlatformApplicationAttributes -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
platformApplicationArn
instance
Data.ToHeaders
GetPlatformApplicationAttributes
where
toHeaders :: GetPlatformApplicationAttributes -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetPlatformApplicationAttributes where
toPath :: GetPlatformApplicationAttributes -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
GetPlatformApplicationAttributes
where
toQuery :: GetPlatformApplicationAttributes -> QueryString
toQuery GetPlatformApplicationAttributes' {Text
platformApplicationArn :: Text
$sel:platformApplicationArn:GetPlatformApplicationAttributes' :: GetPlatformApplicationAttributes -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"GetPlatformApplicationAttributes" ::
Prelude.ByteString
),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
ByteString
"PlatformApplicationArn"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
platformApplicationArn
]
data GetPlatformApplicationAttributesResponse = GetPlatformApplicationAttributesResponse'
{
GetPlatformApplicationAttributesResponse
-> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
GetPlatformApplicationAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetPlatformApplicationAttributesResponse
-> GetPlatformApplicationAttributesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPlatformApplicationAttributesResponse
-> GetPlatformApplicationAttributesResponse -> Bool
$c/= :: GetPlatformApplicationAttributesResponse
-> GetPlatformApplicationAttributesResponse -> Bool
== :: GetPlatformApplicationAttributesResponse
-> GetPlatformApplicationAttributesResponse -> Bool
$c== :: GetPlatformApplicationAttributesResponse
-> GetPlatformApplicationAttributesResponse -> Bool
Prelude.Eq, ReadPrec [GetPlatformApplicationAttributesResponse]
ReadPrec GetPlatformApplicationAttributesResponse
Int -> ReadS GetPlatformApplicationAttributesResponse
ReadS [GetPlatformApplicationAttributesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPlatformApplicationAttributesResponse]
$creadListPrec :: ReadPrec [GetPlatformApplicationAttributesResponse]
readPrec :: ReadPrec GetPlatformApplicationAttributesResponse
$creadPrec :: ReadPrec GetPlatformApplicationAttributesResponse
readList :: ReadS [GetPlatformApplicationAttributesResponse]
$creadList :: ReadS [GetPlatformApplicationAttributesResponse]
readsPrec :: Int -> ReadS GetPlatformApplicationAttributesResponse
$creadsPrec :: Int -> ReadS GetPlatformApplicationAttributesResponse
Prelude.Read, Int -> GetPlatformApplicationAttributesResponse -> ShowS
[GetPlatformApplicationAttributesResponse] -> ShowS
GetPlatformApplicationAttributesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPlatformApplicationAttributesResponse] -> ShowS
$cshowList :: [GetPlatformApplicationAttributesResponse] -> ShowS
show :: GetPlatformApplicationAttributesResponse -> String
$cshow :: GetPlatformApplicationAttributesResponse -> String
showsPrec :: Int -> GetPlatformApplicationAttributesResponse -> ShowS
$cshowsPrec :: Int -> GetPlatformApplicationAttributesResponse -> ShowS
Prelude.Show, forall x.
Rep GetPlatformApplicationAttributesResponse x
-> GetPlatformApplicationAttributesResponse
forall x.
GetPlatformApplicationAttributesResponse
-> Rep GetPlatformApplicationAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetPlatformApplicationAttributesResponse x
-> GetPlatformApplicationAttributesResponse
$cfrom :: forall x.
GetPlatformApplicationAttributesResponse
-> Rep GetPlatformApplicationAttributesResponse x
Prelude.Generic)
newGetPlatformApplicationAttributesResponse ::
Prelude.Int ->
GetPlatformApplicationAttributesResponse
newGetPlatformApplicationAttributesResponse :: Int -> GetPlatformApplicationAttributesResponse
newGetPlatformApplicationAttributesResponse
Int
pHttpStatus_ =
GetPlatformApplicationAttributesResponse'
{ $sel:attributes:GetPlatformApplicationAttributesResponse' :: Maybe (HashMap Text Text)
attributes =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetPlatformApplicationAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getPlatformApplicationAttributesResponse_attributes :: Lens.Lens' GetPlatformApplicationAttributesResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getPlatformApplicationAttributesResponse_attributes :: Lens'
GetPlatformApplicationAttributesResponse
(Maybe (HashMap Text Text))
getPlatformApplicationAttributesResponse_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPlatformApplicationAttributesResponse' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:GetPlatformApplicationAttributesResponse' :: GetPlatformApplicationAttributesResponse
-> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: GetPlatformApplicationAttributesResponse
s@GetPlatformApplicationAttributesResponse' {} Maybe (HashMap Text Text)
a -> GetPlatformApplicationAttributesResponse
s {$sel:attributes:GetPlatformApplicationAttributesResponse' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: GetPlatformApplicationAttributesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getPlatformApplicationAttributesResponse_httpStatus :: Lens.Lens' GetPlatformApplicationAttributesResponse Prelude.Int
getPlatformApplicationAttributesResponse_httpStatus :: Lens' GetPlatformApplicationAttributesResponse Int
getPlatformApplicationAttributesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPlatformApplicationAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetPlatformApplicationAttributesResponse' :: GetPlatformApplicationAttributesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetPlatformApplicationAttributesResponse
s@GetPlatformApplicationAttributesResponse' {} Int
a -> GetPlatformApplicationAttributesResponse
s {$sel:httpStatus:GetPlatformApplicationAttributesResponse' :: Int
httpStatus = Int
a} :: GetPlatformApplicationAttributesResponse)
instance
Prelude.NFData
GetPlatformApplicationAttributesResponse
where
rnf :: GetPlatformApplicationAttributesResponse -> ()
rnf GetPlatformApplicationAttributesResponse' {Int
Maybe (HashMap Text Text)
httpStatus :: Int
attributes :: Maybe (HashMap Text Text)
$sel:httpStatus:GetPlatformApplicationAttributesResponse' :: GetPlatformApplicationAttributesResponse -> Int
$sel:attributes:GetPlatformApplicationAttributesResponse' :: GetPlatformApplicationAttributesResponse
-> Maybe (HashMap Text Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
attributes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus