{-# 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.CloudFront.ListKeyGroups
(
ListKeyGroups (..),
newListKeyGroups,
listKeyGroups_marker,
listKeyGroups_maxItems,
ListKeyGroupsResponse (..),
newListKeyGroupsResponse,
listKeyGroupsResponse_keyGroupList,
listKeyGroupsResponse_httpStatus,
)
where
import Amazonka.CloudFront.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListKeyGroups = ListKeyGroups'
{
ListKeyGroups -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListKeyGroups -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text
}
deriving (ListKeyGroups -> ListKeyGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListKeyGroups -> ListKeyGroups -> Bool
$c/= :: ListKeyGroups -> ListKeyGroups -> Bool
== :: ListKeyGroups -> ListKeyGroups -> Bool
$c== :: ListKeyGroups -> ListKeyGroups -> Bool
Prelude.Eq, ReadPrec [ListKeyGroups]
ReadPrec ListKeyGroups
Int -> ReadS ListKeyGroups
ReadS [ListKeyGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListKeyGroups]
$creadListPrec :: ReadPrec [ListKeyGroups]
readPrec :: ReadPrec ListKeyGroups
$creadPrec :: ReadPrec ListKeyGroups
readList :: ReadS [ListKeyGroups]
$creadList :: ReadS [ListKeyGroups]
readsPrec :: Int -> ReadS ListKeyGroups
$creadsPrec :: Int -> ReadS ListKeyGroups
Prelude.Read, Int -> ListKeyGroups -> ShowS
[ListKeyGroups] -> ShowS
ListKeyGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListKeyGroups] -> ShowS
$cshowList :: [ListKeyGroups] -> ShowS
show :: ListKeyGroups -> String
$cshow :: ListKeyGroups -> String
showsPrec :: Int -> ListKeyGroups -> ShowS
$cshowsPrec :: Int -> ListKeyGroups -> ShowS
Prelude.Show, forall x. Rep ListKeyGroups x -> ListKeyGroups
forall x. ListKeyGroups -> Rep ListKeyGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListKeyGroups x -> ListKeyGroups
$cfrom :: forall x. ListKeyGroups -> Rep ListKeyGroups x
Prelude.Generic)
newListKeyGroups ::
ListKeyGroups
newListKeyGroups :: ListKeyGroups
newListKeyGroups =
ListKeyGroups'
{ $sel:marker:ListKeyGroups' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListKeyGroups' :: Maybe Text
maxItems = forall a. Maybe a
Prelude.Nothing
}
listKeyGroups_marker :: Lens.Lens' ListKeyGroups (Prelude.Maybe Prelude.Text)
listKeyGroups_marker :: Lens' ListKeyGroups (Maybe Text)
listKeyGroups_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKeyGroups' {Maybe Text
marker :: Maybe Text
$sel:marker:ListKeyGroups' :: ListKeyGroups -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListKeyGroups
s@ListKeyGroups' {} Maybe Text
a -> ListKeyGroups
s {$sel:marker:ListKeyGroups' :: Maybe Text
marker = Maybe Text
a} :: ListKeyGroups)
listKeyGroups_maxItems :: Lens.Lens' ListKeyGroups (Prelude.Maybe Prelude.Text)
listKeyGroups_maxItems :: Lens' ListKeyGroups (Maybe Text)
listKeyGroups_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKeyGroups' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListKeyGroups' :: ListKeyGroups -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListKeyGroups
s@ListKeyGroups' {} Maybe Text
a -> ListKeyGroups
s {$sel:maxItems:ListKeyGroups' :: Maybe Text
maxItems = Maybe Text
a} :: ListKeyGroups)
instance Core.AWSRequest ListKeyGroups where
type
AWSResponse ListKeyGroups =
ListKeyGroupsResponse
request :: (Service -> Service) -> ListKeyGroups -> Request ListKeyGroups
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListKeyGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListKeyGroups)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe KeyGroupList -> Int -> ListKeyGroupsResponse
ListKeyGroupsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)
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 ListKeyGroups where
hashWithSalt :: Int -> ListKeyGroups -> Int
hashWithSalt Int
_salt ListKeyGroups' {Maybe Text
maxItems :: Maybe Text
marker :: Maybe Text
$sel:maxItems:ListKeyGroups' :: ListKeyGroups -> Maybe Text
$sel:marker:ListKeyGroups' :: ListKeyGroups -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxItems
instance Prelude.NFData ListKeyGroups where
rnf :: ListKeyGroups -> ()
rnf ListKeyGroups' {Maybe Text
maxItems :: Maybe Text
marker :: Maybe Text
$sel:maxItems:ListKeyGroups' :: ListKeyGroups -> Maybe Text
$sel:marker:ListKeyGroups' :: ListKeyGroups -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxItems
instance Data.ToHeaders ListKeyGroups where
toHeaders :: ListKeyGroups -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListKeyGroups where
toPath :: ListKeyGroups -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/2020-05-31/key-group"
instance Data.ToQuery ListKeyGroups where
toQuery :: ListKeyGroups -> QueryString
toQuery ListKeyGroups' {Maybe Text
maxItems :: Maybe Text
marker :: Maybe Text
$sel:maxItems:ListKeyGroups' :: ListKeyGroups -> Maybe Text
$sel:marker:ListKeyGroups' :: ListKeyGroups -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
ByteString
"MaxItems" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
maxItems
]
data ListKeyGroupsResponse = ListKeyGroupsResponse'
{
ListKeyGroupsResponse -> Maybe KeyGroupList
keyGroupList :: Prelude.Maybe KeyGroupList,
ListKeyGroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListKeyGroupsResponse -> ListKeyGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListKeyGroupsResponse -> ListKeyGroupsResponse -> Bool
$c/= :: ListKeyGroupsResponse -> ListKeyGroupsResponse -> Bool
== :: ListKeyGroupsResponse -> ListKeyGroupsResponse -> Bool
$c== :: ListKeyGroupsResponse -> ListKeyGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListKeyGroupsResponse]
ReadPrec ListKeyGroupsResponse
Int -> ReadS ListKeyGroupsResponse
ReadS [ListKeyGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListKeyGroupsResponse]
$creadListPrec :: ReadPrec [ListKeyGroupsResponse]
readPrec :: ReadPrec ListKeyGroupsResponse
$creadPrec :: ReadPrec ListKeyGroupsResponse
readList :: ReadS [ListKeyGroupsResponse]
$creadList :: ReadS [ListKeyGroupsResponse]
readsPrec :: Int -> ReadS ListKeyGroupsResponse
$creadsPrec :: Int -> ReadS ListKeyGroupsResponse
Prelude.Read, Int -> ListKeyGroupsResponse -> ShowS
[ListKeyGroupsResponse] -> ShowS
ListKeyGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListKeyGroupsResponse] -> ShowS
$cshowList :: [ListKeyGroupsResponse] -> ShowS
show :: ListKeyGroupsResponse -> String
$cshow :: ListKeyGroupsResponse -> String
showsPrec :: Int -> ListKeyGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListKeyGroupsResponse -> ShowS
Prelude.Show, forall x. Rep ListKeyGroupsResponse x -> ListKeyGroupsResponse
forall x. ListKeyGroupsResponse -> Rep ListKeyGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListKeyGroupsResponse x -> ListKeyGroupsResponse
$cfrom :: forall x. ListKeyGroupsResponse -> Rep ListKeyGroupsResponse x
Prelude.Generic)
newListKeyGroupsResponse ::
Prelude.Int ->
ListKeyGroupsResponse
newListKeyGroupsResponse :: Int -> ListKeyGroupsResponse
newListKeyGroupsResponse Int
pHttpStatus_ =
ListKeyGroupsResponse'
{ $sel:keyGroupList:ListKeyGroupsResponse' :: Maybe KeyGroupList
keyGroupList =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListKeyGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listKeyGroupsResponse_keyGroupList :: Lens.Lens' ListKeyGroupsResponse (Prelude.Maybe KeyGroupList)
listKeyGroupsResponse_keyGroupList :: Lens' ListKeyGroupsResponse (Maybe KeyGroupList)
listKeyGroupsResponse_keyGroupList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKeyGroupsResponse' {Maybe KeyGroupList
keyGroupList :: Maybe KeyGroupList
$sel:keyGroupList:ListKeyGroupsResponse' :: ListKeyGroupsResponse -> Maybe KeyGroupList
keyGroupList} -> Maybe KeyGroupList
keyGroupList) (\s :: ListKeyGroupsResponse
s@ListKeyGroupsResponse' {} Maybe KeyGroupList
a -> ListKeyGroupsResponse
s {$sel:keyGroupList:ListKeyGroupsResponse' :: Maybe KeyGroupList
keyGroupList = Maybe KeyGroupList
a} :: ListKeyGroupsResponse)
listKeyGroupsResponse_httpStatus :: Lens.Lens' ListKeyGroupsResponse Prelude.Int
listKeyGroupsResponse_httpStatus :: Lens' ListKeyGroupsResponse Int
listKeyGroupsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKeyGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListKeyGroupsResponse' :: ListKeyGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListKeyGroupsResponse
s@ListKeyGroupsResponse' {} Int
a -> ListKeyGroupsResponse
s {$sel:httpStatus:ListKeyGroupsResponse' :: Int
httpStatus = Int
a} :: ListKeyGroupsResponse)
instance Prelude.NFData ListKeyGroupsResponse where
rnf :: ListKeyGroupsResponse -> ()
rnf ListKeyGroupsResponse' {Int
Maybe KeyGroupList
httpStatus :: Int
keyGroupList :: Maybe KeyGroupList
$sel:httpStatus:ListKeyGroupsResponse' :: ListKeyGroupsResponse -> Int
$sel:keyGroupList:ListKeyGroupsResponse' :: ListKeyGroupsResponse -> Maybe KeyGroupList
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe KeyGroupList
keyGroupList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus