{-# 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.FMS.GetAppsList
(
GetAppsList (..),
newGetAppsList,
getAppsList_defaultList,
getAppsList_listId,
GetAppsListResponse (..),
newGetAppsListResponse,
getAppsListResponse_appsList,
getAppsListResponse_appsListArn,
getAppsListResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FMS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetAppsList = GetAppsList'
{
GetAppsList -> Maybe Bool
defaultList :: Prelude.Maybe Prelude.Bool,
GetAppsList -> Text
listId :: Prelude.Text
}
deriving (GetAppsList -> GetAppsList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAppsList -> GetAppsList -> Bool
$c/= :: GetAppsList -> GetAppsList -> Bool
== :: GetAppsList -> GetAppsList -> Bool
$c== :: GetAppsList -> GetAppsList -> Bool
Prelude.Eq, ReadPrec [GetAppsList]
ReadPrec GetAppsList
Int -> ReadS GetAppsList
ReadS [GetAppsList]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAppsList]
$creadListPrec :: ReadPrec [GetAppsList]
readPrec :: ReadPrec GetAppsList
$creadPrec :: ReadPrec GetAppsList
readList :: ReadS [GetAppsList]
$creadList :: ReadS [GetAppsList]
readsPrec :: Int -> ReadS GetAppsList
$creadsPrec :: Int -> ReadS GetAppsList
Prelude.Read, Int -> GetAppsList -> ShowS
[GetAppsList] -> ShowS
GetAppsList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAppsList] -> ShowS
$cshowList :: [GetAppsList] -> ShowS
show :: GetAppsList -> String
$cshow :: GetAppsList -> String
showsPrec :: Int -> GetAppsList -> ShowS
$cshowsPrec :: Int -> GetAppsList -> ShowS
Prelude.Show, forall x. Rep GetAppsList x -> GetAppsList
forall x. GetAppsList -> Rep GetAppsList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAppsList x -> GetAppsList
$cfrom :: forall x. GetAppsList -> Rep GetAppsList x
Prelude.Generic)
newGetAppsList ::
Prelude.Text ->
GetAppsList
newGetAppsList :: Text -> GetAppsList
newGetAppsList Text
pListId_ =
GetAppsList'
{ $sel:defaultList:GetAppsList' :: Maybe Bool
defaultList = forall a. Maybe a
Prelude.Nothing,
$sel:listId:GetAppsList' :: Text
listId = Text
pListId_
}
getAppsList_defaultList :: Lens.Lens' GetAppsList (Prelude.Maybe Prelude.Bool)
getAppsList_defaultList :: Lens' GetAppsList (Maybe Bool)
getAppsList_defaultList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppsList' {Maybe Bool
defaultList :: Maybe Bool
$sel:defaultList:GetAppsList' :: GetAppsList -> Maybe Bool
defaultList} -> Maybe Bool
defaultList) (\s :: GetAppsList
s@GetAppsList' {} Maybe Bool
a -> GetAppsList
s {$sel:defaultList:GetAppsList' :: Maybe Bool
defaultList = Maybe Bool
a} :: GetAppsList)
getAppsList_listId :: Lens.Lens' GetAppsList Prelude.Text
getAppsList_listId :: Lens' GetAppsList Text
getAppsList_listId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppsList' {Text
listId :: Text
$sel:listId:GetAppsList' :: GetAppsList -> Text
listId} -> Text
listId) (\s :: GetAppsList
s@GetAppsList' {} Text
a -> GetAppsList
s {$sel:listId:GetAppsList' :: Text
listId = Text
a} :: GetAppsList)
instance Core.AWSRequest GetAppsList where
type AWSResponse GetAppsList = GetAppsListResponse
request :: (Service -> Service) -> GetAppsList -> Request GetAppsList
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetAppsList
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAppsList)))
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 ->
Maybe AppsListData -> Maybe Text -> Int -> GetAppsListResponse
GetAppsListResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AppsList")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AppsListArn")
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable GetAppsList where
hashWithSalt :: Int -> GetAppsList -> Int
hashWithSalt Int
_salt GetAppsList' {Maybe Bool
Text
listId :: Text
defaultList :: Maybe Bool
$sel:listId:GetAppsList' :: GetAppsList -> Text
$sel:defaultList:GetAppsList' :: GetAppsList -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
defaultList
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
listId
instance Prelude.NFData GetAppsList where
rnf :: GetAppsList -> ()
rnf GetAppsList' {Maybe Bool
Text
listId :: Text
defaultList :: Maybe Bool
$sel:listId:GetAppsList' :: GetAppsList -> Text
$sel:defaultList:GetAppsList' :: GetAppsList -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
defaultList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
listId
instance Data.ToHeaders GetAppsList where
toHeaders :: GetAppsList -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSFMS_20180101.GetAppsList" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetAppsList where
toJSON :: GetAppsList -> Value
toJSON GetAppsList' {Maybe Bool
Text
listId :: Text
defaultList :: Maybe Bool
$sel:listId:GetAppsList' :: GetAppsList -> Text
$sel:defaultList:GetAppsList' :: GetAppsList -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DefaultList" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
defaultList,
forall a. a -> Maybe a
Prelude.Just (Key
"ListId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
listId)
]
)
instance Data.ToPath GetAppsList where
toPath :: GetAppsList -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetAppsList where
toQuery :: GetAppsList -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetAppsListResponse = GetAppsListResponse'
{
GetAppsListResponse -> Maybe AppsListData
appsList :: Prelude.Maybe AppsListData,
GetAppsListResponse -> Maybe Text
appsListArn :: Prelude.Maybe Prelude.Text,
GetAppsListResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetAppsListResponse -> GetAppsListResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAppsListResponse -> GetAppsListResponse -> Bool
$c/= :: GetAppsListResponse -> GetAppsListResponse -> Bool
== :: GetAppsListResponse -> GetAppsListResponse -> Bool
$c== :: GetAppsListResponse -> GetAppsListResponse -> Bool
Prelude.Eq, ReadPrec [GetAppsListResponse]
ReadPrec GetAppsListResponse
Int -> ReadS GetAppsListResponse
ReadS [GetAppsListResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAppsListResponse]
$creadListPrec :: ReadPrec [GetAppsListResponse]
readPrec :: ReadPrec GetAppsListResponse
$creadPrec :: ReadPrec GetAppsListResponse
readList :: ReadS [GetAppsListResponse]
$creadList :: ReadS [GetAppsListResponse]
readsPrec :: Int -> ReadS GetAppsListResponse
$creadsPrec :: Int -> ReadS GetAppsListResponse
Prelude.Read, Int -> GetAppsListResponse -> ShowS
[GetAppsListResponse] -> ShowS
GetAppsListResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAppsListResponse] -> ShowS
$cshowList :: [GetAppsListResponse] -> ShowS
show :: GetAppsListResponse -> String
$cshow :: GetAppsListResponse -> String
showsPrec :: Int -> GetAppsListResponse -> ShowS
$cshowsPrec :: Int -> GetAppsListResponse -> ShowS
Prelude.Show, forall x. Rep GetAppsListResponse x -> GetAppsListResponse
forall x. GetAppsListResponse -> Rep GetAppsListResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAppsListResponse x -> GetAppsListResponse
$cfrom :: forall x. GetAppsListResponse -> Rep GetAppsListResponse x
Prelude.Generic)
newGetAppsListResponse ::
Prelude.Int ->
GetAppsListResponse
newGetAppsListResponse :: Int -> GetAppsListResponse
newGetAppsListResponse Int
pHttpStatus_ =
GetAppsListResponse'
{ $sel:appsList:GetAppsListResponse' :: Maybe AppsListData
appsList = forall a. Maybe a
Prelude.Nothing,
$sel:appsListArn:GetAppsListResponse' :: Maybe Text
appsListArn = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetAppsListResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getAppsListResponse_appsList :: Lens.Lens' GetAppsListResponse (Prelude.Maybe AppsListData)
getAppsListResponse_appsList :: Lens' GetAppsListResponse (Maybe AppsListData)
getAppsListResponse_appsList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppsListResponse' {Maybe AppsListData
appsList :: Maybe AppsListData
$sel:appsList:GetAppsListResponse' :: GetAppsListResponse -> Maybe AppsListData
appsList} -> Maybe AppsListData
appsList) (\s :: GetAppsListResponse
s@GetAppsListResponse' {} Maybe AppsListData
a -> GetAppsListResponse
s {$sel:appsList:GetAppsListResponse' :: Maybe AppsListData
appsList = Maybe AppsListData
a} :: GetAppsListResponse)
getAppsListResponse_appsListArn :: Lens.Lens' GetAppsListResponse (Prelude.Maybe Prelude.Text)
getAppsListResponse_appsListArn :: Lens' GetAppsListResponse (Maybe Text)
getAppsListResponse_appsListArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppsListResponse' {Maybe Text
appsListArn :: Maybe Text
$sel:appsListArn:GetAppsListResponse' :: GetAppsListResponse -> Maybe Text
appsListArn} -> Maybe Text
appsListArn) (\s :: GetAppsListResponse
s@GetAppsListResponse' {} Maybe Text
a -> GetAppsListResponse
s {$sel:appsListArn:GetAppsListResponse' :: Maybe Text
appsListArn = Maybe Text
a} :: GetAppsListResponse)
getAppsListResponse_httpStatus :: Lens.Lens' GetAppsListResponse Prelude.Int
getAppsListResponse_httpStatus :: Lens' GetAppsListResponse Int
getAppsListResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppsListResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAppsListResponse' :: GetAppsListResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAppsListResponse
s@GetAppsListResponse' {} Int
a -> GetAppsListResponse
s {$sel:httpStatus:GetAppsListResponse' :: Int
httpStatus = Int
a} :: GetAppsListResponse)
instance Prelude.NFData GetAppsListResponse where
rnf :: GetAppsListResponse -> ()
rnf GetAppsListResponse' {Int
Maybe Text
Maybe AppsListData
httpStatus :: Int
appsListArn :: Maybe Text
appsList :: Maybe AppsListData
$sel:httpStatus:GetAppsListResponse' :: GetAppsListResponse -> Int
$sel:appsListArn:GetAppsListResponse' :: GetAppsListResponse -> Maybe Text
$sel:appsList:GetAppsListResponse' :: GetAppsListResponse -> Maybe AppsListData
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AppsListData
appsList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appsListArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus