{-# 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.GlobalAccelerator.ListCustomRoutingPortMappings
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Provides a complete mapping from the public accelerator IP address and
-- port to destination EC2 instance IP addresses and ports in the virtual
-- public cloud (VPC) subnet endpoint for a custom routing accelerator. For
-- each subnet endpoint that you add, Global Accelerator creates a new
-- static port mapping for the accelerator. The port mappings don\'t change
-- after Global Accelerator generates them, so you can retrieve and cache
-- the full mapping on your servers.
--
-- If you remove a subnet from your accelerator, Global Accelerator removes
-- (reclaims) the port mappings. If you add a subnet to your accelerator,
-- Global Accelerator creates new port mappings (the existing ones don\'t
-- change). If you add or remove EC2 instances in your subnet, the port
-- mappings don\'t change, because the mappings are created when you add
-- the subnet to Global Accelerator.
--
-- The mappings also include a flag for each destination denoting which
-- destination IP addresses and ports are allowed or denied traffic.
--
-- This operation returns paginated results.
module Amazonka.GlobalAccelerator.ListCustomRoutingPortMappings
  ( -- * Creating a Request
    ListCustomRoutingPortMappings (..),
    newListCustomRoutingPortMappings,

    -- * Request Lenses
    listCustomRoutingPortMappings_endpointGroupArn,
    listCustomRoutingPortMappings_maxResults,
    listCustomRoutingPortMappings_nextToken,
    listCustomRoutingPortMappings_acceleratorArn,

    -- * Destructuring the Response
    ListCustomRoutingPortMappingsResponse (..),
    newListCustomRoutingPortMappingsResponse,

    -- * Response Lenses
    listCustomRoutingPortMappingsResponse_nextToken,
    listCustomRoutingPortMappingsResponse_portMappings,
    listCustomRoutingPortMappingsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GlobalAccelerator.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListCustomRoutingPortMappings' smart constructor.
data ListCustomRoutingPortMappings = ListCustomRoutingPortMappings'
  { -- | The Amazon Resource Name (ARN) of the endpoint group to list the custom
    -- routing port mappings for.
    ListCustomRoutingPortMappings -> Maybe Text
endpointGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The number of destination port mappings that you want to return with
    -- this call. The default value is 10.
    ListCustomRoutingPortMappings -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of results. You receive this token from a
    -- previous call.
    ListCustomRoutingPortMappings -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the accelerator to list the custom
    -- routing port mappings for.
    ListCustomRoutingPortMappings -> Text
acceleratorArn :: Prelude.Text
  }
  deriving (ListCustomRoutingPortMappings
-> ListCustomRoutingPortMappings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCustomRoutingPortMappings
-> ListCustomRoutingPortMappings -> Bool
$c/= :: ListCustomRoutingPortMappings
-> ListCustomRoutingPortMappings -> Bool
== :: ListCustomRoutingPortMappings
-> ListCustomRoutingPortMappings -> Bool
$c== :: ListCustomRoutingPortMappings
-> ListCustomRoutingPortMappings -> Bool
Prelude.Eq, ReadPrec [ListCustomRoutingPortMappings]
ReadPrec ListCustomRoutingPortMappings
Int -> ReadS ListCustomRoutingPortMappings
ReadS [ListCustomRoutingPortMappings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCustomRoutingPortMappings]
$creadListPrec :: ReadPrec [ListCustomRoutingPortMappings]
readPrec :: ReadPrec ListCustomRoutingPortMappings
$creadPrec :: ReadPrec ListCustomRoutingPortMappings
readList :: ReadS [ListCustomRoutingPortMappings]
$creadList :: ReadS [ListCustomRoutingPortMappings]
readsPrec :: Int -> ReadS ListCustomRoutingPortMappings
$creadsPrec :: Int -> ReadS ListCustomRoutingPortMappings
Prelude.Read, Int -> ListCustomRoutingPortMappings -> ShowS
[ListCustomRoutingPortMappings] -> ShowS
ListCustomRoutingPortMappings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCustomRoutingPortMappings] -> ShowS
$cshowList :: [ListCustomRoutingPortMappings] -> ShowS
show :: ListCustomRoutingPortMappings -> String
$cshow :: ListCustomRoutingPortMappings -> String
showsPrec :: Int -> ListCustomRoutingPortMappings -> ShowS
$cshowsPrec :: Int -> ListCustomRoutingPortMappings -> ShowS
Prelude.Show, forall x.
Rep ListCustomRoutingPortMappings x
-> ListCustomRoutingPortMappings
forall x.
ListCustomRoutingPortMappings
-> Rep ListCustomRoutingPortMappings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCustomRoutingPortMappings x
-> ListCustomRoutingPortMappings
$cfrom :: forall x.
ListCustomRoutingPortMappings
-> Rep ListCustomRoutingPortMappings x
Prelude.Generic)

-- |
-- Create a value of 'ListCustomRoutingPortMappings' 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:
--
-- 'endpointGroupArn', 'listCustomRoutingPortMappings_endpointGroupArn' - The Amazon Resource Name (ARN) of the endpoint group to list the custom
-- routing port mappings for.
--
-- 'maxResults', 'listCustomRoutingPortMappings_maxResults' - The number of destination port mappings that you want to return with
-- this call. The default value is 10.
--
-- 'nextToken', 'listCustomRoutingPortMappings_nextToken' - The token for the next set of results. You receive this token from a
-- previous call.
--
-- 'acceleratorArn', 'listCustomRoutingPortMappings_acceleratorArn' - The Amazon Resource Name (ARN) of the accelerator to list the custom
-- routing port mappings for.
newListCustomRoutingPortMappings ::
  -- | 'acceleratorArn'
  Prelude.Text ->
  ListCustomRoutingPortMappings
newListCustomRoutingPortMappings :: Text -> ListCustomRoutingPortMappings
newListCustomRoutingPortMappings Text
pAcceleratorArn_ =
  ListCustomRoutingPortMappings'
    { $sel:endpointGroupArn:ListCustomRoutingPortMappings' :: Maybe Text
endpointGroupArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListCustomRoutingPortMappings' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCustomRoutingPortMappings' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:acceleratorArn:ListCustomRoutingPortMappings' :: Text
acceleratorArn = Text
pAcceleratorArn_
    }

-- | The Amazon Resource Name (ARN) of the endpoint group to list the custom
-- routing port mappings for.
listCustomRoutingPortMappings_endpointGroupArn :: Lens.Lens' ListCustomRoutingPortMappings (Prelude.Maybe Prelude.Text)
listCustomRoutingPortMappings_endpointGroupArn :: Lens' ListCustomRoutingPortMappings (Maybe Text)
listCustomRoutingPortMappings_endpointGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomRoutingPortMappings' {Maybe Text
endpointGroupArn :: Maybe Text
$sel:endpointGroupArn:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Text
endpointGroupArn} -> Maybe Text
endpointGroupArn) (\s :: ListCustomRoutingPortMappings
s@ListCustomRoutingPortMappings' {} Maybe Text
a -> ListCustomRoutingPortMappings
s {$sel:endpointGroupArn:ListCustomRoutingPortMappings' :: Maybe Text
endpointGroupArn = Maybe Text
a} :: ListCustomRoutingPortMappings)

-- | The number of destination port mappings that you want to return with
-- this call. The default value is 10.
listCustomRoutingPortMappings_maxResults :: Lens.Lens' ListCustomRoutingPortMappings (Prelude.Maybe Prelude.Natural)
listCustomRoutingPortMappings_maxResults :: Lens' ListCustomRoutingPortMappings (Maybe Natural)
listCustomRoutingPortMappings_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomRoutingPortMappings' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCustomRoutingPortMappings
s@ListCustomRoutingPortMappings' {} Maybe Natural
a -> ListCustomRoutingPortMappings
s {$sel:maxResults:ListCustomRoutingPortMappings' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCustomRoutingPortMappings)

-- | The token for the next set of results. You receive this token from a
-- previous call.
listCustomRoutingPortMappings_nextToken :: Lens.Lens' ListCustomRoutingPortMappings (Prelude.Maybe Prelude.Text)
listCustomRoutingPortMappings_nextToken :: Lens' ListCustomRoutingPortMappings (Maybe Text)
listCustomRoutingPortMappings_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomRoutingPortMappings' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCustomRoutingPortMappings
s@ListCustomRoutingPortMappings' {} Maybe Text
a -> ListCustomRoutingPortMappings
s {$sel:nextToken:ListCustomRoutingPortMappings' :: Maybe Text
nextToken = Maybe Text
a} :: ListCustomRoutingPortMappings)

-- | The Amazon Resource Name (ARN) of the accelerator to list the custom
-- routing port mappings for.
listCustomRoutingPortMappings_acceleratorArn :: Lens.Lens' ListCustomRoutingPortMappings Prelude.Text
listCustomRoutingPortMappings_acceleratorArn :: Lens' ListCustomRoutingPortMappings Text
listCustomRoutingPortMappings_acceleratorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomRoutingPortMappings' {Text
acceleratorArn :: Text
$sel:acceleratorArn:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Text
acceleratorArn} -> Text
acceleratorArn) (\s :: ListCustomRoutingPortMappings
s@ListCustomRoutingPortMappings' {} Text
a -> ListCustomRoutingPortMappings
s {$sel:acceleratorArn:ListCustomRoutingPortMappings' :: Text
acceleratorArn = Text
a} :: ListCustomRoutingPortMappings)

instance Core.AWSPager ListCustomRoutingPortMappings where
  page :: ListCustomRoutingPortMappings
-> AWSResponse ListCustomRoutingPortMappings
-> Maybe ListCustomRoutingPortMappings
page ListCustomRoutingPortMappings
rq AWSResponse ListCustomRoutingPortMappings
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCustomRoutingPortMappings
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCustomRoutingPortMappingsResponse (Maybe Text)
listCustomRoutingPortMappingsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCustomRoutingPortMappings
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCustomRoutingPortMappingsResponse (Maybe [PortMapping])
listCustomRoutingPortMappingsResponse_portMappings
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListCustomRoutingPortMappings
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListCustomRoutingPortMappings (Maybe Text)
listCustomRoutingPortMappings_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCustomRoutingPortMappings
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCustomRoutingPortMappingsResponse (Maybe Text)
listCustomRoutingPortMappingsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    ListCustomRoutingPortMappings
  where
  type
    AWSResponse ListCustomRoutingPortMappings =
      ListCustomRoutingPortMappingsResponse
  request :: (Service -> Service)
-> ListCustomRoutingPortMappings
-> Request ListCustomRoutingPortMappings
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListCustomRoutingPortMappings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCustomRoutingPortMappings)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [PortMapping]
-> Int
-> ListCustomRoutingPortMappingsResponse
ListCustomRoutingPortMappingsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"PortMappings" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListCustomRoutingPortMappings
  where
  hashWithSalt :: Int -> ListCustomRoutingPortMappings -> Int
hashWithSalt Int
_salt ListCustomRoutingPortMappings' {Maybe Natural
Maybe Text
Text
acceleratorArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
endpointGroupArn :: Maybe Text
$sel:acceleratorArn:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Text
$sel:nextToken:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Text
$sel:maxResults:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Natural
$sel:endpointGroupArn:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endpointGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
acceleratorArn

instance Prelude.NFData ListCustomRoutingPortMappings where
  rnf :: ListCustomRoutingPortMappings -> ()
rnf ListCustomRoutingPortMappings' {Maybe Natural
Maybe Text
Text
acceleratorArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
endpointGroupArn :: Maybe Text
$sel:acceleratorArn:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Text
$sel:nextToken:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Text
$sel:maxResults:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Natural
$sel:endpointGroupArn:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
acceleratorArn

instance Data.ToHeaders ListCustomRoutingPortMappings where
  toHeaders :: ListCustomRoutingPortMappings -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"GlobalAccelerator_V20180706.ListCustomRoutingPortMappings" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListCustomRoutingPortMappings where
  toJSON :: ListCustomRoutingPortMappings -> Value
toJSON ListCustomRoutingPortMappings' {Maybe Natural
Maybe Text
Text
acceleratorArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
endpointGroupArn :: Maybe Text
$sel:acceleratorArn:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Text
$sel:nextToken:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Text
$sel:maxResults:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Natural
$sel:endpointGroupArn:ListCustomRoutingPortMappings' :: ListCustomRoutingPortMappings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"EndpointGroupArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
endpointGroupArn,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"AcceleratorArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
acceleratorArn)
          ]
      )

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

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

-- | /See:/ 'newListCustomRoutingPortMappingsResponse' smart constructor.
data ListCustomRoutingPortMappingsResponse = ListCustomRoutingPortMappingsResponse'
  { -- | The token for the next set of results. You receive this token from a
    -- previous call.
    ListCustomRoutingPortMappingsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The port mappings for a custom routing accelerator.
    ListCustomRoutingPortMappingsResponse -> Maybe [PortMapping]
portMappings :: Prelude.Maybe [PortMapping],
    -- | The response's http status code.
    ListCustomRoutingPortMappingsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCustomRoutingPortMappingsResponse
-> ListCustomRoutingPortMappingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCustomRoutingPortMappingsResponse
-> ListCustomRoutingPortMappingsResponse -> Bool
$c/= :: ListCustomRoutingPortMappingsResponse
-> ListCustomRoutingPortMappingsResponse -> Bool
== :: ListCustomRoutingPortMappingsResponse
-> ListCustomRoutingPortMappingsResponse -> Bool
$c== :: ListCustomRoutingPortMappingsResponse
-> ListCustomRoutingPortMappingsResponse -> Bool
Prelude.Eq, ReadPrec [ListCustomRoutingPortMappingsResponse]
ReadPrec ListCustomRoutingPortMappingsResponse
Int -> ReadS ListCustomRoutingPortMappingsResponse
ReadS [ListCustomRoutingPortMappingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCustomRoutingPortMappingsResponse]
$creadListPrec :: ReadPrec [ListCustomRoutingPortMappingsResponse]
readPrec :: ReadPrec ListCustomRoutingPortMappingsResponse
$creadPrec :: ReadPrec ListCustomRoutingPortMappingsResponse
readList :: ReadS [ListCustomRoutingPortMappingsResponse]
$creadList :: ReadS [ListCustomRoutingPortMappingsResponse]
readsPrec :: Int -> ReadS ListCustomRoutingPortMappingsResponse
$creadsPrec :: Int -> ReadS ListCustomRoutingPortMappingsResponse
Prelude.Read, Int -> ListCustomRoutingPortMappingsResponse -> ShowS
[ListCustomRoutingPortMappingsResponse] -> ShowS
ListCustomRoutingPortMappingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCustomRoutingPortMappingsResponse] -> ShowS
$cshowList :: [ListCustomRoutingPortMappingsResponse] -> ShowS
show :: ListCustomRoutingPortMappingsResponse -> String
$cshow :: ListCustomRoutingPortMappingsResponse -> String
showsPrec :: Int -> ListCustomRoutingPortMappingsResponse -> ShowS
$cshowsPrec :: Int -> ListCustomRoutingPortMappingsResponse -> ShowS
Prelude.Show, forall x.
Rep ListCustomRoutingPortMappingsResponse x
-> ListCustomRoutingPortMappingsResponse
forall x.
ListCustomRoutingPortMappingsResponse
-> Rep ListCustomRoutingPortMappingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCustomRoutingPortMappingsResponse x
-> ListCustomRoutingPortMappingsResponse
$cfrom :: forall x.
ListCustomRoutingPortMappingsResponse
-> Rep ListCustomRoutingPortMappingsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListCustomRoutingPortMappingsResponse' 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', 'listCustomRoutingPortMappingsResponse_nextToken' - The token for the next set of results. You receive this token from a
-- previous call.
--
-- 'portMappings', 'listCustomRoutingPortMappingsResponse_portMappings' - The port mappings for a custom routing accelerator.
--
-- 'httpStatus', 'listCustomRoutingPortMappingsResponse_httpStatus' - The response's http status code.
newListCustomRoutingPortMappingsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCustomRoutingPortMappingsResponse
newListCustomRoutingPortMappingsResponse :: Int -> ListCustomRoutingPortMappingsResponse
newListCustomRoutingPortMappingsResponse Int
pHttpStatus_ =
  ListCustomRoutingPortMappingsResponse'
    { $sel:nextToken:ListCustomRoutingPortMappingsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:portMappings:ListCustomRoutingPortMappingsResponse' :: Maybe [PortMapping]
portMappings = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCustomRoutingPortMappingsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token for the next set of results. You receive this token from a
-- previous call.
listCustomRoutingPortMappingsResponse_nextToken :: Lens.Lens' ListCustomRoutingPortMappingsResponse (Prelude.Maybe Prelude.Text)
listCustomRoutingPortMappingsResponse_nextToken :: Lens' ListCustomRoutingPortMappingsResponse (Maybe Text)
listCustomRoutingPortMappingsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomRoutingPortMappingsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCustomRoutingPortMappingsResponse' :: ListCustomRoutingPortMappingsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCustomRoutingPortMappingsResponse
s@ListCustomRoutingPortMappingsResponse' {} Maybe Text
a -> ListCustomRoutingPortMappingsResponse
s {$sel:nextToken:ListCustomRoutingPortMappingsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCustomRoutingPortMappingsResponse)

-- | The port mappings for a custom routing accelerator.
listCustomRoutingPortMappingsResponse_portMappings :: Lens.Lens' ListCustomRoutingPortMappingsResponse (Prelude.Maybe [PortMapping])
listCustomRoutingPortMappingsResponse_portMappings :: Lens' ListCustomRoutingPortMappingsResponse (Maybe [PortMapping])
listCustomRoutingPortMappingsResponse_portMappings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomRoutingPortMappingsResponse' {Maybe [PortMapping]
portMappings :: Maybe [PortMapping]
$sel:portMappings:ListCustomRoutingPortMappingsResponse' :: ListCustomRoutingPortMappingsResponse -> Maybe [PortMapping]
portMappings} -> Maybe [PortMapping]
portMappings) (\s :: ListCustomRoutingPortMappingsResponse
s@ListCustomRoutingPortMappingsResponse' {} Maybe [PortMapping]
a -> ListCustomRoutingPortMappingsResponse
s {$sel:portMappings:ListCustomRoutingPortMappingsResponse' :: Maybe [PortMapping]
portMappings = Maybe [PortMapping]
a} :: ListCustomRoutingPortMappingsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListCustomRoutingPortMappingsResponse
  where
  rnf :: ListCustomRoutingPortMappingsResponse -> ()
rnf ListCustomRoutingPortMappingsResponse' {Int
Maybe [PortMapping]
Maybe Text
httpStatus :: Int
portMappings :: Maybe [PortMapping]
nextToken :: Maybe Text
$sel:httpStatus:ListCustomRoutingPortMappingsResponse' :: ListCustomRoutingPortMappingsResponse -> Int
$sel:portMappings:ListCustomRoutingPortMappingsResponse' :: ListCustomRoutingPortMappingsResponse -> Maybe [PortMapping]
$sel:nextToken:ListCustomRoutingPortMappingsResponse' :: ListCustomRoutingPortMappingsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PortMapping]
portMappings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus