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