{-# 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.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 UpdateApplicationSettings = UpdateApplicationSettings'
{
UpdateApplicationSettings -> Text
applicationId :: Prelude.Text,
UpdateApplicationSettings -> WriteApplicationSettingsRequest
writeApplicationSettingsRequest :: WriteApplicationSettingsRequest
}
deriving (UpdateApplicationSettings -> UpdateApplicationSettings -> Bool
(UpdateApplicationSettings -> UpdateApplicationSettings -> Bool)
-> (UpdateApplicationSettings -> UpdateApplicationSettings -> Bool)
-> Eq UpdateApplicationSettings
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]
(Int -> ReadS UpdateApplicationSettings)
-> ReadS [UpdateApplicationSettings]
-> ReadPrec UpdateApplicationSettings
-> ReadPrec [UpdateApplicationSettings]
-> Read 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
(Int -> UpdateApplicationSettings -> ShowS)
-> (UpdateApplicationSettings -> String)
-> ([UpdateApplicationSettings] -> ShowS)
-> Show UpdateApplicationSettings
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.
UpdateApplicationSettings -> Rep UpdateApplicationSettings x)
-> (forall x.
Rep UpdateApplicationSettings x -> UpdateApplicationSettings)
-> Generic UpdateApplicationSettings
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' :: Text
-> WriteApplicationSettingsRequest -> UpdateApplicationSettings
UpdateApplicationSettings'
{ $sel:applicationId:UpdateApplicationSettings' :: Text
applicationId =
Text
pApplicationId_,
$sel:writeApplicationSettingsRequest:UpdateApplicationSettings' :: WriteApplicationSettingsRequest
writeApplicationSettingsRequest =
WriteApplicationSettingsRequest
pWriteApplicationSettingsRequest_
}
updateApplicationSettings_applicationId :: Lens.Lens' UpdateApplicationSettings Prelude.Text
updateApplicationSettings_applicationId :: (Text -> f Text)
-> UpdateApplicationSettings -> f UpdateApplicationSettings
updateApplicationSettings_applicationId = (UpdateApplicationSettings -> Text)
-> (UpdateApplicationSettings -> Text -> UpdateApplicationSettings)
-> Lens
UpdateApplicationSettings UpdateApplicationSettings Text Text
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 :: (WriteApplicationSettingsRequest
-> f WriteApplicationSettingsRequest)
-> UpdateApplicationSettings -> f UpdateApplicationSettings
updateApplicationSettings_writeApplicationSettingsRequest = (UpdateApplicationSettings -> WriteApplicationSettingsRequest)
-> (UpdateApplicationSettings
-> WriteApplicationSettingsRequest -> UpdateApplicationSettings)
-> Lens
UpdateApplicationSettings
UpdateApplicationSettings
WriteApplicationSettingsRequest
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 :: UpdateApplicationSettings -> Request UpdateApplicationSettings
request = Service
-> UpdateApplicationSettings -> Request UpdateApplicationSettings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateApplicationSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateApplicationSettings)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateApplicationSettings))
-> Logger
-> Service
-> Proxy UpdateApplicationSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateApplicationSettings)))
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
-> ApplicationSettingsResource -> UpdateApplicationSettingsResponse
UpdateApplicationSettingsResponse'
(Int
-> ApplicationSettingsResource
-> UpdateApplicationSettingsResponse)
-> Either String Int
-> Either
String
(ApplicationSettingsResource -> UpdateApplicationSettingsResponse)
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
(ApplicationSettingsResource -> UpdateApplicationSettingsResponse)
-> Either String ApplicationSettingsResource
-> Either String UpdateApplicationSettingsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String ApplicationSettingsResource
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance Prelude.Hashable UpdateApplicationSettings
instance Prelude.NFData UpdateApplicationSettings
instance Core.ToHeaders UpdateApplicationSettings where
toHeaders :: UpdateApplicationSettings -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateApplicationSettings -> 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.ToJSON UpdateApplicationSettings where
toJSON :: UpdateApplicationSettings -> Value
toJSON UpdateApplicationSettings' {Text
WriteApplicationSettingsRequest
writeApplicationSettingsRequest :: WriteApplicationSettingsRequest
applicationId :: Text
$sel:writeApplicationSettingsRequest:UpdateApplicationSettings' :: UpdateApplicationSettings -> WriteApplicationSettingsRequest
$sel:applicationId:UpdateApplicationSettings' :: UpdateApplicationSettings -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"WriteApplicationSettingsRequest"
Text -> WriteApplicationSettingsRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= WriteApplicationSettingsRequest
writeApplicationSettingsRequest
)
]
)
instance Core.ToPath UpdateApplicationSettings where
toPath :: UpdateApplicationSettings -> ByteString
toPath UpdateApplicationSettings' {Text
WriteApplicationSettingsRequest
writeApplicationSettingsRequest :: WriteApplicationSettingsRequest
applicationId :: Text
$sel:writeApplicationSettingsRequest:UpdateApplicationSettings' :: UpdateApplicationSettings -> WriteApplicationSettingsRequest
$sel:applicationId:UpdateApplicationSettings' :: UpdateApplicationSettings -> 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
"/settings"]
instance Core.ToQuery UpdateApplicationSettings where
toQuery :: UpdateApplicationSettings -> QueryString
toQuery = QueryString -> UpdateApplicationSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateApplicationSettingsResponse = UpdateApplicationSettingsResponse'
{
UpdateApplicationSettingsResponse -> Int
httpStatus :: Prelude.Int,
UpdateApplicationSettingsResponse -> ApplicationSettingsResource
applicationSettingsResource :: ApplicationSettingsResource
}
deriving (UpdateApplicationSettingsResponse
-> UpdateApplicationSettingsResponse -> Bool
(UpdateApplicationSettingsResponse
-> UpdateApplicationSettingsResponse -> Bool)
-> (UpdateApplicationSettingsResponse
-> UpdateApplicationSettingsResponse -> Bool)
-> Eq UpdateApplicationSettingsResponse
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]
(Int -> ReadS UpdateApplicationSettingsResponse)
-> ReadS [UpdateApplicationSettingsResponse]
-> ReadPrec UpdateApplicationSettingsResponse
-> ReadPrec [UpdateApplicationSettingsResponse]
-> Read 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
(Int -> UpdateApplicationSettingsResponse -> ShowS)
-> (UpdateApplicationSettingsResponse -> String)
-> ([UpdateApplicationSettingsResponse] -> ShowS)
-> Show UpdateApplicationSettingsResponse
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.
UpdateApplicationSettingsResponse
-> Rep UpdateApplicationSettingsResponse x)
-> (forall x.
Rep UpdateApplicationSettingsResponse x
-> UpdateApplicationSettingsResponse)
-> Generic UpdateApplicationSettingsResponse
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' :: Int
-> ApplicationSettingsResource -> UpdateApplicationSettingsResponse
UpdateApplicationSettingsResponse'
{ $sel:httpStatus:UpdateApplicationSettingsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:applicationSettingsResource:UpdateApplicationSettingsResponse' :: ApplicationSettingsResource
applicationSettingsResource =
ApplicationSettingsResource
pApplicationSettingsResource_
}
updateApplicationSettingsResponse_httpStatus :: Lens.Lens' UpdateApplicationSettingsResponse Prelude.Int
updateApplicationSettingsResponse_httpStatus :: (Int -> f Int)
-> UpdateApplicationSettingsResponse
-> f UpdateApplicationSettingsResponse
updateApplicationSettingsResponse_httpStatus = (UpdateApplicationSettingsResponse -> Int)
-> (UpdateApplicationSettingsResponse
-> Int -> UpdateApplicationSettingsResponse)
-> Lens
UpdateApplicationSettingsResponse
UpdateApplicationSettingsResponse
Int
Int
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 :: (ApplicationSettingsResource -> f ApplicationSettingsResource)
-> UpdateApplicationSettingsResponse
-> f UpdateApplicationSettingsResponse
updateApplicationSettingsResponse_applicationSettingsResource = (UpdateApplicationSettingsResponse -> ApplicationSettingsResource)
-> (UpdateApplicationSettingsResponse
-> ApplicationSettingsResource
-> UpdateApplicationSettingsResponse)
-> Lens
UpdateApplicationSettingsResponse
UpdateApplicationSettingsResponse
ApplicationSettingsResource
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