{-# 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.UpdateRecommenderConfiguration
(
UpdateRecommenderConfiguration' (..),
newUpdateRecommenderConfiguration',
updateRecommenderConfiguration'_recommenderId,
updateRecommenderConfiguration'_updateRecommenderConfiguration,
UpdateRecommenderConfigurationResponse (..),
newUpdateRecommenderConfigurationResponse,
updateRecommenderConfigurationResponse_httpStatus,
updateRecommenderConfigurationResponse_recommenderConfigurationResponse,
)
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 UpdateRecommenderConfiguration' = UpdateRecommenderConfiguration''
{
UpdateRecommenderConfiguration' -> Text
recommenderId :: Prelude.Text,
UpdateRecommenderConfiguration' -> UpdateRecommenderConfiguration
updateRecommenderConfiguration :: UpdateRecommenderConfiguration
}
deriving (UpdateRecommenderConfiguration'
-> UpdateRecommenderConfiguration' -> Bool
(UpdateRecommenderConfiguration'
-> UpdateRecommenderConfiguration' -> Bool)
-> (UpdateRecommenderConfiguration'
-> UpdateRecommenderConfiguration' -> Bool)
-> Eq UpdateRecommenderConfiguration'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRecommenderConfiguration'
-> UpdateRecommenderConfiguration' -> Bool
$c/= :: UpdateRecommenderConfiguration'
-> UpdateRecommenderConfiguration' -> Bool
== :: UpdateRecommenderConfiguration'
-> UpdateRecommenderConfiguration' -> Bool
$c== :: UpdateRecommenderConfiguration'
-> UpdateRecommenderConfiguration' -> Bool
Prelude.Eq, ReadPrec [UpdateRecommenderConfiguration']
ReadPrec UpdateRecommenderConfiguration'
Int -> ReadS UpdateRecommenderConfiguration'
ReadS [UpdateRecommenderConfiguration']
(Int -> ReadS UpdateRecommenderConfiguration')
-> ReadS [UpdateRecommenderConfiguration']
-> ReadPrec UpdateRecommenderConfiguration'
-> ReadPrec [UpdateRecommenderConfiguration']
-> Read UpdateRecommenderConfiguration'
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRecommenderConfiguration']
$creadListPrec :: ReadPrec [UpdateRecommenderConfiguration']
readPrec :: ReadPrec UpdateRecommenderConfiguration'
$creadPrec :: ReadPrec UpdateRecommenderConfiguration'
readList :: ReadS [UpdateRecommenderConfiguration']
$creadList :: ReadS [UpdateRecommenderConfiguration']
readsPrec :: Int -> ReadS UpdateRecommenderConfiguration'
$creadsPrec :: Int -> ReadS UpdateRecommenderConfiguration'
Prelude.Read, Int -> UpdateRecommenderConfiguration' -> ShowS
[UpdateRecommenderConfiguration'] -> ShowS
UpdateRecommenderConfiguration' -> String
(Int -> UpdateRecommenderConfiguration' -> ShowS)
-> (UpdateRecommenderConfiguration' -> String)
-> ([UpdateRecommenderConfiguration'] -> ShowS)
-> Show UpdateRecommenderConfiguration'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRecommenderConfiguration'] -> ShowS
$cshowList :: [UpdateRecommenderConfiguration'] -> ShowS
show :: UpdateRecommenderConfiguration' -> String
$cshow :: UpdateRecommenderConfiguration' -> String
showsPrec :: Int -> UpdateRecommenderConfiguration' -> ShowS
$cshowsPrec :: Int -> UpdateRecommenderConfiguration' -> ShowS
Prelude.Show, (forall x.
UpdateRecommenderConfiguration'
-> Rep UpdateRecommenderConfiguration' x)
-> (forall x.
Rep UpdateRecommenderConfiguration' x
-> UpdateRecommenderConfiguration')
-> Generic UpdateRecommenderConfiguration'
forall x.
Rep UpdateRecommenderConfiguration' x
-> UpdateRecommenderConfiguration'
forall x.
UpdateRecommenderConfiguration'
-> Rep UpdateRecommenderConfiguration' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRecommenderConfiguration' x
-> UpdateRecommenderConfiguration'
$cfrom :: forall x.
UpdateRecommenderConfiguration'
-> Rep UpdateRecommenderConfiguration' x
Prelude.Generic)
newUpdateRecommenderConfiguration' ::
Prelude.Text ->
UpdateRecommenderConfiguration ->
UpdateRecommenderConfiguration'
newUpdateRecommenderConfiguration' :: Text
-> UpdateRecommenderConfiguration
-> UpdateRecommenderConfiguration'
newUpdateRecommenderConfiguration'
Text
pRecommenderId_
UpdateRecommenderConfiguration
pUpdateRecommenderConfiguration_ =
UpdateRecommenderConfiguration'' :: Text
-> UpdateRecommenderConfiguration
-> UpdateRecommenderConfiguration'
UpdateRecommenderConfiguration''
{ $sel:recommenderId:UpdateRecommenderConfiguration'' :: Text
recommenderId =
Text
pRecommenderId_,
$sel:updateRecommenderConfiguration:UpdateRecommenderConfiguration'' :: UpdateRecommenderConfiguration
updateRecommenderConfiguration =
UpdateRecommenderConfiguration
pUpdateRecommenderConfiguration_
}
updateRecommenderConfiguration'_recommenderId :: Lens.Lens' UpdateRecommenderConfiguration' Prelude.Text
updateRecommenderConfiguration'_recommenderId :: (Text -> f Text)
-> UpdateRecommenderConfiguration'
-> f UpdateRecommenderConfiguration'
updateRecommenderConfiguration'_recommenderId = (UpdateRecommenderConfiguration' -> Text)
-> (UpdateRecommenderConfiguration'
-> Text -> UpdateRecommenderConfiguration')
-> Lens
UpdateRecommenderConfiguration'
UpdateRecommenderConfiguration'
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecommenderConfiguration'' {Text
recommenderId :: Text
$sel:recommenderId:UpdateRecommenderConfiguration'' :: UpdateRecommenderConfiguration' -> Text
recommenderId} -> Text
recommenderId) (\s :: UpdateRecommenderConfiguration'
s@UpdateRecommenderConfiguration'' {} Text
a -> UpdateRecommenderConfiguration'
s {$sel:recommenderId:UpdateRecommenderConfiguration'' :: Text
recommenderId = Text
a} :: UpdateRecommenderConfiguration')
updateRecommenderConfiguration'_updateRecommenderConfiguration :: Lens.Lens' UpdateRecommenderConfiguration' UpdateRecommenderConfiguration
updateRecommenderConfiguration'_updateRecommenderConfiguration :: (UpdateRecommenderConfiguration
-> f UpdateRecommenderConfiguration)
-> UpdateRecommenderConfiguration'
-> f UpdateRecommenderConfiguration'
updateRecommenderConfiguration'_updateRecommenderConfiguration = (UpdateRecommenderConfiguration' -> UpdateRecommenderConfiguration)
-> (UpdateRecommenderConfiguration'
-> UpdateRecommenderConfiguration
-> UpdateRecommenderConfiguration')
-> Lens
UpdateRecommenderConfiguration'
UpdateRecommenderConfiguration'
UpdateRecommenderConfiguration
UpdateRecommenderConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecommenderConfiguration'' {UpdateRecommenderConfiguration
updateRecommenderConfiguration :: UpdateRecommenderConfiguration
$sel:updateRecommenderConfiguration:UpdateRecommenderConfiguration'' :: UpdateRecommenderConfiguration' -> UpdateRecommenderConfiguration
updateRecommenderConfiguration} -> UpdateRecommenderConfiguration
updateRecommenderConfiguration) (\s :: UpdateRecommenderConfiguration'
s@UpdateRecommenderConfiguration'' {} UpdateRecommenderConfiguration
a -> UpdateRecommenderConfiguration'
s {$sel:updateRecommenderConfiguration:UpdateRecommenderConfiguration'' :: UpdateRecommenderConfiguration
updateRecommenderConfiguration = UpdateRecommenderConfiguration
a} :: UpdateRecommenderConfiguration')
instance
Core.AWSRequest
UpdateRecommenderConfiguration'
where
type
AWSResponse UpdateRecommenderConfiguration' =
UpdateRecommenderConfigurationResponse
request :: UpdateRecommenderConfiguration'
-> Request UpdateRecommenderConfiguration'
request = Service
-> UpdateRecommenderConfiguration'
-> Request UpdateRecommenderConfiguration'
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateRecommenderConfiguration'
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateRecommenderConfiguration')))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateRecommenderConfiguration'))
-> Logger
-> Service
-> Proxy UpdateRecommenderConfiguration'
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateRecommenderConfiguration')))
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
-> RecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse
UpdateRecommenderConfigurationResponse'
(Int
-> RecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse)
-> Either String Int
-> Either
String
(RecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse)
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
(RecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse)
-> Either String RecommenderConfigurationResponse
-> Either String UpdateRecommenderConfigurationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String RecommenderConfigurationResponse
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
)
instance
Prelude.Hashable
UpdateRecommenderConfiguration'
instance
Prelude.NFData
UpdateRecommenderConfiguration'
instance
Core.ToHeaders
UpdateRecommenderConfiguration'
where
toHeaders :: UpdateRecommenderConfiguration' -> ResponseHeaders
toHeaders =
ResponseHeaders
-> UpdateRecommenderConfiguration' -> 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 UpdateRecommenderConfiguration' where
toJSON :: UpdateRecommenderConfiguration' -> Value
toJSON UpdateRecommenderConfiguration'' {Text
UpdateRecommenderConfiguration
updateRecommenderConfiguration :: UpdateRecommenderConfiguration
recommenderId :: Text
$sel:updateRecommenderConfiguration:UpdateRecommenderConfiguration'' :: UpdateRecommenderConfiguration' -> UpdateRecommenderConfiguration
$sel:recommenderId:UpdateRecommenderConfiguration'' :: UpdateRecommenderConfiguration' -> 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
"UpdateRecommenderConfiguration"
Text -> UpdateRecommenderConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= UpdateRecommenderConfiguration
updateRecommenderConfiguration
)
]
)
instance Core.ToPath UpdateRecommenderConfiguration' where
toPath :: UpdateRecommenderConfiguration' -> ByteString
toPath UpdateRecommenderConfiguration'' {Text
UpdateRecommenderConfiguration
updateRecommenderConfiguration :: UpdateRecommenderConfiguration
recommenderId :: Text
$sel:updateRecommenderConfiguration:UpdateRecommenderConfiguration'' :: UpdateRecommenderConfiguration' -> UpdateRecommenderConfiguration
$sel:recommenderId:UpdateRecommenderConfiguration'' :: UpdateRecommenderConfiguration' -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/recommenders/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
recommenderId]
instance Core.ToQuery UpdateRecommenderConfiguration' where
toQuery :: UpdateRecommenderConfiguration' -> QueryString
toQuery = QueryString -> UpdateRecommenderConfiguration' -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateRecommenderConfigurationResponse = UpdateRecommenderConfigurationResponse'
{
UpdateRecommenderConfigurationResponse -> Int
httpStatus :: Prelude.Int,
UpdateRecommenderConfigurationResponse
-> RecommenderConfigurationResponse
recommenderConfigurationResponse :: RecommenderConfigurationResponse
}
deriving (UpdateRecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse -> Bool
(UpdateRecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse -> Bool)
-> (UpdateRecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse -> Bool)
-> Eq UpdateRecommenderConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse -> Bool
$c/= :: UpdateRecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse -> Bool
== :: UpdateRecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse -> Bool
$c== :: UpdateRecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRecommenderConfigurationResponse]
ReadPrec UpdateRecommenderConfigurationResponse
Int -> ReadS UpdateRecommenderConfigurationResponse
ReadS [UpdateRecommenderConfigurationResponse]
(Int -> ReadS UpdateRecommenderConfigurationResponse)
-> ReadS [UpdateRecommenderConfigurationResponse]
-> ReadPrec UpdateRecommenderConfigurationResponse
-> ReadPrec [UpdateRecommenderConfigurationResponse]
-> Read UpdateRecommenderConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRecommenderConfigurationResponse]
$creadListPrec :: ReadPrec [UpdateRecommenderConfigurationResponse]
readPrec :: ReadPrec UpdateRecommenderConfigurationResponse
$creadPrec :: ReadPrec UpdateRecommenderConfigurationResponse
readList :: ReadS [UpdateRecommenderConfigurationResponse]
$creadList :: ReadS [UpdateRecommenderConfigurationResponse]
readsPrec :: Int -> ReadS UpdateRecommenderConfigurationResponse
$creadsPrec :: Int -> ReadS UpdateRecommenderConfigurationResponse
Prelude.Read, Int -> UpdateRecommenderConfigurationResponse -> ShowS
[UpdateRecommenderConfigurationResponse] -> ShowS
UpdateRecommenderConfigurationResponse -> String
(Int -> UpdateRecommenderConfigurationResponse -> ShowS)
-> (UpdateRecommenderConfigurationResponse -> String)
-> ([UpdateRecommenderConfigurationResponse] -> ShowS)
-> Show UpdateRecommenderConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRecommenderConfigurationResponse] -> ShowS
$cshowList :: [UpdateRecommenderConfigurationResponse] -> ShowS
show :: UpdateRecommenderConfigurationResponse -> String
$cshow :: UpdateRecommenderConfigurationResponse -> String
showsPrec :: Int -> UpdateRecommenderConfigurationResponse -> ShowS
$cshowsPrec :: Int -> UpdateRecommenderConfigurationResponse -> ShowS
Prelude.Show, (forall x.
UpdateRecommenderConfigurationResponse
-> Rep UpdateRecommenderConfigurationResponse x)
-> (forall x.
Rep UpdateRecommenderConfigurationResponse x
-> UpdateRecommenderConfigurationResponse)
-> Generic UpdateRecommenderConfigurationResponse
forall x.
Rep UpdateRecommenderConfigurationResponse x
-> UpdateRecommenderConfigurationResponse
forall x.
UpdateRecommenderConfigurationResponse
-> Rep UpdateRecommenderConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRecommenderConfigurationResponse x
-> UpdateRecommenderConfigurationResponse
$cfrom :: forall x.
UpdateRecommenderConfigurationResponse
-> Rep UpdateRecommenderConfigurationResponse x
Prelude.Generic)
newUpdateRecommenderConfigurationResponse ::
Prelude.Int ->
RecommenderConfigurationResponse ->
UpdateRecommenderConfigurationResponse
newUpdateRecommenderConfigurationResponse :: Int
-> RecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse
newUpdateRecommenderConfigurationResponse
Int
pHttpStatus_
RecommenderConfigurationResponse
pRecommenderConfigurationResponse_ =
UpdateRecommenderConfigurationResponse' :: Int
-> RecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse
UpdateRecommenderConfigurationResponse'
{ $sel:httpStatus:UpdateRecommenderConfigurationResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:recommenderConfigurationResponse:UpdateRecommenderConfigurationResponse' :: RecommenderConfigurationResponse
recommenderConfigurationResponse =
RecommenderConfigurationResponse
pRecommenderConfigurationResponse_
}
updateRecommenderConfigurationResponse_httpStatus :: Lens.Lens' UpdateRecommenderConfigurationResponse Prelude.Int
updateRecommenderConfigurationResponse_httpStatus :: (Int -> f Int)
-> UpdateRecommenderConfigurationResponse
-> f UpdateRecommenderConfigurationResponse
updateRecommenderConfigurationResponse_httpStatus = (UpdateRecommenderConfigurationResponse -> Int)
-> (UpdateRecommenderConfigurationResponse
-> Int -> UpdateRecommenderConfigurationResponse)
-> Lens
UpdateRecommenderConfigurationResponse
UpdateRecommenderConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecommenderConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateRecommenderConfigurationResponse' :: UpdateRecommenderConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateRecommenderConfigurationResponse
s@UpdateRecommenderConfigurationResponse' {} Int
a -> UpdateRecommenderConfigurationResponse
s {$sel:httpStatus:UpdateRecommenderConfigurationResponse' :: Int
httpStatus = Int
a} :: UpdateRecommenderConfigurationResponse)
updateRecommenderConfigurationResponse_recommenderConfigurationResponse :: Lens.Lens' UpdateRecommenderConfigurationResponse RecommenderConfigurationResponse
updateRecommenderConfigurationResponse_recommenderConfigurationResponse :: (RecommenderConfigurationResponse
-> f RecommenderConfigurationResponse)
-> UpdateRecommenderConfigurationResponse
-> f UpdateRecommenderConfigurationResponse
updateRecommenderConfigurationResponse_recommenderConfigurationResponse = (UpdateRecommenderConfigurationResponse
-> RecommenderConfigurationResponse)
-> (UpdateRecommenderConfigurationResponse
-> RecommenderConfigurationResponse
-> UpdateRecommenderConfigurationResponse)
-> Lens
UpdateRecommenderConfigurationResponse
UpdateRecommenderConfigurationResponse
RecommenderConfigurationResponse
RecommenderConfigurationResponse
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecommenderConfigurationResponse' {RecommenderConfigurationResponse
recommenderConfigurationResponse :: RecommenderConfigurationResponse
$sel:recommenderConfigurationResponse:UpdateRecommenderConfigurationResponse' :: UpdateRecommenderConfigurationResponse
-> RecommenderConfigurationResponse
recommenderConfigurationResponse} -> RecommenderConfigurationResponse
recommenderConfigurationResponse) (\s :: UpdateRecommenderConfigurationResponse
s@UpdateRecommenderConfigurationResponse' {} RecommenderConfigurationResponse
a -> UpdateRecommenderConfigurationResponse
s {$sel:recommenderConfigurationResponse:UpdateRecommenderConfigurationResponse' :: RecommenderConfigurationResponse
recommenderConfigurationResponse = RecommenderConfigurationResponse
a} :: UpdateRecommenderConfigurationResponse)
instance
Prelude.NFData
UpdateRecommenderConfigurationResponse