{-# 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.CreateNetworkInsightsPath
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a path to analyze for reachability.
--
-- Reachability Analyzer enables you to analyze and debug network
-- reachability between two resources in your virtual private cloud (VPC).
-- For more information, see
-- <https://docs.aws.amazon.com/vpc/latest/reachability/ What is Reachability Analyzer>.
module Amazonka.EC2.CreateNetworkInsightsPath
  ( -- * Creating a Request
    CreateNetworkInsightsPath (..),
    newCreateNetworkInsightsPath,

    -- * Request Lenses
    createNetworkInsightsPath_destinationIp,
    createNetworkInsightsPath_destinationPort,
    createNetworkInsightsPath_dryRun,
    createNetworkInsightsPath_sourceIp,
    createNetworkInsightsPath_tagSpecifications,
    createNetworkInsightsPath_source,
    createNetworkInsightsPath_destination,
    createNetworkInsightsPath_protocol,
    createNetworkInsightsPath_clientToken,

    -- * Destructuring the Response
    CreateNetworkInsightsPathResponse (..),
    newCreateNetworkInsightsPathResponse,

    -- * Response Lenses
    createNetworkInsightsPathResponse_networkInsightsPath,
    createNetworkInsightsPathResponse_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:/ 'newCreateNetworkInsightsPath' smart constructor.
data CreateNetworkInsightsPath = CreateNetworkInsightsPath'
  { -- | The IP address of the Amazon Web Services resource that is the
    -- destination of the path.
    CreateNetworkInsightsPath -> Maybe Text
destinationIp :: Prelude.Maybe Prelude.Text,
    -- | The destination port.
    CreateNetworkInsightsPath -> Maybe Natural
destinationPort :: Prelude.Maybe Prelude.Natural,
    -- | 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@.
    CreateNetworkInsightsPath -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The IP address of the Amazon Web Services resource that is the source of
    -- the path.
    CreateNetworkInsightsPath -> Maybe Text
sourceIp :: Prelude.Maybe Prelude.Text,
    -- | The tags to add to the path.
    CreateNetworkInsightsPath -> Maybe [TagSpecification]
tagSpecifications :: Prelude.Maybe [TagSpecification],
    -- | The Amazon Web Services resource that is the source of the path.
    CreateNetworkInsightsPath -> Text
source :: Prelude.Text,
    -- | The Amazon Web Services resource that is the destination of the path.
    CreateNetworkInsightsPath -> Text
destination :: Prelude.Text,
    -- | The protocol.
    CreateNetworkInsightsPath -> Protocol
protocol :: Protocol,
    -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html How to ensure idempotency>.
    CreateNetworkInsightsPath -> Text
clientToken :: Prelude.Text
  }
  deriving (CreateNetworkInsightsPath -> CreateNetworkInsightsPath -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNetworkInsightsPath -> CreateNetworkInsightsPath -> Bool
$c/= :: CreateNetworkInsightsPath -> CreateNetworkInsightsPath -> Bool
== :: CreateNetworkInsightsPath -> CreateNetworkInsightsPath -> Bool
$c== :: CreateNetworkInsightsPath -> CreateNetworkInsightsPath -> Bool
Prelude.Eq, ReadPrec [CreateNetworkInsightsPath]
ReadPrec CreateNetworkInsightsPath
Int -> ReadS CreateNetworkInsightsPath
ReadS [CreateNetworkInsightsPath]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNetworkInsightsPath]
$creadListPrec :: ReadPrec [CreateNetworkInsightsPath]
readPrec :: ReadPrec CreateNetworkInsightsPath
$creadPrec :: ReadPrec CreateNetworkInsightsPath
readList :: ReadS [CreateNetworkInsightsPath]
$creadList :: ReadS [CreateNetworkInsightsPath]
readsPrec :: Int -> ReadS CreateNetworkInsightsPath
$creadsPrec :: Int -> ReadS CreateNetworkInsightsPath
Prelude.Read, Int -> CreateNetworkInsightsPath -> ShowS
[CreateNetworkInsightsPath] -> ShowS
CreateNetworkInsightsPath -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNetworkInsightsPath] -> ShowS
$cshowList :: [CreateNetworkInsightsPath] -> ShowS
show :: CreateNetworkInsightsPath -> String
$cshow :: CreateNetworkInsightsPath -> String
showsPrec :: Int -> CreateNetworkInsightsPath -> ShowS
$cshowsPrec :: Int -> CreateNetworkInsightsPath -> ShowS
Prelude.Show, forall x.
Rep CreateNetworkInsightsPath x -> CreateNetworkInsightsPath
forall x.
CreateNetworkInsightsPath -> Rep CreateNetworkInsightsPath x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateNetworkInsightsPath x -> CreateNetworkInsightsPath
$cfrom :: forall x.
CreateNetworkInsightsPath -> Rep CreateNetworkInsightsPath x
Prelude.Generic)

-- |
-- Create a value of 'CreateNetworkInsightsPath' 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:
--
-- 'destinationIp', 'createNetworkInsightsPath_destinationIp' - The IP address of the Amazon Web Services resource that is the
-- destination of the path.
--
-- 'destinationPort', 'createNetworkInsightsPath_destinationPort' - The destination port.
--
-- 'dryRun', 'createNetworkInsightsPath_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@.
--
-- 'sourceIp', 'createNetworkInsightsPath_sourceIp' - The IP address of the Amazon Web Services resource that is the source of
-- the path.
--
-- 'tagSpecifications', 'createNetworkInsightsPath_tagSpecifications' - The tags to add to the path.
--
-- 'source', 'createNetworkInsightsPath_source' - The Amazon Web Services resource that is the source of the path.
--
-- 'destination', 'createNetworkInsightsPath_destination' - The Amazon Web Services resource that is the destination of the path.
--
-- 'protocol', 'createNetworkInsightsPath_protocol' - The protocol.
--
-- 'clientToken', 'createNetworkInsightsPath_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html How to ensure idempotency>.
newCreateNetworkInsightsPath ::
  -- | 'source'
  Prelude.Text ->
  -- | 'destination'
  Prelude.Text ->
  -- | 'protocol'
  Protocol ->
  -- | 'clientToken'
  Prelude.Text ->
  CreateNetworkInsightsPath
newCreateNetworkInsightsPath :: Text -> Text -> Protocol -> Text -> CreateNetworkInsightsPath
newCreateNetworkInsightsPath
  Text
pSource_
  Text
pDestination_
  Protocol
pProtocol_
  Text
pClientToken_ =
    CreateNetworkInsightsPath'
      { $sel:destinationIp:CreateNetworkInsightsPath' :: Maybe Text
destinationIp =
          forall a. Maybe a
Prelude.Nothing,
        $sel:destinationPort:CreateNetworkInsightsPath' :: Maybe Natural
destinationPort = forall a. Maybe a
Prelude.Nothing,
        $sel:dryRun:CreateNetworkInsightsPath' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
        $sel:sourceIp:CreateNetworkInsightsPath' :: Maybe Text
sourceIp = forall a. Maybe a
Prelude.Nothing,
        $sel:tagSpecifications:CreateNetworkInsightsPath' :: Maybe [TagSpecification]
tagSpecifications = forall a. Maybe a
Prelude.Nothing,
        $sel:source:CreateNetworkInsightsPath' :: Text
source = Text
pSource_,
        $sel:destination:CreateNetworkInsightsPath' :: Text
destination = Text
pDestination_,
        $sel:protocol:CreateNetworkInsightsPath' :: Protocol
protocol = Protocol
pProtocol_,
        $sel:clientToken:CreateNetworkInsightsPath' :: Text
clientToken = Text
pClientToken_
      }

-- | The IP address of the Amazon Web Services resource that is the
-- destination of the path.
createNetworkInsightsPath_destinationIp :: Lens.Lens' CreateNetworkInsightsPath (Prelude.Maybe Prelude.Text)
createNetworkInsightsPath_destinationIp :: Lens' CreateNetworkInsightsPath (Maybe Text)
createNetworkInsightsPath_destinationIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkInsightsPath' {Maybe Text
destinationIp :: Maybe Text
$sel:destinationIp:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Text
destinationIp} -> Maybe Text
destinationIp) (\s :: CreateNetworkInsightsPath
s@CreateNetworkInsightsPath' {} Maybe Text
a -> CreateNetworkInsightsPath
s {$sel:destinationIp:CreateNetworkInsightsPath' :: Maybe Text
destinationIp = Maybe Text
a} :: CreateNetworkInsightsPath)

-- | The destination port.
createNetworkInsightsPath_destinationPort :: Lens.Lens' CreateNetworkInsightsPath (Prelude.Maybe Prelude.Natural)
createNetworkInsightsPath_destinationPort :: Lens' CreateNetworkInsightsPath (Maybe Natural)
createNetworkInsightsPath_destinationPort = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkInsightsPath' {Maybe Natural
destinationPort :: Maybe Natural
$sel:destinationPort:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Natural
destinationPort} -> Maybe Natural
destinationPort) (\s :: CreateNetworkInsightsPath
s@CreateNetworkInsightsPath' {} Maybe Natural
a -> CreateNetworkInsightsPath
s {$sel:destinationPort:CreateNetworkInsightsPath' :: Maybe Natural
destinationPort = Maybe Natural
a} :: CreateNetworkInsightsPath)

-- | 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@.
createNetworkInsightsPath_dryRun :: Lens.Lens' CreateNetworkInsightsPath (Prelude.Maybe Prelude.Bool)
createNetworkInsightsPath_dryRun :: Lens' CreateNetworkInsightsPath (Maybe Bool)
createNetworkInsightsPath_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkInsightsPath' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateNetworkInsightsPath
s@CreateNetworkInsightsPath' {} Maybe Bool
a -> CreateNetworkInsightsPath
s {$sel:dryRun:CreateNetworkInsightsPath' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateNetworkInsightsPath)

-- | The IP address of the Amazon Web Services resource that is the source of
-- the path.
createNetworkInsightsPath_sourceIp :: Lens.Lens' CreateNetworkInsightsPath (Prelude.Maybe Prelude.Text)
createNetworkInsightsPath_sourceIp :: Lens' CreateNetworkInsightsPath (Maybe Text)
createNetworkInsightsPath_sourceIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkInsightsPath' {Maybe Text
sourceIp :: Maybe Text
$sel:sourceIp:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Text
sourceIp} -> Maybe Text
sourceIp) (\s :: CreateNetworkInsightsPath
s@CreateNetworkInsightsPath' {} Maybe Text
a -> CreateNetworkInsightsPath
s {$sel:sourceIp:CreateNetworkInsightsPath' :: Maybe Text
sourceIp = Maybe Text
a} :: CreateNetworkInsightsPath)

-- | The tags to add to the path.
createNetworkInsightsPath_tagSpecifications :: Lens.Lens' CreateNetworkInsightsPath (Prelude.Maybe [TagSpecification])
createNetworkInsightsPath_tagSpecifications :: Lens' CreateNetworkInsightsPath (Maybe [TagSpecification])
createNetworkInsightsPath_tagSpecifications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkInsightsPath' {Maybe [TagSpecification]
tagSpecifications :: Maybe [TagSpecification]
$sel:tagSpecifications:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe [TagSpecification]
tagSpecifications} -> Maybe [TagSpecification]
tagSpecifications) (\s :: CreateNetworkInsightsPath
s@CreateNetworkInsightsPath' {} Maybe [TagSpecification]
a -> CreateNetworkInsightsPath
s {$sel:tagSpecifications:CreateNetworkInsightsPath' :: Maybe [TagSpecification]
tagSpecifications = Maybe [TagSpecification]
a} :: CreateNetworkInsightsPath) 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 Amazon Web Services resource that is the source of the path.
createNetworkInsightsPath_source :: Lens.Lens' CreateNetworkInsightsPath Prelude.Text
createNetworkInsightsPath_source :: Lens' CreateNetworkInsightsPath Text
createNetworkInsightsPath_source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkInsightsPath' {Text
source :: Text
$sel:source:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
source} -> Text
source) (\s :: CreateNetworkInsightsPath
s@CreateNetworkInsightsPath' {} Text
a -> CreateNetworkInsightsPath
s {$sel:source:CreateNetworkInsightsPath' :: Text
source = Text
a} :: CreateNetworkInsightsPath)

-- | The Amazon Web Services resource that is the destination of the path.
createNetworkInsightsPath_destination :: Lens.Lens' CreateNetworkInsightsPath Prelude.Text
createNetworkInsightsPath_destination :: Lens' CreateNetworkInsightsPath Text
createNetworkInsightsPath_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkInsightsPath' {Text
destination :: Text
$sel:destination:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
destination} -> Text
destination) (\s :: CreateNetworkInsightsPath
s@CreateNetworkInsightsPath' {} Text
a -> CreateNetworkInsightsPath
s {$sel:destination:CreateNetworkInsightsPath' :: Text
destination = Text
a} :: CreateNetworkInsightsPath)

-- | The protocol.
createNetworkInsightsPath_protocol :: Lens.Lens' CreateNetworkInsightsPath Protocol
createNetworkInsightsPath_protocol :: Lens' CreateNetworkInsightsPath Protocol
createNetworkInsightsPath_protocol = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkInsightsPath' {Protocol
protocol :: Protocol
$sel:protocol:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Protocol
protocol} -> Protocol
protocol) (\s :: CreateNetworkInsightsPath
s@CreateNetworkInsightsPath' {} Protocol
a -> CreateNetworkInsightsPath
s {$sel:protocol:CreateNetworkInsightsPath' :: Protocol
protocol = Protocol
a} :: CreateNetworkInsightsPath)

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html How to ensure idempotency>.
createNetworkInsightsPath_clientToken :: Lens.Lens' CreateNetworkInsightsPath Prelude.Text
createNetworkInsightsPath_clientToken :: Lens' CreateNetworkInsightsPath Text
createNetworkInsightsPath_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkInsightsPath' {Text
clientToken :: Text
$sel:clientToken:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
clientToken} -> Text
clientToken) (\s :: CreateNetworkInsightsPath
s@CreateNetworkInsightsPath' {} Text
a -> CreateNetworkInsightsPath
s {$sel:clientToken:CreateNetworkInsightsPath' :: Text
clientToken = Text
a} :: CreateNetworkInsightsPath)

instance Core.AWSRequest CreateNetworkInsightsPath where
  type
    AWSResponse CreateNetworkInsightsPath =
      CreateNetworkInsightsPathResponse
  request :: (Service -> Service)
-> CreateNetworkInsightsPath -> Request CreateNetworkInsightsPath
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 CreateNetworkInsightsPath
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateNetworkInsightsPath)))
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
-> Int -> CreateNetworkInsightsPathResponse
CreateNetworkInsightsPathResponse'
            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
"networkInsightsPath")
            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 CreateNetworkInsightsPath where
  hashWithSalt :: Int -> CreateNetworkInsightsPath -> Int
hashWithSalt Int
_salt CreateNetworkInsightsPath' {Maybe Bool
Maybe Natural
Maybe [TagSpecification]
Maybe Text
Text
Protocol
clientToken :: Text
protocol :: Protocol
destination :: Text
source :: Text
tagSpecifications :: Maybe [TagSpecification]
sourceIp :: Maybe Text
dryRun :: Maybe Bool
destinationPort :: Maybe Natural
destinationIp :: Maybe Text
$sel:clientToken:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
$sel:protocol:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Protocol
$sel:destination:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
$sel:source:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
$sel:tagSpecifications:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe [TagSpecification]
$sel:sourceIp:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Text
$sel:dryRun:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Bool
$sel:destinationPort:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Natural
$sel:destinationIp:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationIp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
destinationPort
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceIp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagSpecification]
tagSpecifications
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
source
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
destination
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Protocol
protocol
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientToken

instance Prelude.NFData CreateNetworkInsightsPath where
  rnf :: CreateNetworkInsightsPath -> ()
rnf CreateNetworkInsightsPath' {Maybe Bool
Maybe Natural
Maybe [TagSpecification]
Maybe Text
Text
Protocol
clientToken :: Text
protocol :: Protocol
destination :: Text
source :: Text
tagSpecifications :: Maybe [TagSpecification]
sourceIp :: Maybe Text
dryRun :: Maybe Bool
destinationPort :: Maybe Natural
destinationIp :: Maybe Text
$sel:clientToken:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
$sel:protocol:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Protocol
$sel:destination:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
$sel:source:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
$sel:tagSpecifications:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe [TagSpecification]
$sel:sourceIp:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Text
$sel:dryRun:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Bool
$sel:destinationPort:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Natural
$sel:destinationIp:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destinationIp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
destinationPort
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
sourceIp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagSpecification]
tagSpecifications
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
source
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
destination
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Protocol
protocol
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientToken

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

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

instance Data.ToQuery CreateNetworkInsightsPath where
  toQuery :: CreateNetworkInsightsPath -> QueryString
toQuery CreateNetworkInsightsPath' {Maybe Bool
Maybe Natural
Maybe [TagSpecification]
Maybe Text
Text
Protocol
clientToken :: Text
protocol :: Protocol
destination :: Text
source :: Text
tagSpecifications :: Maybe [TagSpecification]
sourceIp :: Maybe Text
dryRun :: Maybe Bool
destinationPort :: Maybe Natural
destinationIp :: Maybe Text
$sel:clientToken:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
$sel:protocol:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Protocol
$sel:destination:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
$sel:source:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Text
$sel:tagSpecifications:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe [TagSpecification]
$sel:sourceIp:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Text
$sel:dryRun:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Bool
$sel:destinationPort:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Natural
$sel:destinationIp:CreateNetworkInsightsPath' :: CreateNetworkInsightsPath -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateNetworkInsightsPath" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DestinationIp" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
destinationIp,
        ByteString
"DestinationPort" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
destinationPort,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"SourceIp" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
sourceIp,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagSpecification"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagSpecification]
tagSpecifications
          ),
        ByteString
"Source" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
source,
        ByteString
"Destination" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
destination,
        ByteString
"Protocol" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Protocol
protocol,
        ByteString
"ClientToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
clientToken
      ]

-- | /See:/ 'newCreateNetworkInsightsPathResponse' smart constructor.
data CreateNetworkInsightsPathResponse = CreateNetworkInsightsPathResponse'
  { -- | Information about the path.
    CreateNetworkInsightsPathResponse -> Maybe NetworkInsightsPath
networkInsightsPath :: Prelude.Maybe NetworkInsightsPath,
    -- | The response's http status code.
    CreateNetworkInsightsPathResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateNetworkInsightsPathResponse
-> CreateNetworkInsightsPathResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNetworkInsightsPathResponse
-> CreateNetworkInsightsPathResponse -> Bool
$c/= :: CreateNetworkInsightsPathResponse
-> CreateNetworkInsightsPathResponse -> Bool
== :: CreateNetworkInsightsPathResponse
-> CreateNetworkInsightsPathResponse -> Bool
$c== :: CreateNetworkInsightsPathResponse
-> CreateNetworkInsightsPathResponse -> Bool
Prelude.Eq, ReadPrec [CreateNetworkInsightsPathResponse]
ReadPrec CreateNetworkInsightsPathResponse
Int -> ReadS CreateNetworkInsightsPathResponse
ReadS [CreateNetworkInsightsPathResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNetworkInsightsPathResponse]
$creadListPrec :: ReadPrec [CreateNetworkInsightsPathResponse]
readPrec :: ReadPrec CreateNetworkInsightsPathResponse
$creadPrec :: ReadPrec CreateNetworkInsightsPathResponse
readList :: ReadS [CreateNetworkInsightsPathResponse]
$creadList :: ReadS [CreateNetworkInsightsPathResponse]
readsPrec :: Int -> ReadS CreateNetworkInsightsPathResponse
$creadsPrec :: Int -> ReadS CreateNetworkInsightsPathResponse
Prelude.Read, Int -> CreateNetworkInsightsPathResponse -> ShowS
[CreateNetworkInsightsPathResponse] -> ShowS
CreateNetworkInsightsPathResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNetworkInsightsPathResponse] -> ShowS
$cshowList :: [CreateNetworkInsightsPathResponse] -> ShowS
show :: CreateNetworkInsightsPathResponse -> String
$cshow :: CreateNetworkInsightsPathResponse -> String
showsPrec :: Int -> CreateNetworkInsightsPathResponse -> ShowS
$cshowsPrec :: Int -> CreateNetworkInsightsPathResponse -> ShowS
Prelude.Show, forall x.
Rep CreateNetworkInsightsPathResponse x
-> CreateNetworkInsightsPathResponse
forall x.
CreateNetworkInsightsPathResponse
-> Rep CreateNetworkInsightsPathResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateNetworkInsightsPathResponse x
-> CreateNetworkInsightsPathResponse
$cfrom :: forall x.
CreateNetworkInsightsPathResponse
-> Rep CreateNetworkInsightsPathResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateNetworkInsightsPathResponse' 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:
--
-- 'networkInsightsPath', 'createNetworkInsightsPathResponse_networkInsightsPath' - Information about the path.
--
-- 'httpStatus', 'createNetworkInsightsPathResponse_httpStatus' - The response's http status code.
newCreateNetworkInsightsPathResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateNetworkInsightsPathResponse
newCreateNetworkInsightsPathResponse :: Int -> CreateNetworkInsightsPathResponse
newCreateNetworkInsightsPathResponse Int
pHttpStatus_ =
  CreateNetworkInsightsPathResponse'
    { $sel:networkInsightsPath:CreateNetworkInsightsPathResponse' :: Maybe NetworkInsightsPath
networkInsightsPath =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateNetworkInsightsPathResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the path.
createNetworkInsightsPathResponse_networkInsightsPath :: Lens.Lens' CreateNetworkInsightsPathResponse (Prelude.Maybe NetworkInsightsPath)
createNetworkInsightsPathResponse_networkInsightsPath :: Lens' CreateNetworkInsightsPathResponse (Maybe NetworkInsightsPath)
createNetworkInsightsPathResponse_networkInsightsPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkInsightsPathResponse' {Maybe NetworkInsightsPath
networkInsightsPath :: Maybe NetworkInsightsPath
$sel:networkInsightsPath:CreateNetworkInsightsPathResponse' :: CreateNetworkInsightsPathResponse -> Maybe NetworkInsightsPath
networkInsightsPath} -> Maybe NetworkInsightsPath
networkInsightsPath) (\s :: CreateNetworkInsightsPathResponse
s@CreateNetworkInsightsPathResponse' {} Maybe NetworkInsightsPath
a -> CreateNetworkInsightsPathResponse
s {$sel:networkInsightsPath:CreateNetworkInsightsPathResponse' :: Maybe NetworkInsightsPath
networkInsightsPath = Maybe NetworkInsightsPath
a} :: CreateNetworkInsightsPathResponse)

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

instance
  Prelude.NFData
    CreateNetworkInsightsPathResponse
  where
  rnf :: CreateNetworkInsightsPathResponse -> ()
rnf CreateNetworkInsightsPathResponse' {Int
Maybe NetworkInsightsPath
httpStatus :: Int
networkInsightsPath :: Maybe NetworkInsightsPath
$sel:httpStatus:CreateNetworkInsightsPathResponse' :: CreateNetworkInsightsPathResponse -> Int
$sel:networkInsightsPath:CreateNetworkInsightsPathResponse' :: CreateNetworkInsightsPathResponse -> Maybe NetworkInsightsPath
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkInsightsPath
networkInsightsPath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus