{-# 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.CreateLag
(
CreateLag (..),
newCreateLag,
createLag_childConnectionTags,
createLag_connectionId,
createLag_providerName,
createLag_requestMACSec,
createLag_tags,
createLag_numberOfConnections,
createLag_location,
createLag_connectionsBandwidth,
createLag_lagName,
Lag (..),
newLag,
lag_allowsHostedConnections,
lag_awsDevice,
lag_awsDeviceV2,
lag_awsLogicalDeviceId,
lag_connections,
lag_connectionsBandwidth,
lag_encryptionMode,
lag_hasLogicalRedundancy,
lag_jumboFrameCapable,
lag_lagId,
lag_lagName,
lag_lagState,
lag_location,
lag_macSecCapable,
lag_macSecKeys,
lag_minimumLinks,
lag_numberOfConnections,
lag_ownerAccount,
lag_providerName,
lag_region,
lag_tags,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectConnect.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateLag = CreateLag'
{
CreateLag -> Maybe (NonEmpty Tag)
childConnectionTags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateLag -> Maybe Text
connectionId :: Prelude.Maybe Prelude.Text,
CreateLag -> Maybe Text
providerName :: Prelude.Maybe Prelude.Text,
CreateLag -> Maybe Bool
requestMACSec :: Prelude.Maybe Prelude.Bool,
CreateLag -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateLag -> Int
numberOfConnections :: Prelude.Int,
CreateLag -> Text
location :: Prelude.Text,
CreateLag -> Text
connectionsBandwidth :: Prelude.Text,
CreateLag -> Text
lagName :: Prelude.Text
}
deriving (CreateLag -> CreateLag -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLag -> CreateLag -> Bool
$c/= :: CreateLag -> CreateLag -> Bool
== :: CreateLag -> CreateLag -> Bool
$c== :: CreateLag -> CreateLag -> Bool
Prelude.Eq, ReadPrec [CreateLag]
ReadPrec CreateLag
Int -> ReadS CreateLag
ReadS [CreateLag]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLag]
$creadListPrec :: ReadPrec [CreateLag]
readPrec :: ReadPrec CreateLag
$creadPrec :: ReadPrec CreateLag
readList :: ReadS [CreateLag]
$creadList :: ReadS [CreateLag]
readsPrec :: Int -> ReadS CreateLag
$creadsPrec :: Int -> ReadS CreateLag
Prelude.Read, Int -> CreateLag -> ShowS
[CreateLag] -> ShowS
CreateLag -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLag] -> ShowS
$cshowList :: [CreateLag] -> ShowS
show :: CreateLag -> String
$cshow :: CreateLag -> String
showsPrec :: Int -> CreateLag -> ShowS
$cshowsPrec :: Int -> CreateLag -> ShowS
Prelude.Show, forall x. Rep CreateLag x -> CreateLag
forall x. CreateLag -> Rep CreateLag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLag x -> CreateLag
$cfrom :: forall x. CreateLag -> Rep CreateLag x
Prelude.Generic)
newCreateLag ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateLag
newCreateLag :: Int -> Text -> Text -> Text -> CreateLag
newCreateLag
Int
pNumberOfConnections_
Text
pLocation_
Text
pConnectionsBandwidth_
Text
pLagName_ =
CreateLag'
{ $sel:childConnectionTags:CreateLag' :: Maybe (NonEmpty Tag)
childConnectionTags = forall a. Maybe a
Prelude.Nothing,
$sel:connectionId:CreateLag' :: Maybe Text
connectionId = forall a. Maybe a
Prelude.Nothing,
$sel:providerName:CreateLag' :: Maybe Text
providerName = forall a. Maybe a
Prelude.Nothing,
$sel:requestMACSec:CreateLag' :: Maybe Bool
requestMACSec = forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateLag' :: Maybe (NonEmpty Tag)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:numberOfConnections:CreateLag' :: Int
numberOfConnections = Int
pNumberOfConnections_,
$sel:location:CreateLag' :: Text
location = Text
pLocation_,
$sel:connectionsBandwidth:CreateLag' :: Text
connectionsBandwidth = Text
pConnectionsBandwidth_,
$sel:lagName:CreateLag' :: Text
lagName = Text
pLagName_
}
createLag_childConnectionTags :: Lens.Lens' CreateLag (Prelude.Maybe (Prelude.NonEmpty Tag))
createLag_childConnectionTags :: Lens' CreateLag (Maybe (NonEmpty Tag))
createLag_childConnectionTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLag' {Maybe (NonEmpty Tag)
childConnectionTags :: Maybe (NonEmpty Tag)
$sel:childConnectionTags:CreateLag' :: CreateLag -> Maybe (NonEmpty Tag)
childConnectionTags} -> Maybe (NonEmpty Tag)
childConnectionTags) (\s :: CreateLag
s@CreateLag' {} Maybe (NonEmpty Tag)
a -> CreateLag
s {$sel:childConnectionTags:CreateLag' :: Maybe (NonEmpty Tag)
childConnectionTags = Maybe (NonEmpty Tag)
a} :: CreateLag) 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
createLag_connectionId :: Lens.Lens' CreateLag (Prelude.Maybe Prelude.Text)
createLag_connectionId :: Lens' CreateLag (Maybe Text)
createLag_connectionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLag' {Maybe Text
connectionId :: Maybe Text
$sel:connectionId:CreateLag' :: CreateLag -> Maybe Text
connectionId} -> Maybe Text
connectionId) (\s :: CreateLag
s@CreateLag' {} Maybe Text
a -> CreateLag
s {$sel:connectionId:CreateLag' :: Maybe Text
connectionId = Maybe Text
a} :: CreateLag)
createLag_providerName :: Lens.Lens' CreateLag (Prelude.Maybe Prelude.Text)
createLag_providerName :: Lens' CreateLag (Maybe Text)
createLag_providerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLag' {Maybe Text
providerName :: Maybe Text
$sel:providerName:CreateLag' :: CreateLag -> Maybe Text
providerName} -> Maybe Text
providerName) (\s :: CreateLag
s@CreateLag' {} Maybe Text
a -> CreateLag
s {$sel:providerName:CreateLag' :: Maybe Text
providerName = Maybe Text
a} :: CreateLag)
createLag_requestMACSec :: Lens.Lens' CreateLag (Prelude.Maybe Prelude.Bool)
createLag_requestMACSec :: Lens' CreateLag (Maybe Bool)
createLag_requestMACSec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLag' {Maybe Bool
requestMACSec :: Maybe Bool
$sel:requestMACSec:CreateLag' :: CreateLag -> Maybe Bool
requestMACSec} -> Maybe Bool
requestMACSec) (\s :: CreateLag
s@CreateLag' {} Maybe Bool
a -> CreateLag
s {$sel:requestMACSec:CreateLag' :: Maybe Bool
requestMACSec = Maybe Bool
a} :: CreateLag)
createLag_tags :: Lens.Lens' CreateLag (Prelude.Maybe (Prelude.NonEmpty Tag))
createLag_tags :: Lens' CreateLag (Maybe (NonEmpty Tag))
createLag_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLag' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateLag' :: CreateLag -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateLag
s@CreateLag' {} Maybe (NonEmpty Tag)
a -> CreateLag
s {$sel:tags:CreateLag' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateLag) 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
createLag_numberOfConnections :: Lens.Lens' CreateLag Prelude.Int
createLag_numberOfConnections :: Lens' CreateLag Int
createLag_numberOfConnections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLag' {Int
numberOfConnections :: Int
$sel:numberOfConnections:CreateLag' :: CreateLag -> Int
numberOfConnections} -> Int
numberOfConnections) (\s :: CreateLag
s@CreateLag' {} Int
a -> CreateLag
s {$sel:numberOfConnections:CreateLag' :: Int
numberOfConnections = Int
a} :: CreateLag)
createLag_location :: Lens.Lens' CreateLag Prelude.Text
createLag_location :: Lens' CreateLag Text
createLag_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLag' {Text
location :: Text
$sel:location:CreateLag' :: CreateLag -> Text
location} -> Text
location) (\s :: CreateLag
s@CreateLag' {} Text
a -> CreateLag
s {$sel:location:CreateLag' :: Text
location = Text
a} :: CreateLag)
createLag_connectionsBandwidth :: Lens.Lens' CreateLag Prelude.Text
createLag_connectionsBandwidth :: Lens' CreateLag Text
createLag_connectionsBandwidth = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLag' {Text
connectionsBandwidth :: Text
$sel:connectionsBandwidth:CreateLag' :: CreateLag -> Text
connectionsBandwidth} -> Text
connectionsBandwidth) (\s :: CreateLag
s@CreateLag' {} Text
a -> CreateLag
s {$sel:connectionsBandwidth:CreateLag' :: Text
connectionsBandwidth = Text
a} :: CreateLag)
createLag_lagName :: Lens.Lens' CreateLag Prelude.Text
createLag_lagName :: Lens' CreateLag Text
createLag_lagName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLag' {Text
lagName :: Text
$sel:lagName:CreateLag' :: CreateLag -> Text
lagName} -> Text
lagName) (\s :: CreateLag
s@CreateLag' {} Text
a -> CreateLag
s {$sel:lagName:CreateLag' :: Text
lagName = Text
a} :: CreateLag)
instance Core.AWSRequest CreateLag where
type AWSResponse CreateLag = Lag
request :: (Service -> Service) -> CreateLag -> Request CreateLag
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateLag
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateLag)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
instance Prelude.Hashable CreateLag where
hashWithSalt :: Int -> CreateLag -> Int
hashWithSalt Int
_salt CreateLag' {Int
Maybe Bool
Maybe (NonEmpty Tag)
Maybe Text
Text
lagName :: Text
connectionsBandwidth :: Text
location :: Text
numberOfConnections :: Int
tags :: Maybe (NonEmpty Tag)
requestMACSec :: Maybe Bool
providerName :: Maybe Text
connectionId :: Maybe Text
childConnectionTags :: Maybe (NonEmpty Tag)
$sel:lagName:CreateLag' :: CreateLag -> Text
$sel:connectionsBandwidth:CreateLag' :: CreateLag -> Text
$sel:location:CreateLag' :: CreateLag -> Text
$sel:numberOfConnections:CreateLag' :: CreateLag -> Int
$sel:tags:CreateLag' :: CreateLag -> Maybe (NonEmpty Tag)
$sel:requestMACSec:CreateLag' :: CreateLag -> Maybe Bool
$sel:providerName:CreateLag' :: CreateLag -> Maybe Text
$sel:connectionId:CreateLag' :: CreateLag -> Maybe Text
$sel:childConnectionTags:CreateLag' :: CreateLag -> Maybe (NonEmpty Tag)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
childConnectionTags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
providerName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
requestMACSec
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
numberOfConnections
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectionsBandwidth
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lagName
instance Prelude.NFData CreateLag where
rnf :: CreateLag -> ()
rnf CreateLag' {Int
Maybe Bool
Maybe (NonEmpty Tag)
Maybe Text
Text
lagName :: Text
connectionsBandwidth :: Text
location :: Text
numberOfConnections :: Int
tags :: Maybe (NonEmpty Tag)
requestMACSec :: Maybe Bool
providerName :: Maybe Text
connectionId :: Maybe Text
childConnectionTags :: Maybe (NonEmpty Tag)
$sel:lagName:CreateLag' :: CreateLag -> Text
$sel:connectionsBandwidth:CreateLag' :: CreateLag -> Text
$sel:location:CreateLag' :: CreateLag -> Text
$sel:numberOfConnections:CreateLag' :: CreateLag -> Int
$sel:tags:CreateLag' :: CreateLag -> Maybe (NonEmpty Tag)
$sel:requestMACSec:CreateLag' :: CreateLag -> Maybe Bool
$sel:providerName:CreateLag' :: CreateLag -> Maybe Text
$sel:connectionId:CreateLag' :: CreateLag -> Maybe Text
$sel:childConnectionTags:CreateLag' :: CreateLag -> Maybe (NonEmpty Tag)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
childConnectionTags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
providerName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
requestMACSec
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
numberOfConnections
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
connectionsBandwidth
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lagName
instance Data.ToHeaders CreateLag where
toHeaders :: CreateLag -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"OvertureService.CreateLag" :: Prelude.ByteString),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateLag where
toJSON :: CreateLag -> Value
toJSON CreateLag' {Int
Maybe Bool
Maybe (NonEmpty Tag)
Maybe Text
Text
lagName :: Text
connectionsBandwidth :: Text
location :: Text
numberOfConnections :: Int
tags :: Maybe (NonEmpty Tag)
requestMACSec :: Maybe Bool
providerName :: Maybe Text
connectionId :: Maybe Text
childConnectionTags :: Maybe (NonEmpty Tag)
$sel:lagName:CreateLag' :: CreateLag -> Text
$sel:connectionsBandwidth:CreateLag' :: CreateLag -> Text
$sel:location:CreateLag' :: CreateLag -> Text
$sel:numberOfConnections:CreateLag' :: CreateLag -> Int
$sel:tags:CreateLag' :: CreateLag -> Maybe (NonEmpty Tag)
$sel:requestMACSec:CreateLag' :: CreateLag -> Maybe Bool
$sel:providerName:CreateLag' :: CreateLag -> Maybe Text
$sel:connectionId:CreateLag' :: CreateLag -> Maybe Text
$sel:childConnectionTags:CreateLag' :: CreateLag -> Maybe (NonEmpty Tag)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"childConnectionTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
childConnectionTags,
(Key
"connectionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
connectionId,
(Key
"providerName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
providerName,
(Key
"requestMACSec" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
requestMACSec,
(Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
forall a. a -> Maybe a
Prelude.Just
(Key
"numberOfConnections" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Int
numberOfConnections),
forall a. a -> Maybe a
Prelude.Just (Key
"location" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
location),
forall a. a -> Maybe a
Prelude.Just
( Key
"connectionsBandwidth"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
connectionsBandwidth
),
forall a. a -> Maybe a
Prelude.Just (Key
"lagName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
lagName)
]
)
instance Data.ToPath CreateLag where
toPath :: CreateLag -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateLag where
toQuery :: CreateLag -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty