{-# 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.GetLoadBalancers
-- 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 information about all load balancers in an account.
--
-- This operation returns paginated results.
module Amazonka.Lightsail.GetLoadBalancers
  ( -- * Creating a Request
    GetLoadBalancers (..),
    newGetLoadBalancers,

    -- * Request Lenses
    getLoadBalancers_pageToken,

    -- * Destructuring the Response
    GetLoadBalancersResponse (..),
    newGetLoadBalancersResponse,

    -- * Response Lenses
    getLoadBalancersResponse_nextPageToken,
    getLoadBalancersResponse_loadBalancers,
    getLoadBalancersResponse_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:/ 'newGetLoadBalancers' smart constructor.
data GetLoadBalancers = GetLoadBalancers'
  { -- | The token to advance to the next page of results from your request.
    --
    -- To get a page token, perform an initial @GetLoadBalancers@ 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.
    GetLoadBalancers -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetLoadBalancers -> GetLoadBalancers -> Bool
(GetLoadBalancers -> GetLoadBalancers -> Bool)
-> (GetLoadBalancers -> GetLoadBalancers -> Bool)
-> Eq GetLoadBalancers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLoadBalancers -> GetLoadBalancers -> Bool
$c/= :: GetLoadBalancers -> GetLoadBalancers -> Bool
== :: GetLoadBalancers -> GetLoadBalancers -> Bool
$c== :: GetLoadBalancers -> GetLoadBalancers -> Bool
Prelude.Eq, ReadPrec [GetLoadBalancers]
ReadPrec GetLoadBalancers
Int -> ReadS GetLoadBalancers
ReadS [GetLoadBalancers]
(Int -> ReadS GetLoadBalancers)
-> ReadS [GetLoadBalancers]
-> ReadPrec GetLoadBalancers
-> ReadPrec [GetLoadBalancers]
-> Read GetLoadBalancers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLoadBalancers]
$creadListPrec :: ReadPrec [GetLoadBalancers]
readPrec :: ReadPrec GetLoadBalancers
$creadPrec :: ReadPrec GetLoadBalancers
readList :: ReadS [GetLoadBalancers]
$creadList :: ReadS [GetLoadBalancers]
readsPrec :: Int -> ReadS GetLoadBalancers
$creadsPrec :: Int -> ReadS GetLoadBalancers
Prelude.Read, Int -> GetLoadBalancers -> ShowS
[GetLoadBalancers] -> ShowS
GetLoadBalancers -> String
(Int -> GetLoadBalancers -> ShowS)
-> (GetLoadBalancers -> String)
-> ([GetLoadBalancers] -> ShowS)
-> Show GetLoadBalancers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLoadBalancers] -> ShowS
$cshowList :: [GetLoadBalancers] -> ShowS
show :: GetLoadBalancers -> String
$cshow :: GetLoadBalancers -> String
showsPrec :: Int -> GetLoadBalancers -> ShowS
$cshowsPrec :: Int -> GetLoadBalancers -> ShowS
Prelude.Show, (forall x. GetLoadBalancers -> Rep GetLoadBalancers x)
-> (forall x. Rep GetLoadBalancers x -> GetLoadBalancers)
-> Generic GetLoadBalancers
forall x. Rep GetLoadBalancers x -> GetLoadBalancers
forall x. GetLoadBalancers -> Rep GetLoadBalancers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetLoadBalancers x -> GetLoadBalancers
$cfrom :: forall x. GetLoadBalancers -> Rep GetLoadBalancers x
Prelude.Generic)

-- |
-- Create a value of 'GetLoadBalancers' 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:
--
-- 'pageToken', 'getLoadBalancers_pageToken' - The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetLoadBalancers@ 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.
newGetLoadBalancers ::
  GetLoadBalancers
newGetLoadBalancers :: GetLoadBalancers
newGetLoadBalancers =
  GetLoadBalancers' :: Maybe Text -> GetLoadBalancers
GetLoadBalancers' {$sel:pageToken:GetLoadBalancers' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetLoadBalancers@ 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.
getLoadBalancers_pageToken :: Lens.Lens' GetLoadBalancers (Prelude.Maybe Prelude.Text)
getLoadBalancers_pageToken :: (Maybe Text -> f (Maybe Text))
-> GetLoadBalancers -> f GetLoadBalancers
getLoadBalancers_pageToken = (GetLoadBalancers -> Maybe Text)
-> (GetLoadBalancers -> Maybe Text -> GetLoadBalancers)
-> Lens GetLoadBalancers GetLoadBalancers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancers' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetLoadBalancers' :: GetLoadBalancers -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: GetLoadBalancers
s@GetLoadBalancers' {} Maybe Text
a -> GetLoadBalancers
s {$sel:pageToken:GetLoadBalancers' :: Maybe Text
pageToken = Maybe Text
a} :: GetLoadBalancers)

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

instance Prelude.NFData GetLoadBalancers

instance Core.ToHeaders GetLoadBalancers where
  toHeaders :: GetLoadBalancers -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetLoadBalancers -> 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.GetLoadBalancers" ::
                          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 GetLoadBalancers where
  toJSON :: GetLoadBalancers -> Value
toJSON GetLoadBalancers' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetLoadBalancers' :: GetLoadBalancers -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(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 GetLoadBalancers where
  toPath :: GetLoadBalancers -> ByteString
toPath = ByteString -> GetLoadBalancers -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetLoadBalancersResponse' smart constructor.
data GetLoadBalancersResponse = GetLoadBalancersResponse'
  { -- | 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 @GetLoadBalancers@
    -- request and specify the next page token using the @pageToken@ parameter.
    GetLoadBalancersResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | An array of LoadBalancer objects describing your load balancers.
    GetLoadBalancersResponse -> Maybe [LoadBalancer]
loadBalancers :: Prelude.Maybe [LoadBalancer],
    -- | The response's http status code.
    GetLoadBalancersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetLoadBalancersResponse -> GetLoadBalancersResponse -> Bool
(GetLoadBalancersResponse -> GetLoadBalancersResponse -> Bool)
-> (GetLoadBalancersResponse -> GetLoadBalancersResponse -> Bool)
-> Eq GetLoadBalancersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLoadBalancersResponse -> GetLoadBalancersResponse -> Bool
$c/= :: GetLoadBalancersResponse -> GetLoadBalancersResponse -> Bool
== :: GetLoadBalancersResponse -> GetLoadBalancersResponse -> Bool
$c== :: GetLoadBalancersResponse -> GetLoadBalancersResponse -> Bool
Prelude.Eq, ReadPrec [GetLoadBalancersResponse]
ReadPrec GetLoadBalancersResponse
Int -> ReadS GetLoadBalancersResponse
ReadS [GetLoadBalancersResponse]
(Int -> ReadS GetLoadBalancersResponse)
-> ReadS [GetLoadBalancersResponse]
-> ReadPrec GetLoadBalancersResponse
-> ReadPrec [GetLoadBalancersResponse]
-> Read GetLoadBalancersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLoadBalancersResponse]
$creadListPrec :: ReadPrec [GetLoadBalancersResponse]
readPrec :: ReadPrec GetLoadBalancersResponse
$creadPrec :: ReadPrec GetLoadBalancersResponse
readList :: ReadS [GetLoadBalancersResponse]
$creadList :: ReadS [GetLoadBalancersResponse]
readsPrec :: Int -> ReadS GetLoadBalancersResponse
$creadsPrec :: Int -> ReadS GetLoadBalancersResponse
Prelude.Read, Int -> GetLoadBalancersResponse -> ShowS
[GetLoadBalancersResponse] -> ShowS
GetLoadBalancersResponse -> String
(Int -> GetLoadBalancersResponse -> ShowS)
-> (GetLoadBalancersResponse -> String)
-> ([GetLoadBalancersResponse] -> ShowS)
-> Show GetLoadBalancersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLoadBalancersResponse] -> ShowS
$cshowList :: [GetLoadBalancersResponse] -> ShowS
show :: GetLoadBalancersResponse -> String
$cshow :: GetLoadBalancersResponse -> String
showsPrec :: Int -> GetLoadBalancersResponse -> ShowS
$cshowsPrec :: Int -> GetLoadBalancersResponse -> ShowS
Prelude.Show, (forall x.
 GetLoadBalancersResponse -> Rep GetLoadBalancersResponse x)
-> (forall x.
    Rep GetLoadBalancersResponse x -> GetLoadBalancersResponse)
-> Generic GetLoadBalancersResponse
forall x.
Rep GetLoadBalancersResponse x -> GetLoadBalancersResponse
forall x.
GetLoadBalancersResponse -> Rep GetLoadBalancersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetLoadBalancersResponse x -> GetLoadBalancersResponse
$cfrom :: forall x.
GetLoadBalancersResponse -> Rep GetLoadBalancersResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetLoadBalancersResponse' 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', 'getLoadBalancersResponse_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 @GetLoadBalancers@
-- request and specify the next page token using the @pageToken@ parameter.
--
-- 'loadBalancers', 'getLoadBalancersResponse_loadBalancers' - An array of LoadBalancer objects describing your load balancers.
--
-- 'httpStatus', 'getLoadBalancersResponse_httpStatus' - The response's http status code.
newGetLoadBalancersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetLoadBalancersResponse
newGetLoadBalancersResponse :: Int -> GetLoadBalancersResponse
newGetLoadBalancersResponse Int
pHttpStatus_ =
  GetLoadBalancersResponse' :: Maybe Text
-> Maybe [LoadBalancer] -> Int -> GetLoadBalancersResponse
GetLoadBalancersResponse'
    { $sel:nextPageToken:GetLoadBalancersResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:loadBalancers:GetLoadBalancersResponse' :: Maybe [LoadBalancer]
loadBalancers = Maybe [LoadBalancer]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetLoadBalancersResponse' :: 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 @GetLoadBalancers@
-- request and specify the next page token using the @pageToken@ parameter.
getLoadBalancersResponse_nextPageToken :: Lens.Lens' GetLoadBalancersResponse (Prelude.Maybe Prelude.Text)
getLoadBalancersResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetLoadBalancersResponse -> f GetLoadBalancersResponse
getLoadBalancersResponse_nextPageToken = (GetLoadBalancersResponse -> Maybe Text)
-> (GetLoadBalancersResponse
    -> Maybe Text -> GetLoadBalancersResponse)
-> Lens' GetLoadBalancersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancersResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetLoadBalancersResponse' :: GetLoadBalancersResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetLoadBalancersResponse
s@GetLoadBalancersResponse' {} Maybe Text
a -> GetLoadBalancersResponse
s {$sel:nextPageToken:GetLoadBalancersResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetLoadBalancersResponse)

-- | An array of LoadBalancer objects describing your load balancers.
getLoadBalancersResponse_loadBalancers :: Lens.Lens' GetLoadBalancersResponse (Prelude.Maybe [LoadBalancer])
getLoadBalancersResponse_loadBalancers :: (Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
-> GetLoadBalancersResponse -> f GetLoadBalancersResponse
getLoadBalancersResponse_loadBalancers = (GetLoadBalancersResponse -> Maybe [LoadBalancer])
-> (GetLoadBalancersResponse
    -> Maybe [LoadBalancer] -> GetLoadBalancersResponse)
-> Lens' GetLoadBalancersResponse (Maybe [LoadBalancer])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancersResponse' {Maybe [LoadBalancer]
loadBalancers :: Maybe [LoadBalancer]
$sel:loadBalancers:GetLoadBalancersResponse' :: GetLoadBalancersResponse -> Maybe [LoadBalancer]
loadBalancers} -> Maybe [LoadBalancer]
loadBalancers) (\s :: GetLoadBalancersResponse
s@GetLoadBalancersResponse' {} Maybe [LoadBalancer]
a -> GetLoadBalancersResponse
s {$sel:loadBalancers:GetLoadBalancersResponse' :: Maybe [LoadBalancer]
loadBalancers = Maybe [LoadBalancer]
a} :: GetLoadBalancersResponse) ((Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
 -> GetLoadBalancersResponse -> f GetLoadBalancersResponse)
-> ((Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
    -> Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
-> (Maybe [LoadBalancer] -> f (Maybe [LoadBalancer]))
-> GetLoadBalancersResponse
-> f GetLoadBalancersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [LoadBalancer] [LoadBalancer] [LoadBalancer] [LoadBalancer]
-> Iso
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
     (Maybe [LoadBalancer])
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 [LoadBalancer] [LoadBalancer] [LoadBalancer] [LoadBalancer]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetLoadBalancersResponse