{-# 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.IoT.ListAuthorizers
(
ListAuthorizers (..),
newListAuthorizers,
listAuthorizers_ascendingOrder,
listAuthorizers_marker,
listAuthorizers_pageSize,
listAuthorizers_status,
ListAuthorizersResponse (..),
newListAuthorizersResponse,
listAuthorizersResponse_authorizers,
listAuthorizersResponse_nextMarker,
listAuthorizersResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListAuthorizers = ListAuthorizers'
{
ListAuthorizers -> Maybe Bool
ascendingOrder :: Prelude.Maybe Prelude.Bool,
ListAuthorizers -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListAuthorizers -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
ListAuthorizers -> Maybe AuthorizerStatus
status :: Prelude.Maybe AuthorizerStatus
}
deriving (ListAuthorizers -> ListAuthorizers -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAuthorizers -> ListAuthorizers -> Bool
$c/= :: ListAuthorizers -> ListAuthorizers -> Bool
== :: ListAuthorizers -> ListAuthorizers -> Bool
$c== :: ListAuthorizers -> ListAuthorizers -> Bool
Prelude.Eq, ReadPrec [ListAuthorizers]
ReadPrec ListAuthorizers
Int -> ReadS ListAuthorizers
ReadS [ListAuthorizers]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAuthorizers]
$creadListPrec :: ReadPrec [ListAuthorizers]
readPrec :: ReadPrec ListAuthorizers
$creadPrec :: ReadPrec ListAuthorizers
readList :: ReadS [ListAuthorizers]
$creadList :: ReadS [ListAuthorizers]
readsPrec :: Int -> ReadS ListAuthorizers
$creadsPrec :: Int -> ReadS ListAuthorizers
Prelude.Read, Int -> ListAuthorizers -> ShowS
[ListAuthorizers] -> ShowS
ListAuthorizers -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAuthorizers] -> ShowS
$cshowList :: [ListAuthorizers] -> ShowS
show :: ListAuthorizers -> String
$cshow :: ListAuthorizers -> String
showsPrec :: Int -> ListAuthorizers -> ShowS
$cshowsPrec :: Int -> ListAuthorizers -> ShowS
Prelude.Show, forall x. Rep ListAuthorizers x -> ListAuthorizers
forall x. ListAuthorizers -> Rep ListAuthorizers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAuthorizers x -> ListAuthorizers
$cfrom :: forall x. ListAuthorizers -> Rep ListAuthorizers x
Prelude.Generic)
newListAuthorizers ::
ListAuthorizers
newListAuthorizers :: ListAuthorizers
newListAuthorizers =
ListAuthorizers'
{ $sel:ascendingOrder:ListAuthorizers' :: Maybe Bool
ascendingOrder = forall a. Maybe a
Prelude.Nothing,
$sel:marker:ListAuthorizers' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:ListAuthorizers' :: Maybe Natural
pageSize = forall a. Maybe a
Prelude.Nothing,
$sel:status:ListAuthorizers' :: Maybe AuthorizerStatus
status = forall a. Maybe a
Prelude.Nothing
}
listAuthorizers_ascendingOrder :: Lens.Lens' ListAuthorizers (Prelude.Maybe Prelude.Bool)
listAuthorizers_ascendingOrder :: Lens' ListAuthorizers (Maybe Bool)
listAuthorizers_ascendingOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuthorizers' {Maybe Bool
ascendingOrder :: Maybe Bool
$sel:ascendingOrder:ListAuthorizers' :: ListAuthorizers -> Maybe Bool
ascendingOrder} -> Maybe Bool
ascendingOrder) (\s :: ListAuthorizers
s@ListAuthorizers' {} Maybe Bool
a -> ListAuthorizers
s {$sel:ascendingOrder:ListAuthorizers' :: Maybe Bool
ascendingOrder = Maybe Bool
a} :: ListAuthorizers)
listAuthorizers_marker :: Lens.Lens' ListAuthorizers (Prelude.Maybe Prelude.Text)
listAuthorizers_marker :: Lens' ListAuthorizers (Maybe Text)
listAuthorizers_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuthorizers' {Maybe Text
marker :: Maybe Text
$sel:marker:ListAuthorizers' :: ListAuthorizers -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListAuthorizers
s@ListAuthorizers' {} Maybe Text
a -> ListAuthorizers
s {$sel:marker:ListAuthorizers' :: Maybe Text
marker = Maybe Text
a} :: ListAuthorizers)
listAuthorizers_pageSize :: Lens.Lens' ListAuthorizers (Prelude.Maybe Prelude.Natural)
listAuthorizers_pageSize :: Lens' ListAuthorizers (Maybe Natural)
listAuthorizers_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuthorizers' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:ListAuthorizers' :: ListAuthorizers -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: ListAuthorizers
s@ListAuthorizers' {} Maybe Natural
a -> ListAuthorizers
s {$sel:pageSize:ListAuthorizers' :: Maybe Natural
pageSize = Maybe Natural
a} :: ListAuthorizers)
listAuthorizers_status :: Lens.Lens' ListAuthorizers (Prelude.Maybe AuthorizerStatus)
listAuthorizers_status :: Lens' ListAuthorizers (Maybe AuthorizerStatus)
listAuthorizers_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuthorizers' {Maybe AuthorizerStatus
status :: Maybe AuthorizerStatus
$sel:status:ListAuthorizers' :: ListAuthorizers -> Maybe AuthorizerStatus
status} -> Maybe AuthorizerStatus
status) (\s :: ListAuthorizers
s@ListAuthorizers' {} Maybe AuthorizerStatus
a -> ListAuthorizers
s {$sel:status:ListAuthorizers' :: Maybe AuthorizerStatus
status = Maybe AuthorizerStatus
a} :: ListAuthorizers)
instance Core.AWSPager ListAuthorizers where
page :: ListAuthorizers
-> AWSResponse ListAuthorizers -> Maybe ListAuthorizers
page ListAuthorizers
rq AWSResponse ListAuthorizers
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAuthorizers
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAuthorizersResponse (Maybe Text)
listAuthorizersResponse_nextMarker
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. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAuthorizers
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAuthorizersResponse (Maybe [AuthorizerSummary])
listAuthorizersResponse_authorizers
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.$ ListAuthorizers
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAuthorizers (Maybe Text)
listAuthorizers_marker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAuthorizers
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAuthorizersResponse (Maybe Text)
listAuthorizersResponse_nextMarker
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 ListAuthorizers where
type
AWSResponse ListAuthorizers =
ListAuthorizersResponse
request :: (Service -> Service) -> ListAuthorizers -> Request ListAuthorizers
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 ListAuthorizers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAuthorizers)))
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 [AuthorizerSummary]
-> Maybe Text -> Int -> ListAuthorizersResponse
ListAuthorizersResponse'
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
"authorizers" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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
"nextMarker")
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 ListAuthorizers where
hashWithSalt :: Int -> ListAuthorizers -> Int
hashWithSalt Int
_salt ListAuthorizers' {Maybe Bool
Maybe Natural
Maybe Text
Maybe AuthorizerStatus
status :: Maybe AuthorizerStatus
pageSize :: Maybe Natural
marker :: Maybe Text
ascendingOrder :: Maybe Bool
$sel:status:ListAuthorizers' :: ListAuthorizers -> Maybe AuthorizerStatus
$sel:pageSize:ListAuthorizers' :: ListAuthorizers -> Maybe Natural
$sel:marker:ListAuthorizers' :: ListAuthorizers -> Maybe Text
$sel:ascendingOrder:ListAuthorizers' :: ListAuthorizers -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
ascendingOrder
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pageSize
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AuthorizerStatus
status
instance Prelude.NFData ListAuthorizers where
rnf :: ListAuthorizers -> ()
rnf ListAuthorizers' {Maybe Bool
Maybe Natural
Maybe Text
Maybe AuthorizerStatus
status :: Maybe AuthorizerStatus
pageSize :: Maybe Natural
marker :: Maybe Text
ascendingOrder :: Maybe Bool
$sel:status:ListAuthorizers' :: ListAuthorizers -> Maybe AuthorizerStatus
$sel:pageSize:ListAuthorizers' :: ListAuthorizers -> Maybe Natural
$sel:marker:ListAuthorizers' :: ListAuthorizers -> Maybe Text
$sel:ascendingOrder:ListAuthorizers' :: ListAuthorizers -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
ascendingOrder
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 Maybe Natural
pageSize
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthorizerStatus
status
instance Data.ToHeaders ListAuthorizers where
toHeaders :: ListAuthorizers -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListAuthorizers where
toPath :: ListAuthorizers -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/authorizers/"
instance Data.ToQuery ListAuthorizers where
toQuery :: ListAuthorizers -> QueryString
toQuery ListAuthorizers' {Maybe Bool
Maybe Natural
Maybe Text
Maybe AuthorizerStatus
status :: Maybe AuthorizerStatus
pageSize :: Maybe Natural
marker :: Maybe Text
ascendingOrder :: Maybe Bool
$sel:status:ListAuthorizers' :: ListAuthorizers -> Maybe AuthorizerStatus
$sel:pageSize:ListAuthorizers' :: ListAuthorizers -> Maybe Natural
$sel:marker:ListAuthorizers' :: ListAuthorizers -> Maybe Text
$sel:ascendingOrder:ListAuthorizers' :: ListAuthorizers -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"isAscendingOrder" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
ascendingOrder,
ByteString
"marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
ByteString
"pageSize" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
pageSize,
ByteString
"status" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe AuthorizerStatus
status
]
data ListAuthorizersResponse = ListAuthorizersResponse'
{
ListAuthorizersResponse -> Maybe [AuthorizerSummary]
authorizers :: Prelude.Maybe [AuthorizerSummary],
ListAuthorizersResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListAuthorizersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAuthorizersResponse -> ListAuthorizersResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAuthorizersResponse -> ListAuthorizersResponse -> Bool
$c/= :: ListAuthorizersResponse -> ListAuthorizersResponse -> Bool
== :: ListAuthorizersResponse -> ListAuthorizersResponse -> Bool
$c== :: ListAuthorizersResponse -> ListAuthorizersResponse -> Bool
Prelude.Eq, ReadPrec [ListAuthorizersResponse]
ReadPrec ListAuthorizersResponse
Int -> ReadS ListAuthorizersResponse
ReadS [ListAuthorizersResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAuthorizersResponse]
$creadListPrec :: ReadPrec [ListAuthorizersResponse]
readPrec :: ReadPrec ListAuthorizersResponse
$creadPrec :: ReadPrec ListAuthorizersResponse
readList :: ReadS [ListAuthorizersResponse]
$creadList :: ReadS [ListAuthorizersResponse]
readsPrec :: Int -> ReadS ListAuthorizersResponse
$creadsPrec :: Int -> ReadS ListAuthorizersResponse
Prelude.Read, Int -> ListAuthorizersResponse -> ShowS
[ListAuthorizersResponse] -> ShowS
ListAuthorizersResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAuthorizersResponse] -> ShowS
$cshowList :: [ListAuthorizersResponse] -> ShowS
show :: ListAuthorizersResponse -> String
$cshow :: ListAuthorizersResponse -> String
showsPrec :: Int -> ListAuthorizersResponse -> ShowS
$cshowsPrec :: Int -> ListAuthorizersResponse -> ShowS
Prelude.Show, forall x. Rep ListAuthorizersResponse x -> ListAuthorizersResponse
forall x. ListAuthorizersResponse -> Rep ListAuthorizersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAuthorizersResponse x -> ListAuthorizersResponse
$cfrom :: forall x. ListAuthorizersResponse -> Rep ListAuthorizersResponse x
Prelude.Generic)
newListAuthorizersResponse ::
Prelude.Int ->
ListAuthorizersResponse
newListAuthorizersResponse :: Int -> ListAuthorizersResponse
newListAuthorizersResponse Int
pHttpStatus_ =
ListAuthorizersResponse'
{ $sel:authorizers:ListAuthorizersResponse' :: Maybe [AuthorizerSummary]
authorizers =
forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListAuthorizersResponse' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAuthorizersResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAuthorizersResponse_authorizers :: Lens.Lens' ListAuthorizersResponse (Prelude.Maybe [AuthorizerSummary])
listAuthorizersResponse_authorizers :: Lens' ListAuthorizersResponse (Maybe [AuthorizerSummary])
listAuthorizersResponse_authorizers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuthorizersResponse' {Maybe [AuthorizerSummary]
authorizers :: Maybe [AuthorizerSummary]
$sel:authorizers:ListAuthorizersResponse' :: ListAuthorizersResponse -> Maybe [AuthorizerSummary]
authorizers} -> Maybe [AuthorizerSummary]
authorizers) (\s :: ListAuthorizersResponse
s@ListAuthorizersResponse' {} Maybe [AuthorizerSummary]
a -> ListAuthorizersResponse
s {$sel:authorizers:ListAuthorizersResponse' :: Maybe [AuthorizerSummary]
authorizers = Maybe [AuthorizerSummary]
a} :: ListAuthorizersResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listAuthorizersResponse_nextMarker :: Lens.Lens' ListAuthorizersResponse (Prelude.Maybe Prelude.Text)
listAuthorizersResponse_nextMarker :: Lens' ListAuthorizersResponse (Maybe Text)
listAuthorizersResponse_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuthorizersResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListAuthorizersResponse' :: ListAuthorizersResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListAuthorizersResponse
s@ListAuthorizersResponse' {} Maybe Text
a -> ListAuthorizersResponse
s {$sel:nextMarker:ListAuthorizersResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListAuthorizersResponse)
listAuthorizersResponse_httpStatus :: Lens.Lens' ListAuthorizersResponse Prelude.Int
listAuthorizersResponse_httpStatus :: Lens' ListAuthorizersResponse Int
listAuthorizersResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuthorizersResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAuthorizersResponse' :: ListAuthorizersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAuthorizersResponse
s@ListAuthorizersResponse' {} Int
a -> ListAuthorizersResponse
s {$sel:httpStatus:ListAuthorizersResponse' :: Int
httpStatus = Int
a} :: ListAuthorizersResponse)
instance Prelude.NFData ListAuthorizersResponse where
rnf :: ListAuthorizersResponse -> ()
rnf ListAuthorizersResponse' {Int
Maybe [AuthorizerSummary]
Maybe Text
httpStatus :: Int
nextMarker :: Maybe Text
authorizers :: Maybe [AuthorizerSummary]
$sel:httpStatus:ListAuthorizersResponse' :: ListAuthorizersResponse -> Int
$sel:nextMarker:ListAuthorizersResponse' :: ListAuthorizersResponse -> Maybe Text
$sel:authorizers:ListAuthorizersResponse' :: ListAuthorizersResponse -> Maybe [AuthorizerSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AuthorizerSummary]
authorizers
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus