{-# 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.AlexaBusiness.ListGatewayGroups
(
ListGatewayGroups (..),
newListGatewayGroups,
listGatewayGroups_nextToken,
listGatewayGroups_maxResults,
ListGatewayGroupsResponse (..),
newListGatewayGroupsResponse,
listGatewayGroupsResponse_gatewayGroups,
listGatewayGroupsResponse_nextToken,
listGatewayGroupsResponse_httpStatus,
)
where
import Amazonka.AlexaBusiness.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 ListGatewayGroups = ListGatewayGroups'
{
ListGatewayGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGatewayGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListGatewayGroups -> ListGatewayGroups -> Bool
(ListGatewayGroups -> ListGatewayGroups -> Bool)
-> (ListGatewayGroups -> ListGatewayGroups -> Bool)
-> Eq ListGatewayGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGatewayGroups -> ListGatewayGroups -> Bool
$c/= :: ListGatewayGroups -> ListGatewayGroups -> Bool
== :: ListGatewayGroups -> ListGatewayGroups -> Bool
$c== :: ListGatewayGroups -> ListGatewayGroups -> Bool
Prelude.Eq, ReadPrec [ListGatewayGroups]
ReadPrec ListGatewayGroups
Int -> ReadS ListGatewayGroups
ReadS [ListGatewayGroups]
(Int -> ReadS ListGatewayGroups)
-> ReadS [ListGatewayGroups]
-> ReadPrec ListGatewayGroups
-> ReadPrec [ListGatewayGroups]
-> Read ListGatewayGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGatewayGroups]
$creadListPrec :: ReadPrec [ListGatewayGroups]
readPrec :: ReadPrec ListGatewayGroups
$creadPrec :: ReadPrec ListGatewayGroups
readList :: ReadS [ListGatewayGroups]
$creadList :: ReadS [ListGatewayGroups]
readsPrec :: Int -> ReadS ListGatewayGroups
$creadsPrec :: Int -> ReadS ListGatewayGroups
Prelude.Read, Int -> ListGatewayGroups -> ShowS
[ListGatewayGroups] -> ShowS
ListGatewayGroups -> String
(Int -> ListGatewayGroups -> ShowS)
-> (ListGatewayGroups -> String)
-> ([ListGatewayGroups] -> ShowS)
-> Show ListGatewayGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGatewayGroups] -> ShowS
$cshowList :: [ListGatewayGroups] -> ShowS
show :: ListGatewayGroups -> String
$cshow :: ListGatewayGroups -> String
showsPrec :: Int -> ListGatewayGroups -> ShowS
$cshowsPrec :: Int -> ListGatewayGroups -> ShowS
Prelude.Show, (forall x. ListGatewayGroups -> Rep ListGatewayGroups x)
-> (forall x. Rep ListGatewayGroups x -> ListGatewayGroups)
-> Generic ListGatewayGroups
forall x. Rep ListGatewayGroups x -> ListGatewayGroups
forall x. ListGatewayGroups -> Rep ListGatewayGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGatewayGroups x -> ListGatewayGroups
$cfrom :: forall x. ListGatewayGroups -> Rep ListGatewayGroups x
Prelude.Generic)
newListGatewayGroups ::
ListGatewayGroups
newListGatewayGroups :: ListGatewayGroups
newListGatewayGroups =
ListGatewayGroups' :: Maybe Text -> Maybe Natural -> ListGatewayGroups
ListGatewayGroups'
{ $sel:nextToken:ListGatewayGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListGatewayGroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listGatewayGroups_nextToken :: Lens.Lens' ListGatewayGroups (Prelude.Maybe Prelude.Text)
listGatewayGroups_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGatewayGroups -> f ListGatewayGroups
listGatewayGroups_nextToken = (ListGatewayGroups -> Maybe Text)
-> (ListGatewayGroups -> Maybe Text -> ListGatewayGroups)
-> Lens
ListGatewayGroups ListGatewayGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGatewayGroups' :: ListGatewayGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGatewayGroups
s@ListGatewayGroups' {} Maybe Text
a -> ListGatewayGroups
s {$sel:nextToken:ListGatewayGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListGatewayGroups)
listGatewayGroups_maxResults :: Lens.Lens' ListGatewayGroups (Prelude.Maybe Prelude.Natural)
listGatewayGroups_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListGatewayGroups -> f ListGatewayGroups
listGatewayGroups_maxResults = (ListGatewayGroups -> Maybe Natural)
-> (ListGatewayGroups -> Maybe Natural -> ListGatewayGroups)
-> Lens
ListGatewayGroups ListGatewayGroups (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListGatewayGroups' :: ListGatewayGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListGatewayGroups
s@ListGatewayGroups' {} Maybe Natural
a -> ListGatewayGroups
s {$sel:maxResults:ListGatewayGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListGatewayGroups)
instance Core.AWSRequest ListGatewayGroups where
type
AWSResponse ListGatewayGroups =
ListGatewayGroupsResponse
request :: ListGatewayGroups -> Request ListGatewayGroups
request = Service -> ListGatewayGroups -> Request ListGatewayGroups
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListGatewayGroups
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListGatewayGroups)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListGatewayGroups))
-> Logger
-> Service
-> Proxy ListGatewayGroups
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListGatewayGroups)))
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 [GatewayGroupSummary]
-> Maybe Text -> Int -> ListGatewayGroupsResponse
ListGatewayGroupsResponse'
(Maybe [GatewayGroupSummary]
-> Maybe Text -> Int -> ListGatewayGroupsResponse)
-> Either String (Maybe [GatewayGroupSummary])
-> Either String (Maybe Text -> Int -> ListGatewayGroupsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [GatewayGroupSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GatewayGroups" Either String (Maybe (Maybe [GatewayGroupSummary]))
-> Maybe [GatewayGroupSummary]
-> Either String (Maybe [GatewayGroupSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [GatewayGroupSummary]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> ListGatewayGroupsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListGatewayGroupsResponse)
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 -> ListGatewayGroupsResponse)
-> Either String Int -> Either String ListGatewayGroupsResponse
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 ListGatewayGroups
instance Prelude.NFData ListGatewayGroups
instance Core.ToHeaders ListGatewayGroups where
toHeaders :: ListGatewayGroups -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListGatewayGroups -> 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
"AlexaForBusiness.ListGatewayGroups" ::
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 ListGatewayGroups where
toJSON :: ListGatewayGroups -> Value
toJSON ListGatewayGroups' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListGatewayGroups' :: ListGatewayGroups -> Maybe Natural
$sel:nextToken:ListGatewayGroups' :: ListGatewayGroups -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NextToken" 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
nextToken,
(Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
]
)
instance Core.ToPath ListGatewayGroups where
toPath :: ListGatewayGroups -> ByteString
toPath = ByteString -> ListGatewayGroups -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListGatewayGroups where
toQuery :: ListGatewayGroups -> QueryString
toQuery = QueryString -> ListGatewayGroups -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListGatewayGroupsResponse = ListGatewayGroupsResponse'
{
ListGatewayGroupsResponse -> Maybe [GatewayGroupSummary]
gatewayGroups :: Prelude.Maybe [GatewayGroupSummary],
ListGatewayGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGatewayGroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListGatewayGroupsResponse -> ListGatewayGroupsResponse -> Bool
(ListGatewayGroupsResponse -> ListGatewayGroupsResponse -> Bool)
-> (ListGatewayGroupsResponse -> ListGatewayGroupsResponse -> Bool)
-> Eq ListGatewayGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGatewayGroupsResponse -> ListGatewayGroupsResponse -> Bool
$c/= :: ListGatewayGroupsResponse -> ListGatewayGroupsResponse -> Bool
== :: ListGatewayGroupsResponse -> ListGatewayGroupsResponse -> Bool
$c== :: ListGatewayGroupsResponse -> ListGatewayGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListGatewayGroupsResponse]
ReadPrec ListGatewayGroupsResponse
Int -> ReadS ListGatewayGroupsResponse
ReadS [ListGatewayGroupsResponse]
(Int -> ReadS ListGatewayGroupsResponse)
-> ReadS [ListGatewayGroupsResponse]
-> ReadPrec ListGatewayGroupsResponse
-> ReadPrec [ListGatewayGroupsResponse]
-> Read ListGatewayGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGatewayGroupsResponse]
$creadListPrec :: ReadPrec [ListGatewayGroupsResponse]
readPrec :: ReadPrec ListGatewayGroupsResponse
$creadPrec :: ReadPrec ListGatewayGroupsResponse
readList :: ReadS [ListGatewayGroupsResponse]
$creadList :: ReadS [ListGatewayGroupsResponse]
readsPrec :: Int -> ReadS ListGatewayGroupsResponse
$creadsPrec :: Int -> ReadS ListGatewayGroupsResponse
Prelude.Read, Int -> ListGatewayGroupsResponse -> ShowS
[ListGatewayGroupsResponse] -> ShowS
ListGatewayGroupsResponse -> String
(Int -> ListGatewayGroupsResponse -> ShowS)
-> (ListGatewayGroupsResponse -> String)
-> ([ListGatewayGroupsResponse] -> ShowS)
-> Show ListGatewayGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGatewayGroupsResponse] -> ShowS
$cshowList :: [ListGatewayGroupsResponse] -> ShowS
show :: ListGatewayGroupsResponse -> String
$cshow :: ListGatewayGroupsResponse -> String
showsPrec :: Int -> ListGatewayGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListGatewayGroupsResponse -> ShowS
Prelude.Show, (forall x.
ListGatewayGroupsResponse -> Rep ListGatewayGroupsResponse x)
-> (forall x.
Rep ListGatewayGroupsResponse x -> ListGatewayGroupsResponse)
-> Generic ListGatewayGroupsResponse
forall x.
Rep ListGatewayGroupsResponse x -> ListGatewayGroupsResponse
forall x.
ListGatewayGroupsResponse -> Rep ListGatewayGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGatewayGroupsResponse x -> ListGatewayGroupsResponse
$cfrom :: forall x.
ListGatewayGroupsResponse -> Rep ListGatewayGroupsResponse x
Prelude.Generic)
newListGatewayGroupsResponse ::
Prelude.Int ->
ListGatewayGroupsResponse
newListGatewayGroupsResponse :: Int -> ListGatewayGroupsResponse
newListGatewayGroupsResponse Int
pHttpStatus_ =
ListGatewayGroupsResponse' :: Maybe [GatewayGroupSummary]
-> Maybe Text -> Int -> ListGatewayGroupsResponse
ListGatewayGroupsResponse'
{ $sel:gatewayGroups:ListGatewayGroupsResponse' :: Maybe [GatewayGroupSummary]
gatewayGroups =
Maybe [GatewayGroupSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListGatewayGroupsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListGatewayGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listGatewayGroupsResponse_gatewayGroups :: Lens.Lens' ListGatewayGroupsResponse (Prelude.Maybe [GatewayGroupSummary])
listGatewayGroupsResponse_gatewayGroups :: (Maybe [GatewayGroupSummary] -> f (Maybe [GatewayGroupSummary]))
-> ListGatewayGroupsResponse -> f ListGatewayGroupsResponse
listGatewayGroupsResponse_gatewayGroups = (ListGatewayGroupsResponse -> Maybe [GatewayGroupSummary])
-> (ListGatewayGroupsResponse
-> Maybe [GatewayGroupSummary] -> ListGatewayGroupsResponse)
-> Lens
ListGatewayGroupsResponse
ListGatewayGroupsResponse
(Maybe [GatewayGroupSummary])
(Maybe [GatewayGroupSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayGroupsResponse' {Maybe [GatewayGroupSummary]
gatewayGroups :: Maybe [GatewayGroupSummary]
$sel:gatewayGroups:ListGatewayGroupsResponse' :: ListGatewayGroupsResponse -> Maybe [GatewayGroupSummary]
gatewayGroups} -> Maybe [GatewayGroupSummary]
gatewayGroups) (\s :: ListGatewayGroupsResponse
s@ListGatewayGroupsResponse' {} Maybe [GatewayGroupSummary]
a -> ListGatewayGroupsResponse
s {$sel:gatewayGroups:ListGatewayGroupsResponse' :: Maybe [GatewayGroupSummary]
gatewayGroups = Maybe [GatewayGroupSummary]
a} :: ListGatewayGroupsResponse) ((Maybe [GatewayGroupSummary] -> f (Maybe [GatewayGroupSummary]))
-> ListGatewayGroupsResponse -> f ListGatewayGroupsResponse)
-> ((Maybe [GatewayGroupSummary]
-> f (Maybe [GatewayGroupSummary]))
-> Maybe [GatewayGroupSummary] -> f (Maybe [GatewayGroupSummary]))
-> (Maybe [GatewayGroupSummary] -> f (Maybe [GatewayGroupSummary]))
-> ListGatewayGroupsResponse
-> f ListGatewayGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[GatewayGroupSummary]
[GatewayGroupSummary]
[GatewayGroupSummary]
[GatewayGroupSummary]
-> Iso
(Maybe [GatewayGroupSummary])
(Maybe [GatewayGroupSummary])
(Maybe [GatewayGroupSummary])
(Maybe [GatewayGroupSummary])
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
[GatewayGroupSummary]
[GatewayGroupSummary]
[GatewayGroupSummary]
[GatewayGroupSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listGatewayGroupsResponse_nextToken :: Lens.Lens' ListGatewayGroupsResponse (Prelude.Maybe Prelude.Text)
listGatewayGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGatewayGroupsResponse -> f ListGatewayGroupsResponse
listGatewayGroupsResponse_nextToken = (ListGatewayGroupsResponse -> Maybe Text)
-> (ListGatewayGroupsResponse
-> Maybe Text -> ListGatewayGroupsResponse)
-> Lens
ListGatewayGroupsResponse
ListGatewayGroupsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGatewayGroupsResponse' :: ListGatewayGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGatewayGroupsResponse
s@ListGatewayGroupsResponse' {} Maybe Text
a -> ListGatewayGroupsResponse
s {$sel:nextToken:ListGatewayGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGatewayGroupsResponse)
listGatewayGroupsResponse_httpStatus :: Lens.Lens' ListGatewayGroupsResponse Prelude.Int
listGatewayGroupsResponse_httpStatus :: (Int -> f Int)
-> ListGatewayGroupsResponse -> f ListGatewayGroupsResponse
listGatewayGroupsResponse_httpStatus = (ListGatewayGroupsResponse -> Int)
-> (ListGatewayGroupsResponse -> Int -> ListGatewayGroupsResponse)
-> Lens ListGatewayGroupsResponse ListGatewayGroupsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGatewayGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListGatewayGroupsResponse' :: ListGatewayGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListGatewayGroupsResponse
s@ListGatewayGroupsResponse' {} Int
a -> ListGatewayGroupsResponse
s {$sel:httpStatus:ListGatewayGroupsResponse' :: Int
httpStatus = Int
a} :: ListGatewayGroupsResponse)
instance Prelude.NFData ListGatewayGroupsResponse