{-# 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.AssociateTrunkInterface
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This API action is currently in __limited preview only__. If you are
-- interested in using this feature, contact your account manager.
--
-- Associates a branch network interface with a trunk network interface.
--
-- Before you create the association, run the
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html create-network-interface>
-- command and set @--interface-type@ to @trunk@. You must also create a
-- network interface for each branch network interface that you want to
-- associate with the trunk network interface.
module Amazonka.EC2.AssociateTrunkInterface
  ( -- * Creating a Request
    AssociateTrunkInterface (..),
    newAssociateTrunkInterface,

    -- * Request Lenses
    associateTrunkInterface_clientToken,
    associateTrunkInterface_dryRun,
    associateTrunkInterface_greKey,
    associateTrunkInterface_vlanId,
    associateTrunkInterface_branchInterfaceId,
    associateTrunkInterface_trunkInterfaceId,

    -- * Destructuring the Response
    AssociateTrunkInterfaceResponse (..),
    newAssociateTrunkInterfaceResponse,

    -- * Response Lenses
    associateTrunkInterfaceResponse_clientToken,
    associateTrunkInterfaceResponse_interfaceAssociation,
    associateTrunkInterfaceResponse_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:/ 'newAssociateTrunkInterface' smart constructor.
data AssociateTrunkInterface = AssociateTrunkInterface'
  { -- | 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/UserGuide/Run_Instance_Idempotency.html How to Ensure Idempotency>.
    AssociateTrunkInterface -> Maybe Text
clientToken :: 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@.
    AssociateTrunkInterface -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The application key. This applies to the GRE protocol.
    AssociateTrunkInterface -> Maybe Int
greKey :: Prelude.Maybe Prelude.Int,
    -- | The ID of the VLAN. This applies to the VLAN protocol.
    AssociateTrunkInterface -> Maybe Int
vlanId :: Prelude.Maybe Prelude.Int,
    -- | The ID of the branch network interface.
    AssociateTrunkInterface -> Text
branchInterfaceId :: Prelude.Text,
    -- | The ID of the trunk network interface.
    AssociateTrunkInterface -> Text
trunkInterfaceId :: Prelude.Text
  }
  deriving (AssociateTrunkInterface -> AssociateTrunkInterface -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateTrunkInterface -> AssociateTrunkInterface -> Bool
$c/= :: AssociateTrunkInterface -> AssociateTrunkInterface -> Bool
== :: AssociateTrunkInterface -> AssociateTrunkInterface -> Bool
$c== :: AssociateTrunkInterface -> AssociateTrunkInterface -> Bool
Prelude.Eq, ReadPrec [AssociateTrunkInterface]
ReadPrec AssociateTrunkInterface
Int -> ReadS AssociateTrunkInterface
ReadS [AssociateTrunkInterface]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateTrunkInterface]
$creadListPrec :: ReadPrec [AssociateTrunkInterface]
readPrec :: ReadPrec AssociateTrunkInterface
$creadPrec :: ReadPrec AssociateTrunkInterface
readList :: ReadS [AssociateTrunkInterface]
$creadList :: ReadS [AssociateTrunkInterface]
readsPrec :: Int -> ReadS AssociateTrunkInterface
$creadsPrec :: Int -> ReadS AssociateTrunkInterface
Prelude.Read, Int -> AssociateTrunkInterface -> ShowS
[AssociateTrunkInterface] -> ShowS
AssociateTrunkInterface -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateTrunkInterface] -> ShowS
$cshowList :: [AssociateTrunkInterface] -> ShowS
show :: AssociateTrunkInterface -> String
$cshow :: AssociateTrunkInterface -> String
showsPrec :: Int -> AssociateTrunkInterface -> ShowS
$cshowsPrec :: Int -> AssociateTrunkInterface -> ShowS
Prelude.Show, forall x. Rep AssociateTrunkInterface x -> AssociateTrunkInterface
forall x. AssociateTrunkInterface -> Rep AssociateTrunkInterface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociateTrunkInterface x -> AssociateTrunkInterface
$cfrom :: forall x. AssociateTrunkInterface -> Rep AssociateTrunkInterface x
Prelude.Generic)

-- |
-- Create a value of 'AssociateTrunkInterface' 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:
--
-- 'clientToken', 'associateTrunkInterface_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/UserGuide/Run_Instance_Idempotency.html How to Ensure Idempotency>.
--
-- 'dryRun', 'associateTrunkInterface_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@.
--
-- 'greKey', 'associateTrunkInterface_greKey' - The application key. This applies to the GRE protocol.
--
-- 'vlanId', 'associateTrunkInterface_vlanId' - The ID of the VLAN. This applies to the VLAN protocol.
--
-- 'branchInterfaceId', 'associateTrunkInterface_branchInterfaceId' - The ID of the branch network interface.
--
-- 'trunkInterfaceId', 'associateTrunkInterface_trunkInterfaceId' - The ID of the trunk network interface.
newAssociateTrunkInterface ::
  -- | 'branchInterfaceId'
  Prelude.Text ->
  -- | 'trunkInterfaceId'
  Prelude.Text ->
  AssociateTrunkInterface
newAssociateTrunkInterface :: Text -> Text -> AssociateTrunkInterface
newAssociateTrunkInterface
  Text
pBranchInterfaceId_
  Text
pTrunkInterfaceId_ =
    AssociateTrunkInterface'
      { $sel:clientToken:AssociateTrunkInterface' :: Maybe Text
clientToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:dryRun:AssociateTrunkInterface' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
        $sel:greKey:AssociateTrunkInterface' :: Maybe Int
greKey = forall a. Maybe a
Prelude.Nothing,
        $sel:vlanId:AssociateTrunkInterface' :: Maybe Int
vlanId = forall a. Maybe a
Prelude.Nothing,
        $sel:branchInterfaceId:AssociateTrunkInterface' :: Text
branchInterfaceId = Text
pBranchInterfaceId_,
        $sel:trunkInterfaceId:AssociateTrunkInterface' :: Text
trunkInterfaceId = Text
pTrunkInterfaceId_
      }

-- | 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/UserGuide/Run_Instance_Idempotency.html How to Ensure Idempotency>.
associateTrunkInterface_clientToken :: Lens.Lens' AssociateTrunkInterface (Prelude.Maybe Prelude.Text)
associateTrunkInterface_clientToken :: Lens' AssociateTrunkInterface (Maybe Text)
associateTrunkInterface_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTrunkInterface' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: AssociateTrunkInterface
s@AssociateTrunkInterface' {} Maybe Text
a -> AssociateTrunkInterface
s {$sel:clientToken:AssociateTrunkInterface' :: Maybe Text
clientToken = Maybe Text
a} :: AssociateTrunkInterface)

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

-- | The application key. This applies to the GRE protocol.
associateTrunkInterface_greKey :: Lens.Lens' AssociateTrunkInterface (Prelude.Maybe Prelude.Int)
associateTrunkInterface_greKey :: Lens' AssociateTrunkInterface (Maybe Int)
associateTrunkInterface_greKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTrunkInterface' {Maybe Int
greKey :: Maybe Int
$sel:greKey:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Int
greKey} -> Maybe Int
greKey) (\s :: AssociateTrunkInterface
s@AssociateTrunkInterface' {} Maybe Int
a -> AssociateTrunkInterface
s {$sel:greKey:AssociateTrunkInterface' :: Maybe Int
greKey = Maybe Int
a} :: AssociateTrunkInterface)

-- | The ID of the VLAN. This applies to the VLAN protocol.
associateTrunkInterface_vlanId :: Lens.Lens' AssociateTrunkInterface (Prelude.Maybe Prelude.Int)
associateTrunkInterface_vlanId :: Lens' AssociateTrunkInterface (Maybe Int)
associateTrunkInterface_vlanId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTrunkInterface' {Maybe Int
vlanId :: Maybe Int
$sel:vlanId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Int
vlanId} -> Maybe Int
vlanId) (\s :: AssociateTrunkInterface
s@AssociateTrunkInterface' {} Maybe Int
a -> AssociateTrunkInterface
s {$sel:vlanId:AssociateTrunkInterface' :: Maybe Int
vlanId = Maybe Int
a} :: AssociateTrunkInterface)

-- | The ID of the branch network interface.
associateTrunkInterface_branchInterfaceId :: Lens.Lens' AssociateTrunkInterface Prelude.Text
associateTrunkInterface_branchInterfaceId :: Lens' AssociateTrunkInterface Text
associateTrunkInterface_branchInterfaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTrunkInterface' {Text
branchInterfaceId :: Text
$sel:branchInterfaceId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Text
branchInterfaceId} -> Text
branchInterfaceId) (\s :: AssociateTrunkInterface
s@AssociateTrunkInterface' {} Text
a -> AssociateTrunkInterface
s {$sel:branchInterfaceId:AssociateTrunkInterface' :: Text
branchInterfaceId = Text
a} :: AssociateTrunkInterface)

-- | The ID of the trunk network interface.
associateTrunkInterface_trunkInterfaceId :: Lens.Lens' AssociateTrunkInterface Prelude.Text
associateTrunkInterface_trunkInterfaceId :: Lens' AssociateTrunkInterface Text
associateTrunkInterface_trunkInterfaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTrunkInterface' {Text
trunkInterfaceId :: Text
$sel:trunkInterfaceId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Text
trunkInterfaceId} -> Text
trunkInterfaceId) (\s :: AssociateTrunkInterface
s@AssociateTrunkInterface' {} Text
a -> AssociateTrunkInterface
s {$sel:trunkInterfaceId:AssociateTrunkInterface' :: Text
trunkInterfaceId = Text
a} :: AssociateTrunkInterface)

instance Core.AWSRequest AssociateTrunkInterface where
  type
    AWSResponse AssociateTrunkInterface =
      AssociateTrunkInterfaceResponse
  request :: (Service -> Service)
-> AssociateTrunkInterface -> Request AssociateTrunkInterface
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 AssociateTrunkInterface
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AssociateTrunkInterface)))
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 Text
-> Maybe TrunkInterfaceAssociation
-> Int
-> AssociateTrunkInterfaceResponse
AssociateTrunkInterfaceResponse'
            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
"clientToken")
            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
"interfaceAssociation")
            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 AssociateTrunkInterface where
  hashWithSalt :: Int -> AssociateTrunkInterface -> Int
hashWithSalt Int
_salt AssociateTrunkInterface' {Maybe Bool
Maybe Int
Maybe Text
Text
trunkInterfaceId :: Text
branchInterfaceId :: Text
vlanId :: Maybe Int
greKey :: Maybe Int
dryRun :: Maybe Bool
clientToken :: Maybe Text
$sel:trunkInterfaceId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Text
$sel:branchInterfaceId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Text
$sel:vlanId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Int
$sel:greKey:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Int
$sel:dryRun:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Bool
$sel:clientToken:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
greKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
vlanId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
branchInterfaceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
trunkInterfaceId

instance Prelude.NFData AssociateTrunkInterface where
  rnf :: AssociateTrunkInterface -> ()
rnf AssociateTrunkInterface' {Maybe Bool
Maybe Int
Maybe Text
Text
trunkInterfaceId :: Text
branchInterfaceId :: Text
vlanId :: Maybe Int
greKey :: Maybe Int
dryRun :: Maybe Bool
clientToken :: Maybe Text
$sel:trunkInterfaceId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Text
$sel:branchInterfaceId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Text
$sel:vlanId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Int
$sel:greKey:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Int
$sel:dryRun:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Bool
$sel:clientToken:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      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
greKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
vlanId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
branchInterfaceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
trunkInterfaceId

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

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

instance Data.ToQuery AssociateTrunkInterface where
  toQuery :: AssociateTrunkInterface -> QueryString
toQuery AssociateTrunkInterface' {Maybe Bool
Maybe Int
Maybe Text
Text
trunkInterfaceId :: Text
branchInterfaceId :: Text
vlanId :: Maybe Int
greKey :: Maybe Int
dryRun :: Maybe Bool
clientToken :: Maybe Text
$sel:trunkInterfaceId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Text
$sel:branchInterfaceId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Text
$sel:vlanId:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Int
$sel:greKey:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Int
$sel:dryRun:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Bool
$sel:clientToken:AssociateTrunkInterface' :: AssociateTrunkInterface -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"AssociateTrunkInterface" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"ClientToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clientToken,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"GreKey" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
greKey,
        ByteString
"VlanId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
vlanId,
        ByteString
"BranchInterfaceId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
branchInterfaceId,
        ByteString
"TrunkInterfaceId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
trunkInterfaceId
      ]

-- | /See:/ 'newAssociateTrunkInterfaceResponse' smart constructor.
data AssociateTrunkInterfaceResponse = AssociateTrunkInterfaceResponse'
  { -- | 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/UserGuide/Run_Instance_Idempotency.html How to Ensure Idempotency>.
    AssociateTrunkInterfaceResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the association between the trunk network interface
    -- and branch network interface.
    AssociateTrunkInterfaceResponse -> Maybe TrunkInterfaceAssociation
interfaceAssociation :: Prelude.Maybe TrunkInterfaceAssociation,
    -- | The response's http status code.
    AssociateTrunkInterfaceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AssociateTrunkInterfaceResponse
-> AssociateTrunkInterfaceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateTrunkInterfaceResponse
-> AssociateTrunkInterfaceResponse -> Bool
$c/= :: AssociateTrunkInterfaceResponse
-> AssociateTrunkInterfaceResponse -> Bool
== :: AssociateTrunkInterfaceResponse
-> AssociateTrunkInterfaceResponse -> Bool
$c== :: AssociateTrunkInterfaceResponse
-> AssociateTrunkInterfaceResponse -> Bool
Prelude.Eq, ReadPrec [AssociateTrunkInterfaceResponse]
ReadPrec AssociateTrunkInterfaceResponse
Int -> ReadS AssociateTrunkInterfaceResponse
ReadS [AssociateTrunkInterfaceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateTrunkInterfaceResponse]
$creadListPrec :: ReadPrec [AssociateTrunkInterfaceResponse]
readPrec :: ReadPrec AssociateTrunkInterfaceResponse
$creadPrec :: ReadPrec AssociateTrunkInterfaceResponse
readList :: ReadS [AssociateTrunkInterfaceResponse]
$creadList :: ReadS [AssociateTrunkInterfaceResponse]
readsPrec :: Int -> ReadS AssociateTrunkInterfaceResponse
$creadsPrec :: Int -> ReadS AssociateTrunkInterfaceResponse
Prelude.Read, Int -> AssociateTrunkInterfaceResponse -> ShowS
[AssociateTrunkInterfaceResponse] -> ShowS
AssociateTrunkInterfaceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateTrunkInterfaceResponse] -> ShowS
$cshowList :: [AssociateTrunkInterfaceResponse] -> ShowS
show :: AssociateTrunkInterfaceResponse -> String
$cshow :: AssociateTrunkInterfaceResponse -> String
showsPrec :: Int -> AssociateTrunkInterfaceResponse -> ShowS
$cshowsPrec :: Int -> AssociateTrunkInterfaceResponse -> ShowS
Prelude.Show, forall x.
Rep AssociateTrunkInterfaceResponse x
-> AssociateTrunkInterfaceResponse
forall x.
AssociateTrunkInterfaceResponse
-> Rep AssociateTrunkInterfaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateTrunkInterfaceResponse x
-> AssociateTrunkInterfaceResponse
$cfrom :: forall x.
AssociateTrunkInterfaceResponse
-> Rep AssociateTrunkInterfaceResponse x
Prelude.Generic)

-- |
-- Create a value of 'AssociateTrunkInterfaceResponse' 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:
--
-- 'clientToken', 'associateTrunkInterfaceResponse_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/UserGuide/Run_Instance_Idempotency.html How to Ensure Idempotency>.
--
-- 'interfaceAssociation', 'associateTrunkInterfaceResponse_interfaceAssociation' - Information about the association between the trunk network interface
-- and branch network interface.
--
-- 'httpStatus', 'associateTrunkInterfaceResponse_httpStatus' - The response's http status code.
newAssociateTrunkInterfaceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociateTrunkInterfaceResponse
newAssociateTrunkInterfaceResponse :: Int -> AssociateTrunkInterfaceResponse
newAssociateTrunkInterfaceResponse Int
pHttpStatus_ =
  AssociateTrunkInterfaceResponse'
    { $sel:clientToken:AssociateTrunkInterfaceResponse' :: Maybe Text
clientToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:interfaceAssociation:AssociateTrunkInterfaceResponse' :: Maybe TrunkInterfaceAssociation
interfaceAssociation = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:AssociateTrunkInterfaceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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/UserGuide/Run_Instance_Idempotency.html How to Ensure Idempotency>.
associateTrunkInterfaceResponse_clientToken :: Lens.Lens' AssociateTrunkInterfaceResponse (Prelude.Maybe Prelude.Text)
associateTrunkInterfaceResponse_clientToken :: Lens' AssociateTrunkInterfaceResponse (Maybe Text)
associateTrunkInterfaceResponse_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTrunkInterfaceResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:AssociateTrunkInterfaceResponse' :: AssociateTrunkInterfaceResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: AssociateTrunkInterfaceResponse
s@AssociateTrunkInterfaceResponse' {} Maybe Text
a -> AssociateTrunkInterfaceResponse
s {$sel:clientToken:AssociateTrunkInterfaceResponse' :: Maybe Text
clientToken = Maybe Text
a} :: AssociateTrunkInterfaceResponse)

-- | Information about the association between the trunk network interface
-- and branch network interface.
associateTrunkInterfaceResponse_interfaceAssociation :: Lens.Lens' AssociateTrunkInterfaceResponse (Prelude.Maybe TrunkInterfaceAssociation)
associateTrunkInterfaceResponse_interfaceAssociation :: Lens'
  AssociateTrunkInterfaceResponse (Maybe TrunkInterfaceAssociation)
associateTrunkInterfaceResponse_interfaceAssociation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateTrunkInterfaceResponse' {Maybe TrunkInterfaceAssociation
interfaceAssociation :: Maybe TrunkInterfaceAssociation
$sel:interfaceAssociation:AssociateTrunkInterfaceResponse' :: AssociateTrunkInterfaceResponse -> Maybe TrunkInterfaceAssociation
interfaceAssociation} -> Maybe TrunkInterfaceAssociation
interfaceAssociation) (\s :: AssociateTrunkInterfaceResponse
s@AssociateTrunkInterfaceResponse' {} Maybe TrunkInterfaceAssociation
a -> AssociateTrunkInterfaceResponse
s {$sel:interfaceAssociation:AssociateTrunkInterfaceResponse' :: Maybe TrunkInterfaceAssociation
interfaceAssociation = Maybe TrunkInterfaceAssociation
a} :: AssociateTrunkInterfaceResponse)

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

instance
  Prelude.NFData
    AssociateTrunkInterfaceResponse
  where
  rnf :: AssociateTrunkInterfaceResponse -> ()
rnf AssociateTrunkInterfaceResponse' {Int
Maybe Text
Maybe TrunkInterfaceAssociation
httpStatus :: Int
interfaceAssociation :: Maybe TrunkInterfaceAssociation
clientToken :: Maybe Text
$sel:httpStatus:AssociateTrunkInterfaceResponse' :: AssociateTrunkInterfaceResponse -> Int
$sel:interfaceAssociation:AssociateTrunkInterfaceResponse' :: AssociateTrunkInterfaceResponse -> Maybe TrunkInterfaceAssociation
$sel:clientToken:AssociateTrunkInterfaceResponse' :: AssociateTrunkInterfaceResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TrunkInterfaceAssociation
interfaceAssociation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus