{-# 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.EC2.DescribeNetworkInsightsPaths
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes one or more of your paths.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeNetworkInsightsPaths
  ( -- * Creating a Request
    DescribeNetworkInsightsPaths (..),
    newDescribeNetworkInsightsPaths,

    -- * Request Lenses
    describeNetworkInsightsPaths_dryRun,
    describeNetworkInsightsPaths_filters,
    describeNetworkInsightsPaths_maxResults,
    describeNetworkInsightsPaths_networkInsightsPathIds,
    describeNetworkInsightsPaths_nextToken,

    -- * Destructuring the Response
    DescribeNetworkInsightsPathsResponse (..),
    newDescribeNetworkInsightsPathsResponse,

    -- * Response Lenses
    describeNetworkInsightsPathsResponse_networkInsightsPaths,
    describeNetworkInsightsPathsResponse_nextToken,
    describeNetworkInsightsPathsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeNetworkInsightsPaths' smart constructor.
data DescribeNetworkInsightsPaths = DescribeNetworkInsightsPaths'
  { -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    DescribeNetworkInsightsPaths -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The filters. The following are the possible values:
    --
    -- -   destination - The ID of the resource.
    --
    -- -   destination-port - The destination port.
    --
    -- -   protocol - The protocol.
    --
    -- -   source - The ID of the resource.
    DescribeNetworkInsightsPaths -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    DescribeNetworkInsightsPaths -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The IDs of the paths.
    DescribeNetworkInsightsPaths -> Maybe [Text]
networkInsightsPathIds :: Prelude.Maybe [Prelude.Text],
    -- | The token for the next page of results.
    DescribeNetworkInsightsPaths -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeNetworkInsightsPaths
-> DescribeNetworkInsightsPaths -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNetworkInsightsPaths
-> DescribeNetworkInsightsPaths -> Bool
$c/= :: DescribeNetworkInsightsPaths
-> DescribeNetworkInsightsPaths -> Bool
== :: DescribeNetworkInsightsPaths
-> DescribeNetworkInsightsPaths -> Bool
$c== :: DescribeNetworkInsightsPaths
-> DescribeNetworkInsightsPaths -> Bool
Prelude.Eq, ReadPrec [DescribeNetworkInsightsPaths]
ReadPrec DescribeNetworkInsightsPaths
Int -> ReadS DescribeNetworkInsightsPaths
ReadS [DescribeNetworkInsightsPaths]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNetworkInsightsPaths]
$creadListPrec :: ReadPrec [DescribeNetworkInsightsPaths]
readPrec :: ReadPrec DescribeNetworkInsightsPaths
$creadPrec :: ReadPrec DescribeNetworkInsightsPaths
readList :: ReadS [DescribeNetworkInsightsPaths]
$creadList :: ReadS [DescribeNetworkInsightsPaths]
readsPrec :: Int -> ReadS DescribeNetworkInsightsPaths
$creadsPrec :: Int -> ReadS DescribeNetworkInsightsPaths
Prelude.Read, Int -> DescribeNetworkInsightsPaths -> ShowS
[DescribeNetworkInsightsPaths] -> ShowS
DescribeNetworkInsightsPaths -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNetworkInsightsPaths] -> ShowS
$cshowList :: [DescribeNetworkInsightsPaths] -> ShowS
show :: DescribeNetworkInsightsPaths -> String
$cshow :: DescribeNetworkInsightsPaths -> String
showsPrec :: Int -> DescribeNetworkInsightsPaths -> ShowS
$cshowsPrec :: Int -> DescribeNetworkInsightsPaths -> ShowS
Prelude.Show, forall x.
Rep DescribeNetworkInsightsPaths x -> DescribeNetworkInsightsPaths
forall x.
DescribeNetworkInsightsPaths -> Rep DescribeNetworkInsightsPaths x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeNetworkInsightsPaths x -> DescribeNetworkInsightsPaths
$cfrom :: forall x.
DescribeNetworkInsightsPaths -> Rep DescribeNetworkInsightsPaths x
Prelude.Generic)

-- |
-- Create a value of 'DescribeNetworkInsightsPaths' 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:
--
-- 'dryRun', 'describeNetworkInsightsPaths_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'filters', 'describeNetworkInsightsPaths_filters' - The filters. The following are the possible values:
--
-- -   destination - The ID of the resource.
--
-- -   destination-port - The destination port.
--
-- -   protocol - The protocol.
--
-- -   source - The ID of the resource.
--
-- 'maxResults', 'describeNetworkInsightsPaths_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- 'networkInsightsPathIds', 'describeNetworkInsightsPaths_networkInsightsPathIds' - The IDs of the paths.
--
-- 'nextToken', 'describeNetworkInsightsPaths_nextToken' - The token for the next page of results.
newDescribeNetworkInsightsPaths ::
  DescribeNetworkInsightsPaths
newDescribeNetworkInsightsPaths :: DescribeNetworkInsightsPaths
newDescribeNetworkInsightsPaths =
  DescribeNetworkInsightsPaths'
    { $sel:dryRun:DescribeNetworkInsightsPaths' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeNetworkInsightsPaths' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeNetworkInsightsPaths' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:networkInsightsPathIds:DescribeNetworkInsightsPaths' :: Maybe [Text]
networkInsightsPathIds = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeNetworkInsightsPaths' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
describeNetworkInsightsPaths_dryRun :: Lens.Lens' DescribeNetworkInsightsPaths (Prelude.Maybe Prelude.Bool)
describeNetworkInsightsPaths_dryRun :: Lens' DescribeNetworkInsightsPaths (Maybe Bool)
describeNetworkInsightsPaths_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInsightsPaths' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeNetworkInsightsPaths
s@DescribeNetworkInsightsPaths' {} Maybe Bool
a -> DescribeNetworkInsightsPaths
s {$sel:dryRun:DescribeNetworkInsightsPaths' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeNetworkInsightsPaths)

-- | The filters. The following are the possible values:
--
-- -   destination - The ID of the resource.
--
-- -   destination-port - The destination port.
--
-- -   protocol - The protocol.
--
-- -   source - The ID of the resource.
describeNetworkInsightsPaths_filters :: Lens.Lens' DescribeNetworkInsightsPaths (Prelude.Maybe [Filter])
describeNetworkInsightsPaths_filters :: Lens' DescribeNetworkInsightsPaths (Maybe [Filter])
describeNetworkInsightsPaths_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInsightsPaths' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeNetworkInsightsPaths
s@DescribeNetworkInsightsPaths' {} Maybe [Filter]
a -> DescribeNetworkInsightsPaths
s {$sel:filters:DescribeNetworkInsightsPaths' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeNetworkInsightsPaths) 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 maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
describeNetworkInsightsPaths_maxResults :: Lens.Lens' DescribeNetworkInsightsPaths (Prelude.Maybe Prelude.Natural)
describeNetworkInsightsPaths_maxResults :: Lens' DescribeNetworkInsightsPaths (Maybe Natural)
describeNetworkInsightsPaths_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInsightsPaths' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeNetworkInsightsPaths
s@DescribeNetworkInsightsPaths' {} Maybe Natural
a -> DescribeNetworkInsightsPaths
s {$sel:maxResults:DescribeNetworkInsightsPaths' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeNetworkInsightsPaths)

-- | The IDs of the paths.
describeNetworkInsightsPaths_networkInsightsPathIds :: Lens.Lens' DescribeNetworkInsightsPaths (Prelude.Maybe [Prelude.Text])
describeNetworkInsightsPaths_networkInsightsPathIds :: Lens' DescribeNetworkInsightsPaths (Maybe [Text])
describeNetworkInsightsPaths_networkInsightsPathIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInsightsPaths' {Maybe [Text]
networkInsightsPathIds :: Maybe [Text]
$sel:networkInsightsPathIds:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe [Text]
networkInsightsPathIds} -> Maybe [Text]
networkInsightsPathIds) (\s :: DescribeNetworkInsightsPaths
s@DescribeNetworkInsightsPaths' {} Maybe [Text]
a -> DescribeNetworkInsightsPaths
s {$sel:networkInsightsPathIds:DescribeNetworkInsightsPaths' :: Maybe [Text]
networkInsightsPathIds = Maybe [Text]
a} :: DescribeNetworkInsightsPaths) 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 token for the next page of results.
describeNetworkInsightsPaths_nextToken :: Lens.Lens' DescribeNetworkInsightsPaths (Prelude.Maybe Prelude.Text)
describeNetworkInsightsPaths_nextToken :: Lens' DescribeNetworkInsightsPaths (Maybe Text)
describeNetworkInsightsPaths_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInsightsPaths' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeNetworkInsightsPaths
s@DescribeNetworkInsightsPaths' {} Maybe Text
a -> DescribeNetworkInsightsPaths
s {$sel:nextToken:DescribeNetworkInsightsPaths' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeNetworkInsightsPaths)

instance Core.AWSPager DescribeNetworkInsightsPaths where
  page :: DescribeNetworkInsightsPaths
-> AWSResponse DescribeNetworkInsightsPaths
-> Maybe DescribeNetworkInsightsPaths
page DescribeNetworkInsightsPaths
rq AWSResponse DescribeNetworkInsightsPaths
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeNetworkInsightsPaths
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeNetworkInsightsPathsResponse (Maybe Text)
describeNetworkInsightsPathsResponse_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 DescribeNetworkInsightsPaths
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeNetworkInsightsPathsResponse (Maybe [NetworkInsightsPath])
describeNetworkInsightsPathsResponse_networkInsightsPaths
            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.$ DescribeNetworkInsightsPaths
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeNetworkInsightsPaths (Maybe Text)
describeNetworkInsightsPaths_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeNetworkInsightsPaths
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeNetworkInsightsPathsResponse (Maybe Text)
describeNetworkInsightsPathsResponse_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 DescribeNetworkInsightsPaths where
  type
    AWSResponse DescribeNetworkInsightsPaths =
      DescribeNetworkInsightsPathsResponse
  request :: (Service -> Service)
-> DescribeNetworkInsightsPaths
-> Request DescribeNetworkInsightsPaths
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeNetworkInsightsPaths
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeNetworkInsightsPaths)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [NetworkInsightsPath]
-> Maybe Text -> Int -> DescribeNetworkInsightsPathsResponse
DescribeNetworkInsightsPathsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"networkInsightsPathSet"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"nextToken")
            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
    DescribeNetworkInsightsPaths
  where
  hashWithSalt :: Int -> DescribeNetworkInsightsPaths -> Int
hashWithSalt Int
_salt DescribeNetworkInsightsPaths' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
networkInsightsPathIds :: Maybe [Text]
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Text
$sel:networkInsightsPathIds:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe [Text]
$sel:maxResults:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Natural
$sel:filters:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe [Filter]
$sel:dryRun:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
networkInsightsPathIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData DescribeNetworkInsightsPaths where
  rnf :: DescribeNetworkInsightsPaths -> ()
rnf DescribeNetworkInsightsPaths' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
networkInsightsPathIds :: Maybe [Text]
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Text
$sel:networkInsightsPathIds:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe [Text]
$sel:maxResults:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Natural
$sel:filters:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe [Filter]
$sel:dryRun:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      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]
networkInsightsPathIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders DescribeNetworkInsightsPaths where
  toHeaders :: DescribeNetworkInsightsPaths -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance Data.ToQuery DescribeNetworkInsightsPaths where
  toQuery :: DescribeNetworkInsightsPaths -> QueryString
toQuery DescribeNetworkInsightsPaths' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
networkInsightsPathIds :: Maybe [Text]
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Text
$sel:networkInsightsPathIds:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe [Text]
$sel:maxResults:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Natural
$sel:filters:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe [Filter]
$sel:dryRun:DescribeNetworkInsightsPaths' :: DescribeNetworkInsightsPaths -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeNetworkInsightsPaths" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"NetworkInsightsPathId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
networkInsightsPathIds
          ),
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newDescribeNetworkInsightsPathsResponse' smart constructor.
data DescribeNetworkInsightsPathsResponse = DescribeNetworkInsightsPathsResponse'
  { -- | Information about the paths.
    DescribeNetworkInsightsPathsResponse -> Maybe [NetworkInsightsPath]
networkInsightsPaths :: Prelude.Maybe [NetworkInsightsPath],
    -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    DescribeNetworkInsightsPathsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeNetworkInsightsPathsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeNetworkInsightsPathsResponse
-> DescribeNetworkInsightsPathsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNetworkInsightsPathsResponse
-> DescribeNetworkInsightsPathsResponse -> Bool
$c/= :: DescribeNetworkInsightsPathsResponse
-> DescribeNetworkInsightsPathsResponse -> Bool
== :: DescribeNetworkInsightsPathsResponse
-> DescribeNetworkInsightsPathsResponse -> Bool
$c== :: DescribeNetworkInsightsPathsResponse
-> DescribeNetworkInsightsPathsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeNetworkInsightsPathsResponse]
ReadPrec DescribeNetworkInsightsPathsResponse
Int -> ReadS DescribeNetworkInsightsPathsResponse
ReadS [DescribeNetworkInsightsPathsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNetworkInsightsPathsResponse]
$creadListPrec :: ReadPrec [DescribeNetworkInsightsPathsResponse]
readPrec :: ReadPrec DescribeNetworkInsightsPathsResponse
$creadPrec :: ReadPrec DescribeNetworkInsightsPathsResponse
readList :: ReadS [DescribeNetworkInsightsPathsResponse]
$creadList :: ReadS [DescribeNetworkInsightsPathsResponse]
readsPrec :: Int -> ReadS DescribeNetworkInsightsPathsResponse
$creadsPrec :: Int -> ReadS DescribeNetworkInsightsPathsResponse
Prelude.Read, Int -> DescribeNetworkInsightsPathsResponse -> ShowS
[DescribeNetworkInsightsPathsResponse] -> ShowS
DescribeNetworkInsightsPathsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNetworkInsightsPathsResponse] -> ShowS
$cshowList :: [DescribeNetworkInsightsPathsResponse] -> ShowS
show :: DescribeNetworkInsightsPathsResponse -> String
$cshow :: DescribeNetworkInsightsPathsResponse -> String
showsPrec :: Int -> DescribeNetworkInsightsPathsResponse -> ShowS
$cshowsPrec :: Int -> DescribeNetworkInsightsPathsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeNetworkInsightsPathsResponse x
-> DescribeNetworkInsightsPathsResponse
forall x.
DescribeNetworkInsightsPathsResponse
-> Rep DescribeNetworkInsightsPathsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeNetworkInsightsPathsResponse x
-> DescribeNetworkInsightsPathsResponse
$cfrom :: forall x.
DescribeNetworkInsightsPathsResponse
-> Rep DescribeNetworkInsightsPathsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeNetworkInsightsPathsResponse' 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:
--
-- 'networkInsightsPaths', 'describeNetworkInsightsPathsResponse_networkInsightsPaths' - Information about the paths.
--
-- 'nextToken', 'describeNetworkInsightsPathsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'describeNetworkInsightsPathsResponse_httpStatus' - The response's http status code.
newDescribeNetworkInsightsPathsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeNetworkInsightsPathsResponse
newDescribeNetworkInsightsPathsResponse :: Int -> DescribeNetworkInsightsPathsResponse
newDescribeNetworkInsightsPathsResponse Int
pHttpStatus_ =
  DescribeNetworkInsightsPathsResponse'
    { $sel:networkInsightsPaths:DescribeNetworkInsightsPathsResponse' :: Maybe [NetworkInsightsPath]
networkInsightsPaths =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeNetworkInsightsPathsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeNetworkInsightsPathsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the paths.
describeNetworkInsightsPathsResponse_networkInsightsPaths :: Lens.Lens' DescribeNetworkInsightsPathsResponse (Prelude.Maybe [NetworkInsightsPath])
describeNetworkInsightsPathsResponse_networkInsightsPaths :: Lens'
  DescribeNetworkInsightsPathsResponse (Maybe [NetworkInsightsPath])
describeNetworkInsightsPathsResponse_networkInsightsPaths = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInsightsPathsResponse' {Maybe [NetworkInsightsPath]
networkInsightsPaths :: Maybe [NetworkInsightsPath]
$sel:networkInsightsPaths:DescribeNetworkInsightsPathsResponse' :: DescribeNetworkInsightsPathsResponse -> Maybe [NetworkInsightsPath]
networkInsightsPaths} -> Maybe [NetworkInsightsPath]
networkInsightsPaths) (\s :: DescribeNetworkInsightsPathsResponse
s@DescribeNetworkInsightsPathsResponse' {} Maybe [NetworkInsightsPath]
a -> DescribeNetworkInsightsPathsResponse
s {$sel:networkInsightsPaths:DescribeNetworkInsightsPathsResponse' :: Maybe [NetworkInsightsPath]
networkInsightsPaths = Maybe [NetworkInsightsPath]
a} :: DescribeNetworkInsightsPathsResponse) 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 token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
describeNetworkInsightsPathsResponse_nextToken :: Lens.Lens' DescribeNetworkInsightsPathsResponse (Prelude.Maybe Prelude.Text)
describeNetworkInsightsPathsResponse_nextToken :: Lens' DescribeNetworkInsightsPathsResponse (Maybe Text)
describeNetworkInsightsPathsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInsightsPathsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeNetworkInsightsPathsResponse' :: DescribeNetworkInsightsPathsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeNetworkInsightsPathsResponse
s@DescribeNetworkInsightsPathsResponse' {} Maybe Text
a -> DescribeNetworkInsightsPathsResponse
s {$sel:nextToken:DescribeNetworkInsightsPathsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeNetworkInsightsPathsResponse)

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

instance
  Prelude.NFData
    DescribeNetworkInsightsPathsResponse
  where
  rnf :: DescribeNetworkInsightsPathsResponse -> ()
rnf DescribeNetworkInsightsPathsResponse' {Int
Maybe [NetworkInsightsPath]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
networkInsightsPaths :: Maybe [NetworkInsightsPath]
$sel:httpStatus:DescribeNetworkInsightsPathsResponse' :: DescribeNetworkInsightsPathsResponse -> Int
$sel:nextToken:DescribeNetworkInsightsPathsResponse' :: DescribeNetworkInsightsPathsResponse -> Maybe Text
$sel:networkInsightsPaths:DescribeNetworkInsightsPathsResponse' :: DescribeNetworkInsightsPathsResponse -> Maybe [NetworkInsightsPath]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [NetworkInsightsPath]
networkInsightsPaths
      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 Int
httpStatus