{-# 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 #-}
module Amazonka.DirectConnect.AssociateConnectionWithLag
(
AssociateConnectionWithLag (..),
newAssociateConnectionWithLag,
associateConnectionWithLag_connectionId,
associateConnectionWithLag_lagId,
Connection (..),
newConnection,
connection_lagId,
connection_macSecCapable,
connection_portEncryptionStatus,
connection_vlan,
connection_location,
connection_awsDevice,
connection_hasLogicalRedundancy,
connection_connectionId,
connection_awsLogicalDeviceId,
connection_loaIssueTime,
connection_partnerName,
connection_connectionName,
connection_encryptionMode,
connection_bandwidth,
connection_jumboFrameCapable,
connection_ownerAccount,
connection_region,
connection_macSecKeys,
connection_providerName,
connection_awsDeviceV2,
connection_connectionState,
connection_tags,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AssociateConnectionWithLag = AssociateConnectionWithLag'
{
AssociateConnectionWithLag -> Text
connectionId :: Prelude.Text,
AssociateConnectionWithLag -> Text
lagId :: Prelude.Text
}
deriving (AssociateConnectionWithLag -> AssociateConnectionWithLag -> Bool
(AssociateConnectionWithLag -> AssociateConnectionWithLag -> Bool)
-> (AssociateConnectionWithLag
-> AssociateConnectionWithLag -> Bool)
-> Eq AssociateConnectionWithLag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateConnectionWithLag -> AssociateConnectionWithLag -> Bool
$c/= :: AssociateConnectionWithLag -> AssociateConnectionWithLag -> Bool
== :: AssociateConnectionWithLag -> AssociateConnectionWithLag -> Bool
$c== :: AssociateConnectionWithLag -> AssociateConnectionWithLag -> Bool
Prelude.Eq, ReadPrec [AssociateConnectionWithLag]
ReadPrec AssociateConnectionWithLag
Int -> ReadS AssociateConnectionWithLag
ReadS [AssociateConnectionWithLag]
(Int -> ReadS AssociateConnectionWithLag)
-> ReadS [AssociateConnectionWithLag]
-> ReadPrec AssociateConnectionWithLag
-> ReadPrec [AssociateConnectionWithLag]
-> Read AssociateConnectionWithLag
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateConnectionWithLag]
$creadListPrec :: ReadPrec [AssociateConnectionWithLag]
readPrec :: ReadPrec AssociateConnectionWithLag
$creadPrec :: ReadPrec AssociateConnectionWithLag
readList :: ReadS [AssociateConnectionWithLag]
$creadList :: ReadS [AssociateConnectionWithLag]
readsPrec :: Int -> ReadS AssociateConnectionWithLag
$creadsPrec :: Int -> ReadS AssociateConnectionWithLag
Prelude.Read, Int -> AssociateConnectionWithLag -> ShowS
[AssociateConnectionWithLag] -> ShowS
AssociateConnectionWithLag -> String
(Int -> AssociateConnectionWithLag -> ShowS)
-> (AssociateConnectionWithLag -> String)
-> ([AssociateConnectionWithLag] -> ShowS)
-> Show AssociateConnectionWithLag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateConnectionWithLag] -> ShowS
$cshowList :: [AssociateConnectionWithLag] -> ShowS
show :: AssociateConnectionWithLag -> String
$cshow :: AssociateConnectionWithLag -> String
showsPrec :: Int -> AssociateConnectionWithLag -> ShowS
$cshowsPrec :: Int -> AssociateConnectionWithLag -> ShowS
Prelude.Show, (forall x.
AssociateConnectionWithLag -> Rep AssociateConnectionWithLag x)
-> (forall x.
Rep AssociateConnectionWithLag x -> AssociateConnectionWithLag)
-> Generic AssociateConnectionWithLag
forall x.
Rep AssociateConnectionWithLag x -> AssociateConnectionWithLag
forall x.
AssociateConnectionWithLag -> Rep AssociateConnectionWithLag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateConnectionWithLag x -> AssociateConnectionWithLag
$cfrom :: forall x.
AssociateConnectionWithLag -> Rep AssociateConnectionWithLag x
Prelude.Generic)
newAssociateConnectionWithLag ::
Prelude.Text ->
Prelude.Text ->
AssociateConnectionWithLag
newAssociateConnectionWithLag :: Text -> Text -> AssociateConnectionWithLag
newAssociateConnectionWithLag Text
pConnectionId_ Text
pLagId_ =
AssociateConnectionWithLag' :: Text -> Text -> AssociateConnectionWithLag
AssociateConnectionWithLag'
{ $sel:connectionId:AssociateConnectionWithLag' :: Text
connectionId =
Text
pConnectionId_,
$sel:lagId:AssociateConnectionWithLag' :: Text
lagId = Text
pLagId_
}
associateConnectionWithLag_connectionId :: Lens.Lens' AssociateConnectionWithLag Prelude.Text
associateConnectionWithLag_connectionId :: (Text -> f Text)
-> AssociateConnectionWithLag -> f AssociateConnectionWithLag
associateConnectionWithLag_connectionId = (AssociateConnectionWithLag -> Text)
-> (AssociateConnectionWithLag
-> Text -> AssociateConnectionWithLag)
-> Lens
AssociateConnectionWithLag AssociateConnectionWithLag Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateConnectionWithLag' {Text
connectionId :: Text
$sel:connectionId:AssociateConnectionWithLag' :: AssociateConnectionWithLag -> Text
connectionId} -> Text
connectionId) (\s :: AssociateConnectionWithLag
s@AssociateConnectionWithLag' {} Text
a -> AssociateConnectionWithLag
s {$sel:connectionId:AssociateConnectionWithLag' :: Text
connectionId = Text
a} :: AssociateConnectionWithLag)
associateConnectionWithLag_lagId :: Lens.Lens' AssociateConnectionWithLag Prelude.Text
associateConnectionWithLag_lagId :: (Text -> f Text)
-> AssociateConnectionWithLag -> f AssociateConnectionWithLag
associateConnectionWithLag_lagId = (AssociateConnectionWithLag -> Text)
-> (AssociateConnectionWithLag
-> Text -> AssociateConnectionWithLag)
-> Lens
AssociateConnectionWithLag AssociateConnectionWithLag Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateConnectionWithLag' {Text
lagId :: Text
$sel:lagId:AssociateConnectionWithLag' :: AssociateConnectionWithLag -> Text
lagId} -> Text
lagId) (\s :: AssociateConnectionWithLag
s@AssociateConnectionWithLag' {} Text
a -> AssociateConnectionWithLag
s {$sel:lagId:AssociateConnectionWithLag' :: Text
lagId = Text
a} :: AssociateConnectionWithLag)
instance Core.AWSRequest AssociateConnectionWithLag where
type
AWSResponse AssociateConnectionWithLag =
Connection
request :: AssociateConnectionWithLag -> Request AssociateConnectionWithLag
request = Service
-> AssociateConnectionWithLag -> Request AssociateConnectionWithLag
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateConnectionWithLag
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateConnectionWithLag)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse AssociateConnectionWithLag))
-> Logger
-> Service
-> Proxy AssociateConnectionWithLag
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateConnectionWithLag)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> Object -> Either String Connection
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable AssociateConnectionWithLag
instance Prelude.NFData AssociateConnectionWithLag
instance Core.ToHeaders AssociateConnectionWithLag where
toHeaders :: AssociateConnectionWithLag -> ResponseHeaders
toHeaders =
ResponseHeaders -> AssociateConnectionWithLag -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"OvertureService.AssociateConnectionWithLag" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON AssociateConnectionWithLag where
toJSON :: AssociateConnectionWithLag -> Value
toJSON AssociateConnectionWithLag' {Text
lagId :: Text
connectionId :: Text
$sel:lagId:AssociateConnectionWithLag' :: AssociateConnectionWithLag -> Text
$sel:connectionId:AssociateConnectionWithLag' :: AssociateConnectionWithLag -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"connectionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
connectionId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"lagId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
lagId)
]
)
instance Core.ToPath AssociateConnectionWithLag where
toPath :: AssociateConnectionWithLag -> ByteString
toPath = ByteString -> AssociateConnectionWithLag -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AssociateConnectionWithLag where
toQuery :: AssociateConnectionWithLag -> QueryString
toQuery = QueryString -> AssociateConnectionWithLag -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty