{-# 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.UpdateGcmChannel
(
UpdateGcmChannel (..),
newUpdateGcmChannel,
updateGcmChannel_applicationId,
updateGcmChannel_gCMChannelRequest,
UpdateGcmChannelResponse (..),
newUpdateGcmChannelResponse,
updateGcmChannelResponse_httpStatus,
updateGcmChannelResponse_gCMChannelResponse,
)
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 UpdateGcmChannel = UpdateGcmChannel'
{
UpdateGcmChannel -> Text
applicationId :: Prelude.Text,
UpdateGcmChannel -> GCMChannelRequest
gCMChannelRequest :: GCMChannelRequest
}
deriving (UpdateGcmChannel -> UpdateGcmChannel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGcmChannel -> UpdateGcmChannel -> Bool
$c/= :: UpdateGcmChannel -> UpdateGcmChannel -> Bool
== :: UpdateGcmChannel -> UpdateGcmChannel -> Bool
$c== :: UpdateGcmChannel -> UpdateGcmChannel -> Bool
Prelude.Eq, ReadPrec [UpdateGcmChannel]
ReadPrec UpdateGcmChannel
Int -> ReadS UpdateGcmChannel
ReadS [UpdateGcmChannel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGcmChannel]
$creadListPrec :: ReadPrec [UpdateGcmChannel]
readPrec :: ReadPrec UpdateGcmChannel
$creadPrec :: ReadPrec UpdateGcmChannel
readList :: ReadS [UpdateGcmChannel]
$creadList :: ReadS [UpdateGcmChannel]
readsPrec :: Int -> ReadS UpdateGcmChannel
$creadsPrec :: Int -> ReadS UpdateGcmChannel
Prelude.Read, Int -> UpdateGcmChannel -> ShowS
[UpdateGcmChannel] -> ShowS
UpdateGcmChannel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGcmChannel] -> ShowS
$cshowList :: [UpdateGcmChannel] -> ShowS
show :: UpdateGcmChannel -> String
$cshow :: UpdateGcmChannel -> String
showsPrec :: Int -> UpdateGcmChannel -> ShowS
$cshowsPrec :: Int -> UpdateGcmChannel -> ShowS
Prelude.Show, forall x. Rep UpdateGcmChannel x -> UpdateGcmChannel
forall x. UpdateGcmChannel -> Rep UpdateGcmChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateGcmChannel x -> UpdateGcmChannel
$cfrom :: forall x. UpdateGcmChannel -> Rep UpdateGcmChannel x
Prelude.Generic)
newUpdateGcmChannel ::
Prelude.Text ->
GCMChannelRequest ->
UpdateGcmChannel
newUpdateGcmChannel :: Text -> GCMChannelRequest -> UpdateGcmChannel
newUpdateGcmChannel
Text
pApplicationId_
GCMChannelRequest
pGCMChannelRequest_ =
UpdateGcmChannel'
{ $sel:applicationId:UpdateGcmChannel' :: Text
applicationId = Text
pApplicationId_,
$sel:gCMChannelRequest:UpdateGcmChannel' :: GCMChannelRequest
gCMChannelRequest = GCMChannelRequest
pGCMChannelRequest_
}
updateGcmChannel_applicationId :: Lens.Lens' UpdateGcmChannel Prelude.Text
updateGcmChannel_applicationId :: Lens' UpdateGcmChannel Text
updateGcmChannel_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGcmChannel' {Text
applicationId :: Text
$sel:applicationId:UpdateGcmChannel' :: UpdateGcmChannel -> Text
applicationId} -> Text
applicationId) (\s :: UpdateGcmChannel
s@UpdateGcmChannel' {} Text
a -> UpdateGcmChannel
s {$sel:applicationId:UpdateGcmChannel' :: Text
applicationId = Text
a} :: UpdateGcmChannel)
updateGcmChannel_gCMChannelRequest :: Lens.Lens' UpdateGcmChannel GCMChannelRequest
updateGcmChannel_gCMChannelRequest :: Lens' UpdateGcmChannel GCMChannelRequest
updateGcmChannel_gCMChannelRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGcmChannel' {GCMChannelRequest
gCMChannelRequest :: GCMChannelRequest
$sel:gCMChannelRequest:UpdateGcmChannel' :: UpdateGcmChannel -> GCMChannelRequest
gCMChannelRequest} -> GCMChannelRequest
gCMChannelRequest) (\s :: UpdateGcmChannel
s@UpdateGcmChannel' {} GCMChannelRequest
a -> UpdateGcmChannel
s {$sel:gCMChannelRequest:UpdateGcmChannel' :: GCMChannelRequest
gCMChannelRequest = GCMChannelRequest
a} :: UpdateGcmChannel)
instance Core.AWSRequest UpdateGcmChannel where
type
AWSResponse UpdateGcmChannel =
UpdateGcmChannelResponse
request :: (Service -> Service)
-> UpdateGcmChannel -> Request UpdateGcmChannel
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateGcmChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateGcmChannel)))
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 -> GCMChannelResponse -> UpdateGcmChannelResponse
UpdateGcmChannelResponse'
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 UpdateGcmChannel where
hashWithSalt :: Int -> UpdateGcmChannel -> Int
hashWithSalt Int
_salt UpdateGcmChannel' {Text
GCMChannelRequest
gCMChannelRequest :: GCMChannelRequest
applicationId :: Text
$sel:gCMChannelRequest:UpdateGcmChannel' :: UpdateGcmChannel -> GCMChannelRequest
$sel:applicationId:UpdateGcmChannel' :: UpdateGcmChannel -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` GCMChannelRequest
gCMChannelRequest
instance Prelude.NFData UpdateGcmChannel where
rnf :: UpdateGcmChannel -> ()
rnf UpdateGcmChannel' {Text
GCMChannelRequest
gCMChannelRequest :: GCMChannelRequest
applicationId :: Text
$sel:gCMChannelRequest:UpdateGcmChannel' :: UpdateGcmChannel -> GCMChannelRequest
$sel:applicationId:UpdateGcmChannel' :: UpdateGcmChannel -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
applicationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf GCMChannelRequest
gCMChannelRequest
instance Data.ToHeaders UpdateGcmChannel where
toHeaders :: UpdateGcmChannel -> 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.ToJSON UpdateGcmChannel where
toJSON :: UpdateGcmChannel -> Value
toJSON UpdateGcmChannel' {Text
GCMChannelRequest
gCMChannelRequest :: GCMChannelRequest
applicationId :: Text
$sel:gCMChannelRequest:UpdateGcmChannel' :: UpdateGcmChannel -> GCMChannelRequest
$sel:applicationId:UpdateGcmChannel' :: UpdateGcmChannel -> Text
..} =
forall a. ToJSON a => a -> Value
Data.toJSON GCMChannelRequest
gCMChannelRequest
instance Data.ToPath UpdateGcmChannel where
toPath :: UpdateGcmChannel -> ByteString
toPath UpdateGcmChannel' {Text
GCMChannelRequest
gCMChannelRequest :: GCMChannelRequest
applicationId :: Text
$sel:gCMChannelRequest:UpdateGcmChannel' :: UpdateGcmChannel -> GCMChannelRequest
$sel:applicationId:UpdateGcmChannel' :: UpdateGcmChannel -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/apps/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
applicationId,
ByteString
"/channels/gcm"
]
instance Data.ToQuery UpdateGcmChannel where
toQuery :: UpdateGcmChannel -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateGcmChannelResponse = UpdateGcmChannelResponse'
{
UpdateGcmChannelResponse -> Int
httpStatus :: Prelude.Int,
UpdateGcmChannelResponse -> GCMChannelResponse
gCMChannelResponse :: GCMChannelResponse
}
deriving (UpdateGcmChannelResponse -> UpdateGcmChannelResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGcmChannelResponse -> UpdateGcmChannelResponse -> Bool
$c/= :: UpdateGcmChannelResponse -> UpdateGcmChannelResponse -> Bool
== :: UpdateGcmChannelResponse -> UpdateGcmChannelResponse -> Bool
$c== :: UpdateGcmChannelResponse -> UpdateGcmChannelResponse -> Bool
Prelude.Eq, ReadPrec [UpdateGcmChannelResponse]
ReadPrec UpdateGcmChannelResponse
Int -> ReadS UpdateGcmChannelResponse
ReadS [UpdateGcmChannelResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGcmChannelResponse]
$creadListPrec :: ReadPrec [UpdateGcmChannelResponse]
readPrec :: ReadPrec UpdateGcmChannelResponse
$creadPrec :: ReadPrec UpdateGcmChannelResponse
readList :: ReadS [UpdateGcmChannelResponse]
$creadList :: ReadS [UpdateGcmChannelResponse]
readsPrec :: Int -> ReadS UpdateGcmChannelResponse
$creadsPrec :: Int -> ReadS UpdateGcmChannelResponse
Prelude.Read, Int -> UpdateGcmChannelResponse -> ShowS
[UpdateGcmChannelResponse] -> ShowS
UpdateGcmChannelResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGcmChannelResponse] -> ShowS
$cshowList :: [UpdateGcmChannelResponse] -> ShowS
show :: UpdateGcmChannelResponse -> String
$cshow :: UpdateGcmChannelResponse -> String
showsPrec :: Int -> UpdateGcmChannelResponse -> ShowS
$cshowsPrec :: Int -> UpdateGcmChannelResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateGcmChannelResponse x -> UpdateGcmChannelResponse
forall x.
UpdateGcmChannelResponse -> Rep UpdateGcmChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateGcmChannelResponse x -> UpdateGcmChannelResponse
$cfrom :: forall x.
UpdateGcmChannelResponse -> Rep UpdateGcmChannelResponse x
Prelude.Generic)
newUpdateGcmChannelResponse ::
Prelude.Int ->
GCMChannelResponse ->
UpdateGcmChannelResponse
newUpdateGcmChannelResponse :: Int -> GCMChannelResponse -> UpdateGcmChannelResponse
newUpdateGcmChannelResponse
Int
pHttpStatus_
GCMChannelResponse
pGCMChannelResponse_ =
UpdateGcmChannelResponse'
{ $sel:httpStatus:UpdateGcmChannelResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:gCMChannelResponse:UpdateGcmChannelResponse' :: GCMChannelResponse
gCMChannelResponse = GCMChannelResponse
pGCMChannelResponse_
}
updateGcmChannelResponse_httpStatus :: Lens.Lens' UpdateGcmChannelResponse Prelude.Int
updateGcmChannelResponse_httpStatus :: Lens' UpdateGcmChannelResponse Int
updateGcmChannelResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGcmChannelResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateGcmChannelResponse' :: UpdateGcmChannelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateGcmChannelResponse
s@UpdateGcmChannelResponse' {} Int
a -> UpdateGcmChannelResponse
s {$sel:httpStatus:UpdateGcmChannelResponse' :: Int
httpStatus = Int
a} :: UpdateGcmChannelResponse)
updateGcmChannelResponse_gCMChannelResponse :: Lens.Lens' UpdateGcmChannelResponse GCMChannelResponse
updateGcmChannelResponse_gCMChannelResponse :: Lens' UpdateGcmChannelResponse GCMChannelResponse
updateGcmChannelResponse_gCMChannelResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGcmChannelResponse' {GCMChannelResponse
gCMChannelResponse :: GCMChannelResponse
$sel:gCMChannelResponse:UpdateGcmChannelResponse' :: UpdateGcmChannelResponse -> GCMChannelResponse
gCMChannelResponse} -> GCMChannelResponse
gCMChannelResponse) (\s :: UpdateGcmChannelResponse
s@UpdateGcmChannelResponse' {} GCMChannelResponse
a -> UpdateGcmChannelResponse
s {$sel:gCMChannelResponse:UpdateGcmChannelResponse' :: GCMChannelResponse
gCMChannelResponse = GCMChannelResponse
a} :: UpdateGcmChannelResponse)
instance Prelude.NFData UpdateGcmChannelResponse where
rnf :: UpdateGcmChannelResponse -> ()
rnf UpdateGcmChannelResponse' {Int
GCMChannelResponse
gCMChannelResponse :: GCMChannelResponse
httpStatus :: Int
$sel:gCMChannelResponse:UpdateGcmChannelResponse' :: UpdateGcmChannelResponse -> GCMChannelResponse
$sel:httpStatus:UpdateGcmChannelResponse' :: UpdateGcmChannelResponse -> 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 GCMChannelResponse
gCMChannelResponse