{-# 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.GetUsagePlans
-- 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 all the usage plans of the caller\'s account.
--
-- This operation returns paginated results.
module Amazonka.APIGateway.GetUsagePlans
  ( -- * Creating a Request
    GetUsagePlans (..),
    newGetUsagePlans,

    -- * Request Lenses
    getUsagePlans_keyId,
    getUsagePlans_limit,
    getUsagePlans_position,

    -- * Destructuring the Response
    GetUsagePlansResponse (..),
    newGetUsagePlansResponse,

    -- * Response Lenses
    getUsagePlansResponse_items,
    getUsagePlansResponse_position,
    getUsagePlansResponse_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

-- | The GET request to get all the usage plans of the caller\'s account.
--
-- /See:/ 'newGetUsagePlans' smart constructor.
data GetUsagePlans = GetUsagePlans'
  { -- | The identifier of the API key associated with the usage plans.
    GetUsagePlans -> Maybe Text
keyId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of returned results per page. The default value is 25
    -- and the maximum value is 500.
    GetUsagePlans -> Maybe Int
limit :: Prelude.Maybe Prelude.Int,
    -- | The current pagination position in the paged result set.
    GetUsagePlans -> Maybe Text
position :: Prelude.Maybe Prelude.Text
  }
  deriving (GetUsagePlans -> GetUsagePlans -> Bool
(GetUsagePlans -> GetUsagePlans -> Bool)
-> (GetUsagePlans -> GetUsagePlans -> Bool) -> Eq GetUsagePlans
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUsagePlans -> GetUsagePlans -> Bool
$c/= :: GetUsagePlans -> GetUsagePlans -> Bool
== :: GetUsagePlans -> GetUsagePlans -> Bool
$c== :: GetUsagePlans -> GetUsagePlans -> Bool
Prelude.Eq, ReadPrec [GetUsagePlans]
ReadPrec GetUsagePlans
Int -> ReadS GetUsagePlans
ReadS [GetUsagePlans]
(Int -> ReadS GetUsagePlans)
-> ReadS [GetUsagePlans]
-> ReadPrec GetUsagePlans
-> ReadPrec [GetUsagePlans]
-> Read GetUsagePlans
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUsagePlans]
$creadListPrec :: ReadPrec [GetUsagePlans]
readPrec :: ReadPrec GetUsagePlans
$creadPrec :: ReadPrec GetUsagePlans
readList :: ReadS [GetUsagePlans]
$creadList :: ReadS [GetUsagePlans]
readsPrec :: Int -> ReadS GetUsagePlans
$creadsPrec :: Int -> ReadS GetUsagePlans
Prelude.Read, Int -> GetUsagePlans -> ShowS
[GetUsagePlans] -> ShowS
GetUsagePlans -> String
(Int -> GetUsagePlans -> ShowS)
-> (GetUsagePlans -> String)
-> ([GetUsagePlans] -> ShowS)
-> Show GetUsagePlans
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUsagePlans] -> ShowS
$cshowList :: [GetUsagePlans] -> ShowS
show :: GetUsagePlans -> String
$cshow :: GetUsagePlans -> String
showsPrec :: Int -> GetUsagePlans -> ShowS
$cshowsPrec :: Int -> GetUsagePlans -> ShowS
Prelude.Show, (forall x. GetUsagePlans -> Rep GetUsagePlans x)
-> (forall x. Rep GetUsagePlans x -> GetUsagePlans)
-> Generic GetUsagePlans
forall x. Rep GetUsagePlans x -> GetUsagePlans
forall x. GetUsagePlans -> Rep GetUsagePlans x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetUsagePlans x -> GetUsagePlans
$cfrom :: forall x. GetUsagePlans -> Rep GetUsagePlans x
Prelude.Generic)

-- |
-- Create a value of 'GetUsagePlans' 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:
--
-- 'keyId', 'getUsagePlans_keyId' - The identifier of the API key associated with the usage plans.
--
-- 'limit', 'getUsagePlans_limit' - The maximum number of returned results per page. The default value is 25
-- and the maximum value is 500.
--
-- 'position', 'getUsagePlans_position' - The current pagination position in the paged result set.
newGetUsagePlans ::
  GetUsagePlans
newGetUsagePlans :: GetUsagePlans
newGetUsagePlans =
  GetUsagePlans' :: Maybe Text -> Maybe Int -> Maybe Text -> GetUsagePlans
GetUsagePlans'
    { $sel:keyId:GetUsagePlans' :: Maybe Text
keyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:GetUsagePlans' :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetUsagePlans' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the API key associated with the usage plans.
getUsagePlans_keyId :: Lens.Lens' GetUsagePlans (Prelude.Maybe Prelude.Text)
getUsagePlans_keyId :: (Maybe Text -> f (Maybe Text)) -> GetUsagePlans -> f GetUsagePlans
getUsagePlans_keyId = (GetUsagePlans -> Maybe Text)
-> (GetUsagePlans -> Maybe Text -> GetUsagePlans)
-> Lens GetUsagePlans GetUsagePlans (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUsagePlans' {Maybe Text
keyId :: Maybe Text
$sel:keyId:GetUsagePlans' :: GetUsagePlans -> Maybe Text
keyId} -> Maybe Text
keyId) (\s :: GetUsagePlans
s@GetUsagePlans' {} Maybe Text
a -> GetUsagePlans
s {$sel:keyId:GetUsagePlans' :: Maybe Text
keyId = Maybe Text
a} :: GetUsagePlans)

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

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

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

instance Prelude.NFData GetUsagePlans

instance Core.ToHeaders GetUsagePlans where
  toHeaders :: GetUsagePlans -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetUsagePlans -> 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 GetUsagePlans where
  toPath :: GetUsagePlans -> ByteString
toPath = ByteString -> GetUsagePlans -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/usageplans"

instance Core.ToQuery GetUsagePlans where
  toQuery :: GetUsagePlans -> QueryString
toQuery GetUsagePlans' {Maybe Int
Maybe Text
position :: Maybe Text
limit :: Maybe Int
keyId :: Maybe Text
$sel:position:GetUsagePlans' :: GetUsagePlans -> Maybe Text
$sel:limit:GetUsagePlans' :: GetUsagePlans -> Maybe Int
$sel:keyId:GetUsagePlans' :: GetUsagePlans -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"keyId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
keyId,
        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
      ]

-- | Represents a collection of usage plans for an AWS account.
--
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html Create and Use Usage Plans>
--
-- /See:/ 'newGetUsagePlansResponse' smart constructor.
data GetUsagePlansResponse = GetUsagePlansResponse'
  { -- | The current page of elements from this collection.
    GetUsagePlansResponse -> Maybe [UsagePlan]
items :: Prelude.Maybe [UsagePlan],
    GetUsagePlansResponse -> Maybe Text
position :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetUsagePlansResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetUsagePlansResponse -> GetUsagePlansResponse -> Bool
(GetUsagePlansResponse -> GetUsagePlansResponse -> Bool)
-> (GetUsagePlansResponse -> GetUsagePlansResponse -> Bool)
-> Eq GetUsagePlansResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUsagePlansResponse -> GetUsagePlansResponse -> Bool
$c/= :: GetUsagePlansResponse -> GetUsagePlansResponse -> Bool
== :: GetUsagePlansResponse -> GetUsagePlansResponse -> Bool
$c== :: GetUsagePlansResponse -> GetUsagePlansResponse -> Bool
Prelude.Eq, ReadPrec [GetUsagePlansResponse]
ReadPrec GetUsagePlansResponse
Int -> ReadS GetUsagePlansResponse
ReadS [GetUsagePlansResponse]
(Int -> ReadS GetUsagePlansResponse)
-> ReadS [GetUsagePlansResponse]
-> ReadPrec GetUsagePlansResponse
-> ReadPrec [GetUsagePlansResponse]
-> Read GetUsagePlansResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetUsagePlansResponse]
$creadListPrec :: ReadPrec [GetUsagePlansResponse]
readPrec :: ReadPrec GetUsagePlansResponse
$creadPrec :: ReadPrec GetUsagePlansResponse
readList :: ReadS [GetUsagePlansResponse]
$creadList :: ReadS [GetUsagePlansResponse]
readsPrec :: Int -> ReadS GetUsagePlansResponse
$creadsPrec :: Int -> ReadS GetUsagePlansResponse
Prelude.Read, Int -> GetUsagePlansResponse -> ShowS
[GetUsagePlansResponse] -> ShowS
GetUsagePlansResponse -> String
(Int -> GetUsagePlansResponse -> ShowS)
-> (GetUsagePlansResponse -> String)
-> ([GetUsagePlansResponse] -> ShowS)
-> Show GetUsagePlansResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUsagePlansResponse] -> ShowS
$cshowList :: [GetUsagePlansResponse] -> ShowS
show :: GetUsagePlansResponse -> String
$cshow :: GetUsagePlansResponse -> String
showsPrec :: Int -> GetUsagePlansResponse -> ShowS
$cshowsPrec :: Int -> GetUsagePlansResponse -> ShowS
Prelude.Show, (forall x. GetUsagePlansResponse -> Rep GetUsagePlansResponse x)
-> (forall x. Rep GetUsagePlansResponse x -> GetUsagePlansResponse)
-> Generic GetUsagePlansResponse
forall x. Rep GetUsagePlansResponse x -> GetUsagePlansResponse
forall x. GetUsagePlansResponse -> Rep GetUsagePlansResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetUsagePlansResponse x -> GetUsagePlansResponse
$cfrom :: forall x. GetUsagePlansResponse -> Rep GetUsagePlansResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetUsagePlansResponse' 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', 'getUsagePlansResponse_items' - The current page of elements from this collection.
--
-- 'position', 'getUsagePlansResponse_position' - Undocumented member.
--
-- 'httpStatus', 'getUsagePlansResponse_httpStatus' - The response's http status code.
newGetUsagePlansResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetUsagePlansResponse
newGetUsagePlansResponse :: Int -> GetUsagePlansResponse
newGetUsagePlansResponse Int
pHttpStatus_ =
  GetUsagePlansResponse' :: Maybe [UsagePlan] -> Maybe Text -> Int -> GetUsagePlansResponse
GetUsagePlansResponse'
    { $sel:items:GetUsagePlansResponse' :: Maybe [UsagePlan]
items = Maybe [UsagePlan]
forall a. Maybe a
Prelude.Nothing,
      $sel:position:GetUsagePlansResponse' :: Maybe Text
position = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetUsagePlansResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

instance Prelude.NFData GetUsagePlansResponse