{-# 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.GetApplicationSettings
(
GetApplicationSettings (..),
newGetApplicationSettings,
getApplicationSettings_applicationId,
GetApplicationSettingsResponse (..),
newGetApplicationSettingsResponse,
getApplicationSettingsResponse_httpStatus,
getApplicationSettingsResponse_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 GetApplicationSettings = GetApplicationSettings'
{
GetApplicationSettings -> Text
applicationId :: Prelude.Text
}
deriving (GetApplicationSettings -> GetApplicationSettings -> Bool
(GetApplicationSettings -> GetApplicationSettings -> Bool)
-> (GetApplicationSettings -> GetApplicationSettings -> Bool)
-> Eq GetApplicationSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApplicationSettings -> GetApplicationSettings -> Bool
$c/= :: GetApplicationSettings -> GetApplicationSettings -> Bool
== :: GetApplicationSettings -> GetApplicationSettings -> Bool
$c== :: GetApplicationSettings -> GetApplicationSettings -> Bool
Prelude.Eq, ReadPrec [GetApplicationSettings]
ReadPrec GetApplicationSettings
Int -> ReadS GetApplicationSettings
ReadS [GetApplicationSettings]
(Int -> ReadS GetApplicationSettings)
-> ReadS [GetApplicationSettings]
-> ReadPrec GetApplicationSettings
-> ReadPrec [GetApplicationSettings]
-> Read GetApplicationSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetApplicationSettings]
$creadListPrec :: ReadPrec [GetApplicationSettings]
readPrec :: ReadPrec GetApplicationSettings
$creadPrec :: ReadPrec GetApplicationSettings
readList :: ReadS [GetApplicationSettings]
$creadList :: ReadS [GetApplicationSettings]
readsPrec :: Int -> ReadS GetApplicationSettings
$creadsPrec :: Int -> ReadS GetApplicationSettings
Prelude.Read, Int -> GetApplicationSettings -> ShowS
[GetApplicationSettings] -> ShowS
GetApplicationSettings -> String
(Int -> GetApplicationSettings -> ShowS)
-> (GetApplicationSettings -> String)
-> ([GetApplicationSettings] -> ShowS)
-> Show GetApplicationSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApplicationSettings] -> ShowS
$cshowList :: [GetApplicationSettings] -> ShowS
show :: GetApplicationSettings -> String
$cshow :: GetApplicationSettings -> String
showsPrec :: Int -> GetApplicationSettings -> ShowS
$cshowsPrec :: Int -> GetApplicationSettings -> ShowS
Prelude.Show, (forall x. GetApplicationSettings -> Rep GetApplicationSettings x)
-> (forall x.
Rep GetApplicationSettings x -> GetApplicationSettings)
-> Generic GetApplicationSettings
forall x. Rep GetApplicationSettings x -> GetApplicationSettings
forall x. GetApplicationSettings -> Rep GetApplicationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetApplicationSettings x -> GetApplicationSettings
$cfrom :: forall x. GetApplicationSettings -> Rep GetApplicationSettings x
Prelude.Generic)
newGetApplicationSettings ::
Prelude.Text ->
GetApplicationSettings
newGetApplicationSettings :: Text -> GetApplicationSettings
newGetApplicationSettings Text
pApplicationId_ =
GetApplicationSettings' :: Text -> GetApplicationSettings
GetApplicationSettings'
{ $sel:applicationId:GetApplicationSettings' :: Text
applicationId =
Text
pApplicationId_
}
getApplicationSettings_applicationId :: Lens.Lens' GetApplicationSettings Prelude.Text
getApplicationSettings_applicationId :: (Text -> f Text)
-> GetApplicationSettings -> f GetApplicationSettings
getApplicationSettings_applicationId = (GetApplicationSettings -> Text)
-> (GetApplicationSettings -> Text -> GetApplicationSettings)
-> Lens GetApplicationSettings GetApplicationSettings Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApplicationSettings' {Text
applicationId :: Text
$sel:applicationId:GetApplicationSettings' :: GetApplicationSettings -> Text
applicationId} -> Text
applicationId) (\s :: GetApplicationSettings
s@GetApplicationSettings' {} Text
a -> GetApplicationSettings
s {$sel:applicationId:GetApplicationSettings' :: Text
applicationId = Text
a} :: GetApplicationSettings)
instance Core.AWSRequest GetApplicationSettings where
type
AWSResponse GetApplicationSettings =
GetApplicationSettingsResponse
request :: GetApplicationSettings -> Request GetApplicationSettings
request = Service -> GetApplicationSettings -> Request GetApplicationSettings
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetApplicationSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetApplicationSettings)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetApplicationSettings))
-> Logger
-> Service
-> Proxy GetApplicationSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetApplicationSettings)))
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 -> GetApplicationSettingsResponse
GetApplicationSettingsResponse'
(Int
-> ApplicationSettingsResource -> GetApplicationSettingsResponse)
-> Either String Int
-> Either
String
(ApplicationSettingsResource -> GetApplicationSettingsResponse)
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 -> GetApplicationSettingsResponse)
-> Either String ApplicationSettingsResource
-> Either String GetApplicationSettingsResponse
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 GetApplicationSettings
instance Prelude.NFData GetApplicationSettings
instance Core.ToHeaders GetApplicationSettings where
toHeaders :: GetApplicationSettings -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetApplicationSettings -> 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.ToPath GetApplicationSettings where
toPath :: GetApplicationSettings -> ByteString
toPath GetApplicationSettings' {Text
applicationId :: Text
$sel:applicationId:GetApplicationSettings' :: GetApplicationSettings -> 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 GetApplicationSettings where
toQuery :: GetApplicationSettings -> QueryString
toQuery = QueryString -> GetApplicationSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetApplicationSettingsResponse = GetApplicationSettingsResponse'
{
GetApplicationSettingsResponse -> Int
httpStatus :: Prelude.Int,
GetApplicationSettingsResponse -> ApplicationSettingsResource
applicationSettingsResource :: ApplicationSettingsResource
}
deriving (GetApplicationSettingsResponse
-> GetApplicationSettingsResponse -> Bool
(GetApplicationSettingsResponse
-> GetApplicationSettingsResponse -> Bool)
-> (GetApplicationSettingsResponse
-> GetApplicationSettingsResponse -> Bool)
-> Eq GetApplicationSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApplicationSettingsResponse
-> GetApplicationSettingsResponse -> Bool
$c/= :: GetApplicationSettingsResponse
-> GetApplicationSettingsResponse -> Bool
== :: GetApplicationSettingsResponse
-> GetApplicationSettingsResponse -> Bool
$c== :: GetApplicationSettingsResponse
-> GetApplicationSettingsResponse -> Bool
Prelude.Eq, ReadPrec [GetApplicationSettingsResponse]
ReadPrec GetApplicationSettingsResponse
Int -> ReadS GetApplicationSettingsResponse
ReadS [GetApplicationSettingsResponse]
(Int -> ReadS GetApplicationSettingsResponse)
-> ReadS [GetApplicationSettingsResponse]
-> ReadPrec GetApplicationSettingsResponse
-> ReadPrec [GetApplicationSettingsResponse]
-> Read GetApplicationSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetApplicationSettingsResponse]
$creadListPrec :: ReadPrec [GetApplicationSettingsResponse]
readPrec :: ReadPrec GetApplicationSettingsResponse
$creadPrec :: ReadPrec GetApplicationSettingsResponse
readList :: ReadS [GetApplicationSettingsResponse]
$creadList :: ReadS [GetApplicationSettingsResponse]
readsPrec :: Int -> ReadS GetApplicationSettingsResponse
$creadsPrec :: Int -> ReadS GetApplicationSettingsResponse
Prelude.Read, Int -> GetApplicationSettingsResponse -> ShowS
[GetApplicationSettingsResponse] -> ShowS
GetApplicationSettingsResponse -> String
(Int -> GetApplicationSettingsResponse -> ShowS)
-> (GetApplicationSettingsResponse -> String)
-> ([GetApplicationSettingsResponse] -> ShowS)
-> Show GetApplicationSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApplicationSettingsResponse] -> ShowS
$cshowList :: [GetApplicationSettingsResponse] -> ShowS
show :: GetApplicationSettingsResponse -> String
$cshow :: GetApplicationSettingsResponse -> String
showsPrec :: Int -> GetApplicationSettingsResponse -> ShowS
$cshowsPrec :: Int -> GetApplicationSettingsResponse -> ShowS
Prelude.Show, (forall x.
GetApplicationSettingsResponse
-> Rep GetApplicationSettingsResponse x)
-> (forall x.
Rep GetApplicationSettingsResponse x
-> GetApplicationSettingsResponse)
-> Generic GetApplicationSettingsResponse
forall x.
Rep GetApplicationSettingsResponse x
-> GetApplicationSettingsResponse
forall x.
GetApplicationSettingsResponse
-> Rep GetApplicationSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetApplicationSettingsResponse x
-> GetApplicationSettingsResponse
$cfrom :: forall x.
GetApplicationSettingsResponse
-> Rep GetApplicationSettingsResponse x
Prelude.Generic)
newGetApplicationSettingsResponse ::
Prelude.Int ->
ApplicationSettingsResource ->
GetApplicationSettingsResponse
newGetApplicationSettingsResponse :: Int
-> ApplicationSettingsResource -> GetApplicationSettingsResponse
newGetApplicationSettingsResponse
Int
pHttpStatus_
ApplicationSettingsResource
pApplicationSettingsResource_ =
GetApplicationSettingsResponse' :: Int
-> ApplicationSettingsResource -> GetApplicationSettingsResponse
GetApplicationSettingsResponse'
{ $sel:httpStatus:GetApplicationSettingsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:applicationSettingsResource:GetApplicationSettingsResponse' :: ApplicationSettingsResource
applicationSettingsResource =
ApplicationSettingsResource
pApplicationSettingsResource_
}
getApplicationSettingsResponse_httpStatus :: Lens.Lens' GetApplicationSettingsResponse Prelude.Int
getApplicationSettingsResponse_httpStatus :: (Int -> f Int)
-> GetApplicationSettingsResponse
-> f GetApplicationSettingsResponse
getApplicationSettingsResponse_httpStatus = (GetApplicationSettingsResponse -> Int)
-> (GetApplicationSettingsResponse
-> Int -> GetApplicationSettingsResponse)
-> Lens
GetApplicationSettingsResponse
GetApplicationSettingsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApplicationSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetApplicationSettingsResponse' :: GetApplicationSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetApplicationSettingsResponse
s@GetApplicationSettingsResponse' {} Int
a -> GetApplicationSettingsResponse
s {$sel:httpStatus:GetApplicationSettingsResponse' :: Int
httpStatus = Int
a} :: GetApplicationSettingsResponse)
getApplicationSettingsResponse_applicationSettingsResource :: Lens.Lens' GetApplicationSettingsResponse ApplicationSettingsResource
getApplicationSettingsResponse_applicationSettingsResource :: (ApplicationSettingsResource -> f ApplicationSettingsResource)
-> GetApplicationSettingsResponse
-> f GetApplicationSettingsResponse
getApplicationSettingsResponse_applicationSettingsResource = (GetApplicationSettingsResponse -> ApplicationSettingsResource)
-> (GetApplicationSettingsResponse
-> ApplicationSettingsResource -> GetApplicationSettingsResponse)
-> Lens
GetApplicationSettingsResponse
GetApplicationSettingsResponse
ApplicationSettingsResource
ApplicationSettingsResource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetApplicationSettingsResponse' {ApplicationSettingsResource
applicationSettingsResource :: ApplicationSettingsResource
$sel:applicationSettingsResource:GetApplicationSettingsResponse' :: GetApplicationSettingsResponse -> ApplicationSettingsResource
applicationSettingsResource} -> ApplicationSettingsResource
applicationSettingsResource) (\s :: GetApplicationSettingsResponse
s@GetApplicationSettingsResponse' {} ApplicationSettingsResource
a -> GetApplicationSettingsResponse
s {$sel:applicationSettingsResource:GetApplicationSettingsResponse' :: ApplicationSettingsResource
applicationSettingsResource = ApplicationSettingsResource
a} :: GetApplicationSettingsResponse)
instance
Prelude.NFData
GetApplicationSettingsResponse