{-# 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.ApiGatewayV2.GetAuthorizers
-- 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)
--
-- Gets the Authorizers for an API.
--
-- This operation returns paginated results.
module Amazonka.ApiGatewayV2.GetAuthorizers
  ( -- * Creating a Request
    GetAuthorizers (..),
    newGetAuthorizers,

    -- * Request Lenses
    getAuthorizers_nextToken,
    getAuthorizers_maxResults,
    getAuthorizers_apiId,

    -- * Destructuring the Response
    GetAuthorizersResponse (..),
    newGetAuthorizersResponse,

    -- * Response Lenses
    getAuthorizersResponse_items,
    getAuthorizersResponse_nextToken,
    getAuthorizersResponse_httpStatus,
  )
where

import Amazonka.ApiGatewayV2.Types
import qualified Amazonka.Core as Core
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:/ 'newGetAuthorizers' smart constructor.
data GetAuthorizers = GetAuthorizers'
  { -- | The next page of elements from this collection. Not valid for the last
    -- element of the collection.
    GetAuthorizers -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of elements to be returned for this resource.
    GetAuthorizers -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text,
    -- | The API identifier.
    GetAuthorizers -> Text
apiId :: Prelude.Text
  }
  deriving (GetAuthorizers -> GetAuthorizers -> Bool
(GetAuthorizers -> GetAuthorizers -> Bool)
-> (GetAuthorizers -> GetAuthorizers -> Bool) -> Eq GetAuthorizers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAuthorizers -> GetAuthorizers -> Bool
$c/= :: GetAuthorizers -> GetAuthorizers -> Bool
== :: GetAuthorizers -> GetAuthorizers -> Bool
$c== :: GetAuthorizers -> GetAuthorizers -> Bool
Prelude.Eq, ReadPrec [GetAuthorizers]
ReadPrec GetAuthorizers
Int -> ReadS GetAuthorizers
ReadS [GetAuthorizers]
(Int -> ReadS GetAuthorizers)
-> ReadS [GetAuthorizers]
-> ReadPrec GetAuthorizers
-> ReadPrec [GetAuthorizers]
-> Read GetAuthorizers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAuthorizers]
$creadListPrec :: ReadPrec [GetAuthorizers]
readPrec :: ReadPrec GetAuthorizers
$creadPrec :: ReadPrec GetAuthorizers
readList :: ReadS [GetAuthorizers]
$creadList :: ReadS [GetAuthorizers]
readsPrec :: Int -> ReadS GetAuthorizers
$creadsPrec :: Int -> ReadS GetAuthorizers
Prelude.Read, Int -> GetAuthorizers -> ShowS
[GetAuthorizers] -> ShowS
GetAuthorizers -> String
(Int -> GetAuthorizers -> ShowS)
-> (GetAuthorizers -> String)
-> ([GetAuthorizers] -> ShowS)
-> Show GetAuthorizers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAuthorizers] -> ShowS
$cshowList :: [GetAuthorizers] -> ShowS
show :: GetAuthorizers -> String
$cshow :: GetAuthorizers -> String
showsPrec :: Int -> GetAuthorizers -> ShowS
$cshowsPrec :: Int -> GetAuthorizers -> ShowS
Prelude.Show, (forall x. GetAuthorizers -> Rep GetAuthorizers x)
-> (forall x. Rep GetAuthorizers x -> GetAuthorizers)
-> Generic GetAuthorizers
forall x. Rep GetAuthorizers x -> GetAuthorizers
forall x. GetAuthorizers -> Rep GetAuthorizers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAuthorizers x -> GetAuthorizers
$cfrom :: forall x. GetAuthorizers -> Rep GetAuthorizers x
Prelude.Generic)

-- |
-- Create a value of 'GetAuthorizers' 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:
--
-- 'nextToken', 'getAuthorizers_nextToken' - The next page of elements from this collection. Not valid for the last
-- element of the collection.
--
-- 'maxResults', 'getAuthorizers_maxResults' - The maximum number of elements to be returned for this resource.
--
-- 'apiId', 'getAuthorizers_apiId' - The API identifier.
newGetAuthorizers ::
  -- | 'apiId'
  Prelude.Text ->
  GetAuthorizers
newGetAuthorizers :: Text -> GetAuthorizers
newGetAuthorizers Text
pApiId_ =
  GetAuthorizers' :: Maybe Text -> Maybe Text -> Text -> GetAuthorizers
GetAuthorizers'
    { $sel:nextToken:GetAuthorizers' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetAuthorizers' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:GetAuthorizers' :: Text
apiId = Text
pApiId_
    }

-- | The next page of elements from this collection. Not valid for the last
-- element of the collection.
getAuthorizers_nextToken :: Lens.Lens' GetAuthorizers (Prelude.Maybe Prelude.Text)
getAuthorizers_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetAuthorizers -> f GetAuthorizers
getAuthorizers_nextToken = (GetAuthorizers -> Maybe Text)
-> (GetAuthorizers -> Maybe Text -> GetAuthorizers)
-> Lens GetAuthorizers GetAuthorizers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizers' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetAuthorizers' :: GetAuthorizers -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetAuthorizers
s@GetAuthorizers' {} Maybe Text
a -> GetAuthorizers
s {$sel:nextToken:GetAuthorizers' :: Maybe Text
nextToken = Maybe Text
a} :: GetAuthorizers)

-- | The maximum number of elements to be returned for this resource.
getAuthorizers_maxResults :: Lens.Lens' GetAuthorizers (Prelude.Maybe Prelude.Text)
getAuthorizers_maxResults :: (Maybe Text -> f (Maybe Text))
-> GetAuthorizers -> f GetAuthorizers
getAuthorizers_maxResults = (GetAuthorizers -> Maybe Text)
-> (GetAuthorizers -> Maybe Text -> GetAuthorizers)
-> Lens GetAuthorizers GetAuthorizers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizers' {Maybe Text
maxResults :: Maybe Text
$sel:maxResults:GetAuthorizers' :: GetAuthorizers -> Maybe Text
maxResults} -> Maybe Text
maxResults) (\s :: GetAuthorizers
s@GetAuthorizers' {} Maybe Text
a -> GetAuthorizers
s {$sel:maxResults:GetAuthorizers' :: Maybe Text
maxResults = Maybe Text
a} :: GetAuthorizers)

-- | The API identifier.
getAuthorizers_apiId :: Lens.Lens' GetAuthorizers Prelude.Text
getAuthorizers_apiId :: (Text -> f Text) -> GetAuthorizers -> f GetAuthorizers
getAuthorizers_apiId = (GetAuthorizers -> Text)
-> (GetAuthorizers -> Text -> GetAuthorizers)
-> Lens GetAuthorizers GetAuthorizers Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizers' {Text
apiId :: Text
$sel:apiId:GetAuthorizers' :: GetAuthorizers -> Text
apiId} -> Text
apiId) (\s :: GetAuthorizers
s@GetAuthorizers' {} Text
a -> GetAuthorizers
s {$sel:apiId:GetAuthorizers' :: Text
apiId = Text
a} :: GetAuthorizers)

instance Core.AWSPager GetAuthorizers where
  page :: GetAuthorizers
-> AWSResponse GetAuthorizers -> Maybe GetAuthorizers
page GetAuthorizers
rq AWSResponse GetAuthorizers
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetAuthorizers
GetAuthorizersResponse
rs
            GetAuthorizersResponse
-> Getting (First Text) GetAuthorizersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetAuthorizersResponse
-> Const (First Text) GetAuthorizersResponse
Lens' GetAuthorizersResponse (Maybe Text)
getAuthorizersResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetAuthorizersResponse
 -> Const (First Text) GetAuthorizersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetAuthorizersResponse 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 GetAuthorizers
forall a. Maybe a
Prelude.Nothing
    | Maybe [Authorizer] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetAuthorizers
GetAuthorizersResponse
rs
            GetAuthorizersResponse
-> Getting (First [Authorizer]) GetAuthorizersResponse [Authorizer]
-> Maybe [Authorizer]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Authorizer]
 -> Const (First [Authorizer]) (Maybe [Authorizer]))
-> GetAuthorizersResponse
-> Const (First [Authorizer]) GetAuthorizersResponse
Lens' GetAuthorizersResponse (Maybe [Authorizer])
getAuthorizersResponse_items ((Maybe [Authorizer]
  -> Const (First [Authorizer]) (Maybe [Authorizer]))
 -> GetAuthorizersResponse
 -> Const (First [Authorizer]) GetAuthorizersResponse)
-> (([Authorizer] -> Const (First [Authorizer]) [Authorizer])
    -> Maybe [Authorizer]
    -> Const (First [Authorizer]) (Maybe [Authorizer]))
-> Getting (First [Authorizer]) GetAuthorizersResponse [Authorizer]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Authorizer] -> Const (First [Authorizer]) [Authorizer])
-> Maybe [Authorizer]
-> Const (First [Authorizer]) (Maybe [Authorizer])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetAuthorizers
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetAuthorizers -> Maybe GetAuthorizers
forall a. a -> Maybe a
Prelude.Just (GetAuthorizers -> Maybe GetAuthorizers)
-> GetAuthorizers -> Maybe GetAuthorizers
forall a b. (a -> b) -> a -> b
Prelude.$
        GetAuthorizers
rq
          GetAuthorizers
-> (GetAuthorizers -> GetAuthorizers) -> GetAuthorizers
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetAuthorizers -> Identity GetAuthorizers
Lens GetAuthorizers GetAuthorizers (Maybe Text) (Maybe Text)
getAuthorizers_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetAuthorizers -> Identity GetAuthorizers)
-> Maybe Text -> GetAuthorizers -> GetAuthorizers
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetAuthorizers
GetAuthorizersResponse
rs
          GetAuthorizersResponse
-> Getting (First Text) GetAuthorizersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetAuthorizersResponse
-> Const (First Text) GetAuthorizersResponse
Lens' GetAuthorizersResponse (Maybe Text)
getAuthorizersResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetAuthorizersResponse
 -> Const (First Text) GetAuthorizersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetAuthorizersResponse 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 GetAuthorizers where
  type
    AWSResponse GetAuthorizers =
      GetAuthorizersResponse
  request :: GetAuthorizers -> Request GetAuthorizers
request = Service -> GetAuthorizers -> Request GetAuthorizers
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetAuthorizers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAuthorizers)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetAuthorizers))
-> Logger
-> Service
-> Proxy GetAuthorizers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAuthorizers)))
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 [Authorizer] -> Maybe Text -> Int -> GetAuthorizersResponse
GetAuthorizersResponse'
            (Maybe [Authorizer] -> Maybe Text -> Int -> GetAuthorizersResponse)
-> Either String (Maybe [Authorizer])
-> Either String (Maybe Text -> Int -> GetAuthorizersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Authorizer]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"items" Either String (Maybe (Maybe [Authorizer]))
-> Maybe [Authorizer] -> Either String (Maybe [Authorizer])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Authorizer]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> GetAuthorizersResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetAuthorizersResponse)
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
"nextToken")
            Either String (Int -> GetAuthorizersResponse)
-> Either String Int -> Either String GetAuthorizersResponse
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 GetAuthorizers

instance Prelude.NFData GetAuthorizers

instance Core.ToHeaders GetAuthorizers where
  toHeaders :: GetAuthorizers -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetAuthorizers -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath GetAuthorizers where
  toPath :: GetAuthorizers -> ByteString
toPath GetAuthorizers' {Maybe Text
Text
apiId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:apiId:GetAuthorizers' :: GetAuthorizers -> Text
$sel:maxResults:GetAuthorizers' :: GetAuthorizers -> Maybe Text
$sel:nextToken:GetAuthorizers' :: GetAuthorizers -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v2/apis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId, ByteString
"/authorizers"]

instance Core.ToQuery GetAuthorizers where
  toQuery :: GetAuthorizers -> QueryString
toQuery GetAuthorizers' {Maybe Text
Text
apiId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:apiId:GetAuthorizers' :: GetAuthorizers -> Text
$sel:maxResults:GetAuthorizers' :: GetAuthorizers -> Maybe Text
$sel:nextToken:GetAuthorizers' :: GetAuthorizers -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxResults
      ]

-- | /See:/ 'newGetAuthorizersResponse' smart constructor.
data GetAuthorizersResponse = GetAuthorizersResponse'
  { -- | The elements from this collection.
    GetAuthorizersResponse -> Maybe [Authorizer]
items :: Prelude.Maybe [Authorizer],
    -- | The next page of elements from this collection. Not valid for the last
    -- element of the collection.
    GetAuthorizersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetAuthorizersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetAuthorizersResponse -> GetAuthorizersResponse -> Bool
(GetAuthorizersResponse -> GetAuthorizersResponse -> Bool)
-> (GetAuthorizersResponse -> GetAuthorizersResponse -> Bool)
-> Eq GetAuthorizersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAuthorizersResponse -> GetAuthorizersResponse -> Bool
$c/= :: GetAuthorizersResponse -> GetAuthorizersResponse -> Bool
== :: GetAuthorizersResponse -> GetAuthorizersResponse -> Bool
$c== :: GetAuthorizersResponse -> GetAuthorizersResponse -> Bool
Prelude.Eq, ReadPrec [GetAuthorizersResponse]
ReadPrec GetAuthorizersResponse
Int -> ReadS GetAuthorizersResponse
ReadS [GetAuthorizersResponse]
(Int -> ReadS GetAuthorizersResponse)
-> ReadS [GetAuthorizersResponse]
-> ReadPrec GetAuthorizersResponse
-> ReadPrec [GetAuthorizersResponse]
-> Read GetAuthorizersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAuthorizersResponse]
$creadListPrec :: ReadPrec [GetAuthorizersResponse]
readPrec :: ReadPrec GetAuthorizersResponse
$creadPrec :: ReadPrec GetAuthorizersResponse
readList :: ReadS [GetAuthorizersResponse]
$creadList :: ReadS [GetAuthorizersResponse]
readsPrec :: Int -> ReadS GetAuthorizersResponse
$creadsPrec :: Int -> ReadS GetAuthorizersResponse
Prelude.Read, Int -> GetAuthorizersResponse -> ShowS
[GetAuthorizersResponse] -> ShowS
GetAuthorizersResponse -> String
(Int -> GetAuthorizersResponse -> ShowS)
-> (GetAuthorizersResponse -> String)
-> ([GetAuthorizersResponse] -> ShowS)
-> Show GetAuthorizersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAuthorizersResponse] -> ShowS
$cshowList :: [GetAuthorizersResponse] -> ShowS
show :: GetAuthorizersResponse -> String
$cshow :: GetAuthorizersResponse -> String
showsPrec :: Int -> GetAuthorizersResponse -> ShowS
$cshowsPrec :: Int -> GetAuthorizersResponse -> ShowS
Prelude.Show, (forall x. GetAuthorizersResponse -> Rep GetAuthorizersResponse x)
-> (forall x.
    Rep GetAuthorizersResponse x -> GetAuthorizersResponse)
-> Generic GetAuthorizersResponse
forall x. Rep GetAuthorizersResponse x -> GetAuthorizersResponse
forall x. GetAuthorizersResponse -> Rep GetAuthorizersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAuthorizersResponse x -> GetAuthorizersResponse
$cfrom :: forall x. GetAuthorizersResponse -> Rep GetAuthorizersResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAuthorizersResponse' 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:
--
-- 'items', 'getAuthorizersResponse_items' - The elements from this collection.
--
-- 'nextToken', 'getAuthorizersResponse_nextToken' - The next page of elements from this collection. Not valid for the last
-- element of the collection.
--
-- 'httpStatus', 'getAuthorizersResponse_httpStatus' - The response's http status code.
newGetAuthorizersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAuthorizersResponse
newGetAuthorizersResponse :: Int -> GetAuthorizersResponse
newGetAuthorizersResponse Int
pHttpStatus_ =
  GetAuthorizersResponse' :: Maybe [Authorizer] -> Maybe Text -> Int -> GetAuthorizersResponse
GetAuthorizersResponse'
    { $sel:items:GetAuthorizersResponse' :: Maybe [Authorizer]
items = Maybe [Authorizer]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetAuthorizersResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetAuthorizersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The elements from this collection.
getAuthorizersResponse_items :: Lens.Lens' GetAuthorizersResponse (Prelude.Maybe [Authorizer])
getAuthorizersResponse_items :: (Maybe [Authorizer] -> f (Maybe [Authorizer]))
-> GetAuthorizersResponse -> f GetAuthorizersResponse
getAuthorizersResponse_items = (GetAuthorizersResponse -> Maybe [Authorizer])
-> (GetAuthorizersResponse
    -> Maybe [Authorizer] -> GetAuthorizersResponse)
-> Lens' GetAuthorizersResponse (Maybe [Authorizer])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizersResponse' {Maybe [Authorizer]
items :: Maybe [Authorizer]
$sel:items:GetAuthorizersResponse' :: GetAuthorizersResponse -> Maybe [Authorizer]
items} -> Maybe [Authorizer]
items) (\s :: GetAuthorizersResponse
s@GetAuthorizersResponse' {} Maybe [Authorizer]
a -> GetAuthorizersResponse
s {$sel:items:GetAuthorizersResponse' :: Maybe [Authorizer]
items = Maybe [Authorizer]
a} :: GetAuthorizersResponse) ((Maybe [Authorizer] -> f (Maybe [Authorizer]))
 -> GetAuthorizersResponse -> f GetAuthorizersResponse)
-> ((Maybe [Authorizer] -> f (Maybe [Authorizer]))
    -> Maybe [Authorizer] -> f (Maybe [Authorizer]))
-> (Maybe [Authorizer] -> f (Maybe [Authorizer]))
-> GetAuthorizersResponse
-> f GetAuthorizersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Authorizer] [Authorizer] [Authorizer] [Authorizer]
-> Iso
     (Maybe [Authorizer])
     (Maybe [Authorizer])
     (Maybe [Authorizer])
     (Maybe [Authorizer])
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 [Authorizer] [Authorizer] [Authorizer] [Authorizer]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The next page of elements from this collection. Not valid for the last
-- element of the collection.
getAuthorizersResponse_nextToken :: Lens.Lens' GetAuthorizersResponse (Prelude.Maybe Prelude.Text)
getAuthorizersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetAuthorizersResponse -> f GetAuthorizersResponse
getAuthorizersResponse_nextToken = (GetAuthorizersResponse -> Maybe Text)
-> (GetAuthorizersResponse -> Maybe Text -> GetAuthorizersResponse)
-> Lens' GetAuthorizersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetAuthorizersResponse' :: GetAuthorizersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetAuthorizersResponse
s@GetAuthorizersResponse' {} Maybe Text
a -> GetAuthorizersResponse
s {$sel:nextToken:GetAuthorizersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetAuthorizersResponse)

-- | The response's http status code.
getAuthorizersResponse_httpStatus :: Lens.Lens' GetAuthorizersResponse Prelude.Int
getAuthorizersResponse_httpStatus :: (Int -> f Int)
-> GetAuthorizersResponse -> f GetAuthorizersResponse
getAuthorizersResponse_httpStatus = (GetAuthorizersResponse -> Int)
-> (GetAuthorizersResponse -> Int -> GetAuthorizersResponse)
-> Lens GetAuthorizersResponse GetAuthorizersResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAuthorizersResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAuthorizersResponse' :: GetAuthorizersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAuthorizersResponse
s@GetAuthorizersResponse' {} Int
a -> GetAuthorizersResponse
s {$sel:httpStatus:GetAuthorizersResponse' :: Int
httpStatus = Int
a} :: GetAuthorizersResponse)

instance Prelude.NFData GetAuthorizersResponse