{-# 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.GetProtocolsList
(
GetProtocolsList (..),
newGetProtocolsList,
getProtocolsList_defaultList,
getProtocolsList_listId,
GetProtocolsListResponse (..),
newGetProtocolsListResponse,
getProtocolsListResponse_protocolsList,
getProtocolsListResponse_protocolsListArn,
getProtocolsListResponse_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 GetProtocolsList = GetProtocolsList'
{
GetProtocolsList -> Maybe Bool
defaultList :: Prelude.Maybe Prelude.Bool,
GetProtocolsList -> Text
listId :: Prelude.Text
}
deriving (GetProtocolsList -> GetProtocolsList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetProtocolsList -> GetProtocolsList -> Bool
$c/= :: GetProtocolsList -> GetProtocolsList -> Bool
== :: GetProtocolsList -> GetProtocolsList -> Bool
$c== :: GetProtocolsList -> GetProtocolsList -> Bool
Prelude.Eq, ReadPrec [GetProtocolsList]
ReadPrec GetProtocolsList
Int -> ReadS GetProtocolsList
ReadS [GetProtocolsList]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetProtocolsList]
$creadListPrec :: ReadPrec [GetProtocolsList]
readPrec :: ReadPrec GetProtocolsList
$creadPrec :: ReadPrec GetProtocolsList
readList :: ReadS [GetProtocolsList]
$creadList :: ReadS [GetProtocolsList]
readsPrec :: Int -> ReadS GetProtocolsList
$creadsPrec :: Int -> ReadS GetProtocolsList
Prelude.Read, Int -> GetProtocolsList -> ShowS
[GetProtocolsList] -> ShowS
GetProtocolsList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetProtocolsList] -> ShowS
$cshowList :: [GetProtocolsList] -> ShowS
show :: GetProtocolsList -> String
$cshow :: GetProtocolsList -> String
showsPrec :: Int -> GetProtocolsList -> ShowS
$cshowsPrec :: Int -> GetProtocolsList -> ShowS
Prelude.Show, forall x. Rep GetProtocolsList x -> GetProtocolsList
forall x. GetProtocolsList -> Rep GetProtocolsList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetProtocolsList x -> GetProtocolsList
$cfrom :: forall x. GetProtocolsList -> Rep GetProtocolsList x
Prelude.Generic)
newGetProtocolsList ::
Prelude.Text ->
GetProtocolsList
newGetProtocolsList :: Text -> GetProtocolsList
newGetProtocolsList Text
pListId_ =
GetProtocolsList'
{ $sel:defaultList:GetProtocolsList' :: Maybe Bool
defaultList = forall a. Maybe a
Prelude.Nothing,
$sel:listId:GetProtocolsList' :: Text
listId = Text
pListId_
}
getProtocolsList_defaultList :: Lens.Lens' GetProtocolsList (Prelude.Maybe Prelude.Bool)
getProtocolsList_defaultList :: Lens' GetProtocolsList (Maybe Bool)
getProtocolsList_defaultList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProtocolsList' {Maybe Bool
defaultList :: Maybe Bool
$sel:defaultList:GetProtocolsList' :: GetProtocolsList -> Maybe Bool
defaultList} -> Maybe Bool
defaultList) (\s :: GetProtocolsList
s@GetProtocolsList' {} Maybe Bool
a -> GetProtocolsList
s {$sel:defaultList:GetProtocolsList' :: Maybe Bool
defaultList = Maybe Bool
a} :: GetProtocolsList)
getProtocolsList_listId :: Lens.Lens' GetProtocolsList Prelude.Text
getProtocolsList_listId :: Lens' GetProtocolsList Text
getProtocolsList_listId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProtocolsList' {Text
listId :: Text
$sel:listId:GetProtocolsList' :: GetProtocolsList -> Text
listId} -> Text
listId) (\s :: GetProtocolsList
s@GetProtocolsList' {} Text
a -> GetProtocolsList
s {$sel:listId:GetProtocolsList' :: Text
listId = Text
a} :: GetProtocolsList)
instance Core.AWSRequest GetProtocolsList where
type
AWSResponse GetProtocolsList =
GetProtocolsListResponse
request :: (Service -> Service)
-> GetProtocolsList -> Request GetProtocolsList
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 GetProtocolsList
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetProtocolsList)))
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 ProtocolsListData
-> Maybe Text -> Int -> GetProtocolsListResponse
GetProtocolsListResponse'
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
"ProtocolsList")
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
"ProtocolsListArn")
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 GetProtocolsList where
hashWithSalt :: Int -> GetProtocolsList -> Int
hashWithSalt Int
_salt GetProtocolsList' {Maybe Bool
Text
listId :: Text
defaultList :: Maybe Bool
$sel:listId:GetProtocolsList' :: GetProtocolsList -> Text
$sel:defaultList:GetProtocolsList' :: GetProtocolsList -> 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 GetProtocolsList where
rnf :: GetProtocolsList -> ()
rnf GetProtocolsList' {Maybe Bool
Text
listId :: Text
defaultList :: Maybe Bool
$sel:listId:GetProtocolsList' :: GetProtocolsList -> Text
$sel:defaultList:GetProtocolsList' :: GetProtocolsList -> 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 GetProtocolsList where
toHeaders :: GetProtocolsList -> 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.GetProtocolsList" ::
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 GetProtocolsList where
toJSON :: GetProtocolsList -> Value
toJSON GetProtocolsList' {Maybe Bool
Text
listId :: Text
defaultList :: Maybe Bool
$sel:listId:GetProtocolsList' :: GetProtocolsList -> Text
$sel:defaultList:GetProtocolsList' :: GetProtocolsList -> 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 GetProtocolsList where
toPath :: GetProtocolsList -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetProtocolsList where
toQuery :: GetProtocolsList -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetProtocolsListResponse = GetProtocolsListResponse'
{
GetProtocolsListResponse -> Maybe ProtocolsListData
protocolsList :: Prelude.Maybe ProtocolsListData,
GetProtocolsListResponse -> Maybe Text
protocolsListArn :: Prelude.Maybe Prelude.Text,
GetProtocolsListResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetProtocolsListResponse -> GetProtocolsListResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetProtocolsListResponse -> GetProtocolsListResponse -> Bool
$c/= :: GetProtocolsListResponse -> GetProtocolsListResponse -> Bool
== :: GetProtocolsListResponse -> GetProtocolsListResponse -> Bool
$c== :: GetProtocolsListResponse -> GetProtocolsListResponse -> Bool
Prelude.Eq, ReadPrec [GetProtocolsListResponse]
ReadPrec GetProtocolsListResponse
Int -> ReadS GetProtocolsListResponse
ReadS [GetProtocolsListResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetProtocolsListResponse]
$creadListPrec :: ReadPrec [GetProtocolsListResponse]
readPrec :: ReadPrec GetProtocolsListResponse
$creadPrec :: ReadPrec GetProtocolsListResponse
readList :: ReadS [GetProtocolsListResponse]
$creadList :: ReadS [GetProtocolsListResponse]
readsPrec :: Int -> ReadS GetProtocolsListResponse
$creadsPrec :: Int -> ReadS GetProtocolsListResponse
Prelude.Read, Int -> GetProtocolsListResponse -> ShowS
[GetProtocolsListResponse] -> ShowS
GetProtocolsListResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetProtocolsListResponse] -> ShowS
$cshowList :: [GetProtocolsListResponse] -> ShowS
show :: GetProtocolsListResponse -> String
$cshow :: GetProtocolsListResponse -> String
showsPrec :: Int -> GetProtocolsListResponse -> ShowS
$cshowsPrec :: Int -> GetProtocolsListResponse -> ShowS
Prelude.Show, forall x.
Rep GetProtocolsListResponse x -> GetProtocolsListResponse
forall x.
GetProtocolsListResponse -> Rep GetProtocolsListResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetProtocolsListResponse x -> GetProtocolsListResponse
$cfrom :: forall x.
GetProtocolsListResponse -> Rep GetProtocolsListResponse x
Prelude.Generic)
newGetProtocolsListResponse ::
Prelude.Int ->
GetProtocolsListResponse
newGetProtocolsListResponse :: Int -> GetProtocolsListResponse
newGetProtocolsListResponse Int
pHttpStatus_ =
GetProtocolsListResponse'
{ $sel:protocolsList:GetProtocolsListResponse' :: Maybe ProtocolsListData
protocolsList =
forall a. Maybe a
Prelude.Nothing,
$sel:protocolsListArn:GetProtocolsListResponse' :: Maybe Text
protocolsListArn = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetProtocolsListResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getProtocolsListResponse_protocolsList :: Lens.Lens' GetProtocolsListResponse (Prelude.Maybe ProtocolsListData)
getProtocolsListResponse_protocolsList :: Lens' GetProtocolsListResponse (Maybe ProtocolsListData)
getProtocolsListResponse_protocolsList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProtocolsListResponse' {Maybe ProtocolsListData
protocolsList :: Maybe ProtocolsListData
$sel:protocolsList:GetProtocolsListResponse' :: GetProtocolsListResponse -> Maybe ProtocolsListData
protocolsList} -> Maybe ProtocolsListData
protocolsList) (\s :: GetProtocolsListResponse
s@GetProtocolsListResponse' {} Maybe ProtocolsListData
a -> GetProtocolsListResponse
s {$sel:protocolsList:GetProtocolsListResponse' :: Maybe ProtocolsListData
protocolsList = Maybe ProtocolsListData
a} :: GetProtocolsListResponse)
getProtocolsListResponse_protocolsListArn :: Lens.Lens' GetProtocolsListResponse (Prelude.Maybe Prelude.Text)
getProtocolsListResponse_protocolsListArn :: Lens' GetProtocolsListResponse (Maybe Text)
getProtocolsListResponse_protocolsListArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProtocolsListResponse' {Maybe Text
protocolsListArn :: Maybe Text
$sel:protocolsListArn:GetProtocolsListResponse' :: GetProtocolsListResponse -> Maybe Text
protocolsListArn} -> Maybe Text
protocolsListArn) (\s :: GetProtocolsListResponse
s@GetProtocolsListResponse' {} Maybe Text
a -> GetProtocolsListResponse
s {$sel:protocolsListArn:GetProtocolsListResponse' :: Maybe Text
protocolsListArn = Maybe Text
a} :: GetProtocolsListResponse)
getProtocolsListResponse_httpStatus :: Lens.Lens' GetProtocolsListResponse Prelude.Int
getProtocolsListResponse_httpStatus :: Lens' GetProtocolsListResponse Int
getProtocolsListResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProtocolsListResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetProtocolsListResponse' :: GetProtocolsListResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetProtocolsListResponse
s@GetProtocolsListResponse' {} Int
a -> GetProtocolsListResponse
s {$sel:httpStatus:GetProtocolsListResponse' :: Int
httpStatus = Int
a} :: GetProtocolsListResponse)
instance Prelude.NFData GetProtocolsListResponse where
rnf :: GetProtocolsListResponse -> ()
rnf GetProtocolsListResponse' {Int
Maybe Text
Maybe ProtocolsListData
httpStatus :: Int
protocolsListArn :: Maybe Text
protocolsList :: Maybe ProtocolsListData
$sel:httpStatus:GetProtocolsListResponse' :: GetProtocolsListResponse -> Int
$sel:protocolsListArn:GetProtocolsListResponse' :: GetProtocolsListResponse -> Maybe Text
$sel:protocolsList:GetProtocolsListResponse' :: GetProtocolsListResponse -> Maybe ProtocolsListData
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ProtocolsListData
protocolsList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
protocolsListArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus