{-# 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.APIGateway.GetRequestValidators
-- 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 RequestValidators collection of a given RestApi.
--
-- This operation returns paginated results.
module Amazonka.APIGateway.GetRequestValidators
  ( -- * Creating a Request
    GetRequestValidators (..),
    newGetRequestValidators,

    -- * Request Lenses
    getRequestValidators_limit,
    getRequestValidators_position,
    getRequestValidators_restApiId,

    -- * Destructuring the Response
    GetRequestValidatorsResponse (..),
    newGetRequestValidatorsResponse,

    -- * Response Lenses
    getRequestValidatorsResponse_items,
    getRequestValidatorsResponse_position,
    getRequestValidatorsResponse_httpStatus,
  )
where

import Amazonka.APIGateway.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

-- | Gets the RequestValidators collection of a given RestApi.
--
-- /See:/ 'newGetRequestValidators' smart constructor.
data GetRequestValidators = GetRequestValidators'
  { -- | The maximum number of returned results per page. The default value is 25
    -- and the maximum value is 500.
    GetRequestValidators -> Maybe Int
limit :: Prelude.Maybe Prelude.Int,
    -- | The current pagination position in the paged result set.
    GetRequestValidators -> Maybe Text
position :: Prelude.Maybe Prelude.Text,
    -- | [Required] The string identifier of the associated RestApi.
    GetRequestValidators -> Text
restApiId :: Prelude.Text
  }
  deriving (GetRequestValidators -> GetRequestValidators -> Bool
(GetRequestValidators -> GetRequestValidators -> Bool)
-> (GetRequestValidators -> GetRequestValidators -> Bool)
-> Eq GetRequestValidators
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRequestValidators -> GetRequestValidators -> Bool
$c/= :: GetRequestValidators -> GetRequestValidators -> Bool
== :: GetRequestValidators -> GetRequestValidators -> Bool
$c== :: GetRequestValidators -> GetRequestValidators -> Bool
Prelude.Eq, ReadPrec [GetRequestValidators]
ReadPrec GetRequestValidators
Int -> ReadS GetRequestValidators
ReadS [GetRequestValidators]
(Int -> ReadS GetRequestValidators)
-> ReadS [GetRequestValidators]
-> ReadPrec GetRequestValidators
-> ReadPrec [GetRequestValidators]
-> Read GetRequestValidators
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRequestValidators]
$creadListPrec :: ReadPrec [GetRequestValidators]
readPrec :: ReadPrec GetRequestValidators
$creadPrec :: ReadPrec GetRequestValidators
readList :: ReadS [GetRequestValidators]
$creadList :: ReadS [GetRequestValidators]
readsPrec :: Int -> ReadS GetRequestValidators
$creadsPrec :: Int -> ReadS GetRequestValidators
Prelude.Read, Int -> GetRequestValidators -> ShowS
[GetRequestValidators] -> ShowS
GetRequestValidators -> String
(Int -> GetRequestValidators -> ShowS)
-> (GetRequestValidators -> String)
-> ([GetRequestValidators] -> ShowS)
-> Show GetRequestValidators
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRequestValidators] -> ShowS
$cshowList :: [GetRequestValidators] -> ShowS
show :: GetRequestValidators -> String
$cshow :: GetRequestValidators -> String
showsPrec :: Int -> GetRequestValidators -> ShowS
$cshowsPrec :: Int -> GetRequestValidators -> ShowS
Prelude.Show, (forall x. GetRequestValidators -> Rep GetRequestValidators x)
-> (forall x. Rep GetRequestValidators x -> GetRequestValidators)
-> Generic GetRequestValidators
forall x. Rep GetRequestValidators x -> GetRequestValidators
forall x. GetRequestValidators -> Rep GetRequestValidators x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRequestValidators x -> GetRequestValidators
$cfrom :: forall x. GetRequestValidators -> Rep GetRequestValidators x
Prelude.Generic)

-- |
-- Create a value of 'GetRequestValidators' 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:
--
-- 'limit', 'getRequestValidators_limit' - The maximum number of returned results per page. The default value is 25
-- and the maximum value is 500.
--
-- 'position', 'getRequestValidators_position' - The current pagination position in the paged result set.
--
-- 'restApiId', 'getRequestValidators_restApiId' - [Required] The string identifier of the associated RestApi.
newGetRequestValidators ::
  -- | 'restApiId'
  Prelude.Text ->
  GetRequestValidators
newGetRequestValidators :: Text -> GetRequestValidators
newGetRequestValidators Text
pRestApiId_ =
  GetRequestValidators' :: Maybe Int -> Maybe Text -> Text -> GetRequestValidators
GetRequestValidators'
    { $sel:limit:GetRequestValidators' :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetRequestValidators' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:restApiId:GetRequestValidators' :: Text
restApiId = Text
pRestApiId_
    }

-- | The maximum number of returned results per page. The default value is 25
-- and the maximum value is 500.
getRequestValidators_limit :: Lens.Lens' GetRequestValidators (Prelude.Maybe Prelude.Int)
getRequestValidators_limit :: (Maybe Int -> f (Maybe Int))
-> GetRequestValidators -> f GetRequestValidators
getRequestValidators_limit = (GetRequestValidators -> Maybe Int)
-> (GetRequestValidators -> Maybe Int -> GetRequestValidators)
-> Lens
     GetRequestValidators GetRequestValidators (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRequestValidators' {Maybe Int
limit :: Maybe Int
$sel:limit:GetRequestValidators' :: GetRequestValidators -> Maybe Int
limit} -> Maybe Int
limit) (\s :: GetRequestValidators
s@GetRequestValidators' {} Maybe Int
a -> GetRequestValidators
s {$sel:limit:GetRequestValidators' :: Maybe Int
limit = Maybe Int
a} :: GetRequestValidators)

-- | The current pagination position in the paged result set.
getRequestValidators_position :: Lens.Lens' GetRequestValidators (Prelude.Maybe Prelude.Text)
getRequestValidators_position :: (Maybe Text -> f (Maybe Text))
-> GetRequestValidators -> f GetRequestValidators
getRequestValidators_position = (GetRequestValidators -> Maybe Text)
-> (GetRequestValidators -> Maybe Text -> GetRequestValidators)
-> Lens
     GetRequestValidators GetRequestValidators (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRequestValidators' {Maybe Text
position :: Maybe Text
$sel:position:GetRequestValidators' :: GetRequestValidators -> Maybe Text
position} -> Maybe Text
position) (\s :: GetRequestValidators
s@GetRequestValidators' {} Maybe Text
a -> GetRequestValidators
s {$sel:position:GetRequestValidators' :: Maybe Text
position = Maybe Text
a} :: GetRequestValidators)

-- | [Required] The string identifier of the associated RestApi.
getRequestValidators_restApiId :: Lens.Lens' GetRequestValidators Prelude.Text
getRequestValidators_restApiId :: (Text -> f Text) -> GetRequestValidators -> f GetRequestValidators
getRequestValidators_restApiId = (GetRequestValidators -> Text)
-> (GetRequestValidators -> Text -> GetRequestValidators)
-> Lens GetRequestValidators GetRequestValidators Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRequestValidators' {Text
restApiId :: Text
$sel:restApiId:GetRequestValidators' :: GetRequestValidators -> Text
restApiId} -> Text
restApiId) (\s :: GetRequestValidators
s@GetRequestValidators' {} Text
a -> GetRequestValidators
s {$sel:restApiId:GetRequestValidators' :: Text
restApiId = Text
a} :: GetRequestValidators)

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

instance Prelude.NFData GetRequestValidators

instance Core.ToHeaders GetRequestValidators where
  toHeaders :: GetRequestValidators -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetRequestValidators -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Core.ToPath GetRequestValidators where
  toPath :: GetRequestValidators -> ByteString
toPath GetRequestValidators' {Maybe Int
Maybe Text
Text
restApiId :: Text
position :: Maybe Text
limit :: Maybe Int
$sel:restApiId:GetRequestValidators' :: GetRequestValidators -> Text
$sel:position:GetRequestValidators' :: GetRequestValidators -> Maybe Text
$sel:limit:GetRequestValidators' :: GetRequestValidators -> Maybe Int
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/restapis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId,
        ByteString
"/requestvalidators"
      ]

instance Core.ToQuery GetRequestValidators where
  toQuery :: GetRequestValidators -> QueryString
toQuery GetRequestValidators' {Maybe Int
Maybe Text
Text
restApiId :: Text
position :: Maybe Text
limit :: Maybe Int
$sel:restApiId:GetRequestValidators' :: GetRequestValidators -> Text
$sel:position:GetRequestValidators' :: GetRequestValidators -> Maybe Text
$sel:limit:GetRequestValidators' :: GetRequestValidators -> Maybe Int
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"limit" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
limit, ByteString
"position" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
position]

-- | A collection of RequestValidator resources of a given RestApi.
--
-- In OpenAPI, the RequestValidators of an API is defined by the
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions.html#api-gateway-swagger-extensions-request-validators.html x-amazon-apigateway-request-validators>
-- extension.
--
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html Enable Basic Request Validation in API Gateway>
--
-- /See:/ 'newGetRequestValidatorsResponse' smart constructor.
data GetRequestValidatorsResponse = GetRequestValidatorsResponse'
  { -- | The current page of elements from this collection.
    GetRequestValidatorsResponse -> Maybe [RequestValidator]
items :: Prelude.Maybe [RequestValidator],
    GetRequestValidatorsResponse -> Maybe Text
position :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetRequestValidatorsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRequestValidatorsResponse
-> GetRequestValidatorsResponse -> Bool
(GetRequestValidatorsResponse
 -> GetRequestValidatorsResponse -> Bool)
-> (GetRequestValidatorsResponse
    -> GetRequestValidatorsResponse -> Bool)
-> Eq GetRequestValidatorsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRequestValidatorsResponse
-> GetRequestValidatorsResponse -> Bool
$c/= :: GetRequestValidatorsResponse
-> GetRequestValidatorsResponse -> Bool
== :: GetRequestValidatorsResponse
-> GetRequestValidatorsResponse -> Bool
$c== :: GetRequestValidatorsResponse
-> GetRequestValidatorsResponse -> Bool
Prelude.Eq, ReadPrec [GetRequestValidatorsResponse]
ReadPrec GetRequestValidatorsResponse
Int -> ReadS GetRequestValidatorsResponse
ReadS [GetRequestValidatorsResponse]
(Int -> ReadS GetRequestValidatorsResponse)
-> ReadS [GetRequestValidatorsResponse]
-> ReadPrec GetRequestValidatorsResponse
-> ReadPrec [GetRequestValidatorsResponse]
-> Read GetRequestValidatorsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRequestValidatorsResponse]
$creadListPrec :: ReadPrec [GetRequestValidatorsResponse]
readPrec :: ReadPrec GetRequestValidatorsResponse
$creadPrec :: ReadPrec GetRequestValidatorsResponse
readList :: ReadS [GetRequestValidatorsResponse]
$creadList :: ReadS [GetRequestValidatorsResponse]
readsPrec :: Int -> ReadS GetRequestValidatorsResponse
$creadsPrec :: Int -> ReadS GetRequestValidatorsResponse
Prelude.Read, Int -> GetRequestValidatorsResponse -> ShowS
[GetRequestValidatorsResponse] -> ShowS
GetRequestValidatorsResponse -> String
(Int -> GetRequestValidatorsResponse -> ShowS)
-> (GetRequestValidatorsResponse -> String)
-> ([GetRequestValidatorsResponse] -> ShowS)
-> Show GetRequestValidatorsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRequestValidatorsResponse] -> ShowS
$cshowList :: [GetRequestValidatorsResponse] -> ShowS
show :: GetRequestValidatorsResponse -> String
$cshow :: GetRequestValidatorsResponse -> String
showsPrec :: Int -> GetRequestValidatorsResponse -> ShowS
$cshowsPrec :: Int -> GetRequestValidatorsResponse -> ShowS
Prelude.Show, (forall x.
 GetRequestValidatorsResponse -> Rep GetRequestValidatorsResponse x)
-> (forall x.
    Rep GetRequestValidatorsResponse x -> GetRequestValidatorsResponse)
-> Generic GetRequestValidatorsResponse
forall x.
Rep GetRequestValidatorsResponse x -> GetRequestValidatorsResponse
forall x.
GetRequestValidatorsResponse -> Rep GetRequestValidatorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRequestValidatorsResponse x -> GetRequestValidatorsResponse
$cfrom :: forall x.
GetRequestValidatorsResponse -> Rep GetRequestValidatorsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRequestValidatorsResponse' 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', 'getRequestValidatorsResponse_items' - The current page of elements from this collection.
--
-- 'position', 'getRequestValidatorsResponse_position' - Undocumented member.
--
-- 'httpStatus', 'getRequestValidatorsResponse_httpStatus' - The response's http status code.
newGetRequestValidatorsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRequestValidatorsResponse
newGetRequestValidatorsResponse :: Int -> GetRequestValidatorsResponse
newGetRequestValidatorsResponse Int
pHttpStatus_ =
  GetRequestValidatorsResponse' :: Maybe [RequestValidator]
-> Maybe Text -> Int -> GetRequestValidatorsResponse
GetRequestValidatorsResponse'
    { $sel:items:GetRequestValidatorsResponse' :: Maybe [RequestValidator]
items =
        Maybe [RequestValidator]
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetRequestValidatorsResponse' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRequestValidatorsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | Undocumented member.
getRequestValidatorsResponse_position :: Lens.Lens' GetRequestValidatorsResponse (Prelude.Maybe Prelude.Text)
getRequestValidatorsResponse_position :: (Maybe Text -> f (Maybe Text))
-> GetRequestValidatorsResponse -> f GetRequestValidatorsResponse
getRequestValidatorsResponse_position = (GetRequestValidatorsResponse -> Maybe Text)
-> (GetRequestValidatorsResponse
    -> Maybe Text -> GetRequestValidatorsResponse)
-> Lens' GetRequestValidatorsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRequestValidatorsResponse' {Maybe Text
position :: Maybe Text
$sel:position:GetRequestValidatorsResponse' :: GetRequestValidatorsResponse -> Maybe Text
position} -> Maybe Text
position) (\s :: GetRequestValidatorsResponse
s@GetRequestValidatorsResponse' {} Maybe Text
a -> GetRequestValidatorsResponse
s {$sel:position:GetRequestValidatorsResponse' :: Maybe Text
position = Maybe Text
a} :: GetRequestValidatorsResponse)

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

instance Prelude.NFData GetRequestValidatorsResponse