{-# 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.Lightsail.GetBundles
-- 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)
--
-- Returns the list of bundles that are available for purchase. A bundle
-- describes the specs for your virtual private server (or /instance/).
--
-- This operation returns paginated results.
module Amazonka.Lightsail.GetBundles
  ( -- * Creating a Request
    GetBundles (..),
    newGetBundles,

    -- * Request Lenses
    getBundles_includeInactive,
    getBundles_pageToken,

    -- * Destructuring the Response
    GetBundlesResponse (..),
    newGetBundlesResponse,

    -- * Response Lenses
    getBundlesResponse_nextPageToken,
    getBundlesResponse_bundles,
    getBundlesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetBundles' smart constructor.
data GetBundles = GetBundles'
  { -- | A Boolean value that indicates whether to include inactive bundle
    -- results in your request.
    GetBundles -> Maybe Bool
includeInactive :: Prelude.Maybe Prelude.Bool,
    -- | The token to advance to the next page of results from your request.
    --
    -- To get a page token, perform an initial @GetBundles@ request. If your
    -- results are paginated, the response will return a next page token that
    -- you can specify as the page token in a subsequent request.
    GetBundles -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetBundles -> GetBundles -> Bool
(GetBundles -> GetBundles -> Bool)
-> (GetBundles -> GetBundles -> Bool) -> Eq GetBundles
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBundles -> GetBundles -> Bool
$c/= :: GetBundles -> GetBundles -> Bool
== :: GetBundles -> GetBundles -> Bool
$c== :: GetBundles -> GetBundles -> Bool
Prelude.Eq, ReadPrec [GetBundles]
ReadPrec GetBundles
Int -> ReadS GetBundles
ReadS [GetBundles]
(Int -> ReadS GetBundles)
-> ReadS [GetBundles]
-> ReadPrec GetBundles
-> ReadPrec [GetBundles]
-> Read GetBundles
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBundles]
$creadListPrec :: ReadPrec [GetBundles]
readPrec :: ReadPrec GetBundles
$creadPrec :: ReadPrec GetBundles
readList :: ReadS [GetBundles]
$creadList :: ReadS [GetBundles]
readsPrec :: Int -> ReadS GetBundles
$creadsPrec :: Int -> ReadS GetBundles
Prelude.Read, Int -> GetBundles -> ShowS
[GetBundles] -> ShowS
GetBundles -> String
(Int -> GetBundles -> ShowS)
-> (GetBundles -> String)
-> ([GetBundles] -> ShowS)
-> Show GetBundles
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBundles] -> ShowS
$cshowList :: [GetBundles] -> ShowS
show :: GetBundles -> String
$cshow :: GetBundles -> String
showsPrec :: Int -> GetBundles -> ShowS
$cshowsPrec :: Int -> GetBundles -> ShowS
Prelude.Show, (forall x. GetBundles -> Rep GetBundles x)
-> (forall x. Rep GetBundles x -> GetBundles) -> Generic GetBundles
forall x. Rep GetBundles x -> GetBundles
forall x. GetBundles -> Rep GetBundles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBundles x -> GetBundles
$cfrom :: forall x. GetBundles -> Rep GetBundles x
Prelude.Generic)

-- |
-- Create a value of 'GetBundles' 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:
--
-- 'includeInactive', 'getBundles_includeInactive' - A Boolean value that indicates whether to include inactive bundle
-- results in your request.
--
-- 'pageToken', 'getBundles_pageToken' - The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetBundles@ request. If your
-- results are paginated, the response will return a next page token that
-- you can specify as the page token in a subsequent request.
newGetBundles ::
  GetBundles
newGetBundles :: GetBundles
newGetBundles =
  GetBundles' :: Maybe Bool -> Maybe Text -> GetBundles
GetBundles'
    { $sel:includeInactive:GetBundles' :: Maybe Bool
includeInactive = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:GetBundles' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A Boolean value that indicates whether to include inactive bundle
-- results in your request.
getBundles_includeInactive :: Lens.Lens' GetBundles (Prelude.Maybe Prelude.Bool)
getBundles_includeInactive :: (Maybe Bool -> f (Maybe Bool)) -> GetBundles -> f GetBundles
getBundles_includeInactive = (GetBundles -> Maybe Bool)
-> (GetBundles -> Maybe Bool -> GetBundles)
-> Lens GetBundles GetBundles (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBundles' {Maybe Bool
includeInactive :: Maybe Bool
$sel:includeInactive:GetBundles' :: GetBundles -> Maybe Bool
includeInactive} -> Maybe Bool
includeInactive) (\s :: GetBundles
s@GetBundles' {} Maybe Bool
a -> GetBundles
s {$sel:includeInactive:GetBundles' :: Maybe Bool
includeInactive = Maybe Bool
a} :: GetBundles)

-- | The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetBundles@ request. If your
-- results are paginated, the response will return a next page token that
-- you can specify as the page token in a subsequent request.
getBundles_pageToken :: Lens.Lens' GetBundles (Prelude.Maybe Prelude.Text)
getBundles_pageToken :: (Maybe Text -> f (Maybe Text)) -> GetBundles -> f GetBundles
getBundles_pageToken = (GetBundles -> Maybe Text)
-> (GetBundles -> Maybe Text -> GetBundles)
-> Lens GetBundles GetBundles (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBundles' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetBundles' :: GetBundles -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: GetBundles
s@GetBundles' {} Maybe Text
a -> GetBundles
s {$sel:pageToken:GetBundles' :: Maybe Text
pageToken = Maybe Text
a} :: GetBundles)

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

instance Prelude.NFData GetBundles

instance Core.ToHeaders GetBundles where
  toHeaders :: GetBundles -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetBundles -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.GetBundles" ::
                          Prelude.ByteString
                      ),
            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.ToJSON GetBundles where
  toJSON :: GetBundles -> Value
toJSON GetBundles' {Maybe Bool
Maybe Text
pageToken :: Maybe Text
includeInactive :: Maybe Bool
$sel:pageToken:GetBundles' :: GetBundles -> Maybe Text
$sel:includeInactive:GetBundles' :: GetBundles -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"includeInactive" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeInactive,
            (Text
"pageToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pageToken
          ]
      )

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

instance Core.ToQuery GetBundles where
  toQuery :: GetBundles -> QueryString
toQuery = QueryString -> GetBundles -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetBundlesResponse' smart constructor.
data GetBundlesResponse = GetBundlesResponse'
  { -- | The token to advance to the next page of results from your request.
    --
    -- A next page token is not returned if there are no more results to
    -- display.
    --
    -- To get the next page of results, perform another @GetBundles@ request
    -- and specify the next page token using the @pageToken@ parameter.
    GetBundlesResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | An array of key-value pairs that contains information about the
    -- available bundles.
    GetBundlesResponse -> Maybe [Bundle]
bundles :: Prelude.Maybe [Bundle],
    -- | The response's http status code.
    GetBundlesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBundlesResponse -> GetBundlesResponse -> Bool
(GetBundlesResponse -> GetBundlesResponse -> Bool)
-> (GetBundlesResponse -> GetBundlesResponse -> Bool)
-> Eq GetBundlesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBundlesResponse -> GetBundlesResponse -> Bool
$c/= :: GetBundlesResponse -> GetBundlesResponse -> Bool
== :: GetBundlesResponse -> GetBundlesResponse -> Bool
$c== :: GetBundlesResponse -> GetBundlesResponse -> Bool
Prelude.Eq, ReadPrec [GetBundlesResponse]
ReadPrec GetBundlesResponse
Int -> ReadS GetBundlesResponse
ReadS [GetBundlesResponse]
(Int -> ReadS GetBundlesResponse)
-> ReadS [GetBundlesResponse]
-> ReadPrec GetBundlesResponse
-> ReadPrec [GetBundlesResponse]
-> Read GetBundlesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBundlesResponse]
$creadListPrec :: ReadPrec [GetBundlesResponse]
readPrec :: ReadPrec GetBundlesResponse
$creadPrec :: ReadPrec GetBundlesResponse
readList :: ReadS [GetBundlesResponse]
$creadList :: ReadS [GetBundlesResponse]
readsPrec :: Int -> ReadS GetBundlesResponse
$creadsPrec :: Int -> ReadS GetBundlesResponse
Prelude.Read, Int -> GetBundlesResponse -> ShowS
[GetBundlesResponse] -> ShowS
GetBundlesResponse -> String
(Int -> GetBundlesResponse -> ShowS)
-> (GetBundlesResponse -> String)
-> ([GetBundlesResponse] -> ShowS)
-> Show GetBundlesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBundlesResponse] -> ShowS
$cshowList :: [GetBundlesResponse] -> ShowS
show :: GetBundlesResponse -> String
$cshow :: GetBundlesResponse -> String
showsPrec :: Int -> GetBundlesResponse -> ShowS
$cshowsPrec :: Int -> GetBundlesResponse -> ShowS
Prelude.Show, (forall x. GetBundlesResponse -> Rep GetBundlesResponse x)
-> (forall x. Rep GetBundlesResponse x -> GetBundlesResponse)
-> Generic GetBundlesResponse
forall x. Rep GetBundlesResponse x -> GetBundlesResponse
forall x. GetBundlesResponse -> Rep GetBundlesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBundlesResponse x -> GetBundlesResponse
$cfrom :: forall x. GetBundlesResponse -> Rep GetBundlesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBundlesResponse' 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:
--
-- 'nextPageToken', 'getBundlesResponse_nextPageToken' - The token to advance to the next page of results from your request.
--
-- A next page token is not returned if there are no more results to
-- display.
--
-- To get the next page of results, perform another @GetBundles@ request
-- and specify the next page token using the @pageToken@ parameter.
--
-- 'bundles', 'getBundlesResponse_bundles' - An array of key-value pairs that contains information about the
-- available bundles.
--
-- 'httpStatus', 'getBundlesResponse_httpStatus' - The response's http status code.
newGetBundlesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBundlesResponse
newGetBundlesResponse :: Int -> GetBundlesResponse
newGetBundlesResponse Int
pHttpStatus_ =
  GetBundlesResponse' :: Maybe Text -> Maybe [Bundle] -> Int -> GetBundlesResponse
GetBundlesResponse'
    { $sel:nextPageToken:GetBundlesResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bundles:GetBundlesResponse' :: Maybe [Bundle]
bundles = Maybe [Bundle]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetBundlesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to advance to the next page of results from your request.
--
-- A next page token is not returned if there are no more results to
-- display.
--
-- To get the next page of results, perform another @GetBundles@ request
-- and specify the next page token using the @pageToken@ parameter.
getBundlesResponse_nextPageToken :: Lens.Lens' GetBundlesResponse (Prelude.Maybe Prelude.Text)
getBundlesResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetBundlesResponse -> f GetBundlesResponse
getBundlesResponse_nextPageToken = (GetBundlesResponse -> Maybe Text)
-> (GetBundlesResponse -> Maybe Text -> GetBundlesResponse)
-> Lens' GetBundlesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBundlesResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetBundlesResponse' :: GetBundlesResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetBundlesResponse
s@GetBundlesResponse' {} Maybe Text
a -> GetBundlesResponse
s {$sel:nextPageToken:GetBundlesResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetBundlesResponse)

-- | An array of key-value pairs that contains information about the
-- available bundles.
getBundlesResponse_bundles :: Lens.Lens' GetBundlesResponse (Prelude.Maybe [Bundle])
getBundlesResponse_bundles :: (Maybe [Bundle] -> f (Maybe [Bundle]))
-> GetBundlesResponse -> f GetBundlesResponse
getBundlesResponse_bundles = (GetBundlesResponse -> Maybe [Bundle])
-> (GetBundlesResponse -> Maybe [Bundle] -> GetBundlesResponse)
-> Lens' GetBundlesResponse (Maybe [Bundle])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBundlesResponse' {Maybe [Bundle]
bundles :: Maybe [Bundle]
$sel:bundles:GetBundlesResponse' :: GetBundlesResponse -> Maybe [Bundle]
bundles} -> Maybe [Bundle]
bundles) (\s :: GetBundlesResponse
s@GetBundlesResponse' {} Maybe [Bundle]
a -> GetBundlesResponse
s {$sel:bundles:GetBundlesResponse' :: Maybe [Bundle]
bundles = Maybe [Bundle]
a} :: GetBundlesResponse) ((Maybe [Bundle] -> f (Maybe [Bundle]))
 -> GetBundlesResponse -> f GetBundlesResponse)
-> ((Maybe [Bundle] -> f (Maybe [Bundle]))
    -> Maybe [Bundle] -> f (Maybe [Bundle]))
-> (Maybe [Bundle] -> f (Maybe [Bundle]))
-> GetBundlesResponse
-> f GetBundlesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Bundle] [Bundle] [Bundle] [Bundle]
-> Iso
     (Maybe [Bundle]) (Maybe [Bundle]) (Maybe [Bundle]) (Maybe [Bundle])
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 [Bundle] [Bundle] [Bundle] [Bundle]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetBundlesResponse