{-# 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 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 ConfirmPublicVirtualInterface = ConfirmPublicVirtualInterface'
{
ConfirmPublicVirtualInterface -> Text
virtualInterfaceId :: Prelude.Text
}
deriving (ConfirmPublicVirtualInterface
-> ConfirmPublicVirtualInterface -> Bool
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]
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
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.
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'
{ $sel:virtualInterfaceId:ConfirmPublicVirtualInterface' :: Text
virtualInterfaceId =
Text
pVirtualInterfaceId_
}
confirmPublicVirtualInterface_virtualInterfaceId :: Lens.Lens' ConfirmPublicVirtualInterface Prelude.Text
confirmPublicVirtualInterface_virtualInterfaceId :: Lens' ConfirmPublicVirtualInterface Text
confirmPublicVirtualInterface_virtualInterfaceId = 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 :: (Service -> Service)
-> ConfirmPublicVirtualInterface
-> Request ConfirmPublicVirtualInterface
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 ConfirmPublicVirtualInterface
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ConfirmPublicVirtualInterface)))
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 ->
Maybe VirtualInterfaceState
-> Int -> ConfirmPublicVirtualInterfaceResponse
ConfirmPublicVirtualInterfaceResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"virtualInterfaceState")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
ConfirmPublicVirtualInterface
where
hashWithSalt :: Int -> ConfirmPublicVirtualInterface -> Int
hashWithSalt Int
_salt ConfirmPublicVirtualInterface' {Text
virtualInterfaceId :: Text
$sel:virtualInterfaceId:ConfirmPublicVirtualInterface' :: ConfirmPublicVirtualInterface -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
virtualInterfaceId
instance Prelude.NFData ConfirmPublicVirtualInterface where
rnf :: ConfirmPublicVirtualInterface -> ()
rnf ConfirmPublicVirtualInterface' {Text
virtualInterfaceId :: Text
$sel:virtualInterfaceId:ConfirmPublicVirtualInterface' :: ConfirmPublicVirtualInterface -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
virtualInterfaceId
instance Data.ToHeaders ConfirmPublicVirtualInterface where
toHeaders :: ConfirmPublicVirtualInterface -> 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.ConfirmPublicVirtualInterface" ::
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 ConfirmPublicVirtualInterface where
toJSON :: ConfirmPublicVirtualInterface -> Value
toJSON ConfirmPublicVirtualInterface' {Text
virtualInterfaceId :: Text
$sel:virtualInterfaceId:ConfirmPublicVirtualInterface' :: ConfirmPublicVirtualInterface -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"virtualInterfaceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
virtualInterfaceId)
]
)
instance Data.ToPath ConfirmPublicVirtualInterface where
toPath :: ConfirmPublicVirtualInterface -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ConfirmPublicVirtualInterface where
toQuery :: ConfirmPublicVirtualInterface -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:virtualInterfaceState:ConfirmPublicVirtualInterfaceResponse' :: Maybe VirtualInterfaceState
virtualInterfaceState =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ConfirmPublicVirtualInterfaceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
confirmPublicVirtualInterfaceResponse_virtualInterfaceState :: Lens.Lens' ConfirmPublicVirtualInterfaceResponse (Prelude.Maybe VirtualInterfaceState)
confirmPublicVirtualInterfaceResponse_virtualInterfaceState :: Lens'
ConfirmPublicVirtualInterfaceResponse (Maybe VirtualInterfaceState)
confirmPublicVirtualInterfaceResponse_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 :: Lens' ConfirmPublicVirtualInterfaceResponse Int
confirmPublicVirtualInterfaceResponse_httpStatus = 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
where
rnf :: ConfirmPublicVirtualInterfaceResponse -> ()
rnf ConfirmPublicVirtualInterfaceResponse' {Int
Maybe VirtualInterfaceState
httpStatus :: Int
virtualInterfaceState :: Maybe VirtualInterfaceState
$sel:httpStatus:ConfirmPublicVirtualInterfaceResponse' :: ConfirmPublicVirtualInterfaceResponse -> Int
$sel:virtualInterfaceState:ConfirmPublicVirtualInterfaceResponse' :: ConfirmPublicVirtualInterfaceResponse
-> Maybe VirtualInterfaceState
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe VirtualInterfaceState
virtualInterfaceState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus