{-# 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.IAM.ListServerCertificates
(
ListServerCertificates (..),
newListServerCertificates,
listServerCertificates_marker,
listServerCertificates_maxItems,
listServerCertificates_pathPrefix,
ListServerCertificatesResponse (..),
newListServerCertificatesResponse,
listServerCertificatesResponse_isTruncated,
listServerCertificatesResponse_marker,
listServerCertificatesResponse_httpStatus,
listServerCertificatesResponse_serverCertificateMetadataList,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListServerCertificates = ListServerCertificates'
{
ListServerCertificates -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListServerCertificates -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
ListServerCertificates -> Maybe Text
pathPrefix :: Prelude.Maybe Prelude.Text
}
deriving (ListServerCertificates -> ListServerCertificates -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServerCertificates -> ListServerCertificates -> Bool
$c/= :: ListServerCertificates -> ListServerCertificates -> Bool
== :: ListServerCertificates -> ListServerCertificates -> Bool
$c== :: ListServerCertificates -> ListServerCertificates -> Bool
Prelude.Eq, ReadPrec [ListServerCertificates]
ReadPrec ListServerCertificates
Int -> ReadS ListServerCertificates
ReadS [ListServerCertificates]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListServerCertificates]
$creadListPrec :: ReadPrec [ListServerCertificates]
readPrec :: ReadPrec ListServerCertificates
$creadPrec :: ReadPrec ListServerCertificates
readList :: ReadS [ListServerCertificates]
$creadList :: ReadS [ListServerCertificates]
readsPrec :: Int -> ReadS ListServerCertificates
$creadsPrec :: Int -> ReadS ListServerCertificates
Prelude.Read, Int -> ListServerCertificates -> ShowS
[ListServerCertificates] -> ShowS
ListServerCertificates -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServerCertificates] -> ShowS
$cshowList :: [ListServerCertificates] -> ShowS
show :: ListServerCertificates -> String
$cshow :: ListServerCertificates -> String
showsPrec :: Int -> ListServerCertificates -> ShowS
$cshowsPrec :: Int -> ListServerCertificates -> ShowS
Prelude.Show, forall x. Rep ListServerCertificates x -> ListServerCertificates
forall x. ListServerCertificates -> Rep ListServerCertificates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListServerCertificates x -> ListServerCertificates
$cfrom :: forall x. ListServerCertificates -> Rep ListServerCertificates x
Prelude.Generic)
newListServerCertificates ::
ListServerCertificates
newListServerCertificates :: ListServerCertificates
newListServerCertificates =
ListServerCertificates'
{ $sel:marker:ListServerCertificates' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListServerCertificates' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
$sel:pathPrefix:ListServerCertificates' :: Maybe Text
pathPrefix = forall a. Maybe a
Prelude.Nothing
}
listServerCertificates_marker :: Lens.Lens' ListServerCertificates (Prelude.Maybe Prelude.Text)
listServerCertificates_marker :: Lens' ListServerCertificates (Maybe Text)
listServerCertificates_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerCertificates' {Maybe Text
marker :: Maybe Text
$sel:marker:ListServerCertificates' :: ListServerCertificates -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListServerCertificates
s@ListServerCertificates' {} Maybe Text
a -> ListServerCertificates
s {$sel:marker:ListServerCertificates' :: Maybe Text
marker = Maybe Text
a} :: ListServerCertificates)
listServerCertificates_maxItems :: Lens.Lens' ListServerCertificates (Prelude.Maybe Prelude.Natural)
listServerCertificates_maxItems :: Lens' ListServerCertificates (Maybe Natural)
listServerCertificates_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerCertificates' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListServerCertificates' :: ListServerCertificates -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListServerCertificates
s@ListServerCertificates' {} Maybe Natural
a -> ListServerCertificates
s {$sel:maxItems:ListServerCertificates' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListServerCertificates)
listServerCertificates_pathPrefix :: Lens.Lens' ListServerCertificates (Prelude.Maybe Prelude.Text)
listServerCertificates_pathPrefix :: Lens' ListServerCertificates (Maybe Text)
listServerCertificates_pathPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerCertificates' {Maybe Text
pathPrefix :: Maybe Text
$sel:pathPrefix:ListServerCertificates' :: ListServerCertificates -> Maybe Text
pathPrefix} -> Maybe Text
pathPrefix) (\s :: ListServerCertificates
s@ListServerCertificates' {} Maybe Text
a -> ListServerCertificates
s {$sel:pathPrefix:ListServerCertificates' :: Maybe Text
pathPrefix = Maybe Text
a} :: ListServerCertificates)
instance Core.AWSPager ListServerCertificates where
page :: ListServerCertificates
-> AWSResponse ListServerCertificates
-> Maybe ListServerCertificates
page ListServerCertificates
rq AWSResponse ListServerCertificates
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListServerCertificates
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListServerCertificatesResponse (Maybe Bool)
listServerCertificatesResponse_isTruncated
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. Maybe a -> Bool
Prelude.isNothing
( AWSResponse ListServerCertificates
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListServerCertificatesResponse (Maybe Text)
listServerCertificatesResponse_marker
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListServerCertificates
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListServerCertificates (Maybe Text)
listServerCertificates_marker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListServerCertificates
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListServerCertificatesResponse (Maybe Text)
listServerCertificatesResponse_marker
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListServerCertificates where
type
AWSResponse ListServerCertificates =
ListServerCertificatesResponse
request :: (Service -> Service)
-> ListServerCertificates -> Request ListServerCertificates
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListServerCertificates
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListServerCertificates)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ListServerCertificatesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Bool
-> Maybe Text
-> Int
-> [ServerCertificateMetadata]
-> ListServerCertificatesResponse
ListServerCertificatesResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IsTruncated")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ServerCertificateMetadataList"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
)
)
instance Prelude.Hashable ListServerCertificates where
hashWithSalt :: Int -> ListServerCertificates -> Int
hashWithSalt Int
_salt ListServerCertificates' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListServerCertificates' :: ListServerCertificates -> Maybe Text
$sel:maxItems:ListServerCertificates' :: ListServerCertificates -> Maybe Natural
$sel:marker:ListServerCertificates' :: ListServerCertificates -> 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 Natural
maxItems
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pathPrefix
instance Prelude.NFData ListServerCertificates where
rnf :: ListServerCertificates -> ()
rnf ListServerCertificates' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListServerCertificates' :: ListServerCertificates -> Maybe Text
$sel:maxItems:ListServerCertificates' :: ListServerCertificates -> Maybe Natural
$sel:marker:ListServerCertificates' :: ListServerCertificates -> 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 Natural
maxItems
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pathPrefix
instance Data.ToHeaders ListServerCertificates where
toHeaders :: ListServerCertificates -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListServerCertificates where
toPath :: ListServerCertificates -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListServerCertificates where
toQuery :: ListServerCertificates -> QueryString
toQuery ListServerCertificates' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListServerCertificates' :: ListServerCertificates -> Maybe Text
$sel:maxItems:ListServerCertificates' :: ListServerCertificates -> Maybe Natural
$sel:marker:ListServerCertificates' :: ListServerCertificates -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListServerCertificates" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
ByteString
"MaxItems" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxItems,
ByteString
"PathPrefix" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
pathPrefix
]
data ListServerCertificatesResponse = ListServerCertificatesResponse'
{
ListServerCertificatesResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
ListServerCertificatesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListServerCertificatesResponse -> Int
httpStatus :: Prelude.Int,
ListServerCertificatesResponse -> [ServerCertificateMetadata]
serverCertificateMetadataList :: [ServerCertificateMetadata]
}
deriving (ListServerCertificatesResponse
-> ListServerCertificatesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServerCertificatesResponse
-> ListServerCertificatesResponse -> Bool
$c/= :: ListServerCertificatesResponse
-> ListServerCertificatesResponse -> Bool
== :: ListServerCertificatesResponse
-> ListServerCertificatesResponse -> Bool
$c== :: ListServerCertificatesResponse
-> ListServerCertificatesResponse -> Bool
Prelude.Eq, ReadPrec [ListServerCertificatesResponse]
ReadPrec ListServerCertificatesResponse
Int -> ReadS ListServerCertificatesResponse
ReadS [ListServerCertificatesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListServerCertificatesResponse]
$creadListPrec :: ReadPrec [ListServerCertificatesResponse]
readPrec :: ReadPrec ListServerCertificatesResponse
$creadPrec :: ReadPrec ListServerCertificatesResponse
readList :: ReadS [ListServerCertificatesResponse]
$creadList :: ReadS [ListServerCertificatesResponse]
readsPrec :: Int -> ReadS ListServerCertificatesResponse
$creadsPrec :: Int -> ReadS ListServerCertificatesResponse
Prelude.Read, Int -> ListServerCertificatesResponse -> ShowS
[ListServerCertificatesResponse] -> ShowS
ListServerCertificatesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServerCertificatesResponse] -> ShowS
$cshowList :: [ListServerCertificatesResponse] -> ShowS
show :: ListServerCertificatesResponse -> String
$cshow :: ListServerCertificatesResponse -> String
showsPrec :: Int -> ListServerCertificatesResponse -> ShowS
$cshowsPrec :: Int -> ListServerCertificatesResponse -> ShowS
Prelude.Show, forall x.
Rep ListServerCertificatesResponse x
-> ListServerCertificatesResponse
forall x.
ListServerCertificatesResponse
-> Rep ListServerCertificatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListServerCertificatesResponse x
-> ListServerCertificatesResponse
$cfrom :: forall x.
ListServerCertificatesResponse
-> Rep ListServerCertificatesResponse x
Prelude.Generic)
newListServerCertificatesResponse ::
Prelude.Int ->
ListServerCertificatesResponse
newListServerCertificatesResponse :: Int -> ListServerCertificatesResponse
newListServerCertificatesResponse Int
pHttpStatus_ =
ListServerCertificatesResponse'
{ $sel:isTruncated:ListServerCertificatesResponse' :: Maybe Bool
isTruncated =
forall a. Maybe a
Prelude.Nothing,
$sel:marker:ListServerCertificatesResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListServerCertificatesResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:serverCertificateMetadataList:ListServerCertificatesResponse' :: [ServerCertificateMetadata]
serverCertificateMetadataList =
forall a. Monoid a => a
Prelude.mempty
}
listServerCertificatesResponse_isTruncated :: Lens.Lens' ListServerCertificatesResponse (Prelude.Maybe Prelude.Bool)
listServerCertificatesResponse_isTruncated :: Lens' ListServerCertificatesResponse (Maybe Bool)
listServerCertificatesResponse_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerCertificatesResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListServerCertificatesResponse
s@ListServerCertificatesResponse' {} Maybe Bool
a -> ListServerCertificatesResponse
s {$sel:isTruncated:ListServerCertificatesResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListServerCertificatesResponse)
listServerCertificatesResponse_marker :: Lens.Lens' ListServerCertificatesResponse (Prelude.Maybe Prelude.Text)
listServerCertificatesResponse_marker :: Lens' ListServerCertificatesResponse (Maybe Text)
listServerCertificatesResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerCertificatesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListServerCertificatesResponse
s@ListServerCertificatesResponse' {} Maybe Text
a -> ListServerCertificatesResponse
s {$sel:marker:ListServerCertificatesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListServerCertificatesResponse)
listServerCertificatesResponse_httpStatus :: Lens.Lens' ListServerCertificatesResponse Prelude.Int
listServerCertificatesResponse_httpStatus :: Lens' ListServerCertificatesResponse Int
listServerCertificatesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerCertificatesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListServerCertificatesResponse
s@ListServerCertificatesResponse' {} Int
a -> ListServerCertificatesResponse
s {$sel:httpStatus:ListServerCertificatesResponse' :: Int
httpStatus = Int
a} :: ListServerCertificatesResponse)
listServerCertificatesResponse_serverCertificateMetadataList :: Lens.Lens' ListServerCertificatesResponse [ServerCertificateMetadata]
listServerCertificatesResponse_serverCertificateMetadataList :: Lens' ListServerCertificatesResponse [ServerCertificateMetadata]
listServerCertificatesResponse_serverCertificateMetadataList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerCertificatesResponse' {[ServerCertificateMetadata]
serverCertificateMetadataList :: [ServerCertificateMetadata]
$sel:serverCertificateMetadataList:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> [ServerCertificateMetadata]
serverCertificateMetadataList} -> [ServerCertificateMetadata]
serverCertificateMetadataList) (\s :: ListServerCertificatesResponse
s@ListServerCertificatesResponse' {} [ServerCertificateMetadata]
a -> ListServerCertificatesResponse
s {$sel:serverCertificateMetadataList:ListServerCertificatesResponse' :: [ServerCertificateMetadata]
serverCertificateMetadataList = [ServerCertificateMetadata]
a} :: ListServerCertificatesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
ListServerCertificatesResponse
where
rnf :: ListServerCertificatesResponse -> ()
rnf ListServerCertificatesResponse' {Int
[ServerCertificateMetadata]
Maybe Bool
Maybe Text
serverCertificateMetadataList :: [ServerCertificateMetadata]
httpStatus :: Int
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:serverCertificateMetadataList:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> [ServerCertificateMetadata]
$sel:httpStatus:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> Int
$sel:marker:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> Maybe Text
$sel:isTruncated:ListServerCertificatesResponse' :: ListServerCertificatesResponse -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isTruncated
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ServerCertificateMetadata]
serverCertificateMetadataList