{-# 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_maxResults,
listServiceProfiles_nextToken,
ListServiceProfilesResponse (..),
newListServiceProfilesResponse,
listServiceProfilesResponse_nextToken,
listServiceProfilesResponse_serviceProfileList,
listServiceProfilesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTWireless.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListServiceProfiles = ListServiceProfiles'
{
ListServiceProfiles -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListServiceProfiles -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListServiceProfiles -> ListServiceProfiles -> Bool
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]
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
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. 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'
{ $sel:maxResults:ListServiceProfiles' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListServiceProfiles' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listServiceProfiles_maxResults :: Lens.Lens' ListServiceProfiles (Prelude.Maybe Prelude.Natural)
listServiceProfiles_maxResults :: Lens' ListServiceProfiles (Maybe Natural)
listServiceProfiles_maxResults = 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)
listServiceProfiles_nextToken :: Lens.Lens' ListServiceProfiles (Prelude.Maybe Prelude.Text)
listServiceProfiles_nextToken :: Lens' ListServiceProfiles (Maybe Text)
listServiceProfiles_nextToken = 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)
instance Core.AWSRequest ListServiceProfiles where
type
AWSResponse ListServiceProfiles =
ListServiceProfilesResponse
request :: (Service -> Service)
-> ListServiceProfiles -> Request ListServiceProfiles
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListServiceProfiles
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListServiceProfiles)))
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 [ServiceProfile] -> Int -> ListServiceProfilesResponse
ListServiceProfilesResponse'
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
"ServiceProfileList"
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 ListServiceProfiles where
hashWithSalt :: Int -> ListServiceProfiles -> Int
hashWithSalt Int
_salt ListServiceProfiles' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListServiceProfiles' :: ListServiceProfiles -> Maybe Text
$sel:maxResults:ListServiceProfiles' :: ListServiceProfiles -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListServiceProfiles where
rnf :: ListServiceProfiles -> ()
rnf ListServiceProfiles' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListServiceProfiles' :: ListServiceProfiles -> Maybe Text
$sel:maxResults:ListServiceProfiles' :: ListServiceProfiles -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListServiceProfiles where
toHeaders :: ListServiceProfiles -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListServiceProfiles where
toPath :: ListServiceProfiles -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/service-profiles"
instance Data.ToQuery ListServiceProfiles where
toQuery :: ListServiceProfiles -> QueryString
toQuery ListServiceProfiles' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListServiceProfiles' :: ListServiceProfiles -> Maybe Text
$sel:maxResults:ListServiceProfiles' :: ListServiceProfiles -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListServiceProfilesResponse = ListServiceProfilesResponse'
{
ListServiceProfilesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListServiceProfilesResponse -> Maybe [ServiceProfile]
serviceProfileList :: Prelude.Maybe [ServiceProfile],
ListServiceProfilesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListServiceProfilesResponse -> ListServiceProfilesResponse -> Bool
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]
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
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.
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'
{ $sel:nextToken:ListServiceProfilesResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:serviceProfileList:ListServiceProfilesResponse' :: Maybe [ServiceProfile]
serviceProfileList = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListServiceProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listServiceProfilesResponse_nextToken :: Lens.Lens' ListServiceProfilesResponse (Prelude.Maybe Prelude.Text)
listServiceProfilesResponse_nextToken :: Lens' ListServiceProfilesResponse (Maybe Text)
listServiceProfilesResponse_nextToken = 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_serviceProfileList :: Lens.Lens' ListServiceProfilesResponse (Prelude.Maybe [ServiceProfile])
listServiceProfilesResponse_serviceProfileList :: Lens' ListServiceProfilesResponse (Maybe [ServiceProfile])
listServiceProfilesResponse_serviceProfileList = 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) 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
listServiceProfilesResponse_httpStatus :: Lens.Lens' ListServiceProfilesResponse Prelude.Int
listServiceProfilesResponse_httpStatus :: Lens' ListServiceProfilesResponse Int
listServiceProfilesResponse_httpStatus = 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 where
rnf :: ListServiceProfilesResponse -> ()
rnf ListServiceProfilesResponse' {Int
Maybe [ServiceProfile]
Maybe Text
httpStatus :: Int
serviceProfileList :: Maybe [ServiceProfile]
nextToken :: Maybe Text
$sel:httpStatus:ListServiceProfilesResponse' :: ListServiceProfilesResponse -> Int
$sel:serviceProfileList:ListServiceProfilesResponse' :: ListServiceProfilesResponse -> Maybe [ServiceProfile]
$sel:nextToken:ListServiceProfilesResponse' :: ListServiceProfilesResponse -> 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 [ServiceProfile]
serviceProfileList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus