{-# 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.IoTWireless.ListWirelessGateways
(
ListWirelessGateways (..),
newListWirelessGateways,
listWirelessGateways_nextToken,
listWirelessGateways_maxResults,
ListWirelessGatewaysResponse (..),
newListWirelessGatewaysResponse,
listWirelessGatewaysResponse_wirelessGatewayList,
listWirelessGatewaysResponse_nextToken,
listWirelessGatewaysResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.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 ListWirelessGateways = ListWirelessGateways'
{
ListWirelessGateways -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListWirelessGateways -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListWirelessGateways -> ListWirelessGateways -> Bool
(ListWirelessGateways -> ListWirelessGateways -> Bool)
-> (ListWirelessGateways -> ListWirelessGateways -> Bool)
-> Eq ListWirelessGateways
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWirelessGateways -> ListWirelessGateways -> Bool
$c/= :: ListWirelessGateways -> ListWirelessGateways -> Bool
== :: ListWirelessGateways -> ListWirelessGateways -> Bool
$c== :: ListWirelessGateways -> ListWirelessGateways -> Bool
Prelude.Eq, ReadPrec [ListWirelessGateways]
ReadPrec ListWirelessGateways
Int -> ReadS ListWirelessGateways
ReadS [ListWirelessGateways]
(Int -> ReadS ListWirelessGateways)
-> ReadS [ListWirelessGateways]
-> ReadPrec ListWirelessGateways
-> ReadPrec [ListWirelessGateways]
-> Read ListWirelessGateways
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWirelessGateways]
$creadListPrec :: ReadPrec [ListWirelessGateways]
readPrec :: ReadPrec ListWirelessGateways
$creadPrec :: ReadPrec ListWirelessGateways
readList :: ReadS [ListWirelessGateways]
$creadList :: ReadS [ListWirelessGateways]
readsPrec :: Int -> ReadS ListWirelessGateways
$creadsPrec :: Int -> ReadS ListWirelessGateways
Prelude.Read, Int -> ListWirelessGateways -> ShowS
[ListWirelessGateways] -> ShowS
ListWirelessGateways -> String
(Int -> ListWirelessGateways -> ShowS)
-> (ListWirelessGateways -> String)
-> ([ListWirelessGateways] -> ShowS)
-> Show ListWirelessGateways
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWirelessGateways] -> ShowS
$cshowList :: [ListWirelessGateways] -> ShowS
show :: ListWirelessGateways -> String
$cshow :: ListWirelessGateways -> String
showsPrec :: Int -> ListWirelessGateways -> ShowS
$cshowsPrec :: Int -> ListWirelessGateways -> ShowS
Prelude.Show, (forall x. ListWirelessGateways -> Rep ListWirelessGateways x)
-> (forall x. Rep ListWirelessGateways x -> ListWirelessGateways)
-> Generic ListWirelessGateways
forall x. Rep ListWirelessGateways x -> ListWirelessGateways
forall x. ListWirelessGateways -> Rep ListWirelessGateways x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWirelessGateways x -> ListWirelessGateways
$cfrom :: forall x. ListWirelessGateways -> Rep ListWirelessGateways x
Prelude.Generic)
newListWirelessGateways ::
ListWirelessGateways
newListWirelessGateways :: ListWirelessGateways
newListWirelessGateways =
ListWirelessGateways' :: Maybe Text -> Maybe Natural -> ListWirelessGateways
ListWirelessGateways'
{ $sel:nextToken:ListWirelessGateways' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListWirelessGateways' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listWirelessGateways_nextToken :: Lens.Lens' ListWirelessGateways (Prelude.Maybe Prelude.Text)
listWirelessGateways_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListWirelessGateways -> f ListWirelessGateways
listWirelessGateways_nextToken = (ListWirelessGateways -> Maybe Text)
-> (ListWirelessGateways -> Maybe Text -> ListWirelessGateways)
-> Lens
ListWirelessGateways ListWirelessGateways (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWirelessGateways' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWirelessGateways' :: ListWirelessGateways -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWirelessGateways
s@ListWirelessGateways' {} Maybe Text
a -> ListWirelessGateways
s {$sel:nextToken:ListWirelessGateways' :: Maybe Text
nextToken = Maybe Text
a} :: ListWirelessGateways)
listWirelessGateways_maxResults :: Lens.Lens' ListWirelessGateways (Prelude.Maybe Prelude.Natural)
listWirelessGateways_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListWirelessGateways -> f ListWirelessGateways
listWirelessGateways_maxResults = (ListWirelessGateways -> Maybe Natural)
-> (ListWirelessGateways -> Maybe Natural -> ListWirelessGateways)
-> Lens
ListWirelessGateways
ListWirelessGateways
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWirelessGateways' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListWirelessGateways' :: ListWirelessGateways -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListWirelessGateways
s@ListWirelessGateways' {} Maybe Natural
a -> ListWirelessGateways
s {$sel:maxResults:ListWirelessGateways' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListWirelessGateways)
instance Core.AWSRequest ListWirelessGateways where
type
AWSResponse ListWirelessGateways =
ListWirelessGatewaysResponse
request :: ListWirelessGateways -> Request ListWirelessGateways
request = Service -> ListWirelessGateways -> Request ListWirelessGateways
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListWirelessGateways
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListWirelessGateways)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListWirelessGateways))
-> Logger
-> Service
-> Proxy ListWirelessGateways
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListWirelessGateways)))
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 [WirelessGatewayStatistics]
-> Maybe Text -> Int -> ListWirelessGatewaysResponse
ListWirelessGatewaysResponse'
(Maybe [WirelessGatewayStatistics]
-> Maybe Text -> Int -> ListWirelessGatewaysResponse)
-> Either String (Maybe [WirelessGatewayStatistics])
-> Either
String (Maybe Text -> Int -> ListWirelessGatewaysResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [WirelessGatewayStatistics]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"WirelessGatewayList"
Either String (Maybe (Maybe [WirelessGatewayStatistics]))
-> Maybe [WirelessGatewayStatistics]
-> Either String (Maybe [WirelessGatewayStatistics])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [WirelessGatewayStatistics]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Maybe Text -> Int -> ListWirelessGatewaysResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListWirelessGatewaysResponse)
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 -> ListWirelessGatewaysResponse)
-> Either String Int -> Either String ListWirelessGatewaysResponse
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 ListWirelessGateways
instance Prelude.NFData ListWirelessGateways
instance Core.ToHeaders ListWirelessGateways where
toHeaders :: ListWirelessGateways -> ResponseHeaders
toHeaders = ResponseHeaders -> ListWirelessGateways -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListWirelessGateways where
toPath :: ListWirelessGateways -> ByteString
toPath = ByteString -> ListWirelessGateways -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/wireless-gateways"
instance Core.ToQuery ListWirelessGateways where
toQuery :: ListWirelessGateways -> QueryString
toQuery ListWirelessGateways' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListWirelessGateways' :: ListWirelessGateways -> Maybe Natural
$sel:nextToken:ListWirelessGateways' :: ListWirelessGateways -> 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 Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
]
data ListWirelessGatewaysResponse = ListWirelessGatewaysResponse'
{
ListWirelessGatewaysResponse -> Maybe [WirelessGatewayStatistics]
wirelessGatewayList :: Prelude.Maybe [WirelessGatewayStatistics],
ListWirelessGatewaysResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListWirelessGatewaysResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListWirelessGatewaysResponse
-> ListWirelessGatewaysResponse -> Bool
(ListWirelessGatewaysResponse
-> ListWirelessGatewaysResponse -> Bool)
-> (ListWirelessGatewaysResponse
-> ListWirelessGatewaysResponse -> Bool)
-> Eq ListWirelessGatewaysResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWirelessGatewaysResponse
-> ListWirelessGatewaysResponse -> Bool
$c/= :: ListWirelessGatewaysResponse
-> ListWirelessGatewaysResponse -> Bool
== :: ListWirelessGatewaysResponse
-> ListWirelessGatewaysResponse -> Bool
$c== :: ListWirelessGatewaysResponse
-> ListWirelessGatewaysResponse -> Bool
Prelude.Eq, ReadPrec [ListWirelessGatewaysResponse]
ReadPrec ListWirelessGatewaysResponse
Int -> ReadS ListWirelessGatewaysResponse
ReadS [ListWirelessGatewaysResponse]
(Int -> ReadS ListWirelessGatewaysResponse)
-> ReadS [ListWirelessGatewaysResponse]
-> ReadPrec ListWirelessGatewaysResponse
-> ReadPrec [ListWirelessGatewaysResponse]
-> Read ListWirelessGatewaysResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWirelessGatewaysResponse]
$creadListPrec :: ReadPrec [ListWirelessGatewaysResponse]
readPrec :: ReadPrec ListWirelessGatewaysResponse
$creadPrec :: ReadPrec ListWirelessGatewaysResponse
readList :: ReadS [ListWirelessGatewaysResponse]
$creadList :: ReadS [ListWirelessGatewaysResponse]
readsPrec :: Int -> ReadS ListWirelessGatewaysResponse
$creadsPrec :: Int -> ReadS ListWirelessGatewaysResponse
Prelude.Read, Int -> ListWirelessGatewaysResponse -> ShowS
[ListWirelessGatewaysResponse] -> ShowS
ListWirelessGatewaysResponse -> String
(Int -> ListWirelessGatewaysResponse -> ShowS)
-> (ListWirelessGatewaysResponse -> String)
-> ([ListWirelessGatewaysResponse] -> ShowS)
-> Show ListWirelessGatewaysResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWirelessGatewaysResponse] -> ShowS
$cshowList :: [ListWirelessGatewaysResponse] -> ShowS
show :: ListWirelessGatewaysResponse -> String
$cshow :: ListWirelessGatewaysResponse -> String
showsPrec :: Int -> ListWirelessGatewaysResponse -> ShowS
$cshowsPrec :: Int -> ListWirelessGatewaysResponse -> ShowS
Prelude.Show, (forall x.
ListWirelessGatewaysResponse -> Rep ListWirelessGatewaysResponse x)
-> (forall x.
Rep ListWirelessGatewaysResponse x -> ListWirelessGatewaysResponse)
-> Generic ListWirelessGatewaysResponse
forall x.
Rep ListWirelessGatewaysResponse x -> ListWirelessGatewaysResponse
forall x.
ListWirelessGatewaysResponse -> Rep ListWirelessGatewaysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListWirelessGatewaysResponse x -> ListWirelessGatewaysResponse
$cfrom :: forall x.
ListWirelessGatewaysResponse -> Rep ListWirelessGatewaysResponse x
Prelude.Generic)
newListWirelessGatewaysResponse ::
Prelude.Int ->
ListWirelessGatewaysResponse
newListWirelessGatewaysResponse :: Int -> ListWirelessGatewaysResponse
newListWirelessGatewaysResponse Int
pHttpStatus_ =
ListWirelessGatewaysResponse' :: Maybe [WirelessGatewayStatistics]
-> Maybe Text -> Int -> ListWirelessGatewaysResponse
ListWirelessGatewaysResponse'
{ $sel:wirelessGatewayList:ListWirelessGatewaysResponse' :: Maybe [WirelessGatewayStatistics]
wirelessGatewayList =
Maybe [WirelessGatewayStatistics]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListWirelessGatewaysResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListWirelessGatewaysResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listWirelessGatewaysResponse_wirelessGatewayList :: Lens.Lens' ListWirelessGatewaysResponse (Prelude.Maybe [WirelessGatewayStatistics])
listWirelessGatewaysResponse_wirelessGatewayList :: (Maybe [WirelessGatewayStatistics]
-> f (Maybe [WirelessGatewayStatistics]))
-> ListWirelessGatewaysResponse -> f ListWirelessGatewaysResponse
listWirelessGatewaysResponse_wirelessGatewayList = (ListWirelessGatewaysResponse -> Maybe [WirelessGatewayStatistics])
-> (ListWirelessGatewaysResponse
-> Maybe [WirelessGatewayStatistics]
-> ListWirelessGatewaysResponse)
-> Lens
ListWirelessGatewaysResponse
ListWirelessGatewaysResponse
(Maybe [WirelessGatewayStatistics])
(Maybe [WirelessGatewayStatistics])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWirelessGatewaysResponse' {Maybe [WirelessGatewayStatistics]
wirelessGatewayList :: Maybe [WirelessGatewayStatistics]
$sel:wirelessGatewayList:ListWirelessGatewaysResponse' :: ListWirelessGatewaysResponse -> Maybe [WirelessGatewayStatistics]
wirelessGatewayList} -> Maybe [WirelessGatewayStatistics]
wirelessGatewayList) (\s :: ListWirelessGatewaysResponse
s@ListWirelessGatewaysResponse' {} Maybe [WirelessGatewayStatistics]
a -> ListWirelessGatewaysResponse
s {$sel:wirelessGatewayList:ListWirelessGatewaysResponse' :: Maybe [WirelessGatewayStatistics]
wirelessGatewayList = Maybe [WirelessGatewayStatistics]
a} :: ListWirelessGatewaysResponse) ((Maybe [WirelessGatewayStatistics]
-> f (Maybe [WirelessGatewayStatistics]))
-> ListWirelessGatewaysResponse -> f ListWirelessGatewaysResponse)
-> ((Maybe [WirelessGatewayStatistics]
-> f (Maybe [WirelessGatewayStatistics]))
-> Maybe [WirelessGatewayStatistics]
-> f (Maybe [WirelessGatewayStatistics]))
-> (Maybe [WirelessGatewayStatistics]
-> f (Maybe [WirelessGatewayStatistics]))
-> ListWirelessGatewaysResponse
-> f ListWirelessGatewaysResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[WirelessGatewayStatistics]
[WirelessGatewayStatistics]
[WirelessGatewayStatistics]
[WirelessGatewayStatistics]
-> Iso
(Maybe [WirelessGatewayStatistics])
(Maybe [WirelessGatewayStatistics])
(Maybe [WirelessGatewayStatistics])
(Maybe [WirelessGatewayStatistics])
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
[WirelessGatewayStatistics]
[WirelessGatewayStatistics]
[WirelessGatewayStatistics]
[WirelessGatewayStatistics]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listWirelessGatewaysResponse_nextToken :: Lens.Lens' ListWirelessGatewaysResponse (Prelude.Maybe Prelude.Text)
listWirelessGatewaysResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListWirelessGatewaysResponse -> f ListWirelessGatewaysResponse
listWirelessGatewaysResponse_nextToken = (ListWirelessGatewaysResponse -> Maybe Text)
-> (ListWirelessGatewaysResponse
-> Maybe Text -> ListWirelessGatewaysResponse)
-> Lens
ListWirelessGatewaysResponse
ListWirelessGatewaysResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWirelessGatewaysResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWirelessGatewaysResponse' :: ListWirelessGatewaysResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWirelessGatewaysResponse
s@ListWirelessGatewaysResponse' {} Maybe Text
a -> ListWirelessGatewaysResponse
s {$sel:nextToken:ListWirelessGatewaysResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListWirelessGatewaysResponse)
listWirelessGatewaysResponse_httpStatus :: Lens.Lens' ListWirelessGatewaysResponse Prelude.Int
listWirelessGatewaysResponse_httpStatus :: (Int -> f Int)
-> ListWirelessGatewaysResponse -> f ListWirelessGatewaysResponse
listWirelessGatewaysResponse_httpStatus = (ListWirelessGatewaysResponse -> Int)
-> (ListWirelessGatewaysResponse
-> Int -> ListWirelessGatewaysResponse)
-> Lens
ListWirelessGatewaysResponse ListWirelessGatewaysResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWirelessGatewaysResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListWirelessGatewaysResponse' :: ListWirelessGatewaysResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListWirelessGatewaysResponse
s@ListWirelessGatewaysResponse' {} Int
a -> ListWirelessGatewaysResponse
s {$sel:httpStatus:ListWirelessGatewaysResponse' :: Int
httpStatus = Int
a} :: ListWirelessGatewaysResponse)
instance Prelude.NFData ListWirelessGatewaysResponse