{-# 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.ConfirmTransitVirtualInterface
(
ConfirmTransitVirtualInterface (..),
newConfirmTransitVirtualInterface,
confirmTransitVirtualInterface_virtualInterfaceId,
confirmTransitVirtualInterface_directConnectGatewayId,
ConfirmTransitVirtualInterfaceResponse (..),
newConfirmTransitVirtualInterfaceResponse,
confirmTransitVirtualInterfaceResponse_virtualInterfaceState,
confirmTransitVirtualInterfaceResponse_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 ConfirmTransitVirtualInterface = ConfirmTransitVirtualInterface'
{
ConfirmTransitVirtualInterface -> Text
virtualInterfaceId :: Prelude.Text,
ConfirmTransitVirtualInterface -> Text
directConnectGatewayId :: Prelude.Text
}
deriving (ConfirmTransitVirtualInterface
-> ConfirmTransitVirtualInterface -> Bool
(ConfirmTransitVirtualInterface
-> ConfirmTransitVirtualInterface -> Bool)
-> (ConfirmTransitVirtualInterface
-> ConfirmTransitVirtualInterface -> Bool)
-> Eq ConfirmTransitVirtualInterface
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfirmTransitVirtualInterface
-> ConfirmTransitVirtualInterface -> Bool
$c/= :: ConfirmTransitVirtualInterface
-> ConfirmTransitVirtualInterface -> Bool
== :: ConfirmTransitVirtualInterface
-> ConfirmTransitVirtualInterface -> Bool
$c== :: ConfirmTransitVirtualInterface
-> ConfirmTransitVirtualInterface -> Bool
Prelude.Eq, ReadPrec [ConfirmTransitVirtualInterface]
ReadPrec ConfirmTransitVirtualInterface
Int -> ReadS ConfirmTransitVirtualInterface
ReadS [ConfirmTransitVirtualInterface]
(Int -> ReadS ConfirmTransitVirtualInterface)
-> ReadS [ConfirmTransitVirtualInterface]
-> ReadPrec ConfirmTransitVirtualInterface
-> ReadPrec [ConfirmTransitVirtualInterface]
-> Read ConfirmTransitVirtualInterface
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfirmTransitVirtualInterface]
$creadListPrec :: ReadPrec [ConfirmTransitVirtualInterface]
readPrec :: ReadPrec ConfirmTransitVirtualInterface
$creadPrec :: ReadPrec ConfirmTransitVirtualInterface
readList :: ReadS [ConfirmTransitVirtualInterface]
$creadList :: ReadS [ConfirmTransitVirtualInterface]
readsPrec :: Int -> ReadS ConfirmTransitVirtualInterface
$creadsPrec :: Int -> ReadS ConfirmTransitVirtualInterface
Prelude.Read, Int -> ConfirmTransitVirtualInterface -> ShowS
[ConfirmTransitVirtualInterface] -> ShowS
ConfirmTransitVirtualInterface -> String
(Int -> ConfirmTransitVirtualInterface -> ShowS)
-> (ConfirmTransitVirtualInterface -> String)
-> ([ConfirmTransitVirtualInterface] -> ShowS)
-> Show ConfirmTransitVirtualInterface
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfirmTransitVirtualInterface] -> ShowS
$cshowList :: [ConfirmTransitVirtualInterface] -> ShowS
show :: ConfirmTransitVirtualInterface -> String
$cshow :: ConfirmTransitVirtualInterface -> String
showsPrec :: Int -> ConfirmTransitVirtualInterface -> ShowS
$cshowsPrec :: Int -> ConfirmTransitVirtualInterface -> ShowS
Prelude.Show, (forall x.
ConfirmTransitVirtualInterface
-> Rep ConfirmTransitVirtualInterface x)
-> (forall x.
Rep ConfirmTransitVirtualInterface x
-> ConfirmTransitVirtualInterface)
-> Generic ConfirmTransitVirtualInterface
forall x.
Rep ConfirmTransitVirtualInterface x
-> ConfirmTransitVirtualInterface
forall x.
ConfirmTransitVirtualInterface
-> Rep ConfirmTransitVirtualInterface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConfirmTransitVirtualInterface x
-> ConfirmTransitVirtualInterface
$cfrom :: forall x.
ConfirmTransitVirtualInterface
-> Rep ConfirmTransitVirtualInterface x
Prelude.Generic)
newConfirmTransitVirtualInterface ::
Prelude.Text ->
Prelude.Text ->
ConfirmTransitVirtualInterface
newConfirmTransitVirtualInterface :: Text -> Text -> ConfirmTransitVirtualInterface
newConfirmTransitVirtualInterface
Text
pVirtualInterfaceId_
Text
pDirectConnectGatewayId_ =
ConfirmTransitVirtualInterface' :: Text -> Text -> ConfirmTransitVirtualInterface
ConfirmTransitVirtualInterface'
{ $sel:virtualInterfaceId:ConfirmTransitVirtualInterface' :: Text
virtualInterfaceId =
Text
pVirtualInterfaceId_,
$sel:directConnectGatewayId:ConfirmTransitVirtualInterface' :: Text
directConnectGatewayId =
Text
pDirectConnectGatewayId_
}
confirmTransitVirtualInterface_virtualInterfaceId :: Lens.Lens' ConfirmTransitVirtualInterface Prelude.Text
confirmTransitVirtualInterface_virtualInterfaceId :: (Text -> f Text)
-> ConfirmTransitVirtualInterface
-> f ConfirmTransitVirtualInterface
confirmTransitVirtualInterface_virtualInterfaceId = (ConfirmTransitVirtualInterface -> Text)
-> (ConfirmTransitVirtualInterface
-> Text -> ConfirmTransitVirtualInterface)
-> Lens
ConfirmTransitVirtualInterface
ConfirmTransitVirtualInterface
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmTransitVirtualInterface' {Text
virtualInterfaceId :: Text
$sel:virtualInterfaceId:ConfirmTransitVirtualInterface' :: ConfirmTransitVirtualInterface -> Text
virtualInterfaceId} -> Text
virtualInterfaceId) (\s :: ConfirmTransitVirtualInterface
s@ConfirmTransitVirtualInterface' {} Text
a -> ConfirmTransitVirtualInterface
s {$sel:virtualInterfaceId:ConfirmTransitVirtualInterface' :: Text
virtualInterfaceId = Text
a} :: ConfirmTransitVirtualInterface)
confirmTransitVirtualInterface_directConnectGatewayId :: Lens.Lens' ConfirmTransitVirtualInterface Prelude.Text
confirmTransitVirtualInterface_directConnectGatewayId :: (Text -> f Text)
-> ConfirmTransitVirtualInterface
-> f ConfirmTransitVirtualInterface
confirmTransitVirtualInterface_directConnectGatewayId = (ConfirmTransitVirtualInterface -> Text)
-> (ConfirmTransitVirtualInterface
-> Text -> ConfirmTransitVirtualInterface)
-> Lens
ConfirmTransitVirtualInterface
ConfirmTransitVirtualInterface
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmTransitVirtualInterface' {Text
directConnectGatewayId :: Text
$sel:directConnectGatewayId:ConfirmTransitVirtualInterface' :: ConfirmTransitVirtualInterface -> Text
directConnectGatewayId} -> Text
directConnectGatewayId) (\s :: ConfirmTransitVirtualInterface
s@ConfirmTransitVirtualInterface' {} Text
a -> ConfirmTransitVirtualInterface
s {$sel:directConnectGatewayId:ConfirmTransitVirtualInterface' :: Text
directConnectGatewayId = Text
a} :: ConfirmTransitVirtualInterface)
instance
Core.AWSRequest
ConfirmTransitVirtualInterface
where
type
AWSResponse ConfirmTransitVirtualInterface =
ConfirmTransitVirtualInterfaceResponse
request :: ConfirmTransitVirtualInterface
-> Request ConfirmTransitVirtualInterface
request = Service
-> ConfirmTransitVirtualInterface
-> Request ConfirmTransitVirtualInterface
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ConfirmTransitVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ConfirmTransitVirtualInterface)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ConfirmTransitVirtualInterface))
-> Logger
-> Service
-> Proxy ConfirmTransitVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ConfirmTransitVirtualInterface)))
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 VirtualInterfaceState
-> Int -> ConfirmTransitVirtualInterfaceResponse
ConfirmTransitVirtualInterfaceResponse'
(Maybe VirtualInterfaceState
-> Int -> ConfirmTransitVirtualInterfaceResponse)
-> Either String (Maybe VirtualInterfaceState)
-> Either String (Int -> ConfirmTransitVirtualInterfaceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe VirtualInterfaceState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"virtualInterfaceState")
Either String (Int -> ConfirmTransitVirtualInterfaceResponse)
-> Either String Int
-> Either String ConfirmTransitVirtualInterfaceResponse
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
ConfirmTransitVirtualInterface
instance
Prelude.NFData
ConfirmTransitVirtualInterface
instance
Core.ToHeaders
ConfirmTransitVirtualInterface
where
toHeaders :: ConfirmTransitVirtualInterface -> ResponseHeaders
toHeaders =
ResponseHeaders
-> ConfirmTransitVirtualInterface -> 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.ConfirmTransitVirtualInterface" ::
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 ConfirmTransitVirtualInterface where
toJSON :: ConfirmTransitVirtualInterface -> Value
toJSON ConfirmTransitVirtualInterface' {Text
directConnectGatewayId :: Text
virtualInterfaceId :: Text
$sel:directConnectGatewayId:ConfirmTransitVirtualInterface' :: ConfirmTransitVirtualInterface -> Text
$sel:virtualInterfaceId:ConfirmTransitVirtualInterface' :: ConfirmTransitVirtualInterface -> 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
"virtualInterfaceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
virtualInterfaceId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"directConnectGatewayId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directConnectGatewayId
)
]
)
instance Core.ToPath ConfirmTransitVirtualInterface where
toPath :: ConfirmTransitVirtualInterface -> ByteString
toPath = ByteString -> ConfirmTransitVirtualInterface -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ConfirmTransitVirtualInterface where
toQuery :: ConfirmTransitVirtualInterface -> QueryString
toQuery = QueryString -> ConfirmTransitVirtualInterface -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ConfirmTransitVirtualInterfaceResponse = ConfirmTransitVirtualInterfaceResponse'
{
ConfirmTransitVirtualInterfaceResponse
-> Maybe VirtualInterfaceState
virtualInterfaceState :: Prelude.Maybe VirtualInterfaceState,
ConfirmTransitVirtualInterfaceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ConfirmTransitVirtualInterfaceResponse
-> ConfirmTransitVirtualInterfaceResponse -> Bool
(ConfirmTransitVirtualInterfaceResponse
-> ConfirmTransitVirtualInterfaceResponse -> Bool)
-> (ConfirmTransitVirtualInterfaceResponse
-> ConfirmTransitVirtualInterfaceResponse -> Bool)
-> Eq ConfirmTransitVirtualInterfaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfirmTransitVirtualInterfaceResponse
-> ConfirmTransitVirtualInterfaceResponse -> Bool
$c/= :: ConfirmTransitVirtualInterfaceResponse
-> ConfirmTransitVirtualInterfaceResponse -> Bool
== :: ConfirmTransitVirtualInterfaceResponse
-> ConfirmTransitVirtualInterfaceResponse -> Bool
$c== :: ConfirmTransitVirtualInterfaceResponse
-> ConfirmTransitVirtualInterfaceResponse -> Bool
Prelude.Eq, ReadPrec [ConfirmTransitVirtualInterfaceResponse]
ReadPrec ConfirmTransitVirtualInterfaceResponse
Int -> ReadS ConfirmTransitVirtualInterfaceResponse
ReadS [ConfirmTransitVirtualInterfaceResponse]
(Int -> ReadS ConfirmTransitVirtualInterfaceResponse)
-> ReadS [ConfirmTransitVirtualInterfaceResponse]
-> ReadPrec ConfirmTransitVirtualInterfaceResponse
-> ReadPrec [ConfirmTransitVirtualInterfaceResponse]
-> Read ConfirmTransitVirtualInterfaceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfirmTransitVirtualInterfaceResponse]
$creadListPrec :: ReadPrec [ConfirmTransitVirtualInterfaceResponse]
readPrec :: ReadPrec ConfirmTransitVirtualInterfaceResponse
$creadPrec :: ReadPrec ConfirmTransitVirtualInterfaceResponse
readList :: ReadS [ConfirmTransitVirtualInterfaceResponse]
$creadList :: ReadS [ConfirmTransitVirtualInterfaceResponse]
readsPrec :: Int -> ReadS ConfirmTransitVirtualInterfaceResponse
$creadsPrec :: Int -> ReadS ConfirmTransitVirtualInterfaceResponse
Prelude.Read, Int -> ConfirmTransitVirtualInterfaceResponse -> ShowS
[ConfirmTransitVirtualInterfaceResponse] -> ShowS
ConfirmTransitVirtualInterfaceResponse -> String
(Int -> ConfirmTransitVirtualInterfaceResponse -> ShowS)
-> (ConfirmTransitVirtualInterfaceResponse -> String)
-> ([ConfirmTransitVirtualInterfaceResponse] -> ShowS)
-> Show ConfirmTransitVirtualInterfaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfirmTransitVirtualInterfaceResponse] -> ShowS
$cshowList :: [ConfirmTransitVirtualInterfaceResponse] -> ShowS
show :: ConfirmTransitVirtualInterfaceResponse -> String
$cshow :: ConfirmTransitVirtualInterfaceResponse -> String
showsPrec :: Int -> ConfirmTransitVirtualInterfaceResponse -> ShowS
$cshowsPrec :: Int -> ConfirmTransitVirtualInterfaceResponse -> ShowS
Prelude.Show, (forall x.
ConfirmTransitVirtualInterfaceResponse
-> Rep ConfirmTransitVirtualInterfaceResponse x)
-> (forall x.
Rep ConfirmTransitVirtualInterfaceResponse x
-> ConfirmTransitVirtualInterfaceResponse)
-> Generic ConfirmTransitVirtualInterfaceResponse
forall x.
Rep ConfirmTransitVirtualInterfaceResponse x
-> ConfirmTransitVirtualInterfaceResponse
forall x.
ConfirmTransitVirtualInterfaceResponse
-> Rep ConfirmTransitVirtualInterfaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConfirmTransitVirtualInterfaceResponse x
-> ConfirmTransitVirtualInterfaceResponse
$cfrom :: forall x.
ConfirmTransitVirtualInterfaceResponse
-> Rep ConfirmTransitVirtualInterfaceResponse x
Prelude.Generic)
newConfirmTransitVirtualInterfaceResponse ::
Prelude.Int ->
ConfirmTransitVirtualInterfaceResponse
newConfirmTransitVirtualInterfaceResponse :: Int -> ConfirmTransitVirtualInterfaceResponse
newConfirmTransitVirtualInterfaceResponse
Int
pHttpStatus_ =
ConfirmTransitVirtualInterfaceResponse' :: Maybe VirtualInterfaceState
-> Int -> ConfirmTransitVirtualInterfaceResponse
ConfirmTransitVirtualInterfaceResponse'
{ $sel:virtualInterfaceState:ConfirmTransitVirtualInterfaceResponse' :: Maybe VirtualInterfaceState
virtualInterfaceState =
Maybe VirtualInterfaceState
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ConfirmTransitVirtualInterfaceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
confirmTransitVirtualInterfaceResponse_virtualInterfaceState :: Lens.Lens' ConfirmTransitVirtualInterfaceResponse (Prelude.Maybe VirtualInterfaceState)
confirmTransitVirtualInterfaceResponse_virtualInterfaceState :: (Maybe VirtualInterfaceState -> f (Maybe VirtualInterfaceState))
-> ConfirmTransitVirtualInterfaceResponse
-> f ConfirmTransitVirtualInterfaceResponse
confirmTransitVirtualInterfaceResponse_virtualInterfaceState = (ConfirmTransitVirtualInterfaceResponse
-> Maybe VirtualInterfaceState)
-> (ConfirmTransitVirtualInterfaceResponse
-> Maybe VirtualInterfaceState
-> ConfirmTransitVirtualInterfaceResponse)
-> Lens
ConfirmTransitVirtualInterfaceResponse
ConfirmTransitVirtualInterfaceResponse
(Maybe VirtualInterfaceState)
(Maybe VirtualInterfaceState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmTransitVirtualInterfaceResponse' {Maybe VirtualInterfaceState
virtualInterfaceState :: Maybe VirtualInterfaceState
$sel:virtualInterfaceState:ConfirmTransitVirtualInterfaceResponse' :: ConfirmTransitVirtualInterfaceResponse
-> Maybe VirtualInterfaceState
virtualInterfaceState} -> Maybe VirtualInterfaceState
virtualInterfaceState) (\s :: ConfirmTransitVirtualInterfaceResponse
s@ConfirmTransitVirtualInterfaceResponse' {} Maybe VirtualInterfaceState
a -> ConfirmTransitVirtualInterfaceResponse
s {$sel:virtualInterfaceState:ConfirmTransitVirtualInterfaceResponse' :: Maybe VirtualInterfaceState
virtualInterfaceState = Maybe VirtualInterfaceState
a} :: ConfirmTransitVirtualInterfaceResponse)
confirmTransitVirtualInterfaceResponse_httpStatus :: Lens.Lens' ConfirmTransitVirtualInterfaceResponse Prelude.Int
confirmTransitVirtualInterfaceResponse_httpStatus :: (Int -> f Int)
-> ConfirmTransitVirtualInterfaceResponse
-> f ConfirmTransitVirtualInterfaceResponse
confirmTransitVirtualInterfaceResponse_httpStatus = (ConfirmTransitVirtualInterfaceResponse -> Int)
-> (ConfirmTransitVirtualInterfaceResponse
-> Int -> ConfirmTransitVirtualInterfaceResponse)
-> Lens
ConfirmTransitVirtualInterfaceResponse
ConfirmTransitVirtualInterfaceResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfirmTransitVirtualInterfaceResponse' {Int
httpStatus :: Int
$sel:httpStatus:ConfirmTransitVirtualInterfaceResponse' :: ConfirmTransitVirtualInterfaceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ConfirmTransitVirtualInterfaceResponse
s@ConfirmTransitVirtualInterfaceResponse' {} Int
a -> ConfirmTransitVirtualInterfaceResponse
s {$sel:httpStatus:ConfirmTransitVirtualInterfaceResponse' :: Int
httpStatus = Int
a} :: ConfirmTransitVirtualInterfaceResponse)
instance
Prelude.NFData
ConfirmTransitVirtualInterfaceResponse