{-# 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.ModifyTrafficMirrorSession
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies a Traffic Mirror session.
module Amazonka.EC2.ModifyTrafficMirrorSession
  ( -- * Creating a Request
    ModifyTrafficMirrorSession (..),
    newModifyTrafficMirrorSession,

    -- * Request Lenses
    modifyTrafficMirrorSession_description,
    modifyTrafficMirrorSession_dryRun,
    modifyTrafficMirrorSession_packetLength,
    modifyTrafficMirrorSession_removeFields,
    modifyTrafficMirrorSession_sessionNumber,
    modifyTrafficMirrorSession_trafficMirrorFilterId,
    modifyTrafficMirrorSession_trafficMirrorTargetId,
    modifyTrafficMirrorSession_virtualNetworkId,
    modifyTrafficMirrorSession_trafficMirrorSessionId,

    -- * Destructuring the Response
    ModifyTrafficMirrorSessionResponse (..),
    newModifyTrafficMirrorSessionResponse,

    -- * Response Lenses
    modifyTrafficMirrorSessionResponse_trafficMirrorSession,
    modifyTrafficMirrorSessionResponse_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:/ 'newModifyTrafficMirrorSession' smart constructor.
data ModifyTrafficMirrorSession = ModifyTrafficMirrorSession'
  { -- | The description to assign to the Traffic Mirror session.
    ModifyTrafficMirrorSession -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | 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@.
    ModifyTrafficMirrorSession -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The number of bytes in each packet to mirror. These are bytes after the
    -- VXLAN header. To mirror a subset, set this to the length (in bytes) to
    -- mirror. For example, if you set this value to 100, then the first 100
    -- bytes that meet the filter criteria are copied to the target. Do not
    -- specify this parameter when you want to mirror the entire packet.
    ModifyTrafficMirrorSession -> Maybe Int
packetLength :: Prelude.Maybe Prelude.Int,
    -- | The properties that you want to remove from the Traffic Mirror session.
    --
    -- When you remove a property from a Traffic Mirror session, the property
    -- is set to the default.
    ModifyTrafficMirrorSession -> Maybe [TrafficMirrorSessionField]
removeFields :: Prelude.Maybe [TrafficMirrorSessionField],
    -- | The session number determines the order in which sessions are evaluated
    -- when an interface is used by multiple sessions. The first session with a
    -- matching filter is the one that mirrors the packets.
    --
    -- Valid values are 1-32766.
    ModifyTrafficMirrorSession -> Maybe Int
sessionNumber :: Prelude.Maybe Prelude.Int,
    -- | The ID of the Traffic Mirror filter.
    ModifyTrafficMirrorSession -> Maybe Text
trafficMirrorFilterId :: Prelude.Maybe Prelude.Text,
    -- | The Traffic Mirror target. The target must be in the same VPC as the
    -- source, or have a VPC peering connection with the source.
    ModifyTrafficMirrorSession -> Maybe Text
trafficMirrorTargetId :: Prelude.Maybe Prelude.Text,
    -- | The virtual network ID of the Traffic Mirror session.
    ModifyTrafficMirrorSession -> Maybe Int
virtualNetworkId :: Prelude.Maybe Prelude.Int,
    -- | The ID of the Traffic Mirror session.
    ModifyTrafficMirrorSession -> Text
trafficMirrorSessionId :: Prelude.Text
  }
  deriving (ModifyTrafficMirrorSession -> ModifyTrafficMirrorSession -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyTrafficMirrorSession -> ModifyTrafficMirrorSession -> Bool
$c/= :: ModifyTrafficMirrorSession -> ModifyTrafficMirrorSession -> Bool
== :: ModifyTrafficMirrorSession -> ModifyTrafficMirrorSession -> Bool
$c== :: ModifyTrafficMirrorSession -> ModifyTrafficMirrorSession -> Bool
Prelude.Eq, ReadPrec [ModifyTrafficMirrorSession]
ReadPrec ModifyTrafficMirrorSession
Int -> ReadS ModifyTrafficMirrorSession
ReadS [ModifyTrafficMirrorSession]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyTrafficMirrorSession]
$creadListPrec :: ReadPrec [ModifyTrafficMirrorSession]
readPrec :: ReadPrec ModifyTrafficMirrorSession
$creadPrec :: ReadPrec ModifyTrafficMirrorSession
readList :: ReadS [ModifyTrafficMirrorSession]
$creadList :: ReadS [ModifyTrafficMirrorSession]
readsPrec :: Int -> ReadS ModifyTrafficMirrorSession
$creadsPrec :: Int -> ReadS ModifyTrafficMirrorSession
Prelude.Read, Int -> ModifyTrafficMirrorSession -> ShowS
[ModifyTrafficMirrorSession] -> ShowS
ModifyTrafficMirrorSession -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyTrafficMirrorSession] -> ShowS
$cshowList :: [ModifyTrafficMirrorSession] -> ShowS
show :: ModifyTrafficMirrorSession -> String
$cshow :: ModifyTrafficMirrorSession -> String
showsPrec :: Int -> ModifyTrafficMirrorSession -> ShowS
$cshowsPrec :: Int -> ModifyTrafficMirrorSession -> ShowS
Prelude.Show, forall x.
Rep ModifyTrafficMirrorSession x -> ModifyTrafficMirrorSession
forall x.
ModifyTrafficMirrorSession -> Rep ModifyTrafficMirrorSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyTrafficMirrorSession x -> ModifyTrafficMirrorSession
$cfrom :: forall x.
ModifyTrafficMirrorSession -> Rep ModifyTrafficMirrorSession x
Prelude.Generic)

-- |
-- Create a value of 'ModifyTrafficMirrorSession' 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:
--
-- 'description', 'modifyTrafficMirrorSession_description' - The description to assign to the Traffic Mirror session.
--
-- 'dryRun', 'modifyTrafficMirrorSession_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@.
--
-- 'packetLength', 'modifyTrafficMirrorSession_packetLength' - The number of bytes in each packet to mirror. These are bytes after the
-- VXLAN header. To mirror a subset, set this to the length (in bytes) to
-- mirror. For example, if you set this value to 100, then the first 100
-- bytes that meet the filter criteria are copied to the target. Do not
-- specify this parameter when you want to mirror the entire packet.
--
-- 'removeFields', 'modifyTrafficMirrorSession_removeFields' - The properties that you want to remove from the Traffic Mirror session.
--
-- When you remove a property from a Traffic Mirror session, the property
-- is set to the default.
--
-- 'sessionNumber', 'modifyTrafficMirrorSession_sessionNumber' - The session number determines the order in which sessions are evaluated
-- when an interface is used by multiple sessions. The first session with a
-- matching filter is the one that mirrors the packets.
--
-- Valid values are 1-32766.
--
-- 'trafficMirrorFilterId', 'modifyTrafficMirrorSession_trafficMirrorFilterId' - The ID of the Traffic Mirror filter.
--
-- 'trafficMirrorTargetId', 'modifyTrafficMirrorSession_trafficMirrorTargetId' - The Traffic Mirror target. The target must be in the same VPC as the
-- source, or have a VPC peering connection with the source.
--
-- 'virtualNetworkId', 'modifyTrafficMirrorSession_virtualNetworkId' - The virtual network ID of the Traffic Mirror session.
--
-- 'trafficMirrorSessionId', 'modifyTrafficMirrorSession_trafficMirrorSessionId' - The ID of the Traffic Mirror session.
newModifyTrafficMirrorSession ::
  -- | 'trafficMirrorSessionId'
  Prelude.Text ->
  ModifyTrafficMirrorSession
newModifyTrafficMirrorSession :: Text -> ModifyTrafficMirrorSession
newModifyTrafficMirrorSession
  Text
pTrafficMirrorSessionId_ =
    ModifyTrafficMirrorSession'
      { $sel:description:ModifyTrafficMirrorSession' :: Maybe Text
description =
          forall a. Maybe a
Prelude.Nothing,
        $sel:dryRun:ModifyTrafficMirrorSession' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
        $sel:packetLength:ModifyTrafficMirrorSession' :: Maybe Int
packetLength = forall a. Maybe a
Prelude.Nothing,
        $sel:removeFields:ModifyTrafficMirrorSession' :: Maybe [TrafficMirrorSessionField]
removeFields = forall a. Maybe a
Prelude.Nothing,
        $sel:sessionNumber:ModifyTrafficMirrorSession' :: Maybe Int
sessionNumber = forall a. Maybe a
Prelude.Nothing,
        $sel:trafficMirrorFilterId:ModifyTrafficMirrorSession' :: Maybe Text
trafficMirrorFilterId = forall a. Maybe a
Prelude.Nothing,
        $sel:trafficMirrorTargetId:ModifyTrafficMirrorSession' :: Maybe Text
trafficMirrorTargetId = forall a. Maybe a
Prelude.Nothing,
        $sel:virtualNetworkId:ModifyTrafficMirrorSession' :: Maybe Int
virtualNetworkId = forall a. Maybe a
Prelude.Nothing,
        $sel:trafficMirrorSessionId:ModifyTrafficMirrorSession' :: Text
trafficMirrorSessionId =
          Text
pTrafficMirrorSessionId_
      }

-- | The description to assign to the Traffic Mirror session.
modifyTrafficMirrorSession_description :: Lens.Lens' ModifyTrafficMirrorSession (Prelude.Maybe Prelude.Text)
modifyTrafficMirrorSession_description :: Lens' ModifyTrafficMirrorSession (Maybe Text)
modifyTrafficMirrorSession_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTrafficMirrorSession' {Maybe Text
description :: Maybe Text
$sel:description:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
description} -> Maybe Text
description) (\s :: ModifyTrafficMirrorSession
s@ModifyTrafficMirrorSession' {} Maybe Text
a -> ModifyTrafficMirrorSession
s {$sel:description:ModifyTrafficMirrorSession' :: Maybe Text
description = Maybe Text
a} :: ModifyTrafficMirrorSession)

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

-- | The number of bytes in each packet to mirror. These are bytes after the
-- VXLAN header. To mirror a subset, set this to the length (in bytes) to
-- mirror. For example, if you set this value to 100, then the first 100
-- bytes that meet the filter criteria are copied to the target. Do not
-- specify this parameter when you want to mirror the entire packet.
modifyTrafficMirrorSession_packetLength :: Lens.Lens' ModifyTrafficMirrorSession (Prelude.Maybe Prelude.Int)
modifyTrafficMirrorSession_packetLength :: Lens' ModifyTrafficMirrorSession (Maybe Int)
modifyTrafficMirrorSession_packetLength = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTrafficMirrorSession' {Maybe Int
packetLength :: Maybe Int
$sel:packetLength:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
packetLength} -> Maybe Int
packetLength) (\s :: ModifyTrafficMirrorSession
s@ModifyTrafficMirrorSession' {} Maybe Int
a -> ModifyTrafficMirrorSession
s {$sel:packetLength:ModifyTrafficMirrorSession' :: Maybe Int
packetLength = Maybe Int
a} :: ModifyTrafficMirrorSession)

-- | The properties that you want to remove from the Traffic Mirror session.
--
-- When you remove a property from a Traffic Mirror session, the property
-- is set to the default.
modifyTrafficMirrorSession_removeFields :: Lens.Lens' ModifyTrafficMirrorSession (Prelude.Maybe [TrafficMirrorSessionField])
modifyTrafficMirrorSession_removeFields :: Lens'
  ModifyTrafficMirrorSession (Maybe [TrafficMirrorSessionField])
modifyTrafficMirrorSession_removeFields = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTrafficMirrorSession' {Maybe [TrafficMirrorSessionField]
removeFields :: Maybe [TrafficMirrorSessionField]
$sel:removeFields:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe [TrafficMirrorSessionField]
removeFields} -> Maybe [TrafficMirrorSessionField]
removeFields) (\s :: ModifyTrafficMirrorSession
s@ModifyTrafficMirrorSession' {} Maybe [TrafficMirrorSessionField]
a -> ModifyTrafficMirrorSession
s {$sel:removeFields:ModifyTrafficMirrorSession' :: Maybe [TrafficMirrorSessionField]
removeFields = Maybe [TrafficMirrorSessionField]
a} :: ModifyTrafficMirrorSession) 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 session number determines the order in which sessions are evaluated
-- when an interface is used by multiple sessions. The first session with a
-- matching filter is the one that mirrors the packets.
--
-- Valid values are 1-32766.
modifyTrafficMirrorSession_sessionNumber :: Lens.Lens' ModifyTrafficMirrorSession (Prelude.Maybe Prelude.Int)
modifyTrafficMirrorSession_sessionNumber :: Lens' ModifyTrafficMirrorSession (Maybe Int)
modifyTrafficMirrorSession_sessionNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTrafficMirrorSession' {Maybe Int
sessionNumber :: Maybe Int
$sel:sessionNumber:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
sessionNumber} -> Maybe Int
sessionNumber) (\s :: ModifyTrafficMirrorSession
s@ModifyTrafficMirrorSession' {} Maybe Int
a -> ModifyTrafficMirrorSession
s {$sel:sessionNumber:ModifyTrafficMirrorSession' :: Maybe Int
sessionNumber = Maybe Int
a} :: ModifyTrafficMirrorSession)

-- | The ID of the Traffic Mirror filter.
modifyTrafficMirrorSession_trafficMirrorFilterId :: Lens.Lens' ModifyTrafficMirrorSession (Prelude.Maybe Prelude.Text)
modifyTrafficMirrorSession_trafficMirrorFilterId :: Lens' ModifyTrafficMirrorSession (Maybe Text)
modifyTrafficMirrorSession_trafficMirrorFilterId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTrafficMirrorSession' {Maybe Text
trafficMirrorFilterId :: Maybe Text
$sel:trafficMirrorFilterId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
trafficMirrorFilterId} -> Maybe Text
trafficMirrorFilterId) (\s :: ModifyTrafficMirrorSession
s@ModifyTrafficMirrorSession' {} Maybe Text
a -> ModifyTrafficMirrorSession
s {$sel:trafficMirrorFilterId:ModifyTrafficMirrorSession' :: Maybe Text
trafficMirrorFilterId = Maybe Text
a} :: ModifyTrafficMirrorSession)

-- | The Traffic Mirror target. The target must be in the same VPC as the
-- source, or have a VPC peering connection with the source.
modifyTrafficMirrorSession_trafficMirrorTargetId :: Lens.Lens' ModifyTrafficMirrorSession (Prelude.Maybe Prelude.Text)
modifyTrafficMirrorSession_trafficMirrorTargetId :: Lens' ModifyTrafficMirrorSession (Maybe Text)
modifyTrafficMirrorSession_trafficMirrorTargetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTrafficMirrorSession' {Maybe Text
trafficMirrorTargetId :: Maybe Text
$sel:trafficMirrorTargetId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
trafficMirrorTargetId} -> Maybe Text
trafficMirrorTargetId) (\s :: ModifyTrafficMirrorSession
s@ModifyTrafficMirrorSession' {} Maybe Text
a -> ModifyTrafficMirrorSession
s {$sel:trafficMirrorTargetId:ModifyTrafficMirrorSession' :: Maybe Text
trafficMirrorTargetId = Maybe Text
a} :: ModifyTrafficMirrorSession)

-- | The virtual network ID of the Traffic Mirror session.
modifyTrafficMirrorSession_virtualNetworkId :: Lens.Lens' ModifyTrafficMirrorSession (Prelude.Maybe Prelude.Int)
modifyTrafficMirrorSession_virtualNetworkId :: Lens' ModifyTrafficMirrorSession (Maybe Int)
modifyTrafficMirrorSession_virtualNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTrafficMirrorSession' {Maybe Int
virtualNetworkId :: Maybe Int
$sel:virtualNetworkId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
virtualNetworkId} -> Maybe Int
virtualNetworkId) (\s :: ModifyTrafficMirrorSession
s@ModifyTrafficMirrorSession' {} Maybe Int
a -> ModifyTrafficMirrorSession
s {$sel:virtualNetworkId:ModifyTrafficMirrorSession' :: Maybe Int
virtualNetworkId = Maybe Int
a} :: ModifyTrafficMirrorSession)

-- | The ID of the Traffic Mirror session.
modifyTrafficMirrorSession_trafficMirrorSessionId :: Lens.Lens' ModifyTrafficMirrorSession Prelude.Text
modifyTrafficMirrorSession_trafficMirrorSessionId :: Lens' ModifyTrafficMirrorSession Text
modifyTrafficMirrorSession_trafficMirrorSessionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTrafficMirrorSession' {Text
trafficMirrorSessionId :: Text
$sel:trafficMirrorSessionId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Text
trafficMirrorSessionId} -> Text
trafficMirrorSessionId) (\s :: ModifyTrafficMirrorSession
s@ModifyTrafficMirrorSession' {} Text
a -> ModifyTrafficMirrorSession
s {$sel:trafficMirrorSessionId:ModifyTrafficMirrorSession' :: Text
trafficMirrorSessionId = Text
a} :: ModifyTrafficMirrorSession)

instance Core.AWSRequest ModifyTrafficMirrorSession where
  type
    AWSResponse ModifyTrafficMirrorSession =
      ModifyTrafficMirrorSessionResponse
  request :: (Service -> Service)
-> ModifyTrafficMirrorSession -> Request ModifyTrafficMirrorSession
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 ModifyTrafficMirrorSession
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyTrafficMirrorSession)))
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 TrafficMirrorSession
-> Int -> ModifyTrafficMirrorSessionResponse
ModifyTrafficMirrorSessionResponse'
            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
"trafficMirrorSession")
            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 ModifyTrafficMirrorSession where
  hashWithSalt :: Int -> ModifyTrafficMirrorSession -> Int
hashWithSalt Int
_salt ModifyTrafficMirrorSession' {Maybe Bool
Maybe Int
Maybe [TrafficMirrorSessionField]
Maybe Text
Text
trafficMirrorSessionId :: Text
virtualNetworkId :: Maybe Int
trafficMirrorTargetId :: Maybe Text
trafficMirrorFilterId :: Maybe Text
sessionNumber :: Maybe Int
removeFields :: Maybe [TrafficMirrorSessionField]
packetLength :: Maybe Int
dryRun :: Maybe Bool
description :: Maybe Text
$sel:trafficMirrorSessionId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Text
$sel:virtualNetworkId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
$sel:trafficMirrorTargetId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
$sel:trafficMirrorFilterId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
$sel:sessionNumber:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
$sel:removeFields:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe [TrafficMirrorSessionField]
$sel:packetLength:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
$sel:dryRun:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Bool
$sel:description:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
packetLength
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TrafficMirrorSessionField]
removeFields
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
sessionNumber
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
trafficMirrorFilterId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
trafficMirrorTargetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
virtualNetworkId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
trafficMirrorSessionId

instance Prelude.NFData ModifyTrafficMirrorSession where
  rnf :: ModifyTrafficMirrorSession -> ()
rnf ModifyTrafficMirrorSession' {Maybe Bool
Maybe Int
Maybe [TrafficMirrorSessionField]
Maybe Text
Text
trafficMirrorSessionId :: Text
virtualNetworkId :: Maybe Int
trafficMirrorTargetId :: Maybe Text
trafficMirrorFilterId :: Maybe Text
sessionNumber :: Maybe Int
removeFields :: Maybe [TrafficMirrorSessionField]
packetLength :: Maybe Int
dryRun :: Maybe Bool
description :: Maybe Text
$sel:trafficMirrorSessionId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Text
$sel:virtualNetworkId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
$sel:trafficMirrorTargetId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
$sel:trafficMirrorFilterId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
$sel:sessionNumber:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
$sel:removeFields:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe [TrafficMirrorSessionField]
$sel:packetLength:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
$sel:dryRun:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Bool
$sel:description:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      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 Int
packetLength
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TrafficMirrorSessionField]
removeFields
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
sessionNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
trafficMirrorFilterId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
trafficMirrorTargetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
virtualNetworkId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
trafficMirrorSessionId

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

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

instance Data.ToQuery ModifyTrafficMirrorSession where
  toQuery :: ModifyTrafficMirrorSession -> QueryString
toQuery ModifyTrafficMirrorSession' {Maybe Bool
Maybe Int
Maybe [TrafficMirrorSessionField]
Maybe Text
Text
trafficMirrorSessionId :: Text
virtualNetworkId :: Maybe Int
trafficMirrorTargetId :: Maybe Text
trafficMirrorFilterId :: Maybe Text
sessionNumber :: Maybe Int
removeFields :: Maybe [TrafficMirrorSessionField]
packetLength :: Maybe Int
dryRun :: Maybe Bool
description :: Maybe Text
$sel:trafficMirrorSessionId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Text
$sel:virtualNetworkId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
$sel:trafficMirrorTargetId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
$sel:trafficMirrorFilterId:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
$sel:sessionNumber:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
$sel:removeFields:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe [TrafficMirrorSessionField]
$sel:packetLength:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Int
$sel:dryRun:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Bool
$sel:description:ModifyTrafficMirrorSession' :: ModifyTrafficMirrorSession -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyTrafficMirrorSession" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"Description" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
description,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"PacketLength" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
packetLength,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"RemoveField"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TrafficMirrorSessionField]
removeFields
          ),
        ByteString
"SessionNumber" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
sessionNumber,
        ByteString
"TrafficMirrorFilterId"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
trafficMirrorFilterId,
        ByteString
"TrafficMirrorTargetId"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
trafficMirrorTargetId,
        ByteString
"VirtualNetworkId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
virtualNetworkId,
        ByteString
"TrafficMirrorSessionId"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
trafficMirrorSessionId
      ]

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

-- |
-- Create a value of 'ModifyTrafficMirrorSessionResponse' 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:
--
-- 'trafficMirrorSession', 'modifyTrafficMirrorSessionResponse_trafficMirrorSession' - Information about the Traffic Mirror session.
--
-- 'httpStatus', 'modifyTrafficMirrorSessionResponse_httpStatus' - The response's http status code.
newModifyTrafficMirrorSessionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyTrafficMirrorSessionResponse
newModifyTrafficMirrorSessionResponse :: Int -> ModifyTrafficMirrorSessionResponse
newModifyTrafficMirrorSessionResponse Int
pHttpStatus_ =
  ModifyTrafficMirrorSessionResponse'
    { $sel:trafficMirrorSession:ModifyTrafficMirrorSessionResponse' :: Maybe TrafficMirrorSession
trafficMirrorSession =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyTrafficMirrorSessionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the Traffic Mirror session.
modifyTrafficMirrorSessionResponse_trafficMirrorSession :: Lens.Lens' ModifyTrafficMirrorSessionResponse (Prelude.Maybe TrafficMirrorSession)
modifyTrafficMirrorSessionResponse_trafficMirrorSession :: Lens'
  ModifyTrafficMirrorSessionResponse (Maybe TrafficMirrorSession)
modifyTrafficMirrorSessionResponse_trafficMirrorSession = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyTrafficMirrorSessionResponse' {Maybe TrafficMirrorSession
trafficMirrorSession :: Maybe TrafficMirrorSession
$sel:trafficMirrorSession:ModifyTrafficMirrorSessionResponse' :: ModifyTrafficMirrorSessionResponse -> Maybe TrafficMirrorSession
trafficMirrorSession} -> Maybe TrafficMirrorSession
trafficMirrorSession) (\s :: ModifyTrafficMirrorSessionResponse
s@ModifyTrafficMirrorSessionResponse' {} Maybe TrafficMirrorSession
a -> ModifyTrafficMirrorSessionResponse
s {$sel:trafficMirrorSession:ModifyTrafficMirrorSessionResponse' :: Maybe TrafficMirrorSession
trafficMirrorSession = Maybe TrafficMirrorSession
a} :: ModifyTrafficMirrorSessionResponse)

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

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