{-# 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.CreateTransitVirtualInterface
(
CreateTransitVirtualInterface (..),
newCreateTransitVirtualInterface,
createTransitVirtualInterface_connectionId,
createTransitVirtualInterface_newTransitVirtualInterface,
CreateTransitVirtualInterfaceResponse (..),
newCreateTransitVirtualInterfaceResponse,
createTransitVirtualInterfaceResponse_virtualInterface,
createTransitVirtualInterfaceResponse_httpStatus,
)
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 CreateTransitVirtualInterface = CreateTransitVirtualInterface'
{
CreateTransitVirtualInterface -> Text
connectionId :: Prelude.Text,
CreateTransitVirtualInterface -> NewTransitVirtualInterface
newTransitVirtualInterface' :: NewTransitVirtualInterface
}
deriving (CreateTransitVirtualInterface
-> CreateTransitVirtualInterface -> Bool
(CreateTransitVirtualInterface
-> CreateTransitVirtualInterface -> Bool)
-> (CreateTransitVirtualInterface
-> CreateTransitVirtualInterface -> Bool)
-> Eq CreateTransitVirtualInterface
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTransitVirtualInterface
-> CreateTransitVirtualInterface -> Bool
$c/= :: CreateTransitVirtualInterface
-> CreateTransitVirtualInterface -> Bool
== :: CreateTransitVirtualInterface
-> CreateTransitVirtualInterface -> Bool
$c== :: CreateTransitVirtualInterface
-> CreateTransitVirtualInterface -> Bool
Prelude.Eq, ReadPrec [CreateTransitVirtualInterface]
ReadPrec CreateTransitVirtualInterface
Int -> ReadS CreateTransitVirtualInterface
ReadS [CreateTransitVirtualInterface]
(Int -> ReadS CreateTransitVirtualInterface)
-> ReadS [CreateTransitVirtualInterface]
-> ReadPrec CreateTransitVirtualInterface
-> ReadPrec [CreateTransitVirtualInterface]
-> Read CreateTransitVirtualInterface
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTransitVirtualInterface]
$creadListPrec :: ReadPrec [CreateTransitVirtualInterface]
readPrec :: ReadPrec CreateTransitVirtualInterface
$creadPrec :: ReadPrec CreateTransitVirtualInterface
readList :: ReadS [CreateTransitVirtualInterface]
$creadList :: ReadS [CreateTransitVirtualInterface]
readsPrec :: Int -> ReadS CreateTransitVirtualInterface
$creadsPrec :: Int -> ReadS CreateTransitVirtualInterface
Prelude.Read, Int -> CreateTransitVirtualInterface -> ShowS
[CreateTransitVirtualInterface] -> ShowS
CreateTransitVirtualInterface -> String
(Int -> CreateTransitVirtualInterface -> ShowS)
-> (CreateTransitVirtualInterface -> String)
-> ([CreateTransitVirtualInterface] -> ShowS)
-> Show CreateTransitVirtualInterface
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTransitVirtualInterface] -> ShowS
$cshowList :: [CreateTransitVirtualInterface] -> ShowS
show :: CreateTransitVirtualInterface -> String
$cshow :: CreateTransitVirtualInterface -> String
showsPrec :: Int -> CreateTransitVirtualInterface -> ShowS
$cshowsPrec :: Int -> CreateTransitVirtualInterface -> ShowS
Prelude.Show, (forall x.
CreateTransitVirtualInterface
-> Rep CreateTransitVirtualInterface x)
-> (forall x.
Rep CreateTransitVirtualInterface x
-> CreateTransitVirtualInterface)
-> Generic CreateTransitVirtualInterface
forall x.
Rep CreateTransitVirtualInterface x
-> CreateTransitVirtualInterface
forall x.
CreateTransitVirtualInterface
-> Rep CreateTransitVirtualInterface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateTransitVirtualInterface x
-> CreateTransitVirtualInterface
$cfrom :: forall x.
CreateTransitVirtualInterface
-> Rep CreateTransitVirtualInterface x
Prelude.Generic)
newCreateTransitVirtualInterface ::
Prelude.Text ->
NewTransitVirtualInterface ->
CreateTransitVirtualInterface
newCreateTransitVirtualInterface :: Text -> NewTransitVirtualInterface -> CreateTransitVirtualInterface
newCreateTransitVirtualInterface
Text
pConnectionId_
NewTransitVirtualInterface
pNewTransitVirtualInterface_ =
CreateTransitVirtualInterface' :: Text -> NewTransitVirtualInterface -> CreateTransitVirtualInterface
CreateTransitVirtualInterface'
{ $sel:connectionId:CreateTransitVirtualInterface' :: Text
connectionId =
Text
pConnectionId_,
$sel:newTransitVirtualInterface':CreateTransitVirtualInterface' :: NewTransitVirtualInterface
newTransitVirtualInterface' =
NewTransitVirtualInterface
pNewTransitVirtualInterface_
}
createTransitVirtualInterface_connectionId :: Lens.Lens' CreateTransitVirtualInterface Prelude.Text
createTransitVirtualInterface_connectionId :: (Text -> f Text)
-> CreateTransitVirtualInterface -> f CreateTransitVirtualInterface
createTransitVirtualInterface_connectionId = (CreateTransitVirtualInterface -> Text)
-> (CreateTransitVirtualInterface
-> Text -> CreateTransitVirtualInterface)
-> Lens
CreateTransitVirtualInterface
CreateTransitVirtualInterface
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTransitVirtualInterface' {Text
connectionId :: Text
$sel:connectionId:CreateTransitVirtualInterface' :: CreateTransitVirtualInterface -> Text
connectionId} -> Text
connectionId) (\s :: CreateTransitVirtualInterface
s@CreateTransitVirtualInterface' {} Text
a -> CreateTransitVirtualInterface
s {$sel:connectionId:CreateTransitVirtualInterface' :: Text
connectionId = Text
a} :: CreateTransitVirtualInterface)
createTransitVirtualInterface_newTransitVirtualInterface :: Lens.Lens' CreateTransitVirtualInterface NewTransitVirtualInterface
createTransitVirtualInterface_newTransitVirtualInterface :: (NewTransitVirtualInterface -> f NewTransitVirtualInterface)
-> CreateTransitVirtualInterface -> f CreateTransitVirtualInterface
createTransitVirtualInterface_newTransitVirtualInterface = (CreateTransitVirtualInterface -> NewTransitVirtualInterface)
-> (CreateTransitVirtualInterface
-> NewTransitVirtualInterface -> CreateTransitVirtualInterface)
-> Lens
CreateTransitVirtualInterface
CreateTransitVirtualInterface
NewTransitVirtualInterface
NewTransitVirtualInterface
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTransitVirtualInterface' {NewTransitVirtualInterface
newTransitVirtualInterface' :: NewTransitVirtualInterface
$sel:newTransitVirtualInterface':CreateTransitVirtualInterface' :: CreateTransitVirtualInterface -> NewTransitVirtualInterface
newTransitVirtualInterface'} -> NewTransitVirtualInterface
newTransitVirtualInterface') (\s :: CreateTransitVirtualInterface
s@CreateTransitVirtualInterface' {} NewTransitVirtualInterface
a -> CreateTransitVirtualInterface
s {$sel:newTransitVirtualInterface':CreateTransitVirtualInterface' :: NewTransitVirtualInterface
newTransitVirtualInterface' = NewTransitVirtualInterface
a} :: CreateTransitVirtualInterface)
instance
Core.AWSRequest
CreateTransitVirtualInterface
where
type
AWSResponse CreateTransitVirtualInterface =
CreateTransitVirtualInterfaceResponse
request :: CreateTransitVirtualInterface
-> Request CreateTransitVirtualInterface
request = Service
-> CreateTransitVirtualInterface
-> Request CreateTransitVirtualInterface
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateTransitVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateTransitVirtualInterface)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateTransitVirtualInterface))
-> Logger
-> Service
-> Proxy CreateTransitVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateTransitVirtualInterface)))
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 ->
Maybe VirtualInterface
-> Int -> CreateTransitVirtualInterfaceResponse
CreateTransitVirtualInterfaceResponse'
(Maybe VirtualInterface
-> Int -> CreateTransitVirtualInterfaceResponse)
-> Either String (Maybe VirtualInterface)
-> Either String (Int -> CreateTransitVirtualInterfaceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe VirtualInterface)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"virtualInterface")
Either String (Int -> CreateTransitVirtualInterfaceResponse)
-> Either String Int
-> Either String CreateTransitVirtualInterfaceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
CreateTransitVirtualInterface
instance Prelude.NFData CreateTransitVirtualInterface
instance Core.ToHeaders CreateTransitVirtualInterface where
toHeaders :: CreateTransitVirtualInterface -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateTransitVirtualInterface -> 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.CreateTransitVirtualInterface" ::
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 CreateTransitVirtualInterface where
toJSON :: CreateTransitVirtualInterface -> Value
toJSON CreateTransitVirtualInterface' {Text
NewTransitVirtualInterface
newTransitVirtualInterface' :: NewTransitVirtualInterface
connectionId :: Text
$sel:newTransitVirtualInterface':CreateTransitVirtualInterface' :: CreateTransitVirtualInterface -> NewTransitVirtualInterface
$sel:connectionId:CreateTransitVirtualInterface' :: CreateTransitVirtualInterface -> 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
"newTransitVirtualInterface"
Text -> NewTransitVirtualInterface -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NewTransitVirtualInterface
newTransitVirtualInterface'
)
]
)
instance Core.ToPath CreateTransitVirtualInterface where
toPath :: CreateTransitVirtualInterface -> ByteString
toPath = ByteString -> CreateTransitVirtualInterface -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateTransitVirtualInterface where
toQuery :: CreateTransitVirtualInterface -> QueryString
toQuery = QueryString -> CreateTransitVirtualInterface -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateTransitVirtualInterfaceResponse = CreateTransitVirtualInterfaceResponse'
{ CreateTransitVirtualInterfaceResponse -> Maybe VirtualInterface
virtualInterface :: Prelude.Maybe VirtualInterface,
CreateTransitVirtualInterfaceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateTransitVirtualInterfaceResponse
-> CreateTransitVirtualInterfaceResponse -> Bool
(CreateTransitVirtualInterfaceResponse
-> CreateTransitVirtualInterfaceResponse -> Bool)
-> (CreateTransitVirtualInterfaceResponse
-> CreateTransitVirtualInterfaceResponse -> Bool)
-> Eq CreateTransitVirtualInterfaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTransitVirtualInterfaceResponse
-> CreateTransitVirtualInterfaceResponse -> Bool
$c/= :: CreateTransitVirtualInterfaceResponse
-> CreateTransitVirtualInterfaceResponse -> Bool
== :: CreateTransitVirtualInterfaceResponse
-> CreateTransitVirtualInterfaceResponse -> Bool
$c== :: CreateTransitVirtualInterfaceResponse
-> CreateTransitVirtualInterfaceResponse -> Bool
Prelude.Eq, ReadPrec [CreateTransitVirtualInterfaceResponse]
ReadPrec CreateTransitVirtualInterfaceResponse
Int -> ReadS CreateTransitVirtualInterfaceResponse
ReadS [CreateTransitVirtualInterfaceResponse]
(Int -> ReadS CreateTransitVirtualInterfaceResponse)
-> ReadS [CreateTransitVirtualInterfaceResponse]
-> ReadPrec CreateTransitVirtualInterfaceResponse
-> ReadPrec [CreateTransitVirtualInterfaceResponse]
-> Read CreateTransitVirtualInterfaceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTransitVirtualInterfaceResponse]
$creadListPrec :: ReadPrec [CreateTransitVirtualInterfaceResponse]
readPrec :: ReadPrec CreateTransitVirtualInterfaceResponse
$creadPrec :: ReadPrec CreateTransitVirtualInterfaceResponse
readList :: ReadS [CreateTransitVirtualInterfaceResponse]
$creadList :: ReadS [CreateTransitVirtualInterfaceResponse]
readsPrec :: Int -> ReadS CreateTransitVirtualInterfaceResponse
$creadsPrec :: Int -> ReadS CreateTransitVirtualInterfaceResponse
Prelude.Read, Int -> CreateTransitVirtualInterfaceResponse -> ShowS
[CreateTransitVirtualInterfaceResponse] -> ShowS
CreateTransitVirtualInterfaceResponse -> String
(Int -> CreateTransitVirtualInterfaceResponse -> ShowS)
-> (CreateTransitVirtualInterfaceResponse -> String)
-> ([CreateTransitVirtualInterfaceResponse] -> ShowS)
-> Show CreateTransitVirtualInterfaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTransitVirtualInterfaceResponse] -> ShowS
$cshowList :: [CreateTransitVirtualInterfaceResponse] -> ShowS
show :: CreateTransitVirtualInterfaceResponse -> String
$cshow :: CreateTransitVirtualInterfaceResponse -> String
showsPrec :: Int -> CreateTransitVirtualInterfaceResponse -> ShowS
$cshowsPrec :: Int -> CreateTransitVirtualInterfaceResponse -> ShowS
Prelude.Show, (forall x.
CreateTransitVirtualInterfaceResponse
-> Rep CreateTransitVirtualInterfaceResponse x)
-> (forall x.
Rep CreateTransitVirtualInterfaceResponse x
-> CreateTransitVirtualInterfaceResponse)
-> Generic CreateTransitVirtualInterfaceResponse
forall x.
Rep CreateTransitVirtualInterfaceResponse x
-> CreateTransitVirtualInterfaceResponse
forall x.
CreateTransitVirtualInterfaceResponse
-> Rep CreateTransitVirtualInterfaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateTransitVirtualInterfaceResponse x
-> CreateTransitVirtualInterfaceResponse
$cfrom :: forall x.
CreateTransitVirtualInterfaceResponse
-> Rep CreateTransitVirtualInterfaceResponse x
Prelude.Generic)
newCreateTransitVirtualInterfaceResponse ::
Prelude.Int ->
CreateTransitVirtualInterfaceResponse
newCreateTransitVirtualInterfaceResponse :: Int -> CreateTransitVirtualInterfaceResponse
newCreateTransitVirtualInterfaceResponse Int
pHttpStatus_ =
CreateTransitVirtualInterfaceResponse' :: Maybe VirtualInterface
-> Int -> CreateTransitVirtualInterfaceResponse
CreateTransitVirtualInterfaceResponse'
{ $sel:virtualInterface:CreateTransitVirtualInterfaceResponse' :: Maybe VirtualInterface
virtualInterface =
Maybe VirtualInterface
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateTransitVirtualInterfaceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createTransitVirtualInterfaceResponse_virtualInterface :: Lens.Lens' CreateTransitVirtualInterfaceResponse (Prelude.Maybe VirtualInterface)
createTransitVirtualInterfaceResponse_virtualInterface :: (Maybe VirtualInterface -> f (Maybe VirtualInterface))
-> CreateTransitVirtualInterfaceResponse
-> f CreateTransitVirtualInterfaceResponse
createTransitVirtualInterfaceResponse_virtualInterface = (CreateTransitVirtualInterfaceResponse -> Maybe VirtualInterface)
-> (CreateTransitVirtualInterfaceResponse
-> Maybe VirtualInterface -> CreateTransitVirtualInterfaceResponse)
-> Lens
CreateTransitVirtualInterfaceResponse
CreateTransitVirtualInterfaceResponse
(Maybe VirtualInterface)
(Maybe VirtualInterface)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTransitVirtualInterfaceResponse' {Maybe VirtualInterface
virtualInterface :: Maybe VirtualInterface
$sel:virtualInterface:CreateTransitVirtualInterfaceResponse' :: CreateTransitVirtualInterfaceResponse -> Maybe VirtualInterface
virtualInterface} -> Maybe VirtualInterface
virtualInterface) (\s :: CreateTransitVirtualInterfaceResponse
s@CreateTransitVirtualInterfaceResponse' {} Maybe VirtualInterface
a -> CreateTransitVirtualInterfaceResponse
s {$sel:virtualInterface:CreateTransitVirtualInterfaceResponse' :: Maybe VirtualInterface
virtualInterface = Maybe VirtualInterface
a} :: CreateTransitVirtualInterfaceResponse)
createTransitVirtualInterfaceResponse_httpStatus :: Lens.Lens' CreateTransitVirtualInterfaceResponse Prelude.Int
createTransitVirtualInterfaceResponse_httpStatus :: (Int -> f Int)
-> CreateTransitVirtualInterfaceResponse
-> f CreateTransitVirtualInterfaceResponse
createTransitVirtualInterfaceResponse_httpStatus = (CreateTransitVirtualInterfaceResponse -> Int)
-> (CreateTransitVirtualInterfaceResponse
-> Int -> CreateTransitVirtualInterfaceResponse)
-> Lens
CreateTransitVirtualInterfaceResponse
CreateTransitVirtualInterfaceResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTransitVirtualInterfaceResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateTransitVirtualInterfaceResponse' :: CreateTransitVirtualInterfaceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateTransitVirtualInterfaceResponse
s@CreateTransitVirtualInterfaceResponse' {} Int
a -> CreateTransitVirtualInterfaceResponse
s {$sel:httpStatus:CreateTransitVirtualInterfaceResponse' :: Int
httpStatus = Int
a} :: CreateTransitVirtualInterfaceResponse)
instance
Prelude.NFData
CreateTransitVirtualInterfaceResponse