{-# 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.Location.ListRouteCalculators
-- 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)
--
-- Lists route calculator resources in your AWS account.
--
-- This operation returns paginated results.
module Amazonka.Location.ListRouteCalculators
  ( -- * Creating a Request
    ListRouteCalculators (..),
    newListRouteCalculators,

    -- * Request Lenses
    listRouteCalculators_nextToken,
    listRouteCalculators_maxResults,

    -- * Destructuring the Response
    ListRouteCalculatorsResponse (..),
    newListRouteCalculatorsResponse,

    -- * Response Lenses
    listRouteCalculatorsResponse_nextToken,
    listRouteCalculatorsResponse_httpStatus,
    listRouteCalculatorsResponse_entries,
  )
where

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

-- | /See:/ 'newListRouteCalculators' smart constructor.
data ListRouteCalculators = ListRouteCalculators'
  { -- | The pagination token specifying which page of results to return in the
    -- response. If no token is provided, the default page is the first page.
    --
    -- Default Value: @null@
    ListRouteCalculators -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An optional maximum number of results returned in a single call.
    --
    -- Default Value: @100@
    ListRouteCalculators -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListRouteCalculators -> ListRouteCalculators -> Bool
(ListRouteCalculators -> ListRouteCalculators -> Bool)
-> (ListRouteCalculators -> ListRouteCalculators -> Bool)
-> Eq ListRouteCalculators
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRouteCalculators -> ListRouteCalculators -> Bool
$c/= :: ListRouteCalculators -> ListRouteCalculators -> Bool
== :: ListRouteCalculators -> ListRouteCalculators -> Bool
$c== :: ListRouteCalculators -> ListRouteCalculators -> Bool
Prelude.Eq, ReadPrec [ListRouteCalculators]
ReadPrec ListRouteCalculators
Int -> ReadS ListRouteCalculators
ReadS [ListRouteCalculators]
(Int -> ReadS ListRouteCalculators)
-> ReadS [ListRouteCalculators]
-> ReadPrec ListRouteCalculators
-> ReadPrec [ListRouteCalculators]
-> Read ListRouteCalculators
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRouteCalculators]
$creadListPrec :: ReadPrec [ListRouteCalculators]
readPrec :: ReadPrec ListRouteCalculators
$creadPrec :: ReadPrec ListRouteCalculators
readList :: ReadS [ListRouteCalculators]
$creadList :: ReadS [ListRouteCalculators]
readsPrec :: Int -> ReadS ListRouteCalculators
$creadsPrec :: Int -> ReadS ListRouteCalculators
Prelude.Read, Int -> ListRouteCalculators -> ShowS
[ListRouteCalculators] -> ShowS
ListRouteCalculators -> String
(Int -> ListRouteCalculators -> ShowS)
-> (ListRouteCalculators -> String)
-> ([ListRouteCalculators] -> ShowS)
-> Show ListRouteCalculators
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRouteCalculators] -> ShowS
$cshowList :: [ListRouteCalculators] -> ShowS
show :: ListRouteCalculators -> String
$cshow :: ListRouteCalculators -> String
showsPrec :: Int -> ListRouteCalculators -> ShowS
$cshowsPrec :: Int -> ListRouteCalculators -> ShowS
Prelude.Show, (forall x. ListRouteCalculators -> Rep ListRouteCalculators x)
-> (forall x. Rep ListRouteCalculators x -> ListRouteCalculators)
-> Generic ListRouteCalculators
forall x. Rep ListRouteCalculators x -> ListRouteCalculators
forall x. ListRouteCalculators -> Rep ListRouteCalculators x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRouteCalculators x -> ListRouteCalculators
$cfrom :: forall x. ListRouteCalculators -> Rep ListRouteCalculators x
Prelude.Generic)

-- |
-- Create a value of 'ListRouteCalculators' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listRouteCalculators_nextToken' - The pagination token specifying which page of results to return in the
-- response. If no token is provided, the default page is the first page.
--
-- Default Value: @null@
--
-- 'maxResults', 'listRouteCalculators_maxResults' - An optional maximum number of results returned in a single call.
--
-- Default Value: @100@
newListRouteCalculators ::
  ListRouteCalculators
newListRouteCalculators :: ListRouteCalculators
newListRouteCalculators =
  ListRouteCalculators' :: Maybe Text -> Maybe Natural -> ListRouteCalculators
ListRouteCalculators'
    { $sel:nextToken:ListRouteCalculators' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRouteCalculators' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The pagination token specifying which page of results to return in the
-- response. If no token is provided, the default page is the first page.
--
-- Default Value: @null@
listRouteCalculators_nextToken :: Lens.Lens' ListRouteCalculators (Prelude.Maybe Prelude.Text)
listRouteCalculators_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRouteCalculators -> f ListRouteCalculators
listRouteCalculators_nextToken = (ListRouteCalculators -> Maybe Text)
-> (ListRouteCalculators -> Maybe Text -> ListRouteCalculators)
-> Lens
     ListRouteCalculators ListRouteCalculators (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRouteCalculators' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRouteCalculators' :: ListRouteCalculators -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRouteCalculators
s@ListRouteCalculators' {} Maybe Text
a -> ListRouteCalculators
s {$sel:nextToken:ListRouteCalculators' :: Maybe Text
nextToken = Maybe Text
a} :: ListRouteCalculators)

-- | An optional maximum number of results returned in a single call.
--
-- Default Value: @100@
listRouteCalculators_maxResults :: Lens.Lens' ListRouteCalculators (Prelude.Maybe Prelude.Natural)
listRouteCalculators_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListRouteCalculators -> f ListRouteCalculators
listRouteCalculators_maxResults = (ListRouteCalculators -> Maybe Natural)
-> (ListRouteCalculators -> Maybe Natural -> ListRouteCalculators)
-> Lens
     ListRouteCalculators
     ListRouteCalculators
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRouteCalculators' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRouteCalculators' :: ListRouteCalculators -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRouteCalculators
s@ListRouteCalculators' {} Maybe Natural
a -> ListRouteCalculators
s {$sel:maxResults:ListRouteCalculators' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRouteCalculators)

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

instance Prelude.Hashable ListRouteCalculators

instance Prelude.NFData ListRouteCalculators

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

instance Core.ToJSON ListRouteCalculators where
  toJSON :: ListRouteCalculators -> Value
toJSON ListRouteCalculators' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListRouteCalculators' :: ListRouteCalculators -> Maybe Natural
$sel:nextToken:ListRouteCalculators' :: ListRouteCalculators -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" 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
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

instance Core.ToPath ListRouteCalculators where
  toPath :: ListRouteCalculators -> ByteString
toPath = ByteString -> ListRouteCalculators -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/routes/v0/list-calculators"

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

-- | /See:/ 'newListRouteCalculatorsResponse' smart constructor.
data ListRouteCalculatorsResponse = ListRouteCalculatorsResponse'
  { -- | A pagination token indicating there are additional pages available. You
    -- can use the token in a subsequent request to fetch the next set of
    -- results.
    ListRouteCalculatorsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListRouteCalculatorsResponse -> Int
httpStatus :: Prelude.Int,
    -- | Lists the route calculator resources that exist in your AWS account
    ListRouteCalculatorsResponse -> [ListRouteCalculatorsResponseEntry]
entries :: [ListRouteCalculatorsResponseEntry]
  }
  deriving (ListRouteCalculatorsResponse
-> ListRouteCalculatorsResponse -> Bool
(ListRouteCalculatorsResponse
 -> ListRouteCalculatorsResponse -> Bool)
-> (ListRouteCalculatorsResponse
    -> ListRouteCalculatorsResponse -> Bool)
-> Eq ListRouteCalculatorsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRouteCalculatorsResponse
-> ListRouteCalculatorsResponse -> Bool
$c/= :: ListRouteCalculatorsResponse
-> ListRouteCalculatorsResponse -> Bool
== :: ListRouteCalculatorsResponse
-> ListRouteCalculatorsResponse -> Bool
$c== :: ListRouteCalculatorsResponse
-> ListRouteCalculatorsResponse -> Bool
Prelude.Eq, ReadPrec [ListRouteCalculatorsResponse]
ReadPrec ListRouteCalculatorsResponse
Int -> ReadS ListRouteCalculatorsResponse
ReadS [ListRouteCalculatorsResponse]
(Int -> ReadS ListRouteCalculatorsResponse)
-> ReadS [ListRouteCalculatorsResponse]
-> ReadPrec ListRouteCalculatorsResponse
-> ReadPrec [ListRouteCalculatorsResponse]
-> Read ListRouteCalculatorsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRouteCalculatorsResponse]
$creadListPrec :: ReadPrec [ListRouteCalculatorsResponse]
readPrec :: ReadPrec ListRouteCalculatorsResponse
$creadPrec :: ReadPrec ListRouteCalculatorsResponse
readList :: ReadS [ListRouteCalculatorsResponse]
$creadList :: ReadS [ListRouteCalculatorsResponse]
readsPrec :: Int -> ReadS ListRouteCalculatorsResponse
$creadsPrec :: Int -> ReadS ListRouteCalculatorsResponse
Prelude.Read, Int -> ListRouteCalculatorsResponse -> ShowS
[ListRouteCalculatorsResponse] -> ShowS
ListRouteCalculatorsResponse -> String
(Int -> ListRouteCalculatorsResponse -> ShowS)
-> (ListRouteCalculatorsResponse -> String)
-> ([ListRouteCalculatorsResponse] -> ShowS)
-> Show ListRouteCalculatorsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRouteCalculatorsResponse] -> ShowS
$cshowList :: [ListRouteCalculatorsResponse] -> ShowS
show :: ListRouteCalculatorsResponse -> String
$cshow :: ListRouteCalculatorsResponse -> String
showsPrec :: Int -> ListRouteCalculatorsResponse -> ShowS
$cshowsPrec :: Int -> ListRouteCalculatorsResponse -> ShowS
Prelude.Show, (forall x.
 ListRouteCalculatorsResponse -> Rep ListRouteCalculatorsResponse x)
-> (forall x.
    Rep ListRouteCalculatorsResponse x -> ListRouteCalculatorsResponse)
-> Generic ListRouteCalculatorsResponse
forall x.
Rep ListRouteCalculatorsResponse x -> ListRouteCalculatorsResponse
forall x.
ListRouteCalculatorsResponse -> Rep ListRouteCalculatorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRouteCalculatorsResponse x -> ListRouteCalculatorsResponse
$cfrom :: forall x.
ListRouteCalculatorsResponse -> Rep ListRouteCalculatorsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRouteCalculatorsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listRouteCalculatorsResponse_nextToken' - A pagination token indicating there are additional pages available. You
-- can use the token in a subsequent request to fetch the next set of
-- results.
--
-- 'httpStatus', 'listRouteCalculatorsResponse_httpStatus' - The response's http status code.
--
-- 'entries', 'listRouteCalculatorsResponse_entries' - Lists the route calculator resources that exist in your AWS account
newListRouteCalculatorsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRouteCalculatorsResponse
newListRouteCalculatorsResponse :: Int -> ListRouteCalculatorsResponse
newListRouteCalculatorsResponse Int
pHttpStatus_ =
  ListRouteCalculatorsResponse' :: Maybe Text
-> Int
-> [ListRouteCalculatorsResponseEntry]
-> ListRouteCalculatorsResponse
ListRouteCalculatorsResponse'
    { $sel:nextToken:ListRouteCalculatorsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRouteCalculatorsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:entries:ListRouteCalculatorsResponse' :: [ListRouteCalculatorsResponseEntry]
entries = [ListRouteCalculatorsResponseEntry]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A pagination token indicating there are additional pages available. You
-- can use the token in a subsequent request to fetch the next set of
-- results.
listRouteCalculatorsResponse_nextToken :: Lens.Lens' ListRouteCalculatorsResponse (Prelude.Maybe Prelude.Text)
listRouteCalculatorsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRouteCalculatorsResponse -> f ListRouteCalculatorsResponse
listRouteCalculatorsResponse_nextToken = (ListRouteCalculatorsResponse -> Maybe Text)
-> (ListRouteCalculatorsResponse
    -> Maybe Text -> ListRouteCalculatorsResponse)
-> Lens' ListRouteCalculatorsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRouteCalculatorsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRouteCalculatorsResponse' :: ListRouteCalculatorsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRouteCalculatorsResponse
s@ListRouteCalculatorsResponse' {} Maybe Text
a -> ListRouteCalculatorsResponse
s {$sel:nextToken:ListRouteCalculatorsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRouteCalculatorsResponse)

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

-- | Lists the route calculator resources that exist in your AWS account
listRouteCalculatorsResponse_entries :: Lens.Lens' ListRouteCalculatorsResponse [ListRouteCalculatorsResponseEntry]
listRouteCalculatorsResponse_entries :: ([ListRouteCalculatorsResponseEntry]
 -> f [ListRouteCalculatorsResponseEntry])
-> ListRouteCalculatorsResponse -> f ListRouteCalculatorsResponse
listRouteCalculatorsResponse_entries = (ListRouteCalculatorsResponse
 -> [ListRouteCalculatorsResponseEntry])
-> (ListRouteCalculatorsResponse
    -> [ListRouteCalculatorsResponseEntry]
    -> ListRouteCalculatorsResponse)
-> Lens'
     ListRouteCalculatorsResponse [ListRouteCalculatorsResponseEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRouteCalculatorsResponse' {[ListRouteCalculatorsResponseEntry]
entries :: [ListRouteCalculatorsResponseEntry]
$sel:entries:ListRouteCalculatorsResponse' :: ListRouteCalculatorsResponse -> [ListRouteCalculatorsResponseEntry]
entries} -> [ListRouteCalculatorsResponseEntry]
entries) (\s :: ListRouteCalculatorsResponse
s@ListRouteCalculatorsResponse' {} [ListRouteCalculatorsResponseEntry]
a -> ListRouteCalculatorsResponse
s {$sel:entries:ListRouteCalculatorsResponse' :: [ListRouteCalculatorsResponseEntry]
entries = [ListRouteCalculatorsResponseEntry]
a} :: ListRouteCalculatorsResponse) (([ListRouteCalculatorsResponseEntry]
  -> f [ListRouteCalculatorsResponseEntry])
 -> ListRouteCalculatorsResponse -> f ListRouteCalculatorsResponse)
-> (([ListRouteCalculatorsResponseEntry]
     -> f [ListRouteCalculatorsResponseEntry])
    -> [ListRouteCalculatorsResponseEntry]
    -> f [ListRouteCalculatorsResponseEntry])
-> ([ListRouteCalculatorsResponseEntry]
    -> f [ListRouteCalculatorsResponseEntry])
-> ListRouteCalculatorsResponse
-> f ListRouteCalculatorsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ListRouteCalculatorsResponseEntry]
 -> f [ListRouteCalculatorsResponseEntry])
-> [ListRouteCalculatorsResponseEntry]
-> f [ListRouteCalculatorsResponseEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListRouteCalculatorsResponse