{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoT.ListAuthorizers
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the authorizers registered in your account.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListAuthorizers>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListAuthorizers
  ( -- * Creating a Request
    ListAuthorizers (..),
    newListAuthorizers,

    -- * Request Lenses
    listAuthorizers_status,
    listAuthorizers_marker,
    listAuthorizers_ascendingOrder,
    listAuthorizers_pageSize,

    -- * Destructuring the Response
    ListAuthorizersResponse (..),
    newListAuthorizersResponse,

    -- * Response Lenses
    listAuthorizersResponse_authorizers,
    listAuthorizersResponse_nextMarker,
    listAuthorizersResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListAuthorizers' smart constructor.
data ListAuthorizers = ListAuthorizers'
  { -- | The status of the list authorizers request.
    ListAuthorizers -> Maybe AuthorizerStatus
status :: Prelude.Maybe AuthorizerStatus,
    -- | A marker used to get the next set of results.
    ListAuthorizers -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Return the list of authorizers in ascending alphabetical order.
    ListAuthorizers -> Maybe Bool
ascendingOrder :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of results to return at one time.
    ListAuthorizers -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListAuthorizers -> ListAuthorizers -> Bool
(ListAuthorizers -> ListAuthorizers -> Bool)
-> (ListAuthorizers -> ListAuthorizers -> Bool)
-> Eq ListAuthorizers
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]
(Int -> ReadS ListAuthorizers)
-> ReadS [ListAuthorizers]
-> ReadPrec ListAuthorizers
-> ReadPrec [ListAuthorizers]
-> Read 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
(Int -> ListAuthorizers -> ShowS)
-> (ListAuthorizers -> String)
-> ([ListAuthorizers] -> ShowS)
-> Show ListAuthorizers
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. ListAuthorizers -> Rep ListAuthorizers x)
-> (forall x. Rep ListAuthorizers x -> ListAuthorizers)
-> Generic ListAuthorizers
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)

-- |
-- Create a value of 'ListAuthorizers' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'listAuthorizers_status' - The status of the list authorizers request.
--
-- 'marker', 'listAuthorizers_marker' - A marker used to get the next set of results.
--
-- 'ascendingOrder', 'listAuthorizers_ascendingOrder' - Return the list of authorizers in ascending alphabetical order.
--
-- 'pageSize', 'listAuthorizers_pageSize' - The maximum number of results to return at one time.
newListAuthorizers ::
  ListAuthorizers
newListAuthorizers :: ListAuthorizers
newListAuthorizers =
  ListAuthorizers' :: Maybe AuthorizerStatus
-> Maybe Text -> Maybe Bool -> Maybe Natural -> ListAuthorizers
ListAuthorizers'
    { $sel:status:ListAuthorizers' :: Maybe AuthorizerStatus
status = Maybe AuthorizerStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListAuthorizers' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ascendingOrder:ListAuthorizers' :: Maybe Bool
ascendingOrder = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListAuthorizers' :: Maybe Natural
pageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the list authorizers request.
listAuthorizers_status :: Lens.Lens' ListAuthorizers (Prelude.Maybe AuthorizerStatus)
listAuthorizers_status :: (Maybe AuthorizerStatus -> f (Maybe AuthorizerStatus))
-> ListAuthorizers -> f ListAuthorizers
listAuthorizers_status = (ListAuthorizers -> Maybe AuthorizerStatus)
-> (ListAuthorizers -> Maybe AuthorizerStatus -> ListAuthorizers)
-> Lens
     ListAuthorizers
     ListAuthorizers
     (Maybe AuthorizerStatus)
     (Maybe AuthorizerStatus)
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)

-- | A marker used to get the next set of results.
listAuthorizers_marker :: Lens.Lens' ListAuthorizers (Prelude.Maybe Prelude.Text)
listAuthorizers_marker :: (Maybe Text -> f (Maybe Text))
-> ListAuthorizers -> f ListAuthorizers
listAuthorizers_marker = (ListAuthorizers -> Maybe Text)
-> (ListAuthorizers -> Maybe Text -> ListAuthorizers)
-> Lens ListAuthorizers ListAuthorizers (Maybe Text) (Maybe Text)
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)

-- | Return the list of authorizers in ascending alphabetical order.
listAuthorizers_ascendingOrder :: Lens.Lens' ListAuthorizers (Prelude.Maybe Prelude.Bool)
listAuthorizers_ascendingOrder :: (Maybe Bool -> f (Maybe Bool))
-> ListAuthorizers -> f ListAuthorizers
listAuthorizers_ascendingOrder = (ListAuthorizers -> Maybe Bool)
-> (ListAuthorizers -> Maybe Bool -> ListAuthorizers)
-> Lens ListAuthorizers ListAuthorizers (Maybe Bool) (Maybe Bool)
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)

-- | The maximum number of results to return at one time.
listAuthorizers_pageSize :: Lens.Lens' ListAuthorizers (Prelude.Maybe Prelude.Natural)
listAuthorizers_pageSize :: (Maybe Natural -> f (Maybe Natural))
-> ListAuthorizers -> f ListAuthorizers
listAuthorizers_pageSize = (ListAuthorizers -> Maybe Natural)
-> (ListAuthorizers -> Maybe Natural -> ListAuthorizers)
-> Lens
     ListAuthorizers ListAuthorizers (Maybe Natural) (Maybe Natural)
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)

instance Core.AWSPager ListAuthorizers where
  page :: ListAuthorizers
-> AWSResponse ListAuthorizers -> Maybe ListAuthorizers
page ListAuthorizers
rq AWSResponse ListAuthorizers
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAuthorizers
ListAuthorizersResponse
rs
            ListAuthorizersResponse
-> Getting (First Text) ListAuthorizersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAuthorizersResponse
-> Const (First Text) ListAuthorizersResponse
Lens' ListAuthorizersResponse (Maybe Text)
listAuthorizersResponse_nextMarker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAuthorizersResponse
 -> Const (First Text) ListAuthorizersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAuthorizersResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAuthorizers
forall a. Maybe a
Prelude.Nothing
    | Maybe [AuthorizerSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAuthorizers
ListAuthorizersResponse
rs
            ListAuthorizersResponse
-> Getting
     (First [AuthorizerSummary])
     ListAuthorizersResponse
     [AuthorizerSummary]
-> Maybe [AuthorizerSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [AuthorizerSummary]
 -> Const (First [AuthorizerSummary]) (Maybe [AuthorizerSummary]))
-> ListAuthorizersResponse
-> Const (First [AuthorizerSummary]) ListAuthorizersResponse
Lens' ListAuthorizersResponse (Maybe [AuthorizerSummary])
listAuthorizersResponse_authorizers
              ((Maybe [AuthorizerSummary]
  -> Const (First [AuthorizerSummary]) (Maybe [AuthorizerSummary]))
 -> ListAuthorizersResponse
 -> Const (First [AuthorizerSummary]) ListAuthorizersResponse)
-> (([AuthorizerSummary]
     -> Const (First [AuthorizerSummary]) [AuthorizerSummary])
    -> Maybe [AuthorizerSummary]
    -> Const (First [AuthorizerSummary]) (Maybe [AuthorizerSummary]))
-> Getting
     (First [AuthorizerSummary])
     ListAuthorizersResponse
     [AuthorizerSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AuthorizerSummary]
 -> Const (First [AuthorizerSummary]) [AuthorizerSummary])
-> Maybe [AuthorizerSummary]
-> Const (First [AuthorizerSummary]) (Maybe [AuthorizerSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListAuthorizers
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAuthorizers -> Maybe ListAuthorizers
forall a. a -> Maybe a
Prelude.Just (ListAuthorizers -> Maybe ListAuthorizers)
-> ListAuthorizers -> Maybe ListAuthorizers
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAuthorizers
rq
          ListAuthorizers
-> (ListAuthorizers -> ListAuthorizers) -> ListAuthorizers
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAuthorizers -> Identity ListAuthorizers
Lens ListAuthorizers ListAuthorizers (Maybe Text) (Maybe Text)
listAuthorizers_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAuthorizers -> Identity ListAuthorizers)
-> Maybe Text -> ListAuthorizers -> ListAuthorizers
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAuthorizers
ListAuthorizersResponse
rs
          ListAuthorizersResponse
-> Getting (First Text) ListAuthorizersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAuthorizersResponse
-> Const (First Text) ListAuthorizersResponse
Lens' ListAuthorizersResponse (Maybe Text)
listAuthorizersResponse_nextMarker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAuthorizersResponse
 -> Const (First Text) ListAuthorizersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAuthorizersResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListAuthorizers where
  type
    AWSResponse ListAuthorizers =
      ListAuthorizersResponse
  request :: ListAuthorizers -> Request ListAuthorizers
request = Service -> ListAuthorizers -> Request ListAuthorizers
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAuthorizers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAuthorizers)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAuthorizers))
-> Logger
-> Service
-> Proxy ListAuthorizers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAuthorizers)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> 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'
            (Maybe [AuthorizerSummary]
 -> Maybe Text -> Int -> ListAuthorizersResponse)
-> Either String (Maybe [AuthorizerSummary])
-> Either String (Maybe Text -> Int -> ListAuthorizersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [AuthorizerSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"authorizers" Either String (Maybe (Maybe [AuthorizerSummary]))
-> Maybe [AuthorizerSummary]
-> Either String (Maybe [AuthorizerSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AuthorizerSummary]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListAuthorizersResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListAuthorizersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextMarker")
            Either String (Int -> ListAuthorizersResponse)
-> Either String Int -> Either String ListAuthorizersResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListAuthorizers

instance Prelude.NFData ListAuthorizers

instance Core.ToHeaders ListAuthorizers where
  toHeaders :: ListAuthorizers -> ResponseHeaders
toHeaders = ResponseHeaders -> ListAuthorizers -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath ListAuthorizers where
  toPath :: ListAuthorizers -> ByteString
toPath = ByteString -> ListAuthorizers -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/authorizers/"

instance Core.ToQuery ListAuthorizers where
  toQuery :: ListAuthorizers -> QueryString
toQuery ListAuthorizers' {Maybe Bool
Maybe Natural
Maybe Text
Maybe AuthorizerStatus
pageSize :: Maybe Natural
ascendingOrder :: Maybe Bool
marker :: Maybe Text
status :: Maybe AuthorizerStatus
$sel:pageSize:ListAuthorizers' :: ListAuthorizers -> Maybe Natural
$sel:ascendingOrder:ListAuthorizers' :: ListAuthorizers -> Maybe Bool
$sel:marker:ListAuthorizers' :: ListAuthorizers -> Maybe Text
$sel:status:ListAuthorizers' :: ListAuthorizers -> Maybe AuthorizerStatus
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"status" ByteString -> Maybe AuthorizerStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AuthorizerStatus
status,
        ByteString
"marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"isAscendingOrder" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
ascendingOrder,
        ByteString
"pageSize" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
pageSize
      ]

-- | /See:/ 'newListAuthorizersResponse' smart constructor.
data ListAuthorizersResponse = ListAuthorizersResponse'
  { -- | The authorizers.
    ListAuthorizersResponse -> Maybe [AuthorizerSummary]
authorizers :: Prelude.Maybe [AuthorizerSummary],
    -- | A marker used to get the next set of results.
    ListAuthorizersResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAuthorizersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAuthorizersResponse -> ListAuthorizersResponse -> Bool
(ListAuthorizersResponse -> ListAuthorizersResponse -> Bool)
-> (ListAuthorizersResponse -> ListAuthorizersResponse -> Bool)
-> Eq ListAuthorizersResponse
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]
(Int -> ReadS ListAuthorizersResponse)
-> ReadS [ListAuthorizersResponse]
-> ReadPrec ListAuthorizersResponse
-> ReadPrec [ListAuthorizersResponse]
-> Read 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
(Int -> ListAuthorizersResponse -> ShowS)
-> (ListAuthorizersResponse -> String)
-> ([ListAuthorizersResponse] -> ShowS)
-> Show ListAuthorizersResponse
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.
 ListAuthorizersResponse -> Rep ListAuthorizersResponse x)
-> (forall x.
    Rep ListAuthorizersResponse x -> ListAuthorizersResponse)
-> Generic ListAuthorizersResponse
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)

-- |
-- Create a value of 'ListAuthorizersResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'authorizers', 'listAuthorizersResponse_authorizers' - The authorizers.
--
-- 'nextMarker', 'listAuthorizersResponse_nextMarker' - A marker used to get the next set of results.
--
-- 'httpStatus', 'listAuthorizersResponse_httpStatus' - The response's http status code.
newListAuthorizersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAuthorizersResponse
newListAuthorizersResponse :: Int -> ListAuthorizersResponse
newListAuthorizersResponse Int
pHttpStatus_ =
  ListAuthorizersResponse' :: Maybe [AuthorizerSummary]
-> Maybe Text -> Int -> ListAuthorizersResponse
ListAuthorizersResponse'
    { $sel:authorizers:ListAuthorizersResponse' :: Maybe [AuthorizerSummary]
authorizers =
        Maybe [AuthorizerSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:ListAuthorizersResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAuthorizersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The authorizers.
listAuthorizersResponse_authorizers :: Lens.Lens' ListAuthorizersResponse (Prelude.Maybe [AuthorizerSummary])
listAuthorizersResponse_authorizers :: (Maybe [AuthorizerSummary] -> f (Maybe [AuthorizerSummary]))
-> ListAuthorizersResponse -> f ListAuthorizersResponse
listAuthorizersResponse_authorizers = (ListAuthorizersResponse -> Maybe [AuthorizerSummary])
-> (ListAuthorizersResponse
    -> Maybe [AuthorizerSummary] -> ListAuthorizersResponse)
-> Lens' ListAuthorizersResponse (Maybe [AuthorizerSummary])
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) ((Maybe [AuthorizerSummary] -> f (Maybe [AuthorizerSummary]))
 -> ListAuthorizersResponse -> f ListAuthorizersResponse)
-> ((Maybe [AuthorizerSummary] -> f (Maybe [AuthorizerSummary]))
    -> Maybe [AuthorizerSummary] -> f (Maybe [AuthorizerSummary]))
-> (Maybe [AuthorizerSummary] -> f (Maybe [AuthorizerSummary]))
-> ListAuthorizersResponse
-> f ListAuthorizersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AuthorizerSummary]
  [AuthorizerSummary]
  [AuthorizerSummary]
  [AuthorizerSummary]
-> Iso
     (Maybe [AuthorizerSummary])
     (Maybe [AuthorizerSummary])
     (Maybe [AuthorizerSummary])
     (Maybe [AuthorizerSummary])
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 AnIso
  [AuthorizerSummary]
  [AuthorizerSummary]
  [AuthorizerSummary]
  [AuthorizerSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A marker used to get the next set of results.
listAuthorizersResponse_nextMarker :: Lens.Lens' ListAuthorizersResponse (Prelude.Maybe Prelude.Text)
listAuthorizersResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListAuthorizersResponse -> f ListAuthorizersResponse
listAuthorizersResponse_nextMarker = (ListAuthorizersResponse -> Maybe Text)
-> (ListAuthorizersResponse
    -> Maybe Text -> ListAuthorizersResponse)
-> Lens' ListAuthorizersResponse (Maybe Text)
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)

-- | The response's http status code.
listAuthorizersResponse_httpStatus :: Lens.Lens' ListAuthorizersResponse Prelude.Int
listAuthorizersResponse_httpStatus :: (Int -> f Int)
-> ListAuthorizersResponse -> f ListAuthorizersResponse
listAuthorizersResponse_httpStatus = (ListAuthorizersResponse -> Int)
-> (ListAuthorizersResponse -> Int -> ListAuthorizersResponse)
-> Lens ListAuthorizersResponse ListAuthorizersResponse Int Int
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