{-# 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.Pinpoint.GetApnsChannel
(
GetApnsChannel (..),
newGetApnsChannel,
getApnsChannel_applicationId,
GetApnsChannelResponse (..),
newGetApnsChannelResponse,
getApnsChannelResponse_httpStatus,
getApnsChannelResponse_aPNSChannelResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Pinpoint.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetApnsChannel = GetApnsChannel'
{
GetApnsChannel -> Text
applicationId :: Prelude.Text
}
deriving (GetApnsChannel -> GetApnsChannel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApnsChannel -> GetApnsChannel -> Bool
$c/= :: GetApnsChannel -> GetApnsChannel -> Bool
== :: GetApnsChannel -> GetApnsChannel -> Bool
$c== :: GetApnsChannel -> GetApnsChannel -> Bool
Prelude.Eq, ReadPrec [GetApnsChannel]
ReadPrec GetApnsChannel
Int -> ReadS GetApnsChannel
ReadS [GetApnsChannel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetApnsChannel]
$creadListPrec :: ReadPrec [GetApnsChannel]
readPrec :: ReadPrec GetApnsChannel
$creadPrec :: ReadPrec GetApnsChannel
readList :: ReadS [GetApnsChannel]
$creadList :: ReadS [GetApnsChannel]
readsPrec :: Int -> ReadS GetApnsChannel
$creadsPrec :: Int -> ReadS GetApnsChannel
Prelude.Read, Int -> GetApnsChannel -> ShowS
[GetApnsChannel] -> ShowS
GetApnsChannel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApnsChannel] -> ShowS
$cshowList :: [GetApnsChannel] -> ShowS
show :: GetApnsChannel -> String
$cshow :: GetApnsChannel -> String
showsPrec :: Int -> GetApnsChannel -> ShowS
$cshowsPrec :: Int -> GetApnsChannel -> ShowS
Prelude.Show, forall x. Rep GetApnsChannel x -> GetApnsChannel
forall x. GetApnsChannel -> Rep GetApnsChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetApnsChannel x -> GetApnsChannel
$cfrom :: forall x. GetApnsChannel -> Rep GetApnsChannel x
Prelude.Generic)
newGetApnsChannel ::
Prelude.Text ->
GetApnsChannel
newGetApnsChannel :: Text -> GetApnsChannel
newGetApnsChannel Text
pApplicationId_ =
GetApnsChannel' {$sel:applicationId:GetApnsChannel' :: Text
applicationId = Text
pApplicationId_}
getApnsChannel_applicationId :: Lens.Lens' GetApnsChannel Prelude.Text
getApnsChannel_applicationId :: Lens' GetApnsChannel Text
getApnsChannel_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApnsChannel' {Text
applicationId :: Text
$sel:applicationId:GetApnsChannel' :: GetApnsChannel -> Text
applicationId} -> Text
applicationId) (\s :: GetApnsChannel
s@GetApnsChannel' {} Text
a -> GetApnsChannel
s {$sel:applicationId:GetApnsChannel' :: Text
applicationId = Text
a} :: GetApnsChannel)
instance Core.AWSRequest GetApnsChannel where
type
AWSResponse GetApnsChannel =
GetApnsChannelResponse
request :: (Service -> Service) -> GetApnsChannel -> Request GetApnsChannel
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetApnsChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetApnsChannel)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> APNSChannelResponse -> GetApnsChannelResponse
GetApnsChannelResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
)
instance Prelude.Hashable GetApnsChannel where
hashWithSalt :: Int -> GetApnsChannel -> Int
hashWithSalt Int
_salt GetApnsChannel' {Text
applicationId :: Text
$sel:applicationId:GetApnsChannel' :: GetApnsChannel -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId
instance Prelude.NFData GetApnsChannel where
rnf :: GetApnsChannel -> ()
rnf GetApnsChannel' {Text
applicationId :: Text
$sel:applicationId:GetApnsChannel' :: GetApnsChannel -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
applicationId
instance Data.ToHeaders GetApnsChannel where
toHeaders :: GetApnsChannel -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath GetApnsChannel where
toPath :: GetApnsChannel -> ByteString
toPath GetApnsChannel' {Text
applicationId :: Text
$sel:applicationId:GetApnsChannel' :: GetApnsChannel -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/apps/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
applicationId,
ByteString
"/channels/apns"
]
instance Data.ToQuery GetApnsChannel where
toQuery :: GetApnsChannel -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetApnsChannelResponse = GetApnsChannelResponse'
{
GetApnsChannelResponse -> Int
httpStatus :: Prelude.Int,
GetApnsChannelResponse -> APNSChannelResponse
aPNSChannelResponse :: APNSChannelResponse
}
deriving (GetApnsChannelResponse -> GetApnsChannelResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApnsChannelResponse -> GetApnsChannelResponse -> Bool
$c/= :: GetApnsChannelResponse -> GetApnsChannelResponse -> Bool
== :: GetApnsChannelResponse -> GetApnsChannelResponse -> Bool
$c== :: GetApnsChannelResponse -> GetApnsChannelResponse -> Bool
Prelude.Eq, ReadPrec [GetApnsChannelResponse]
ReadPrec GetApnsChannelResponse
Int -> ReadS GetApnsChannelResponse
ReadS [GetApnsChannelResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetApnsChannelResponse]
$creadListPrec :: ReadPrec [GetApnsChannelResponse]
readPrec :: ReadPrec GetApnsChannelResponse
$creadPrec :: ReadPrec GetApnsChannelResponse
readList :: ReadS [GetApnsChannelResponse]
$creadList :: ReadS [GetApnsChannelResponse]
readsPrec :: Int -> ReadS GetApnsChannelResponse
$creadsPrec :: Int -> ReadS GetApnsChannelResponse
Prelude.Read, Int -> GetApnsChannelResponse -> ShowS
[GetApnsChannelResponse] -> ShowS
GetApnsChannelResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApnsChannelResponse] -> ShowS
$cshowList :: [GetApnsChannelResponse] -> ShowS
show :: GetApnsChannelResponse -> String
$cshow :: GetApnsChannelResponse -> String
showsPrec :: Int -> GetApnsChannelResponse -> ShowS
$cshowsPrec :: Int -> GetApnsChannelResponse -> ShowS
Prelude.Show, forall x. Rep GetApnsChannelResponse x -> GetApnsChannelResponse
forall x. GetApnsChannelResponse -> Rep GetApnsChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetApnsChannelResponse x -> GetApnsChannelResponse
$cfrom :: forall x. GetApnsChannelResponse -> Rep GetApnsChannelResponse x
Prelude.Generic)
newGetApnsChannelResponse ::
Prelude.Int ->
APNSChannelResponse ->
GetApnsChannelResponse
newGetApnsChannelResponse :: Int -> APNSChannelResponse -> GetApnsChannelResponse
newGetApnsChannelResponse
Int
pHttpStatus_
APNSChannelResponse
pAPNSChannelResponse_ =
GetApnsChannelResponse'
{ $sel:httpStatus:GetApnsChannelResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:aPNSChannelResponse:GetApnsChannelResponse' :: APNSChannelResponse
aPNSChannelResponse = APNSChannelResponse
pAPNSChannelResponse_
}
getApnsChannelResponse_httpStatus :: Lens.Lens' GetApnsChannelResponse Prelude.Int
getApnsChannelResponse_httpStatus :: Lens' GetApnsChannelResponse Int
getApnsChannelResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApnsChannelResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetApnsChannelResponse' :: GetApnsChannelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetApnsChannelResponse
s@GetApnsChannelResponse' {} Int
a -> GetApnsChannelResponse
s {$sel:httpStatus:GetApnsChannelResponse' :: Int
httpStatus = Int
a} :: GetApnsChannelResponse)
getApnsChannelResponse_aPNSChannelResponse :: Lens.Lens' GetApnsChannelResponse APNSChannelResponse
getApnsChannelResponse_aPNSChannelResponse :: Lens' GetApnsChannelResponse APNSChannelResponse
getApnsChannelResponse_aPNSChannelResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApnsChannelResponse' {APNSChannelResponse
aPNSChannelResponse :: APNSChannelResponse
$sel:aPNSChannelResponse:GetApnsChannelResponse' :: GetApnsChannelResponse -> APNSChannelResponse
aPNSChannelResponse} -> APNSChannelResponse
aPNSChannelResponse) (\s :: GetApnsChannelResponse
s@GetApnsChannelResponse' {} APNSChannelResponse
a -> GetApnsChannelResponse
s {$sel:aPNSChannelResponse:GetApnsChannelResponse' :: APNSChannelResponse
aPNSChannelResponse = APNSChannelResponse
a} :: GetApnsChannelResponse)
instance Prelude.NFData GetApnsChannelResponse where
rnf :: GetApnsChannelResponse -> ()
rnf GetApnsChannelResponse' {Int
APNSChannelResponse
aPNSChannelResponse :: APNSChannelResponse
httpStatus :: Int
$sel:aPNSChannelResponse:GetApnsChannelResponse' :: GetApnsChannelResponse -> APNSChannelResponse
$sel:httpStatus:GetApnsChannelResponse' :: GetApnsChannelResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf APNSChannelResponse
aPNSChannelResponse