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