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