{-# 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.DeviceFarm.ListVPCEConfigurations
(
ListVPCEConfigurations (..),
newListVPCEConfigurations,
listVPCEConfigurations_maxResults,
listVPCEConfigurations_nextToken,
ListVPCEConfigurationsResponse (..),
newListVPCEConfigurationsResponse,
listVPCEConfigurationsResponse_nextToken,
listVPCEConfigurationsResponse_vpceConfigurations,
listVPCEConfigurationsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DeviceFarm.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListVPCEConfigurations = ListVPCEConfigurations'
{
ListVPCEConfigurations -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
ListVPCEConfigurations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListVPCEConfigurations -> ListVPCEConfigurations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVPCEConfigurations -> ListVPCEConfigurations -> Bool
$c/= :: ListVPCEConfigurations -> ListVPCEConfigurations -> Bool
== :: ListVPCEConfigurations -> ListVPCEConfigurations -> Bool
$c== :: ListVPCEConfigurations -> ListVPCEConfigurations -> Bool
Prelude.Eq, ReadPrec [ListVPCEConfigurations]
ReadPrec ListVPCEConfigurations
Int -> ReadS ListVPCEConfigurations
ReadS [ListVPCEConfigurations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVPCEConfigurations]
$creadListPrec :: ReadPrec [ListVPCEConfigurations]
readPrec :: ReadPrec ListVPCEConfigurations
$creadPrec :: ReadPrec ListVPCEConfigurations
readList :: ReadS [ListVPCEConfigurations]
$creadList :: ReadS [ListVPCEConfigurations]
readsPrec :: Int -> ReadS ListVPCEConfigurations
$creadsPrec :: Int -> ReadS ListVPCEConfigurations
Prelude.Read, Int -> ListVPCEConfigurations -> ShowS
[ListVPCEConfigurations] -> ShowS
ListVPCEConfigurations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVPCEConfigurations] -> ShowS
$cshowList :: [ListVPCEConfigurations] -> ShowS
show :: ListVPCEConfigurations -> String
$cshow :: ListVPCEConfigurations -> String
showsPrec :: Int -> ListVPCEConfigurations -> ShowS
$cshowsPrec :: Int -> ListVPCEConfigurations -> ShowS
Prelude.Show, forall x. Rep ListVPCEConfigurations x -> ListVPCEConfigurations
forall x. ListVPCEConfigurations -> Rep ListVPCEConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVPCEConfigurations x -> ListVPCEConfigurations
$cfrom :: forall x. ListVPCEConfigurations -> Rep ListVPCEConfigurations x
Prelude.Generic)
newListVPCEConfigurations ::
ListVPCEConfigurations
newListVPCEConfigurations :: ListVPCEConfigurations
newListVPCEConfigurations =
ListVPCEConfigurations'
{ $sel:maxResults:ListVPCEConfigurations' :: Maybe Int
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListVPCEConfigurations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listVPCEConfigurations_maxResults :: Lens.Lens' ListVPCEConfigurations (Prelude.Maybe Prelude.Int)
listVPCEConfigurations_maxResults :: Lens' ListVPCEConfigurations (Maybe Int)
listVPCEConfigurations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCEConfigurations' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListVPCEConfigurations' :: ListVPCEConfigurations -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListVPCEConfigurations
s@ListVPCEConfigurations' {} Maybe Int
a -> ListVPCEConfigurations
s {$sel:maxResults:ListVPCEConfigurations' :: Maybe Int
maxResults = Maybe Int
a} :: ListVPCEConfigurations)
listVPCEConfigurations_nextToken :: Lens.Lens' ListVPCEConfigurations (Prelude.Maybe Prelude.Text)
listVPCEConfigurations_nextToken :: Lens' ListVPCEConfigurations (Maybe Text)
listVPCEConfigurations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCEConfigurations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVPCEConfigurations' :: ListVPCEConfigurations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVPCEConfigurations
s@ListVPCEConfigurations' {} Maybe Text
a -> ListVPCEConfigurations
s {$sel:nextToken:ListVPCEConfigurations' :: Maybe Text
nextToken = Maybe Text
a} :: ListVPCEConfigurations)
instance Core.AWSPager ListVPCEConfigurations where
page :: ListVPCEConfigurations
-> AWSResponse ListVPCEConfigurations
-> Maybe ListVPCEConfigurations
page ListVPCEConfigurations
rq AWSResponse ListVPCEConfigurations
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListVPCEConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVPCEConfigurationsResponse (Maybe Text)
listVPCEConfigurationsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListVPCEConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVPCEConfigurationsResponse (Maybe [VPCEConfiguration])
listVPCEConfigurationsResponse_vpceConfigurations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListVPCEConfigurations
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListVPCEConfigurations (Maybe Text)
listVPCEConfigurations_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVPCEConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVPCEConfigurationsResponse (Maybe Text)
listVPCEConfigurationsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListVPCEConfigurations where
type
AWSResponse ListVPCEConfigurations =
ListVPCEConfigurationsResponse
request :: (Service -> Service)
-> ListVPCEConfigurations -> Request ListVPCEConfigurations
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 ListVPCEConfigurations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListVPCEConfigurations)))
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 Text
-> Maybe [VPCEConfiguration]
-> Int
-> ListVPCEConfigurationsResponse
ListVPCEConfigurationsResponse'
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
"nextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"vpceConfigurations"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
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 ListVPCEConfigurations where
hashWithSalt :: Int -> ListVPCEConfigurations -> Int
hashWithSalt Int
_salt ListVPCEConfigurations' {Maybe Int
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:nextToken:ListVPCEConfigurations' :: ListVPCEConfigurations -> Maybe Text
$sel:maxResults:ListVPCEConfigurations' :: ListVPCEConfigurations -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListVPCEConfigurations where
rnf :: ListVPCEConfigurations -> ()
rnf ListVPCEConfigurations' {Maybe Int
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:nextToken:ListVPCEConfigurations' :: ListVPCEConfigurations -> Maybe Text
$sel:maxResults:ListVPCEConfigurations' :: ListVPCEConfigurations -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListVPCEConfigurations where
toHeaders :: ListVPCEConfigurations -> 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
"DeviceFarm_20150623.ListVPCEConfigurations" ::
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 ListVPCEConfigurations where
toJSON :: ListVPCEConfigurations -> Value
toJSON ListVPCEConfigurations' {Maybe Int
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
$sel:nextToken:ListVPCEConfigurations' :: ListVPCEConfigurations -> Maybe Text
$sel:maxResults:ListVPCEConfigurations' :: ListVPCEConfigurations -> Maybe Int
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
(Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
]
)
instance Data.ToPath ListVPCEConfigurations where
toPath :: ListVPCEConfigurations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListVPCEConfigurations where
toQuery :: ListVPCEConfigurations -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListVPCEConfigurationsResponse = ListVPCEConfigurationsResponse'
{
ListVPCEConfigurationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListVPCEConfigurationsResponse -> Maybe [VPCEConfiguration]
vpceConfigurations :: Prelude.Maybe [VPCEConfiguration],
ListVPCEConfigurationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListVPCEConfigurationsResponse
-> ListVPCEConfigurationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVPCEConfigurationsResponse
-> ListVPCEConfigurationsResponse -> Bool
$c/= :: ListVPCEConfigurationsResponse
-> ListVPCEConfigurationsResponse -> Bool
== :: ListVPCEConfigurationsResponse
-> ListVPCEConfigurationsResponse -> Bool
$c== :: ListVPCEConfigurationsResponse
-> ListVPCEConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [ListVPCEConfigurationsResponse]
ReadPrec ListVPCEConfigurationsResponse
Int -> ReadS ListVPCEConfigurationsResponse
ReadS [ListVPCEConfigurationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVPCEConfigurationsResponse]
$creadListPrec :: ReadPrec [ListVPCEConfigurationsResponse]
readPrec :: ReadPrec ListVPCEConfigurationsResponse
$creadPrec :: ReadPrec ListVPCEConfigurationsResponse
readList :: ReadS [ListVPCEConfigurationsResponse]
$creadList :: ReadS [ListVPCEConfigurationsResponse]
readsPrec :: Int -> ReadS ListVPCEConfigurationsResponse
$creadsPrec :: Int -> ReadS ListVPCEConfigurationsResponse
Prelude.Read, Int -> ListVPCEConfigurationsResponse -> ShowS
[ListVPCEConfigurationsResponse] -> ShowS
ListVPCEConfigurationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVPCEConfigurationsResponse] -> ShowS
$cshowList :: [ListVPCEConfigurationsResponse] -> ShowS
show :: ListVPCEConfigurationsResponse -> String
$cshow :: ListVPCEConfigurationsResponse -> String
showsPrec :: Int -> ListVPCEConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> ListVPCEConfigurationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListVPCEConfigurationsResponse x
-> ListVPCEConfigurationsResponse
forall x.
ListVPCEConfigurationsResponse
-> Rep ListVPCEConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListVPCEConfigurationsResponse x
-> ListVPCEConfigurationsResponse
$cfrom :: forall x.
ListVPCEConfigurationsResponse
-> Rep ListVPCEConfigurationsResponse x
Prelude.Generic)
newListVPCEConfigurationsResponse ::
Prelude.Int ->
ListVPCEConfigurationsResponse
newListVPCEConfigurationsResponse :: Int -> ListVPCEConfigurationsResponse
newListVPCEConfigurationsResponse Int
pHttpStatus_ =
ListVPCEConfigurationsResponse'
{ $sel:nextToken:ListVPCEConfigurationsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:vpceConfigurations:ListVPCEConfigurationsResponse' :: Maybe [VPCEConfiguration]
vpceConfigurations = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListVPCEConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listVPCEConfigurationsResponse_nextToken :: Lens.Lens' ListVPCEConfigurationsResponse (Prelude.Maybe Prelude.Text)
listVPCEConfigurationsResponse_nextToken :: Lens' ListVPCEConfigurationsResponse (Maybe Text)
listVPCEConfigurationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCEConfigurationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVPCEConfigurationsResponse' :: ListVPCEConfigurationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVPCEConfigurationsResponse
s@ListVPCEConfigurationsResponse' {} Maybe Text
a -> ListVPCEConfigurationsResponse
s {$sel:nextToken:ListVPCEConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListVPCEConfigurationsResponse)
listVPCEConfigurationsResponse_vpceConfigurations :: Lens.Lens' ListVPCEConfigurationsResponse (Prelude.Maybe [VPCEConfiguration])
listVPCEConfigurationsResponse_vpceConfigurations :: Lens' ListVPCEConfigurationsResponse (Maybe [VPCEConfiguration])
listVPCEConfigurationsResponse_vpceConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCEConfigurationsResponse' {Maybe [VPCEConfiguration]
vpceConfigurations :: Maybe [VPCEConfiguration]
$sel:vpceConfigurations:ListVPCEConfigurationsResponse' :: ListVPCEConfigurationsResponse -> Maybe [VPCEConfiguration]
vpceConfigurations} -> Maybe [VPCEConfiguration]
vpceConfigurations) (\s :: ListVPCEConfigurationsResponse
s@ListVPCEConfigurationsResponse' {} Maybe [VPCEConfiguration]
a -> ListVPCEConfigurationsResponse
s {$sel:vpceConfigurations:ListVPCEConfigurationsResponse' :: Maybe [VPCEConfiguration]
vpceConfigurations = Maybe [VPCEConfiguration]
a} :: ListVPCEConfigurationsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listVPCEConfigurationsResponse_httpStatus :: Lens.Lens' ListVPCEConfigurationsResponse Prelude.Int
listVPCEConfigurationsResponse_httpStatus :: Lens' ListVPCEConfigurationsResponse Int
listVPCEConfigurationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVPCEConfigurationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListVPCEConfigurationsResponse' :: ListVPCEConfigurationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListVPCEConfigurationsResponse
s@ListVPCEConfigurationsResponse' {} Int
a -> ListVPCEConfigurationsResponse
s {$sel:httpStatus:ListVPCEConfigurationsResponse' :: Int
httpStatus = Int
a} :: ListVPCEConfigurationsResponse)
instance
Prelude.NFData
ListVPCEConfigurationsResponse
where
rnf :: ListVPCEConfigurationsResponse -> ()
rnf ListVPCEConfigurationsResponse' {Int
Maybe [VPCEConfiguration]
Maybe Text
httpStatus :: Int
vpceConfigurations :: Maybe [VPCEConfiguration]
nextToken :: Maybe Text
$sel:httpStatus:ListVPCEConfigurationsResponse' :: ListVPCEConfigurationsResponse -> Int
$sel:vpceConfigurations:ListVPCEConfigurationsResponse' :: ListVPCEConfigurationsResponse -> Maybe [VPCEConfiguration]
$sel:nextToken:ListVPCEConfigurationsResponse' :: ListVPCEConfigurationsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VPCEConfiguration]
vpceConfigurations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus