{-# 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.GetAdmChannel
(
GetAdmChannel (..),
newGetAdmChannel,
getAdmChannel_applicationId,
GetAdmChannelResponse (..),
newGetAdmChannelResponse,
getAdmChannelResponse_httpStatus,
getAdmChannelResponse_aDMChannelResponse,
)
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 GetAdmChannel = GetAdmChannel'
{
GetAdmChannel -> Text
applicationId :: Prelude.Text
}
deriving (GetAdmChannel -> GetAdmChannel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAdmChannel -> GetAdmChannel -> Bool
$c/= :: GetAdmChannel -> GetAdmChannel -> Bool
== :: GetAdmChannel -> GetAdmChannel -> Bool
$c== :: GetAdmChannel -> GetAdmChannel -> Bool
Prelude.Eq, ReadPrec [GetAdmChannel]
ReadPrec GetAdmChannel
Int -> ReadS GetAdmChannel
ReadS [GetAdmChannel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAdmChannel]
$creadListPrec :: ReadPrec [GetAdmChannel]
readPrec :: ReadPrec GetAdmChannel
$creadPrec :: ReadPrec GetAdmChannel
readList :: ReadS [GetAdmChannel]
$creadList :: ReadS [GetAdmChannel]
readsPrec :: Int -> ReadS GetAdmChannel
$creadsPrec :: Int -> ReadS GetAdmChannel
Prelude.Read, Int -> GetAdmChannel -> ShowS
[GetAdmChannel] -> ShowS
GetAdmChannel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAdmChannel] -> ShowS
$cshowList :: [GetAdmChannel] -> ShowS
show :: GetAdmChannel -> String
$cshow :: GetAdmChannel -> String
showsPrec :: Int -> GetAdmChannel -> ShowS
$cshowsPrec :: Int -> GetAdmChannel -> ShowS
Prelude.Show, forall x. Rep GetAdmChannel x -> GetAdmChannel
forall x. GetAdmChannel -> Rep GetAdmChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAdmChannel x -> GetAdmChannel
$cfrom :: forall x. GetAdmChannel -> Rep GetAdmChannel x
Prelude.Generic)
newGetAdmChannel ::
Prelude.Text ->
GetAdmChannel
newGetAdmChannel :: Text -> GetAdmChannel
newGetAdmChannel Text
pApplicationId_ =
GetAdmChannel' {$sel:applicationId:GetAdmChannel' :: Text
applicationId = Text
pApplicationId_}
getAdmChannel_applicationId :: Lens.Lens' GetAdmChannel Prelude.Text
getAdmChannel_applicationId :: Lens' GetAdmChannel Text
getAdmChannel_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAdmChannel' {Text
applicationId :: Text
$sel:applicationId:GetAdmChannel' :: GetAdmChannel -> Text
applicationId} -> Text
applicationId) (\s :: GetAdmChannel
s@GetAdmChannel' {} Text
a -> GetAdmChannel
s {$sel:applicationId:GetAdmChannel' :: Text
applicationId = Text
a} :: GetAdmChannel)
instance Core.AWSRequest GetAdmChannel where
type
AWSResponse GetAdmChannel =
GetAdmChannelResponse
request :: (Service -> Service) -> GetAdmChannel -> Request GetAdmChannel
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 GetAdmChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAdmChannel)))
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 -> ADMChannelResponse -> GetAdmChannelResponse
GetAdmChannelResponse'
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 GetAdmChannel where
hashWithSalt :: Int -> GetAdmChannel -> Int
hashWithSalt Int
_salt GetAdmChannel' {Text
applicationId :: Text
$sel:applicationId:GetAdmChannel' :: GetAdmChannel -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId
instance Prelude.NFData GetAdmChannel where
rnf :: GetAdmChannel -> ()
rnf GetAdmChannel' {Text
applicationId :: Text
$sel:applicationId:GetAdmChannel' :: GetAdmChannel -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
applicationId
instance Data.ToHeaders GetAdmChannel where
toHeaders :: GetAdmChannel -> 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 GetAdmChannel where
toPath :: GetAdmChannel -> ByteString
toPath GetAdmChannel' {Text
applicationId :: Text
$sel:applicationId:GetAdmChannel' :: GetAdmChannel -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/apps/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
applicationId,
ByteString
"/channels/adm"
]
instance Data.ToQuery GetAdmChannel where
toQuery :: GetAdmChannel -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetAdmChannelResponse = GetAdmChannelResponse'
{
GetAdmChannelResponse -> Int
httpStatus :: Prelude.Int,
GetAdmChannelResponse -> ADMChannelResponse
aDMChannelResponse :: ADMChannelResponse
}
deriving (GetAdmChannelResponse -> GetAdmChannelResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAdmChannelResponse -> GetAdmChannelResponse -> Bool
$c/= :: GetAdmChannelResponse -> GetAdmChannelResponse -> Bool
== :: GetAdmChannelResponse -> GetAdmChannelResponse -> Bool
$c== :: GetAdmChannelResponse -> GetAdmChannelResponse -> Bool
Prelude.Eq, ReadPrec [GetAdmChannelResponse]
ReadPrec GetAdmChannelResponse
Int -> ReadS GetAdmChannelResponse
ReadS [GetAdmChannelResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAdmChannelResponse]
$creadListPrec :: ReadPrec [GetAdmChannelResponse]
readPrec :: ReadPrec GetAdmChannelResponse
$creadPrec :: ReadPrec GetAdmChannelResponse
readList :: ReadS [GetAdmChannelResponse]
$creadList :: ReadS [GetAdmChannelResponse]
readsPrec :: Int -> ReadS GetAdmChannelResponse
$creadsPrec :: Int -> ReadS GetAdmChannelResponse
Prelude.Read, Int -> GetAdmChannelResponse -> ShowS
[GetAdmChannelResponse] -> ShowS
GetAdmChannelResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAdmChannelResponse] -> ShowS
$cshowList :: [GetAdmChannelResponse] -> ShowS
show :: GetAdmChannelResponse -> String
$cshow :: GetAdmChannelResponse -> String
showsPrec :: Int -> GetAdmChannelResponse -> ShowS
$cshowsPrec :: Int -> GetAdmChannelResponse -> ShowS
Prelude.Show, forall x. Rep GetAdmChannelResponse x -> GetAdmChannelResponse
forall x. GetAdmChannelResponse -> Rep GetAdmChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAdmChannelResponse x -> GetAdmChannelResponse
$cfrom :: forall x. GetAdmChannelResponse -> Rep GetAdmChannelResponse x
Prelude.Generic)
newGetAdmChannelResponse ::
Prelude.Int ->
ADMChannelResponse ->
GetAdmChannelResponse
newGetAdmChannelResponse :: Int -> ADMChannelResponse -> GetAdmChannelResponse
newGetAdmChannelResponse
Int
pHttpStatus_
ADMChannelResponse
pADMChannelResponse_ =
GetAdmChannelResponse'
{ $sel:httpStatus:GetAdmChannelResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:aDMChannelResponse:GetAdmChannelResponse' :: ADMChannelResponse
aDMChannelResponse = ADMChannelResponse
pADMChannelResponse_
}
getAdmChannelResponse_httpStatus :: Lens.Lens' GetAdmChannelResponse Prelude.Int
getAdmChannelResponse_httpStatus :: Lens' GetAdmChannelResponse Int
getAdmChannelResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAdmChannelResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAdmChannelResponse' :: GetAdmChannelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAdmChannelResponse
s@GetAdmChannelResponse' {} Int
a -> GetAdmChannelResponse
s {$sel:httpStatus:GetAdmChannelResponse' :: Int
httpStatus = Int
a} :: GetAdmChannelResponse)
getAdmChannelResponse_aDMChannelResponse :: Lens.Lens' GetAdmChannelResponse ADMChannelResponse
getAdmChannelResponse_aDMChannelResponse :: Lens' GetAdmChannelResponse ADMChannelResponse
getAdmChannelResponse_aDMChannelResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAdmChannelResponse' {ADMChannelResponse
aDMChannelResponse :: ADMChannelResponse
$sel:aDMChannelResponse:GetAdmChannelResponse' :: GetAdmChannelResponse -> ADMChannelResponse
aDMChannelResponse} -> ADMChannelResponse
aDMChannelResponse) (\s :: GetAdmChannelResponse
s@GetAdmChannelResponse' {} ADMChannelResponse
a -> GetAdmChannelResponse
s {$sel:aDMChannelResponse:GetAdmChannelResponse' :: ADMChannelResponse
aDMChannelResponse = ADMChannelResponse
a} :: GetAdmChannelResponse)
instance Prelude.NFData GetAdmChannelResponse where
rnf :: GetAdmChannelResponse -> ()
rnf GetAdmChannelResponse' {Int
ADMChannelResponse
aDMChannelResponse :: ADMChannelResponse
httpStatus :: Int
$sel:aDMChannelResponse:GetAdmChannelResponse' :: GetAdmChannelResponse -> ADMChannelResponse
$sel:httpStatus:GetAdmChannelResponse' :: GetAdmChannelResponse -> 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 ADMChannelResponse
aDMChannelResponse