{-# 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.ApiGatewayV2.GetVpcLinks
(
GetVpcLinks (..),
newGetVpcLinks,
getVpcLinks_nextToken,
getVpcLinks_maxResults,
GetVpcLinksResponse (..),
newGetVpcLinksResponse,
getVpcLinksResponse_items,
getVpcLinksResponse_nextToken,
getVpcLinksResponse_httpStatus,
)
where
import Amazonka.ApiGatewayV2.Types
import qualified Amazonka.Core as Core
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 GetVpcLinks = GetVpcLinks'
{
GetVpcLinks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetVpcLinks -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text
}
deriving (GetVpcLinks -> GetVpcLinks -> Bool
(GetVpcLinks -> GetVpcLinks -> Bool)
-> (GetVpcLinks -> GetVpcLinks -> Bool) -> Eq GetVpcLinks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVpcLinks -> GetVpcLinks -> Bool
$c/= :: GetVpcLinks -> GetVpcLinks -> Bool
== :: GetVpcLinks -> GetVpcLinks -> Bool
$c== :: GetVpcLinks -> GetVpcLinks -> Bool
Prelude.Eq, ReadPrec [GetVpcLinks]
ReadPrec GetVpcLinks
Int -> ReadS GetVpcLinks
ReadS [GetVpcLinks]
(Int -> ReadS GetVpcLinks)
-> ReadS [GetVpcLinks]
-> ReadPrec GetVpcLinks
-> ReadPrec [GetVpcLinks]
-> Read GetVpcLinks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVpcLinks]
$creadListPrec :: ReadPrec [GetVpcLinks]
readPrec :: ReadPrec GetVpcLinks
$creadPrec :: ReadPrec GetVpcLinks
readList :: ReadS [GetVpcLinks]
$creadList :: ReadS [GetVpcLinks]
readsPrec :: Int -> ReadS GetVpcLinks
$creadsPrec :: Int -> ReadS GetVpcLinks
Prelude.Read, Int -> GetVpcLinks -> ShowS
[GetVpcLinks] -> ShowS
GetVpcLinks -> String
(Int -> GetVpcLinks -> ShowS)
-> (GetVpcLinks -> String)
-> ([GetVpcLinks] -> ShowS)
-> Show GetVpcLinks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVpcLinks] -> ShowS
$cshowList :: [GetVpcLinks] -> ShowS
show :: GetVpcLinks -> String
$cshow :: GetVpcLinks -> String
showsPrec :: Int -> GetVpcLinks -> ShowS
$cshowsPrec :: Int -> GetVpcLinks -> ShowS
Prelude.Show, (forall x. GetVpcLinks -> Rep GetVpcLinks x)
-> (forall x. Rep GetVpcLinks x -> GetVpcLinks)
-> Generic GetVpcLinks
forall x. Rep GetVpcLinks x -> GetVpcLinks
forall x. GetVpcLinks -> Rep GetVpcLinks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetVpcLinks x -> GetVpcLinks
$cfrom :: forall x. GetVpcLinks -> Rep GetVpcLinks x
Prelude.Generic)
newGetVpcLinks ::
GetVpcLinks
newGetVpcLinks :: GetVpcLinks
newGetVpcLinks =
GetVpcLinks' :: Maybe Text -> Maybe Text -> GetVpcLinks
GetVpcLinks'
{ $sel:nextToken:GetVpcLinks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetVpcLinks' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
getVpcLinks_nextToken :: Lens.Lens' GetVpcLinks (Prelude.Maybe Prelude.Text)
getVpcLinks_nextToken :: (Maybe Text -> f (Maybe Text)) -> GetVpcLinks -> f GetVpcLinks
getVpcLinks_nextToken = (GetVpcLinks -> Maybe Text)
-> (GetVpcLinks -> Maybe Text -> GetVpcLinks)
-> Lens GetVpcLinks GetVpcLinks (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVpcLinks' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetVpcLinks' :: GetVpcLinks -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetVpcLinks
s@GetVpcLinks' {} Maybe Text
a -> GetVpcLinks
s {$sel:nextToken:GetVpcLinks' :: Maybe Text
nextToken = Maybe Text
a} :: GetVpcLinks)
getVpcLinks_maxResults :: Lens.Lens' GetVpcLinks (Prelude.Maybe Prelude.Text)
getVpcLinks_maxResults :: (Maybe Text -> f (Maybe Text)) -> GetVpcLinks -> f GetVpcLinks
getVpcLinks_maxResults = (GetVpcLinks -> Maybe Text)
-> (GetVpcLinks -> Maybe Text -> GetVpcLinks)
-> Lens GetVpcLinks GetVpcLinks (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVpcLinks' {Maybe Text
maxResults :: Maybe Text
$sel:maxResults:GetVpcLinks' :: GetVpcLinks -> Maybe Text
maxResults} -> Maybe Text
maxResults) (\s :: GetVpcLinks
s@GetVpcLinks' {} Maybe Text
a -> GetVpcLinks
s {$sel:maxResults:GetVpcLinks' :: Maybe Text
maxResults = Maybe Text
a} :: GetVpcLinks)
instance Core.AWSRequest GetVpcLinks where
type AWSResponse GetVpcLinks = GetVpcLinksResponse
request :: GetVpcLinks -> Request GetVpcLinks
request = Service -> GetVpcLinks -> Request GetVpcLinks
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetVpcLinks
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetVpcLinks)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetVpcLinks))
-> Logger
-> Service
-> Proxy GetVpcLinks
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetVpcLinks)))
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 [VpcLink] -> Maybe Text -> Int -> GetVpcLinksResponse
GetVpcLinksResponse'
(Maybe [VpcLink] -> Maybe Text -> Int -> GetVpcLinksResponse)
-> Either String (Maybe [VpcLink])
-> Either String (Maybe Text -> Int -> GetVpcLinksResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [VpcLink]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"items" Either String (Maybe (Maybe [VpcLink]))
-> Maybe [VpcLink] -> Either String (Maybe [VpcLink])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [VpcLink]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> GetVpcLinksResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetVpcLinksResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
Either String (Int -> GetVpcLinksResponse)
-> Either String Int -> Either String GetVpcLinksResponse
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 GetVpcLinks
instance Prelude.NFData GetVpcLinks
instance Core.ToHeaders GetVpcLinks where
toHeaders :: GetVpcLinks -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetVpcLinks -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath GetVpcLinks where
toPath :: GetVpcLinks -> ByteString
toPath = ByteString -> GetVpcLinks -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v2/vpclinks"
instance Core.ToQuery GetVpcLinks where
toQuery :: GetVpcLinks -> QueryString
toQuery GetVpcLinks' {Maybe Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:GetVpcLinks' :: GetVpcLinks -> Maybe Text
$sel:nextToken:GetVpcLinks' :: GetVpcLinks -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"maxResults" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxResults
]
data GetVpcLinksResponse = GetVpcLinksResponse'
{
GetVpcLinksResponse -> Maybe [VpcLink]
items :: Prelude.Maybe [VpcLink],
GetVpcLinksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetVpcLinksResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetVpcLinksResponse -> GetVpcLinksResponse -> Bool
(GetVpcLinksResponse -> GetVpcLinksResponse -> Bool)
-> (GetVpcLinksResponse -> GetVpcLinksResponse -> Bool)
-> Eq GetVpcLinksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVpcLinksResponse -> GetVpcLinksResponse -> Bool
$c/= :: GetVpcLinksResponse -> GetVpcLinksResponse -> Bool
== :: GetVpcLinksResponse -> GetVpcLinksResponse -> Bool
$c== :: GetVpcLinksResponse -> GetVpcLinksResponse -> Bool
Prelude.Eq, ReadPrec [GetVpcLinksResponse]
ReadPrec GetVpcLinksResponse
Int -> ReadS GetVpcLinksResponse
ReadS [GetVpcLinksResponse]
(Int -> ReadS GetVpcLinksResponse)
-> ReadS [GetVpcLinksResponse]
-> ReadPrec GetVpcLinksResponse
-> ReadPrec [GetVpcLinksResponse]
-> Read GetVpcLinksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVpcLinksResponse]
$creadListPrec :: ReadPrec [GetVpcLinksResponse]
readPrec :: ReadPrec GetVpcLinksResponse
$creadPrec :: ReadPrec GetVpcLinksResponse
readList :: ReadS [GetVpcLinksResponse]
$creadList :: ReadS [GetVpcLinksResponse]
readsPrec :: Int -> ReadS GetVpcLinksResponse
$creadsPrec :: Int -> ReadS GetVpcLinksResponse
Prelude.Read, Int -> GetVpcLinksResponse -> ShowS
[GetVpcLinksResponse] -> ShowS
GetVpcLinksResponse -> String
(Int -> GetVpcLinksResponse -> ShowS)
-> (GetVpcLinksResponse -> String)
-> ([GetVpcLinksResponse] -> ShowS)
-> Show GetVpcLinksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVpcLinksResponse] -> ShowS
$cshowList :: [GetVpcLinksResponse] -> ShowS
show :: GetVpcLinksResponse -> String
$cshow :: GetVpcLinksResponse -> String
showsPrec :: Int -> GetVpcLinksResponse -> ShowS
$cshowsPrec :: Int -> GetVpcLinksResponse -> ShowS
Prelude.Show, (forall x. GetVpcLinksResponse -> Rep GetVpcLinksResponse x)
-> (forall x. Rep GetVpcLinksResponse x -> GetVpcLinksResponse)
-> Generic GetVpcLinksResponse
forall x. Rep GetVpcLinksResponse x -> GetVpcLinksResponse
forall x. GetVpcLinksResponse -> Rep GetVpcLinksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetVpcLinksResponse x -> GetVpcLinksResponse
$cfrom :: forall x. GetVpcLinksResponse -> Rep GetVpcLinksResponse x
Prelude.Generic)
newGetVpcLinksResponse ::
Prelude.Int ->
GetVpcLinksResponse
newGetVpcLinksResponse :: Int -> GetVpcLinksResponse
newGetVpcLinksResponse Int
pHttpStatus_ =
GetVpcLinksResponse' :: Maybe [VpcLink] -> Maybe Text -> Int -> GetVpcLinksResponse
GetVpcLinksResponse'
{ $sel:items:GetVpcLinksResponse' :: Maybe [VpcLink]
items = Maybe [VpcLink]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetVpcLinksResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetVpcLinksResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getVpcLinksResponse_items :: Lens.Lens' GetVpcLinksResponse (Prelude.Maybe [VpcLink])
getVpcLinksResponse_items :: (Maybe [VpcLink] -> f (Maybe [VpcLink]))
-> GetVpcLinksResponse -> f GetVpcLinksResponse
getVpcLinksResponse_items = (GetVpcLinksResponse -> Maybe [VpcLink])
-> (GetVpcLinksResponse -> Maybe [VpcLink] -> GetVpcLinksResponse)
-> Lens
GetVpcLinksResponse
GetVpcLinksResponse
(Maybe [VpcLink])
(Maybe [VpcLink])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVpcLinksResponse' {Maybe [VpcLink]
items :: Maybe [VpcLink]
$sel:items:GetVpcLinksResponse' :: GetVpcLinksResponse -> Maybe [VpcLink]
items} -> Maybe [VpcLink]
items) (\s :: GetVpcLinksResponse
s@GetVpcLinksResponse' {} Maybe [VpcLink]
a -> GetVpcLinksResponse
s {$sel:items:GetVpcLinksResponse' :: Maybe [VpcLink]
items = Maybe [VpcLink]
a} :: GetVpcLinksResponse) ((Maybe [VpcLink] -> f (Maybe [VpcLink]))
-> GetVpcLinksResponse -> f GetVpcLinksResponse)
-> ((Maybe [VpcLink] -> f (Maybe [VpcLink]))
-> Maybe [VpcLink] -> f (Maybe [VpcLink]))
-> (Maybe [VpcLink] -> f (Maybe [VpcLink]))
-> GetVpcLinksResponse
-> f GetVpcLinksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [VpcLink] [VpcLink] [VpcLink] [VpcLink]
-> Iso
(Maybe [VpcLink])
(Maybe [VpcLink])
(Maybe [VpcLink])
(Maybe [VpcLink])
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 [VpcLink] [VpcLink] [VpcLink] [VpcLink]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getVpcLinksResponse_nextToken :: Lens.Lens' GetVpcLinksResponse (Prelude.Maybe Prelude.Text)
getVpcLinksResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetVpcLinksResponse -> f GetVpcLinksResponse
getVpcLinksResponse_nextToken = (GetVpcLinksResponse -> Maybe Text)
-> (GetVpcLinksResponse -> Maybe Text -> GetVpcLinksResponse)
-> Lens
GetVpcLinksResponse GetVpcLinksResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVpcLinksResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetVpcLinksResponse' :: GetVpcLinksResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetVpcLinksResponse
s@GetVpcLinksResponse' {} Maybe Text
a -> GetVpcLinksResponse
s {$sel:nextToken:GetVpcLinksResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetVpcLinksResponse)
getVpcLinksResponse_httpStatus :: Lens.Lens' GetVpcLinksResponse Prelude.Int
getVpcLinksResponse_httpStatus :: (Int -> f Int) -> GetVpcLinksResponse -> f GetVpcLinksResponse
getVpcLinksResponse_httpStatus = (GetVpcLinksResponse -> Int)
-> (GetVpcLinksResponse -> Int -> GetVpcLinksResponse)
-> Lens GetVpcLinksResponse GetVpcLinksResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVpcLinksResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetVpcLinksResponse' :: GetVpcLinksResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetVpcLinksResponse
s@GetVpcLinksResponse' {} Int
a -> GetVpcLinksResponse
s {$sel:httpStatus:GetVpcLinksResponse' :: Int
httpStatus = Int
a} :: GetVpcLinksResponse)
instance Prelude.NFData GetVpcLinksResponse