{-# 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.DisassociateConnectionFromLag
(
DisassociateConnectionFromLag (..),
newDisassociateConnectionFromLag,
disassociateConnectionFromLag_connectionId,
disassociateConnectionFromLag_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 DisassociateConnectionFromLag = DisassociateConnectionFromLag'
{
DisassociateConnectionFromLag -> Text
connectionId :: Prelude.Text,
DisassociateConnectionFromLag -> Text
lagId :: Prelude.Text
}
deriving (DisassociateConnectionFromLag
-> DisassociateConnectionFromLag -> Bool
(DisassociateConnectionFromLag
-> DisassociateConnectionFromLag -> Bool)
-> (DisassociateConnectionFromLag
-> DisassociateConnectionFromLag -> Bool)
-> Eq DisassociateConnectionFromLag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateConnectionFromLag
-> DisassociateConnectionFromLag -> Bool
$c/= :: DisassociateConnectionFromLag
-> DisassociateConnectionFromLag -> Bool
== :: DisassociateConnectionFromLag
-> DisassociateConnectionFromLag -> Bool
$c== :: DisassociateConnectionFromLag
-> DisassociateConnectionFromLag -> Bool
Prelude.Eq, ReadPrec [DisassociateConnectionFromLag]
ReadPrec DisassociateConnectionFromLag
Int -> ReadS DisassociateConnectionFromLag
ReadS [DisassociateConnectionFromLag]
(Int -> ReadS DisassociateConnectionFromLag)
-> ReadS [DisassociateConnectionFromLag]
-> ReadPrec DisassociateConnectionFromLag
-> ReadPrec [DisassociateConnectionFromLag]
-> Read DisassociateConnectionFromLag
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateConnectionFromLag]
$creadListPrec :: ReadPrec [DisassociateConnectionFromLag]
readPrec :: ReadPrec DisassociateConnectionFromLag
$creadPrec :: ReadPrec DisassociateConnectionFromLag
readList :: ReadS [DisassociateConnectionFromLag]
$creadList :: ReadS [DisassociateConnectionFromLag]
readsPrec :: Int -> ReadS DisassociateConnectionFromLag
$creadsPrec :: Int -> ReadS DisassociateConnectionFromLag
Prelude.Read, Int -> DisassociateConnectionFromLag -> ShowS
[DisassociateConnectionFromLag] -> ShowS
DisassociateConnectionFromLag -> String
(Int -> DisassociateConnectionFromLag -> ShowS)
-> (DisassociateConnectionFromLag -> String)
-> ([DisassociateConnectionFromLag] -> ShowS)
-> Show DisassociateConnectionFromLag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateConnectionFromLag] -> ShowS
$cshowList :: [DisassociateConnectionFromLag] -> ShowS
show :: DisassociateConnectionFromLag -> String
$cshow :: DisassociateConnectionFromLag -> String
showsPrec :: Int -> DisassociateConnectionFromLag -> ShowS
$cshowsPrec :: Int -> DisassociateConnectionFromLag -> ShowS
Prelude.Show, (forall x.
DisassociateConnectionFromLag
-> Rep DisassociateConnectionFromLag x)
-> (forall x.
Rep DisassociateConnectionFromLag x
-> DisassociateConnectionFromLag)
-> Generic DisassociateConnectionFromLag
forall x.
Rep DisassociateConnectionFromLag x
-> DisassociateConnectionFromLag
forall x.
DisassociateConnectionFromLag
-> Rep DisassociateConnectionFromLag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateConnectionFromLag x
-> DisassociateConnectionFromLag
$cfrom :: forall x.
DisassociateConnectionFromLag
-> Rep DisassociateConnectionFromLag x
Prelude.Generic)
newDisassociateConnectionFromLag ::
Prelude.Text ->
Prelude.Text ->
DisassociateConnectionFromLag
newDisassociateConnectionFromLag :: Text -> Text -> DisassociateConnectionFromLag
newDisassociateConnectionFromLag
Text
pConnectionId_
Text
pLagId_ =
DisassociateConnectionFromLag' :: Text -> Text -> DisassociateConnectionFromLag
DisassociateConnectionFromLag'
{ $sel:connectionId:DisassociateConnectionFromLag' :: Text
connectionId =
Text
pConnectionId_,
$sel:lagId:DisassociateConnectionFromLag' :: Text
lagId = Text
pLagId_
}
disassociateConnectionFromLag_connectionId :: Lens.Lens' DisassociateConnectionFromLag Prelude.Text
disassociateConnectionFromLag_connectionId :: (Text -> f Text)
-> DisassociateConnectionFromLag -> f DisassociateConnectionFromLag
disassociateConnectionFromLag_connectionId = (DisassociateConnectionFromLag -> Text)
-> (DisassociateConnectionFromLag
-> Text -> DisassociateConnectionFromLag)
-> Lens
DisassociateConnectionFromLag
DisassociateConnectionFromLag
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateConnectionFromLag' {Text
connectionId :: Text
$sel:connectionId:DisassociateConnectionFromLag' :: DisassociateConnectionFromLag -> Text
connectionId} -> Text
connectionId) (\s :: DisassociateConnectionFromLag
s@DisassociateConnectionFromLag' {} Text
a -> DisassociateConnectionFromLag
s {$sel:connectionId:DisassociateConnectionFromLag' :: Text
connectionId = Text
a} :: DisassociateConnectionFromLag)
disassociateConnectionFromLag_lagId :: Lens.Lens' DisassociateConnectionFromLag Prelude.Text
disassociateConnectionFromLag_lagId :: (Text -> f Text)
-> DisassociateConnectionFromLag -> f DisassociateConnectionFromLag
disassociateConnectionFromLag_lagId = (DisassociateConnectionFromLag -> Text)
-> (DisassociateConnectionFromLag
-> Text -> DisassociateConnectionFromLag)
-> Lens
DisassociateConnectionFromLag
DisassociateConnectionFromLag
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateConnectionFromLag' {Text
lagId :: Text
$sel:lagId:DisassociateConnectionFromLag' :: DisassociateConnectionFromLag -> Text
lagId} -> Text
lagId) (\s :: DisassociateConnectionFromLag
s@DisassociateConnectionFromLag' {} Text
a -> DisassociateConnectionFromLag
s {$sel:lagId:DisassociateConnectionFromLag' :: Text
lagId = Text
a} :: DisassociateConnectionFromLag)
instance
Core.AWSRequest
DisassociateConnectionFromLag
where
type
AWSResponse DisassociateConnectionFromLag =
Connection
request :: DisassociateConnectionFromLag
-> Request DisassociateConnectionFromLag
request = Service
-> DisassociateConnectionFromLag
-> Request DisassociateConnectionFromLag
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateConnectionFromLag
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateConnectionFromLag)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DisassociateConnectionFromLag))
-> Logger
-> Service
-> Proxy DisassociateConnectionFromLag
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateConnectionFromLag)))
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
DisassociateConnectionFromLag
instance Prelude.NFData DisassociateConnectionFromLag
instance Core.ToHeaders DisassociateConnectionFromLag where
toHeaders :: DisassociateConnectionFromLag -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisassociateConnectionFromLag -> 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.DisassociateConnectionFromLag" ::
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 DisassociateConnectionFromLag where
toJSON :: DisassociateConnectionFromLag -> Value
toJSON DisassociateConnectionFromLag' {Text
lagId :: Text
connectionId :: Text
$sel:lagId:DisassociateConnectionFromLag' :: DisassociateConnectionFromLag -> Text
$sel:connectionId:DisassociateConnectionFromLag' :: DisassociateConnectionFromLag -> 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 DisassociateConnectionFromLag where
toPath :: DisassociateConnectionFromLag -> ByteString
toPath = ByteString -> DisassociateConnectionFromLag -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisassociateConnectionFromLag where
toQuery :: DisassociateConnectionFromLag -> QueryString
toQuery = QueryString -> DisassociateConnectionFromLag -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty