{-# 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.DirectoryService.ListIpRoutes
-- 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 the address blocks that you have added to a directory.
--
-- This operation returns paginated results.
module Amazonka.DirectoryService.ListIpRoutes
  ( -- * Creating a Request
    ListIpRoutes (..),
    newListIpRoutes,

    -- * Request Lenses
    listIpRoutes_nextToken,
    listIpRoutes_limit,
    listIpRoutes_directoryId,

    -- * Destructuring the Response
    ListIpRoutesResponse (..),
    newListIpRoutesResponse,

    -- * Response Lenses
    listIpRoutesResponse_ipRoutesInfo,
    listIpRoutesResponse_nextToken,
    listIpRoutesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListIpRoutes' smart constructor.
data ListIpRoutes = ListIpRoutes'
  { -- | The /ListIpRoutes.NextToken/ value from a previous call to ListIpRoutes.
    -- Pass null if this is the first call.
    ListIpRoutes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Maximum number of items to return. If this value is zero, the maximum
    -- number of items is specified by the limitations of the operation.
    ListIpRoutes -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | Identifier (ID) of the directory for which you want to retrieve the IP
    -- addresses.
    ListIpRoutes -> Text
directoryId :: Prelude.Text
  }
  deriving (ListIpRoutes -> ListIpRoutes -> Bool
(ListIpRoutes -> ListIpRoutes -> Bool)
-> (ListIpRoutes -> ListIpRoutes -> Bool) -> Eq ListIpRoutes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIpRoutes -> ListIpRoutes -> Bool
$c/= :: ListIpRoutes -> ListIpRoutes -> Bool
== :: ListIpRoutes -> ListIpRoutes -> Bool
$c== :: ListIpRoutes -> ListIpRoutes -> Bool
Prelude.Eq, ReadPrec [ListIpRoutes]
ReadPrec ListIpRoutes
Int -> ReadS ListIpRoutes
ReadS [ListIpRoutes]
(Int -> ReadS ListIpRoutes)
-> ReadS [ListIpRoutes]
-> ReadPrec ListIpRoutes
-> ReadPrec [ListIpRoutes]
-> Read ListIpRoutes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIpRoutes]
$creadListPrec :: ReadPrec [ListIpRoutes]
readPrec :: ReadPrec ListIpRoutes
$creadPrec :: ReadPrec ListIpRoutes
readList :: ReadS [ListIpRoutes]
$creadList :: ReadS [ListIpRoutes]
readsPrec :: Int -> ReadS ListIpRoutes
$creadsPrec :: Int -> ReadS ListIpRoutes
Prelude.Read, Int -> ListIpRoutes -> ShowS
[ListIpRoutes] -> ShowS
ListIpRoutes -> String
(Int -> ListIpRoutes -> ShowS)
-> (ListIpRoutes -> String)
-> ([ListIpRoutes] -> ShowS)
-> Show ListIpRoutes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIpRoutes] -> ShowS
$cshowList :: [ListIpRoutes] -> ShowS
show :: ListIpRoutes -> String
$cshow :: ListIpRoutes -> String
showsPrec :: Int -> ListIpRoutes -> ShowS
$cshowsPrec :: Int -> ListIpRoutes -> ShowS
Prelude.Show, (forall x. ListIpRoutes -> Rep ListIpRoutes x)
-> (forall x. Rep ListIpRoutes x -> ListIpRoutes)
-> Generic ListIpRoutes
forall x. Rep ListIpRoutes x -> ListIpRoutes
forall x. ListIpRoutes -> Rep ListIpRoutes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIpRoutes x -> ListIpRoutes
$cfrom :: forall x. ListIpRoutes -> Rep ListIpRoutes x
Prelude.Generic)

-- |
-- Create a value of 'ListIpRoutes' 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', 'listIpRoutes_nextToken' - The /ListIpRoutes.NextToken/ value from a previous call to ListIpRoutes.
-- Pass null if this is the first call.
--
-- 'limit', 'listIpRoutes_limit' - Maximum number of items to return. If this value is zero, the maximum
-- number of items is specified by the limitations of the operation.
--
-- 'directoryId', 'listIpRoutes_directoryId' - Identifier (ID) of the directory for which you want to retrieve the IP
-- addresses.
newListIpRoutes ::
  -- | 'directoryId'
  Prelude.Text ->
  ListIpRoutes
newListIpRoutes :: Text -> ListIpRoutes
newListIpRoutes Text
pDirectoryId_ =
  ListIpRoutes' :: Maybe Text -> Maybe Natural -> Text -> ListIpRoutes
ListIpRoutes'
    { $sel:nextToken:ListIpRoutes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListIpRoutes' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:directoryId:ListIpRoutes' :: Text
directoryId = Text
pDirectoryId_
    }

-- | The /ListIpRoutes.NextToken/ value from a previous call to ListIpRoutes.
-- Pass null if this is the first call.
listIpRoutes_nextToken :: Lens.Lens' ListIpRoutes (Prelude.Maybe Prelude.Text)
listIpRoutes_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListIpRoutes -> f ListIpRoutes
listIpRoutes_nextToken = (ListIpRoutes -> Maybe Text)
-> (ListIpRoutes -> Maybe Text -> ListIpRoutes)
-> Lens ListIpRoutes ListIpRoutes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIpRoutes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIpRoutes' :: ListIpRoutes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIpRoutes
s@ListIpRoutes' {} Maybe Text
a -> ListIpRoutes
s {$sel:nextToken:ListIpRoutes' :: Maybe Text
nextToken = Maybe Text
a} :: ListIpRoutes)

-- | Maximum number of items to return. If this value is zero, the maximum
-- number of items is specified by the limitations of the operation.
listIpRoutes_limit :: Lens.Lens' ListIpRoutes (Prelude.Maybe Prelude.Natural)
listIpRoutes_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListIpRoutes -> f ListIpRoutes
listIpRoutes_limit = (ListIpRoutes -> Maybe Natural)
-> (ListIpRoutes -> Maybe Natural -> ListIpRoutes)
-> Lens ListIpRoutes ListIpRoutes (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIpRoutes' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListIpRoutes' :: ListIpRoutes -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListIpRoutes
s@ListIpRoutes' {} Maybe Natural
a -> ListIpRoutes
s {$sel:limit:ListIpRoutes' :: Maybe Natural
limit = Maybe Natural
a} :: ListIpRoutes)

-- | Identifier (ID) of the directory for which you want to retrieve the IP
-- addresses.
listIpRoutes_directoryId :: Lens.Lens' ListIpRoutes Prelude.Text
listIpRoutes_directoryId :: (Text -> f Text) -> ListIpRoutes -> f ListIpRoutes
listIpRoutes_directoryId = (ListIpRoutes -> Text)
-> (ListIpRoutes -> Text -> ListIpRoutes)
-> Lens ListIpRoutes ListIpRoutes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIpRoutes' {Text
directoryId :: Text
$sel:directoryId:ListIpRoutes' :: ListIpRoutes -> Text
directoryId} -> Text
directoryId) (\s :: ListIpRoutes
s@ListIpRoutes' {} Text
a -> ListIpRoutes
s {$sel:directoryId:ListIpRoutes' :: Text
directoryId = Text
a} :: ListIpRoutes)

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

instance Prelude.NFData ListIpRoutes

instance Core.ToHeaders ListIpRoutes where
  toHeaders :: ListIpRoutes -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListIpRoutes -> 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
"DirectoryService_20150416.ListIpRoutes" ::
                          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 ListIpRoutes where
  toJSON :: ListIpRoutes -> Value
toJSON ListIpRoutes' {Maybe Natural
Maybe Text
Text
directoryId :: Text
limit :: Maybe Natural
nextToken :: Maybe Text
$sel:directoryId:ListIpRoutes' :: ListIpRoutes -> Text
$sel:limit:ListIpRoutes' :: ListIpRoutes -> Maybe Natural
$sel:nextToken:ListIpRoutes' :: ListIpRoutes -> 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
"Limit" 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
limit,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryId)
          ]
      )

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

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

-- | /See:/ 'newListIpRoutesResponse' smart constructor.
data ListIpRoutesResponse = ListIpRoutesResponse'
  { -- | A list of IpRoutes.
    ListIpRoutesResponse -> Maybe [IpRouteInfo]
ipRoutesInfo :: Prelude.Maybe [IpRouteInfo],
    -- | If not null, more results are available. Pass this value for the
    -- /NextToken/ parameter in a subsequent call to ListIpRoutes to retrieve
    -- the next set of items.
    ListIpRoutesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListIpRoutesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListIpRoutesResponse -> ListIpRoutesResponse -> Bool
(ListIpRoutesResponse -> ListIpRoutesResponse -> Bool)
-> (ListIpRoutesResponse -> ListIpRoutesResponse -> Bool)
-> Eq ListIpRoutesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIpRoutesResponse -> ListIpRoutesResponse -> Bool
$c/= :: ListIpRoutesResponse -> ListIpRoutesResponse -> Bool
== :: ListIpRoutesResponse -> ListIpRoutesResponse -> Bool
$c== :: ListIpRoutesResponse -> ListIpRoutesResponse -> Bool
Prelude.Eq, ReadPrec [ListIpRoutesResponse]
ReadPrec ListIpRoutesResponse
Int -> ReadS ListIpRoutesResponse
ReadS [ListIpRoutesResponse]
(Int -> ReadS ListIpRoutesResponse)
-> ReadS [ListIpRoutesResponse]
-> ReadPrec ListIpRoutesResponse
-> ReadPrec [ListIpRoutesResponse]
-> Read ListIpRoutesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIpRoutesResponse]
$creadListPrec :: ReadPrec [ListIpRoutesResponse]
readPrec :: ReadPrec ListIpRoutesResponse
$creadPrec :: ReadPrec ListIpRoutesResponse
readList :: ReadS [ListIpRoutesResponse]
$creadList :: ReadS [ListIpRoutesResponse]
readsPrec :: Int -> ReadS ListIpRoutesResponse
$creadsPrec :: Int -> ReadS ListIpRoutesResponse
Prelude.Read, Int -> ListIpRoutesResponse -> ShowS
[ListIpRoutesResponse] -> ShowS
ListIpRoutesResponse -> String
(Int -> ListIpRoutesResponse -> ShowS)
-> (ListIpRoutesResponse -> String)
-> ([ListIpRoutesResponse] -> ShowS)
-> Show ListIpRoutesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIpRoutesResponse] -> ShowS
$cshowList :: [ListIpRoutesResponse] -> ShowS
show :: ListIpRoutesResponse -> String
$cshow :: ListIpRoutesResponse -> String
showsPrec :: Int -> ListIpRoutesResponse -> ShowS
$cshowsPrec :: Int -> ListIpRoutesResponse -> ShowS
Prelude.Show, (forall x. ListIpRoutesResponse -> Rep ListIpRoutesResponse x)
-> (forall x. Rep ListIpRoutesResponse x -> ListIpRoutesResponse)
-> Generic ListIpRoutesResponse
forall x. Rep ListIpRoutesResponse x -> ListIpRoutesResponse
forall x. ListIpRoutesResponse -> Rep ListIpRoutesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIpRoutesResponse x -> ListIpRoutesResponse
$cfrom :: forall x. ListIpRoutesResponse -> Rep ListIpRoutesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListIpRoutesResponse' 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:
--
-- 'ipRoutesInfo', 'listIpRoutesResponse_ipRoutesInfo' - A list of IpRoutes.
--
-- 'nextToken', 'listIpRoutesResponse_nextToken' - If not null, more results are available. Pass this value for the
-- /NextToken/ parameter in a subsequent call to ListIpRoutes to retrieve
-- the next set of items.
--
-- 'httpStatus', 'listIpRoutesResponse_httpStatus' - The response's http status code.
newListIpRoutesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListIpRoutesResponse
newListIpRoutesResponse :: Int -> ListIpRoutesResponse
newListIpRoutesResponse Int
pHttpStatus_ =
  ListIpRoutesResponse' :: Maybe [IpRouteInfo] -> Maybe Text -> Int -> ListIpRoutesResponse
ListIpRoutesResponse'
    { $sel:ipRoutesInfo:ListIpRoutesResponse' :: Maybe [IpRouteInfo]
ipRoutesInfo =
        Maybe [IpRouteInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListIpRoutesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListIpRoutesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of IpRoutes.
listIpRoutesResponse_ipRoutesInfo :: Lens.Lens' ListIpRoutesResponse (Prelude.Maybe [IpRouteInfo])
listIpRoutesResponse_ipRoutesInfo :: (Maybe [IpRouteInfo] -> f (Maybe [IpRouteInfo]))
-> ListIpRoutesResponse -> f ListIpRoutesResponse
listIpRoutesResponse_ipRoutesInfo = (ListIpRoutesResponse -> Maybe [IpRouteInfo])
-> (ListIpRoutesResponse
    -> Maybe [IpRouteInfo] -> ListIpRoutesResponse)
-> Lens' ListIpRoutesResponse (Maybe [IpRouteInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIpRoutesResponse' {Maybe [IpRouteInfo]
ipRoutesInfo :: Maybe [IpRouteInfo]
$sel:ipRoutesInfo:ListIpRoutesResponse' :: ListIpRoutesResponse -> Maybe [IpRouteInfo]
ipRoutesInfo} -> Maybe [IpRouteInfo]
ipRoutesInfo) (\s :: ListIpRoutesResponse
s@ListIpRoutesResponse' {} Maybe [IpRouteInfo]
a -> ListIpRoutesResponse
s {$sel:ipRoutesInfo:ListIpRoutesResponse' :: Maybe [IpRouteInfo]
ipRoutesInfo = Maybe [IpRouteInfo]
a} :: ListIpRoutesResponse) ((Maybe [IpRouteInfo] -> f (Maybe [IpRouteInfo]))
 -> ListIpRoutesResponse -> f ListIpRoutesResponse)
-> ((Maybe [IpRouteInfo] -> f (Maybe [IpRouteInfo]))
    -> Maybe [IpRouteInfo] -> f (Maybe [IpRouteInfo]))
-> (Maybe [IpRouteInfo] -> f (Maybe [IpRouteInfo]))
-> ListIpRoutesResponse
-> f ListIpRoutesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [IpRouteInfo] [IpRouteInfo] [IpRouteInfo] [IpRouteInfo]
-> Iso
     (Maybe [IpRouteInfo])
     (Maybe [IpRouteInfo])
     (Maybe [IpRouteInfo])
     (Maybe [IpRouteInfo])
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 [IpRouteInfo] [IpRouteInfo] [IpRouteInfo] [IpRouteInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If not null, more results are available. Pass this value for the
-- /NextToken/ parameter in a subsequent call to ListIpRoutes to retrieve
-- the next set of items.
listIpRoutesResponse_nextToken :: Lens.Lens' ListIpRoutesResponse (Prelude.Maybe Prelude.Text)
listIpRoutesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListIpRoutesResponse -> f ListIpRoutesResponse
listIpRoutesResponse_nextToken = (ListIpRoutesResponse -> Maybe Text)
-> (ListIpRoutesResponse -> Maybe Text -> ListIpRoutesResponse)
-> Lens' ListIpRoutesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIpRoutesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIpRoutesResponse' :: ListIpRoutesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIpRoutesResponse
s@ListIpRoutesResponse' {} Maybe Text
a -> ListIpRoutesResponse
s {$sel:nextToken:ListIpRoutesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListIpRoutesResponse)

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

instance Prelude.NFData ListIpRoutesResponse