{-# 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.ListDeviceProfiles
(
ListDeviceProfiles (..),
newListDeviceProfiles,
listDeviceProfiles_nextToken,
listDeviceProfiles_maxResults,
ListDeviceProfilesResponse (..),
newListDeviceProfilesResponse,
listDeviceProfilesResponse_deviceProfileList,
listDeviceProfilesResponse_nextToken,
listDeviceProfilesResponse_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 ListDeviceProfiles = ListDeviceProfiles'
{
ListDeviceProfiles -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDeviceProfiles -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListDeviceProfiles -> ListDeviceProfiles -> Bool
(ListDeviceProfiles -> ListDeviceProfiles -> Bool)
-> (ListDeviceProfiles -> ListDeviceProfiles -> Bool)
-> Eq ListDeviceProfiles
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeviceProfiles -> ListDeviceProfiles -> Bool
$c/= :: ListDeviceProfiles -> ListDeviceProfiles -> Bool
== :: ListDeviceProfiles -> ListDeviceProfiles -> Bool
$c== :: ListDeviceProfiles -> ListDeviceProfiles -> Bool
Prelude.Eq, ReadPrec [ListDeviceProfiles]
ReadPrec ListDeviceProfiles
Int -> ReadS ListDeviceProfiles
ReadS [ListDeviceProfiles]
(Int -> ReadS ListDeviceProfiles)
-> ReadS [ListDeviceProfiles]
-> ReadPrec ListDeviceProfiles
-> ReadPrec [ListDeviceProfiles]
-> Read ListDeviceProfiles
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeviceProfiles]
$creadListPrec :: ReadPrec [ListDeviceProfiles]
readPrec :: ReadPrec ListDeviceProfiles
$creadPrec :: ReadPrec ListDeviceProfiles
readList :: ReadS [ListDeviceProfiles]
$creadList :: ReadS [ListDeviceProfiles]
readsPrec :: Int -> ReadS ListDeviceProfiles
$creadsPrec :: Int -> ReadS ListDeviceProfiles
Prelude.Read, Int -> ListDeviceProfiles -> ShowS
[ListDeviceProfiles] -> ShowS
ListDeviceProfiles -> String
(Int -> ListDeviceProfiles -> ShowS)
-> (ListDeviceProfiles -> String)
-> ([ListDeviceProfiles] -> ShowS)
-> Show ListDeviceProfiles
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeviceProfiles] -> ShowS
$cshowList :: [ListDeviceProfiles] -> ShowS
show :: ListDeviceProfiles -> String
$cshow :: ListDeviceProfiles -> String
showsPrec :: Int -> ListDeviceProfiles -> ShowS
$cshowsPrec :: Int -> ListDeviceProfiles -> ShowS
Prelude.Show, (forall x. ListDeviceProfiles -> Rep ListDeviceProfiles x)
-> (forall x. Rep ListDeviceProfiles x -> ListDeviceProfiles)
-> Generic ListDeviceProfiles
forall x. Rep ListDeviceProfiles x -> ListDeviceProfiles
forall x. ListDeviceProfiles -> Rep ListDeviceProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDeviceProfiles x -> ListDeviceProfiles
$cfrom :: forall x. ListDeviceProfiles -> Rep ListDeviceProfiles x
Prelude.Generic)
newListDeviceProfiles ::
ListDeviceProfiles
newListDeviceProfiles :: ListDeviceProfiles
newListDeviceProfiles =
ListDeviceProfiles' :: Maybe Text -> Maybe Natural -> ListDeviceProfiles
ListDeviceProfiles'
{ $sel:nextToken:ListDeviceProfiles' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListDeviceProfiles' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listDeviceProfiles_nextToken :: Lens.Lens' ListDeviceProfiles (Prelude.Maybe Prelude.Text)
listDeviceProfiles_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeviceProfiles -> f ListDeviceProfiles
listDeviceProfiles_nextToken = (ListDeviceProfiles -> Maybe Text)
-> (ListDeviceProfiles -> Maybe Text -> ListDeviceProfiles)
-> Lens
ListDeviceProfiles ListDeviceProfiles (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceProfiles' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeviceProfiles' :: ListDeviceProfiles -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeviceProfiles
s@ListDeviceProfiles' {} Maybe Text
a -> ListDeviceProfiles
s {$sel:nextToken:ListDeviceProfiles' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeviceProfiles)
listDeviceProfiles_maxResults :: Lens.Lens' ListDeviceProfiles (Prelude.Maybe Prelude.Natural)
listDeviceProfiles_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDeviceProfiles -> f ListDeviceProfiles
listDeviceProfiles_maxResults = (ListDeviceProfiles -> Maybe Natural)
-> (ListDeviceProfiles -> Maybe Natural -> ListDeviceProfiles)
-> Lens
ListDeviceProfiles
ListDeviceProfiles
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceProfiles' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDeviceProfiles' :: ListDeviceProfiles -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDeviceProfiles
s@ListDeviceProfiles' {} Maybe Natural
a -> ListDeviceProfiles
s {$sel:maxResults:ListDeviceProfiles' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDeviceProfiles)
instance Core.AWSRequest ListDeviceProfiles where
type
AWSResponse ListDeviceProfiles =
ListDeviceProfilesResponse
request :: ListDeviceProfiles -> Request ListDeviceProfiles
request = Service -> ListDeviceProfiles -> Request ListDeviceProfiles
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListDeviceProfiles
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDeviceProfiles)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListDeviceProfiles))
-> Logger
-> Service
-> Proxy ListDeviceProfiles
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDeviceProfiles)))
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 [DeviceProfile]
-> Maybe Text -> Int -> ListDeviceProfilesResponse
ListDeviceProfilesResponse'
(Maybe [DeviceProfile]
-> Maybe Text -> Int -> ListDeviceProfilesResponse)
-> Either String (Maybe [DeviceProfile])
-> Either String (Maybe Text -> Int -> ListDeviceProfilesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [DeviceProfile]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DeviceProfileList"
Either String (Maybe (Maybe [DeviceProfile]))
-> Maybe [DeviceProfile] -> Either String (Maybe [DeviceProfile])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DeviceProfile]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Maybe Text -> Int -> ListDeviceProfilesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListDeviceProfilesResponse)
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 -> ListDeviceProfilesResponse)
-> Either String Int -> Either String ListDeviceProfilesResponse
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 ListDeviceProfiles
instance Prelude.NFData ListDeviceProfiles
instance Core.ToHeaders ListDeviceProfiles where
toHeaders :: ListDeviceProfiles -> ResponseHeaders
toHeaders = ResponseHeaders -> ListDeviceProfiles -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListDeviceProfiles where
toPath :: ListDeviceProfiles -> ByteString
toPath = ByteString -> ListDeviceProfiles -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/device-profiles"
instance Core.ToQuery ListDeviceProfiles where
toQuery :: ListDeviceProfiles -> QueryString
toQuery ListDeviceProfiles' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListDeviceProfiles' :: ListDeviceProfiles -> Maybe Natural
$sel:nextToken:ListDeviceProfiles' :: ListDeviceProfiles -> 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 ListDeviceProfilesResponse = ListDeviceProfilesResponse'
{
ListDeviceProfilesResponse -> Maybe [DeviceProfile]
deviceProfileList :: Prelude.Maybe [DeviceProfile],
ListDeviceProfilesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDeviceProfilesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDeviceProfilesResponse -> ListDeviceProfilesResponse -> Bool
(ListDeviceProfilesResponse -> ListDeviceProfilesResponse -> Bool)
-> (ListDeviceProfilesResponse
-> ListDeviceProfilesResponse -> Bool)
-> Eq ListDeviceProfilesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeviceProfilesResponse -> ListDeviceProfilesResponse -> Bool
$c/= :: ListDeviceProfilesResponse -> ListDeviceProfilesResponse -> Bool
== :: ListDeviceProfilesResponse -> ListDeviceProfilesResponse -> Bool
$c== :: ListDeviceProfilesResponse -> ListDeviceProfilesResponse -> Bool
Prelude.Eq, ReadPrec [ListDeviceProfilesResponse]
ReadPrec ListDeviceProfilesResponse
Int -> ReadS ListDeviceProfilesResponse
ReadS [ListDeviceProfilesResponse]
(Int -> ReadS ListDeviceProfilesResponse)
-> ReadS [ListDeviceProfilesResponse]
-> ReadPrec ListDeviceProfilesResponse
-> ReadPrec [ListDeviceProfilesResponse]
-> Read ListDeviceProfilesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeviceProfilesResponse]
$creadListPrec :: ReadPrec [ListDeviceProfilesResponse]
readPrec :: ReadPrec ListDeviceProfilesResponse
$creadPrec :: ReadPrec ListDeviceProfilesResponse
readList :: ReadS [ListDeviceProfilesResponse]
$creadList :: ReadS [ListDeviceProfilesResponse]
readsPrec :: Int -> ReadS ListDeviceProfilesResponse
$creadsPrec :: Int -> ReadS ListDeviceProfilesResponse
Prelude.Read, Int -> ListDeviceProfilesResponse -> ShowS
[ListDeviceProfilesResponse] -> ShowS
ListDeviceProfilesResponse -> String
(Int -> ListDeviceProfilesResponse -> ShowS)
-> (ListDeviceProfilesResponse -> String)
-> ([ListDeviceProfilesResponse] -> ShowS)
-> Show ListDeviceProfilesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeviceProfilesResponse] -> ShowS
$cshowList :: [ListDeviceProfilesResponse] -> ShowS
show :: ListDeviceProfilesResponse -> String
$cshow :: ListDeviceProfilesResponse -> String
showsPrec :: Int -> ListDeviceProfilesResponse -> ShowS
$cshowsPrec :: Int -> ListDeviceProfilesResponse -> ShowS
Prelude.Show, (forall x.
ListDeviceProfilesResponse -> Rep ListDeviceProfilesResponse x)
-> (forall x.
Rep ListDeviceProfilesResponse x -> ListDeviceProfilesResponse)
-> Generic ListDeviceProfilesResponse
forall x.
Rep ListDeviceProfilesResponse x -> ListDeviceProfilesResponse
forall x.
ListDeviceProfilesResponse -> Rep ListDeviceProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeviceProfilesResponse x -> ListDeviceProfilesResponse
$cfrom :: forall x.
ListDeviceProfilesResponse -> Rep ListDeviceProfilesResponse x
Prelude.Generic)
newListDeviceProfilesResponse ::
Prelude.Int ->
ListDeviceProfilesResponse
newListDeviceProfilesResponse :: Int -> ListDeviceProfilesResponse
newListDeviceProfilesResponse Int
pHttpStatus_ =
ListDeviceProfilesResponse' :: Maybe [DeviceProfile]
-> Maybe Text -> Int -> ListDeviceProfilesResponse
ListDeviceProfilesResponse'
{ $sel:deviceProfileList:ListDeviceProfilesResponse' :: Maybe [DeviceProfile]
deviceProfileList =
Maybe [DeviceProfile]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDeviceProfilesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDeviceProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDeviceProfilesResponse_deviceProfileList :: Lens.Lens' ListDeviceProfilesResponse (Prelude.Maybe [DeviceProfile])
listDeviceProfilesResponse_deviceProfileList :: (Maybe [DeviceProfile] -> f (Maybe [DeviceProfile]))
-> ListDeviceProfilesResponse -> f ListDeviceProfilesResponse
listDeviceProfilesResponse_deviceProfileList = (ListDeviceProfilesResponse -> Maybe [DeviceProfile])
-> (ListDeviceProfilesResponse
-> Maybe [DeviceProfile] -> ListDeviceProfilesResponse)
-> Lens
ListDeviceProfilesResponse
ListDeviceProfilesResponse
(Maybe [DeviceProfile])
(Maybe [DeviceProfile])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceProfilesResponse' {Maybe [DeviceProfile]
deviceProfileList :: Maybe [DeviceProfile]
$sel:deviceProfileList:ListDeviceProfilesResponse' :: ListDeviceProfilesResponse -> Maybe [DeviceProfile]
deviceProfileList} -> Maybe [DeviceProfile]
deviceProfileList) (\s :: ListDeviceProfilesResponse
s@ListDeviceProfilesResponse' {} Maybe [DeviceProfile]
a -> ListDeviceProfilesResponse
s {$sel:deviceProfileList:ListDeviceProfilesResponse' :: Maybe [DeviceProfile]
deviceProfileList = Maybe [DeviceProfile]
a} :: ListDeviceProfilesResponse) ((Maybe [DeviceProfile] -> f (Maybe [DeviceProfile]))
-> ListDeviceProfilesResponse -> f ListDeviceProfilesResponse)
-> ((Maybe [DeviceProfile] -> f (Maybe [DeviceProfile]))
-> Maybe [DeviceProfile] -> f (Maybe [DeviceProfile]))
-> (Maybe [DeviceProfile] -> f (Maybe [DeviceProfile]))
-> ListDeviceProfilesResponse
-> f ListDeviceProfilesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DeviceProfile] [DeviceProfile] [DeviceProfile] [DeviceProfile]
-> Iso
(Maybe [DeviceProfile])
(Maybe [DeviceProfile])
(Maybe [DeviceProfile])
(Maybe [DeviceProfile])
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
[DeviceProfile] [DeviceProfile] [DeviceProfile] [DeviceProfile]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listDeviceProfilesResponse_nextToken :: Lens.Lens' ListDeviceProfilesResponse (Prelude.Maybe Prelude.Text)
listDeviceProfilesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDeviceProfilesResponse -> f ListDeviceProfilesResponse
listDeviceProfilesResponse_nextToken = (ListDeviceProfilesResponse -> Maybe Text)
-> (ListDeviceProfilesResponse
-> Maybe Text -> ListDeviceProfilesResponse)
-> Lens
ListDeviceProfilesResponse
ListDeviceProfilesResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceProfilesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDeviceProfilesResponse' :: ListDeviceProfilesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDeviceProfilesResponse
s@ListDeviceProfilesResponse' {} Maybe Text
a -> ListDeviceProfilesResponse
s {$sel:nextToken:ListDeviceProfilesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDeviceProfilesResponse)
listDeviceProfilesResponse_httpStatus :: Lens.Lens' ListDeviceProfilesResponse Prelude.Int
listDeviceProfilesResponse_httpStatus :: (Int -> f Int)
-> ListDeviceProfilesResponse -> f ListDeviceProfilesResponse
listDeviceProfilesResponse_httpStatus = (ListDeviceProfilesResponse -> Int)
-> (ListDeviceProfilesResponse
-> Int -> ListDeviceProfilesResponse)
-> Lens
ListDeviceProfilesResponse ListDeviceProfilesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeviceProfilesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDeviceProfilesResponse' :: ListDeviceProfilesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDeviceProfilesResponse
s@ListDeviceProfilesResponse' {} Int
a -> ListDeviceProfilesResponse
s {$sel:httpStatus:ListDeviceProfilesResponse' :: Int
httpStatus = Int
a} :: ListDeviceProfilesResponse)
instance Prelude.NFData ListDeviceProfilesResponse