{-# 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.UpdateApplicationSettings
(
UpdateApplicationSettings (..),
newUpdateApplicationSettings,
updateApplicationSettings_applicationId,
updateApplicationSettings_writeApplicationSettingsRequest,
UpdateApplicationSettingsResponse (..),
newUpdateApplicationSettingsResponse,
updateApplicationSettingsResponse_httpStatus,
updateApplicationSettingsResponse_applicationSettingsResource,
)
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 UpdateApplicationSettings = UpdateApplicationSettings'
{
UpdateApplicationSettings -> Text
applicationId :: Prelude.Text,
UpdateApplicationSettings -> WriteApplicationSettingsRequest
writeApplicationSettingsRequest :: WriteApplicationSettingsRequest
}
deriving (UpdateApplicationSettings -> UpdateApplicationSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateApplicationSettings -> UpdateApplicationSettings -> Bool
$c/= :: UpdateApplicationSettings -> UpdateApplicationSettings -> Bool
== :: UpdateApplicationSettings -> UpdateApplicationSettings -> Bool
$c== :: UpdateApplicationSettings -> UpdateApplicationSettings -> Bool
Prelude.Eq, ReadPrec [UpdateApplicationSettings]
ReadPrec UpdateApplicationSettings
Int -> ReadS UpdateApplicationSettings
ReadS [UpdateApplicationSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateApplicationSettings]
$creadListPrec :: ReadPrec [UpdateApplicationSettings]
readPrec :: ReadPrec UpdateApplicationSettings
$creadPrec :: ReadPrec UpdateApplicationSettings
readList :: ReadS [UpdateApplicationSettings]
$creadList :: ReadS [UpdateApplicationSettings]
readsPrec :: Int -> ReadS UpdateApplicationSettings
$creadsPrec :: Int -> ReadS UpdateApplicationSettings
Prelude.Read, Int -> UpdateApplicationSettings -> ShowS
[UpdateApplicationSettings] -> ShowS
UpdateApplicationSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateApplicationSettings] -> ShowS
$cshowList :: [UpdateApplicationSettings] -> ShowS
show :: UpdateApplicationSettings -> String
$cshow :: UpdateApplicationSettings -> String
showsPrec :: Int -> UpdateApplicationSettings -> ShowS
$cshowsPrec :: Int -> UpdateApplicationSettings -> ShowS
Prelude.Show, forall x.
Rep UpdateApplicationSettings x -> UpdateApplicationSettings
forall x.
UpdateApplicationSettings -> Rep UpdateApplicationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateApplicationSettings x -> UpdateApplicationSettings
$cfrom :: forall x.
UpdateApplicationSettings -> Rep UpdateApplicationSettings x
Prelude.Generic)
newUpdateApplicationSettings ::
Prelude.Text ->
WriteApplicationSettingsRequest ->
UpdateApplicationSettings
newUpdateApplicationSettings :: Text
-> WriteApplicationSettingsRequest -> UpdateApplicationSettings
newUpdateApplicationSettings
Text
pApplicationId_
WriteApplicationSettingsRequest
pWriteApplicationSettingsRequest_ =
UpdateApplicationSettings'
{ $sel:applicationId:UpdateApplicationSettings' :: Text
applicationId =
Text
pApplicationId_,
$sel:writeApplicationSettingsRequest:UpdateApplicationSettings' :: WriteApplicationSettingsRequest
writeApplicationSettingsRequest =
WriteApplicationSettingsRequest
pWriteApplicationSettingsRequest_
}
updateApplicationSettings_applicationId :: Lens.Lens' UpdateApplicationSettings Prelude.Text
updateApplicationSettings_applicationId :: Lens' UpdateApplicationSettings Text
updateApplicationSettings_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApplicationSettings' {Text
applicationId :: Text
$sel:applicationId:UpdateApplicationSettings' :: UpdateApplicationSettings -> Text
applicationId} -> Text
applicationId) (\s :: UpdateApplicationSettings
s@UpdateApplicationSettings' {} Text
a -> UpdateApplicationSettings
s {$sel:applicationId:UpdateApplicationSettings' :: Text
applicationId = Text
a} :: UpdateApplicationSettings)
updateApplicationSettings_writeApplicationSettingsRequest :: Lens.Lens' UpdateApplicationSettings WriteApplicationSettingsRequest
updateApplicationSettings_writeApplicationSettingsRequest :: Lens' UpdateApplicationSettings WriteApplicationSettingsRequest
updateApplicationSettings_writeApplicationSettingsRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApplicationSettings' {WriteApplicationSettingsRequest
writeApplicationSettingsRequest :: WriteApplicationSettingsRequest
$sel:writeApplicationSettingsRequest:UpdateApplicationSettings' :: UpdateApplicationSettings -> WriteApplicationSettingsRequest
writeApplicationSettingsRequest} -> WriteApplicationSettingsRequest
writeApplicationSettingsRequest) (\s :: UpdateApplicationSettings
s@UpdateApplicationSettings' {} WriteApplicationSettingsRequest
a -> UpdateApplicationSettings
s {$sel:writeApplicationSettingsRequest:UpdateApplicationSettings' :: WriteApplicationSettingsRequest
writeApplicationSettingsRequest = WriteApplicationSettingsRequest
a} :: UpdateApplicationSettings)
instance Core.AWSRequest UpdateApplicationSettings where
type
AWSResponse UpdateApplicationSettings =
UpdateApplicationSettingsResponse
request :: (Service -> Service)
-> UpdateApplicationSettings -> Request UpdateApplicationSettings
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 UpdateApplicationSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateApplicationSettings)))
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
-> ApplicationSettingsResource -> UpdateApplicationSettingsResponse
UpdateApplicationSettingsResponse'
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 UpdateApplicationSettings where
hashWithSalt :: Int -> UpdateApplicationSettings -> Int
hashWithSalt Int
_salt UpdateApplicationSettings' {Text
WriteApplicationSettingsRequest
writeApplicationSettingsRequest :: WriteApplicationSettingsRequest
applicationId :: Text
$sel:writeApplicationSettingsRequest:UpdateApplicationSettings' :: UpdateApplicationSettings -> WriteApplicationSettingsRequest
$sel:applicationId:UpdateApplicationSettings' :: UpdateApplicationSettings -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` WriteApplicationSettingsRequest
writeApplicationSettingsRequest
instance Prelude.NFData UpdateApplicationSettings where
rnf :: UpdateApplicationSettings -> ()
rnf UpdateApplicationSettings' {Text
WriteApplicationSettingsRequest
writeApplicationSettingsRequest :: WriteApplicationSettingsRequest
applicationId :: Text
$sel:writeApplicationSettingsRequest:UpdateApplicationSettings' :: UpdateApplicationSettings -> WriteApplicationSettingsRequest
$sel:applicationId:UpdateApplicationSettings' :: UpdateApplicationSettings -> 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 WriteApplicationSettingsRequest
writeApplicationSettingsRequest
instance Data.ToHeaders UpdateApplicationSettings where
toHeaders :: UpdateApplicationSettings -> 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 UpdateApplicationSettings where
toJSON :: UpdateApplicationSettings -> Value
toJSON UpdateApplicationSettings' {Text
WriteApplicationSettingsRequest
writeApplicationSettingsRequest :: WriteApplicationSettingsRequest
applicationId :: Text
$sel:writeApplicationSettingsRequest:UpdateApplicationSettings' :: UpdateApplicationSettings -> WriteApplicationSettingsRequest
$sel:applicationId:UpdateApplicationSettings' :: UpdateApplicationSettings -> Text
..} =
forall a. ToJSON a => a -> Value
Data.toJSON WriteApplicationSettingsRequest
writeApplicationSettingsRequest
instance Data.ToPath UpdateApplicationSettings where
toPath :: UpdateApplicationSettings -> ByteString
toPath UpdateApplicationSettings' {Text
WriteApplicationSettingsRequest
writeApplicationSettingsRequest :: WriteApplicationSettingsRequest
applicationId :: Text
$sel:writeApplicationSettingsRequest:UpdateApplicationSettings' :: UpdateApplicationSettings -> WriteApplicationSettingsRequest
$sel:applicationId:UpdateApplicationSettings' :: UpdateApplicationSettings -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/apps/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
applicationId, ByteString
"/settings"]
instance Data.ToQuery UpdateApplicationSettings where
toQuery :: UpdateApplicationSettings -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateApplicationSettingsResponse = UpdateApplicationSettingsResponse'
{
UpdateApplicationSettingsResponse -> Int
httpStatus :: Prelude.Int,
UpdateApplicationSettingsResponse -> ApplicationSettingsResource
applicationSettingsResource :: ApplicationSettingsResource
}
deriving (UpdateApplicationSettingsResponse
-> UpdateApplicationSettingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateApplicationSettingsResponse
-> UpdateApplicationSettingsResponse -> Bool
$c/= :: UpdateApplicationSettingsResponse
-> UpdateApplicationSettingsResponse -> Bool
== :: UpdateApplicationSettingsResponse
-> UpdateApplicationSettingsResponse -> Bool
$c== :: UpdateApplicationSettingsResponse
-> UpdateApplicationSettingsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateApplicationSettingsResponse]
ReadPrec UpdateApplicationSettingsResponse
Int -> ReadS UpdateApplicationSettingsResponse
ReadS [UpdateApplicationSettingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateApplicationSettingsResponse]
$creadListPrec :: ReadPrec [UpdateApplicationSettingsResponse]
readPrec :: ReadPrec UpdateApplicationSettingsResponse
$creadPrec :: ReadPrec UpdateApplicationSettingsResponse
readList :: ReadS [UpdateApplicationSettingsResponse]
$creadList :: ReadS [UpdateApplicationSettingsResponse]
readsPrec :: Int -> ReadS UpdateApplicationSettingsResponse
$creadsPrec :: Int -> ReadS UpdateApplicationSettingsResponse
Prelude.Read, Int -> UpdateApplicationSettingsResponse -> ShowS
[UpdateApplicationSettingsResponse] -> ShowS
UpdateApplicationSettingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateApplicationSettingsResponse] -> ShowS
$cshowList :: [UpdateApplicationSettingsResponse] -> ShowS
show :: UpdateApplicationSettingsResponse -> String
$cshow :: UpdateApplicationSettingsResponse -> String
showsPrec :: Int -> UpdateApplicationSettingsResponse -> ShowS
$cshowsPrec :: Int -> UpdateApplicationSettingsResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateApplicationSettingsResponse x
-> UpdateApplicationSettingsResponse
forall x.
UpdateApplicationSettingsResponse
-> Rep UpdateApplicationSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateApplicationSettingsResponse x
-> UpdateApplicationSettingsResponse
$cfrom :: forall x.
UpdateApplicationSettingsResponse
-> Rep UpdateApplicationSettingsResponse x
Prelude.Generic)
newUpdateApplicationSettingsResponse ::
Prelude.Int ->
ApplicationSettingsResource ->
UpdateApplicationSettingsResponse
newUpdateApplicationSettingsResponse :: Int
-> ApplicationSettingsResource -> UpdateApplicationSettingsResponse
newUpdateApplicationSettingsResponse
Int
pHttpStatus_
ApplicationSettingsResource
pApplicationSettingsResource_ =
UpdateApplicationSettingsResponse'
{ $sel:httpStatus:UpdateApplicationSettingsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:applicationSettingsResource:UpdateApplicationSettingsResponse' :: ApplicationSettingsResource
applicationSettingsResource =
ApplicationSettingsResource
pApplicationSettingsResource_
}
updateApplicationSettingsResponse_httpStatus :: Lens.Lens' UpdateApplicationSettingsResponse Prelude.Int
updateApplicationSettingsResponse_httpStatus :: Lens' UpdateApplicationSettingsResponse Int
updateApplicationSettingsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApplicationSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateApplicationSettingsResponse' :: UpdateApplicationSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateApplicationSettingsResponse
s@UpdateApplicationSettingsResponse' {} Int
a -> UpdateApplicationSettingsResponse
s {$sel:httpStatus:UpdateApplicationSettingsResponse' :: Int
httpStatus = Int
a} :: UpdateApplicationSettingsResponse)
updateApplicationSettingsResponse_applicationSettingsResource :: Lens.Lens' UpdateApplicationSettingsResponse ApplicationSettingsResource
updateApplicationSettingsResponse_applicationSettingsResource :: Lens' UpdateApplicationSettingsResponse ApplicationSettingsResource
updateApplicationSettingsResponse_applicationSettingsResource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApplicationSettingsResponse' {ApplicationSettingsResource
applicationSettingsResource :: ApplicationSettingsResource
$sel:applicationSettingsResource:UpdateApplicationSettingsResponse' :: UpdateApplicationSettingsResponse -> ApplicationSettingsResource
applicationSettingsResource} -> ApplicationSettingsResource
applicationSettingsResource) (\s :: UpdateApplicationSettingsResponse
s@UpdateApplicationSettingsResponse' {} ApplicationSettingsResource
a -> UpdateApplicationSettingsResponse
s {$sel:applicationSettingsResource:UpdateApplicationSettingsResponse' :: ApplicationSettingsResource
applicationSettingsResource = ApplicationSettingsResource
a} :: UpdateApplicationSettingsResponse)
instance
Prelude.NFData
UpdateApplicationSettingsResponse
where
rnf :: UpdateApplicationSettingsResponse -> ()
rnf UpdateApplicationSettingsResponse' {Int
ApplicationSettingsResource
applicationSettingsResource :: ApplicationSettingsResource
httpStatus :: Int
$sel:applicationSettingsResource:UpdateApplicationSettingsResponse' :: UpdateApplicationSettingsResponse -> ApplicationSettingsResource
$sel:httpStatus:UpdateApplicationSettingsResponse' :: UpdateApplicationSettingsResponse -> 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 ApplicationSettingsResource
applicationSettingsResource