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