{-# 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.DescribeVirtualInterfaces
(
DescribeVirtualInterfaces (..),
newDescribeVirtualInterfaces,
describeVirtualInterfaces_connectionId,
describeVirtualInterfaces_virtualInterfaceId,
DescribeVirtualInterfacesResponse (..),
newDescribeVirtualInterfacesResponse,
describeVirtualInterfacesResponse_virtualInterfaces,
describeVirtualInterfacesResponse_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 DescribeVirtualInterfaces = DescribeVirtualInterfaces'
{
DescribeVirtualInterfaces -> Maybe Text
connectionId :: Prelude.Maybe Prelude.Text,
DescribeVirtualInterfaces -> Maybe Text
virtualInterfaceId :: Prelude.Maybe Prelude.Text
}
deriving (DescribeVirtualInterfaces -> DescribeVirtualInterfaces -> Bool
(DescribeVirtualInterfaces -> DescribeVirtualInterfaces -> Bool)
-> (DescribeVirtualInterfaces -> DescribeVirtualInterfaces -> Bool)
-> Eq DescribeVirtualInterfaces
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVirtualInterfaces -> DescribeVirtualInterfaces -> Bool
$c/= :: DescribeVirtualInterfaces -> DescribeVirtualInterfaces -> Bool
== :: DescribeVirtualInterfaces -> DescribeVirtualInterfaces -> Bool
$c== :: DescribeVirtualInterfaces -> DescribeVirtualInterfaces -> Bool
Prelude.Eq, ReadPrec [DescribeVirtualInterfaces]
ReadPrec DescribeVirtualInterfaces
Int -> ReadS DescribeVirtualInterfaces
ReadS [DescribeVirtualInterfaces]
(Int -> ReadS DescribeVirtualInterfaces)
-> ReadS [DescribeVirtualInterfaces]
-> ReadPrec DescribeVirtualInterfaces
-> ReadPrec [DescribeVirtualInterfaces]
-> Read DescribeVirtualInterfaces
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVirtualInterfaces]
$creadListPrec :: ReadPrec [DescribeVirtualInterfaces]
readPrec :: ReadPrec DescribeVirtualInterfaces
$creadPrec :: ReadPrec DescribeVirtualInterfaces
readList :: ReadS [DescribeVirtualInterfaces]
$creadList :: ReadS [DescribeVirtualInterfaces]
readsPrec :: Int -> ReadS DescribeVirtualInterfaces
$creadsPrec :: Int -> ReadS DescribeVirtualInterfaces
Prelude.Read, Int -> DescribeVirtualInterfaces -> ShowS
[DescribeVirtualInterfaces] -> ShowS
DescribeVirtualInterfaces -> String
(Int -> DescribeVirtualInterfaces -> ShowS)
-> (DescribeVirtualInterfaces -> String)
-> ([DescribeVirtualInterfaces] -> ShowS)
-> Show DescribeVirtualInterfaces
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVirtualInterfaces] -> ShowS
$cshowList :: [DescribeVirtualInterfaces] -> ShowS
show :: DescribeVirtualInterfaces -> String
$cshow :: DescribeVirtualInterfaces -> String
showsPrec :: Int -> DescribeVirtualInterfaces -> ShowS
$cshowsPrec :: Int -> DescribeVirtualInterfaces -> ShowS
Prelude.Show, (forall x.
DescribeVirtualInterfaces -> Rep DescribeVirtualInterfaces x)
-> (forall x.
Rep DescribeVirtualInterfaces x -> DescribeVirtualInterfaces)
-> Generic DescribeVirtualInterfaces
forall x.
Rep DescribeVirtualInterfaces x -> DescribeVirtualInterfaces
forall x.
DescribeVirtualInterfaces -> Rep DescribeVirtualInterfaces x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeVirtualInterfaces x -> DescribeVirtualInterfaces
$cfrom :: forall x.
DescribeVirtualInterfaces -> Rep DescribeVirtualInterfaces x
Prelude.Generic)
newDescribeVirtualInterfaces ::
DescribeVirtualInterfaces
newDescribeVirtualInterfaces :: DescribeVirtualInterfaces
newDescribeVirtualInterfaces =
DescribeVirtualInterfaces' :: Maybe Text -> Maybe Text -> DescribeVirtualInterfaces
DescribeVirtualInterfaces'
{ $sel:connectionId:DescribeVirtualInterfaces' :: Maybe Text
connectionId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:virtualInterfaceId:DescribeVirtualInterfaces' :: Maybe Text
virtualInterfaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
describeVirtualInterfaces_connectionId :: Lens.Lens' DescribeVirtualInterfaces (Prelude.Maybe Prelude.Text)
describeVirtualInterfaces_connectionId :: (Maybe Text -> f (Maybe Text))
-> DescribeVirtualInterfaces -> f DescribeVirtualInterfaces
describeVirtualInterfaces_connectionId = (DescribeVirtualInterfaces -> Maybe Text)
-> (DescribeVirtualInterfaces
-> Maybe Text -> DescribeVirtualInterfaces)
-> Lens
DescribeVirtualInterfaces
DescribeVirtualInterfaces
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualInterfaces' {Maybe Text
connectionId :: Maybe Text
$sel:connectionId:DescribeVirtualInterfaces' :: DescribeVirtualInterfaces -> Maybe Text
connectionId} -> Maybe Text
connectionId) (\s :: DescribeVirtualInterfaces
s@DescribeVirtualInterfaces' {} Maybe Text
a -> DescribeVirtualInterfaces
s {$sel:connectionId:DescribeVirtualInterfaces' :: Maybe Text
connectionId = Maybe Text
a} :: DescribeVirtualInterfaces)
describeVirtualInterfaces_virtualInterfaceId :: Lens.Lens' DescribeVirtualInterfaces (Prelude.Maybe Prelude.Text)
describeVirtualInterfaces_virtualInterfaceId :: (Maybe Text -> f (Maybe Text))
-> DescribeVirtualInterfaces -> f DescribeVirtualInterfaces
describeVirtualInterfaces_virtualInterfaceId = (DescribeVirtualInterfaces -> Maybe Text)
-> (DescribeVirtualInterfaces
-> Maybe Text -> DescribeVirtualInterfaces)
-> Lens
DescribeVirtualInterfaces
DescribeVirtualInterfaces
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualInterfaces' {Maybe Text
virtualInterfaceId :: Maybe Text
$sel:virtualInterfaceId:DescribeVirtualInterfaces' :: DescribeVirtualInterfaces -> Maybe Text
virtualInterfaceId} -> Maybe Text
virtualInterfaceId) (\s :: DescribeVirtualInterfaces
s@DescribeVirtualInterfaces' {} Maybe Text
a -> DescribeVirtualInterfaces
s {$sel:virtualInterfaceId:DescribeVirtualInterfaces' :: Maybe Text
virtualInterfaceId = Maybe Text
a} :: DescribeVirtualInterfaces)
instance Core.AWSRequest DescribeVirtualInterfaces where
type
AWSResponse DescribeVirtualInterfaces =
DescribeVirtualInterfacesResponse
request :: DescribeVirtualInterfaces -> Request DescribeVirtualInterfaces
request = Service
-> DescribeVirtualInterfaces -> Request DescribeVirtualInterfaces
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeVirtualInterfaces
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeVirtualInterfaces)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeVirtualInterfaces))
-> Logger
-> Service
-> Proxy DescribeVirtualInterfaces
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeVirtualInterfaces)))
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 -> DescribeVirtualInterfacesResponse
DescribeVirtualInterfacesResponse'
(Maybe [VirtualInterface]
-> Int -> DescribeVirtualInterfacesResponse)
-> Either String (Maybe [VirtualInterface])
-> Either String (Int -> DescribeVirtualInterfacesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [VirtualInterface]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"virtualInterfaces"
Either String (Maybe (Maybe [VirtualInterface]))
-> Maybe [VirtualInterface]
-> Either String (Maybe [VirtualInterface])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [VirtualInterface]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DescribeVirtualInterfacesResponse)
-> Either String Int
-> Either String DescribeVirtualInterfacesResponse
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 DescribeVirtualInterfaces
instance Prelude.NFData DescribeVirtualInterfaces
instance Core.ToHeaders DescribeVirtualInterfaces where
toHeaders :: DescribeVirtualInterfaces -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeVirtualInterfaces -> 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.DescribeVirtualInterfaces" ::
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 DescribeVirtualInterfaces where
toJSON :: DescribeVirtualInterfaces -> Value
toJSON DescribeVirtualInterfaces' {Maybe Text
virtualInterfaceId :: Maybe Text
connectionId :: Maybe Text
$sel:virtualInterfaceId:DescribeVirtualInterfaces' :: DescribeVirtualInterfaces -> Maybe Text
$sel:connectionId:DescribeVirtualInterfaces' :: DescribeVirtualInterfaces -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"connectionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
connectionId,
(Text
"virtualInterfaceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
virtualInterfaceId
]
)
instance Core.ToPath DescribeVirtualInterfaces where
toPath :: DescribeVirtualInterfaces -> ByteString
toPath = ByteString -> DescribeVirtualInterfaces -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeVirtualInterfaces where
toQuery :: DescribeVirtualInterfaces -> QueryString
toQuery = QueryString -> DescribeVirtualInterfaces -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeVirtualInterfacesResponse = DescribeVirtualInterfacesResponse'
{
DescribeVirtualInterfacesResponse -> Maybe [VirtualInterface]
virtualInterfaces :: Prelude.Maybe [VirtualInterface],
DescribeVirtualInterfacesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeVirtualInterfacesResponse
-> DescribeVirtualInterfacesResponse -> Bool
(DescribeVirtualInterfacesResponse
-> DescribeVirtualInterfacesResponse -> Bool)
-> (DescribeVirtualInterfacesResponse
-> DescribeVirtualInterfacesResponse -> Bool)
-> Eq DescribeVirtualInterfacesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVirtualInterfacesResponse
-> DescribeVirtualInterfacesResponse -> Bool
$c/= :: DescribeVirtualInterfacesResponse
-> DescribeVirtualInterfacesResponse -> Bool
== :: DescribeVirtualInterfacesResponse
-> DescribeVirtualInterfacesResponse -> Bool
$c== :: DescribeVirtualInterfacesResponse
-> DescribeVirtualInterfacesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeVirtualInterfacesResponse]
ReadPrec DescribeVirtualInterfacesResponse
Int -> ReadS DescribeVirtualInterfacesResponse
ReadS [DescribeVirtualInterfacesResponse]
(Int -> ReadS DescribeVirtualInterfacesResponse)
-> ReadS [DescribeVirtualInterfacesResponse]
-> ReadPrec DescribeVirtualInterfacesResponse
-> ReadPrec [DescribeVirtualInterfacesResponse]
-> Read DescribeVirtualInterfacesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVirtualInterfacesResponse]
$creadListPrec :: ReadPrec [DescribeVirtualInterfacesResponse]
readPrec :: ReadPrec DescribeVirtualInterfacesResponse
$creadPrec :: ReadPrec DescribeVirtualInterfacesResponse
readList :: ReadS [DescribeVirtualInterfacesResponse]
$creadList :: ReadS [DescribeVirtualInterfacesResponse]
readsPrec :: Int -> ReadS DescribeVirtualInterfacesResponse
$creadsPrec :: Int -> ReadS DescribeVirtualInterfacesResponse
Prelude.Read, Int -> DescribeVirtualInterfacesResponse -> ShowS
[DescribeVirtualInterfacesResponse] -> ShowS
DescribeVirtualInterfacesResponse -> String
(Int -> DescribeVirtualInterfacesResponse -> ShowS)
-> (DescribeVirtualInterfacesResponse -> String)
-> ([DescribeVirtualInterfacesResponse] -> ShowS)
-> Show DescribeVirtualInterfacesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVirtualInterfacesResponse] -> ShowS
$cshowList :: [DescribeVirtualInterfacesResponse] -> ShowS
show :: DescribeVirtualInterfacesResponse -> String
$cshow :: DescribeVirtualInterfacesResponse -> String
showsPrec :: Int -> DescribeVirtualInterfacesResponse -> ShowS
$cshowsPrec :: Int -> DescribeVirtualInterfacesResponse -> ShowS
Prelude.Show, (forall x.
DescribeVirtualInterfacesResponse
-> Rep DescribeVirtualInterfacesResponse x)
-> (forall x.
Rep DescribeVirtualInterfacesResponse x
-> DescribeVirtualInterfacesResponse)
-> Generic DescribeVirtualInterfacesResponse
forall x.
Rep DescribeVirtualInterfacesResponse x
-> DescribeVirtualInterfacesResponse
forall x.
DescribeVirtualInterfacesResponse
-> Rep DescribeVirtualInterfacesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeVirtualInterfacesResponse x
-> DescribeVirtualInterfacesResponse
$cfrom :: forall x.
DescribeVirtualInterfacesResponse
-> Rep DescribeVirtualInterfacesResponse x
Prelude.Generic)
newDescribeVirtualInterfacesResponse ::
Prelude.Int ->
DescribeVirtualInterfacesResponse
newDescribeVirtualInterfacesResponse :: Int -> DescribeVirtualInterfacesResponse
newDescribeVirtualInterfacesResponse Int
pHttpStatus_ =
DescribeVirtualInterfacesResponse' :: Maybe [VirtualInterface]
-> Int -> DescribeVirtualInterfacesResponse
DescribeVirtualInterfacesResponse'
{ $sel:virtualInterfaces:DescribeVirtualInterfacesResponse' :: Maybe [VirtualInterface]
virtualInterfaces =
Maybe [VirtualInterface]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeVirtualInterfacesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeVirtualInterfacesResponse_virtualInterfaces :: Lens.Lens' DescribeVirtualInterfacesResponse (Prelude.Maybe [VirtualInterface])
describeVirtualInterfacesResponse_virtualInterfaces :: (Maybe [VirtualInterface] -> f (Maybe [VirtualInterface]))
-> DescribeVirtualInterfacesResponse
-> f DescribeVirtualInterfacesResponse
describeVirtualInterfacesResponse_virtualInterfaces = (DescribeVirtualInterfacesResponse -> Maybe [VirtualInterface])
-> (DescribeVirtualInterfacesResponse
-> Maybe [VirtualInterface] -> DescribeVirtualInterfacesResponse)
-> Lens
DescribeVirtualInterfacesResponse
DescribeVirtualInterfacesResponse
(Maybe [VirtualInterface])
(Maybe [VirtualInterface])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualInterfacesResponse' {Maybe [VirtualInterface]
virtualInterfaces :: Maybe [VirtualInterface]
$sel:virtualInterfaces:DescribeVirtualInterfacesResponse' :: DescribeVirtualInterfacesResponse -> Maybe [VirtualInterface]
virtualInterfaces} -> Maybe [VirtualInterface]
virtualInterfaces) (\s :: DescribeVirtualInterfacesResponse
s@DescribeVirtualInterfacesResponse' {} Maybe [VirtualInterface]
a -> DescribeVirtualInterfacesResponse
s {$sel:virtualInterfaces:DescribeVirtualInterfacesResponse' :: Maybe [VirtualInterface]
virtualInterfaces = Maybe [VirtualInterface]
a} :: DescribeVirtualInterfacesResponse) ((Maybe [VirtualInterface] -> f (Maybe [VirtualInterface]))
-> DescribeVirtualInterfacesResponse
-> f DescribeVirtualInterfacesResponse)
-> ((Maybe [VirtualInterface] -> f (Maybe [VirtualInterface]))
-> Maybe [VirtualInterface] -> f (Maybe [VirtualInterface]))
-> (Maybe [VirtualInterface] -> f (Maybe [VirtualInterface]))
-> DescribeVirtualInterfacesResponse
-> f DescribeVirtualInterfacesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[VirtualInterface]
[VirtualInterface]
[VirtualInterface]
[VirtualInterface]
-> Iso
(Maybe [VirtualInterface])
(Maybe [VirtualInterface])
(Maybe [VirtualInterface])
(Maybe [VirtualInterface])
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 AnIso
[VirtualInterface]
[VirtualInterface]
[VirtualInterface]
[VirtualInterface]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeVirtualInterfacesResponse_httpStatus :: Lens.Lens' DescribeVirtualInterfacesResponse Prelude.Int
describeVirtualInterfacesResponse_httpStatus :: (Int -> f Int)
-> DescribeVirtualInterfacesResponse
-> f DescribeVirtualInterfacesResponse
describeVirtualInterfacesResponse_httpStatus = (DescribeVirtualInterfacesResponse -> Int)
-> (DescribeVirtualInterfacesResponse
-> Int -> DescribeVirtualInterfacesResponse)
-> Lens
DescribeVirtualInterfacesResponse
DescribeVirtualInterfacesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVirtualInterfacesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeVirtualInterfacesResponse' :: DescribeVirtualInterfacesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeVirtualInterfacesResponse
s@DescribeVirtualInterfacesResponse' {} Int
a -> DescribeVirtualInterfacesResponse
s {$sel:httpStatus:DescribeVirtualInterfacesResponse' :: Int
httpStatus = Int
a} :: DescribeVirtualInterfacesResponse)
instance
Prelude.NFData
DescribeVirtualInterfacesResponse