{-# 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.IoT.ListThingGroups
(
ListThingGroups (..),
newListThingGroups,
listThingGroups_namePrefixFilter,
listThingGroups_parentGroup,
listThingGroups_nextToken,
listThingGroups_recursive,
listThingGroups_maxResults,
ListThingGroupsResponse (..),
newListThingGroupsResponse,
listThingGroupsResponse_thingGroups,
listThingGroupsResponse_nextToken,
listThingGroupsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.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 ListThingGroups = ListThingGroups'
{
ListThingGroups -> Maybe Text
namePrefixFilter :: Prelude.Maybe Prelude.Text,
ListThingGroups -> Maybe Text
parentGroup :: Prelude.Maybe Prelude.Text,
ListThingGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListThingGroups -> Maybe Bool
recursive :: Prelude.Maybe Prelude.Bool,
ListThingGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListThingGroups -> ListThingGroups -> Bool
(ListThingGroups -> ListThingGroups -> Bool)
-> (ListThingGroups -> ListThingGroups -> Bool)
-> Eq ListThingGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingGroups -> ListThingGroups -> Bool
$c/= :: ListThingGroups -> ListThingGroups -> Bool
== :: ListThingGroups -> ListThingGroups -> Bool
$c== :: ListThingGroups -> ListThingGroups -> Bool
Prelude.Eq, ReadPrec [ListThingGroups]
ReadPrec ListThingGroups
Int -> ReadS ListThingGroups
ReadS [ListThingGroups]
(Int -> ReadS ListThingGroups)
-> ReadS [ListThingGroups]
-> ReadPrec ListThingGroups
-> ReadPrec [ListThingGroups]
-> Read ListThingGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingGroups]
$creadListPrec :: ReadPrec [ListThingGroups]
readPrec :: ReadPrec ListThingGroups
$creadPrec :: ReadPrec ListThingGroups
readList :: ReadS [ListThingGroups]
$creadList :: ReadS [ListThingGroups]
readsPrec :: Int -> ReadS ListThingGroups
$creadsPrec :: Int -> ReadS ListThingGroups
Prelude.Read, Int -> ListThingGroups -> ShowS
[ListThingGroups] -> ShowS
ListThingGroups -> String
(Int -> ListThingGroups -> ShowS)
-> (ListThingGroups -> String)
-> ([ListThingGroups] -> ShowS)
-> Show ListThingGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingGroups] -> ShowS
$cshowList :: [ListThingGroups] -> ShowS
show :: ListThingGroups -> String
$cshow :: ListThingGroups -> String
showsPrec :: Int -> ListThingGroups -> ShowS
$cshowsPrec :: Int -> ListThingGroups -> ShowS
Prelude.Show, (forall x. ListThingGroups -> Rep ListThingGroups x)
-> (forall x. Rep ListThingGroups x -> ListThingGroups)
-> Generic ListThingGroups
forall x. Rep ListThingGroups x -> ListThingGroups
forall x. ListThingGroups -> Rep ListThingGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListThingGroups x -> ListThingGroups
$cfrom :: forall x. ListThingGroups -> Rep ListThingGroups x
Prelude.Generic)
newListThingGroups ::
ListThingGroups
newListThingGroups :: ListThingGroups
newListThingGroups =
ListThingGroups' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Natural
-> ListThingGroups
ListThingGroups'
{ $sel:namePrefixFilter:ListThingGroups' :: Maybe Text
namePrefixFilter =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parentGroup:ListThingGroups' :: Maybe Text
parentGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListThingGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:recursive:ListThingGroups' :: Maybe Bool
recursive = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListThingGroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listThingGroups_namePrefixFilter :: Lens.Lens' ListThingGroups (Prelude.Maybe Prelude.Text)
listThingGroups_namePrefixFilter :: (Maybe Text -> f (Maybe Text))
-> ListThingGroups -> f ListThingGroups
listThingGroups_namePrefixFilter = (ListThingGroups -> Maybe Text)
-> (ListThingGroups -> Maybe Text -> ListThingGroups)
-> Lens ListThingGroups ListThingGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroups' {Maybe Text
namePrefixFilter :: Maybe Text
$sel:namePrefixFilter:ListThingGroups' :: ListThingGroups -> Maybe Text
namePrefixFilter} -> Maybe Text
namePrefixFilter) (\s :: ListThingGroups
s@ListThingGroups' {} Maybe Text
a -> ListThingGroups
s {$sel:namePrefixFilter:ListThingGroups' :: Maybe Text
namePrefixFilter = Maybe Text
a} :: ListThingGroups)
listThingGroups_parentGroup :: Lens.Lens' ListThingGroups (Prelude.Maybe Prelude.Text)
listThingGroups_parentGroup :: (Maybe Text -> f (Maybe Text))
-> ListThingGroups -> f ListThingGroups
listThingGroups_parentGroup = (ListThingGroups -> Maybe Text)
-> (ListThingGroups -> Maybe Text -> ListThingGroups)
-> Lens ListThingGroups ListThingGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroups' {Maybe Text
parentGroup :: Maybe Text
$sel:parentGroup:ListThingGroups' :: ListThingGroups -> Maybe Text
parentGroup} -> Maybe Text
parentGroup) (\s :: ListThingGroups
s@ListThingGroups' {} Maybe Text
a -> ListThingGroups
s {$sel:parentGroup:ListThingGroups' :: Maybe Text
parentGroup = Maybe Text
a} :: ListThingGroups)
listThingGroups_nextToken :: Lens.Lens' ListThingGroups (Prelude.Maybe Prelude.Text)
listThingGroups_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListThingGroups -> f ListThingGroups
listThingGroups_nextToken = (ListThingGroups -> Maybe Text)
-> (ListThingGroups -> Maybe Text -> ListThingGroups)
-> Lens ListThingGroups ListThingGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThingGroups' :: ListThingGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThingGroups
s@ListThingGroups' {} Maybe Text
a -> ListThingGroups
s {$sel:nextToken:ListThingGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListThingGroups)
listThingGroups_recursive :: Lens.Lens' ListThingGroups (Prelude.Maybe Prelude.Bool)
listThingGroups_recursive :: (Maybe Bool -> f (Maybe Bool))
-> ListThingGroups -> f ListThingGroups
listThingGroups_recursive = (ListThingGroups -> Maybe Bool)
-> (ListThingGroups -> Maybe Bool -> ListThingGroups)
-> Lens ListThingGroups ListThingGroups (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroups' {Maybe Bool
recursive :: Maybe Bool
$sel:recursive:ListThingGroups' :: ListThingGroups -> Maybe Bool
recursive} -> Maybe Bool
recursive) (\s :: ListThingGroups
s@ListThingGroups' {} Maybe Bool
a -> ListThingGroups
s {$sel:recursive:ListThingGroups' :: Maybe Bool
recursive = Maybe Bool
a} :: ListThingGroups)
listThingGroups_maxResults :: Lens.Lens' ListThingGroups (Prelude.Maybe Prelude.Natural)
listThingGroups_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListThingGroups -> f ListThingGroups
listThingGroups_maxResults = (ListThingGroups -> Maybe Natural)
-> (ListThingGroups -> Maybe Natural -> ListThingGroups)
-> Lens
ListThingGroups ListThingGroups (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListThingGroups' :: ListThingGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListThingGroups
s@ListThingGroups' {} Maybe Natural
a -> ListThingGroups
s {$sel:maxResults:ListThingGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListThingGroups)
instance Core.AWSPager ListThingGroups where
page :: ListThingGroups
-> AWSResponse ListThingGroups -> Maybe ListThingGroups
page ListThingGroups
rq AWSResponse ListThingGroups
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListThingGroups
ListThingGroupsResponse
rs
ListThingGroupsResponse
-> Getting (First Text) ListThingGroupsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListThingGroupsResponse
-> Const (First Text) ListThingGroupsResponse
Lens' ListThingGroupsResponse (Maybe Text)
listThingGroupsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListThingGroupsResponse
-> Const (First Text) ListThingGroupsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListThingGroupsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListThingGroups
forall a. Maybe a
Prelude.Nothing
| Maybe [GroupNameAndArn] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListThingGroups
ListThingGroupsResponse
rs
ListThingGroupsResponse
-> Getting
(First [GroupNameAndArn]) ListThingGroupsResponse [GroupNameAndArn]
-> Maybe [GroupNameAndArn]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [GroupNameAndArn]
-> Const (First [GroupNameAndArn]) (Maybe [GroupNameAndArn]))
-> ListThingGroupsResponse
-> Const (First [GroupNameAndArn]) ListThingGroupsResponse
Lens' ListThingGroupsResponse (Maybe [GroupNameAndArn])
listThingGroupsResponse_thingGroups
((Maybe [GroupNameAndArn]
-> Const (First [GroupNameAndArn]) (Maybe [GroupNameAndArn]))
-> ListThingGroupsResponse
-> Const (First [GroupNameAndArn]) ListThingGroupsResponse)
-> (([GroupNameAndArn]
-> Const (First [GroupNameAndArn]) [GroupNameAndArn])
-> Maybe [GroupNameAndArn]
-> Const (First [GroupNameAndArn]) (Maybe [GroupNameAndArn]))
-> Getting
(First [GroupNameAndArn]) ListThingGroupsResponse [GroupNameAndArn]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([GroupNameAndArn]
-> Const (First [GroupNameAndArn]) [GroupNameAndArn])
-> Maybe [GroupNameAndArn]
-> Const (First [GroupNameAndArn]) (Maybe [GroupNameAndArn])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListThingGroups
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListThingGroups -> Maybe ListThingGroups
forall a. a -> Maybe a
Prelude.Just (ListThingGroups -> Maybe ListThingGroups)
-> ListThingGroups -> Maybe ListThingGroups
forall a b. (a -> b) -> a -> b
Prelude.$
ListThingGroups
rq
ListThingGroups
-> (ListThingGroups -> ListThingGroups) -> ListThingGroups
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListThingGroups -> Identity ListThingGroups
Lens ListThingGroups ListThingGroups (Maybe Text) (Maybe Text)
listThingGroups_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListThingGroups -> Identity ListThingGroups)
-> Maybe Text -> ListThingGroups -> ListThingGroups
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListThingGroups
ListThingGroupsResponse
rs
ListThingGroupsResponse
-> Getting (First Text) ListThingGroupsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListThingGroupsResponse
-> Const (First Text) ListThingGroupsResponse
Lens' ListThingGroupsResponse (Maybe Text)
listThingGroupsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListThingGroupsResponse
-> Const (First Text) ListThingGroupsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListThingGroupsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListThingGroups where
type
AWSResponse ListThingGroups =
ListThingGroupsResponse
request :: ListThingGroups -> Request ListThingGroups
request = Service -> ListThingGroups -> Request ListThingGroups
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListThingGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListThingGroups)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListThingGroups))
-> Logger
-> Service
-> Proxy ListThingGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListThingGroups)))
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 [GroupNameAndArn]
-> Maybe Text -> Int -> ListThingGroupsResponse
ListThingGroupsResponse'
(Maybe [GroupNameAndArn]
-> Maybe Text -> Int -> ListThingGroupsResponse)
-> Either String (Maybe [GroupNameAndArn])
-> Either String (Maybe Text -> Int -> ListThingGroupsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [GroupNameAndArn]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"thingGroups" Either String (Maybe (Maybe [GroupNameAndArn]))
-> Maybe [GroupNameAndArn]
-> Either String (Maybe [GroupNameAndArn])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [GroupNameAndArn]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> ListThingGroupsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListThingGroupsResponse)
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 -> ListThingGroupsResponse)
-> Either String Int -> Either String ListThingGroupsResponse
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 ListThingGroups
instance Prelude.NFData ListThingGroups
instance Core.ToHeaders ListThingGroups where
toHeaders :: ListThingGroups -> ResponseHeaders
toHeaders = ResponseHeaders -> ListThingGroups -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListThingGroups where
toPath :: ListThingGroups -> ByteString
toPath = ByteString -> ListThingGroups -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/thing-groups"
instance Core.ToQuery ListThingGroups where
toQuery :: ListThingGroups -> QueryString
toQuery ListThingGroups' {Maybe Bool
Maybe Natural
Maybe Text
maxResults :: Maybe Natural
recursive :: Maybe Bool
nextToken :: Maybe Text
parentGroup :: Maybe Text
namePrefixFilter :: Maybe Text
$sel:maxResults:ListThingGroups' :: ListThingGroups -> Maybe Natural
$sel:recursive:ListThingGroups' :: ListThingGroups -> Maybe Bool
$sel:nextToken:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:parentGroup:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:namePrefixFilter:ListThingGroups' :: ListThingGroups -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"namePrefixFilter" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
namePrefixFilter,
ByteString
"parentGroup" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
parentGroup,
ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"recursive" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
recursive,
ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
]
data ListThingGroupsResponse = ListThingGroupsResponse'
{
ListThingGroupsResponse -> Maybe [GroupNameAndArn]
thingGroups :: Prelude.Maybe [GroupNameAndArn],
ListThingGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListThingGroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListThingGroupsResponse -> ListThingGroupsResponse -> Bool
(ListThingGroupsResponse -> ListThingGroupsResponse -> Bool)
-> (ListThingGroupsResponse -> ListThingGroupsResponse -> Bool)
-> Eq ListThingGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingGroupsResponse -> ListThingGroupsResponse -> Bool
$c/= :: ListThingGroupsResponse -> ListThingGroupsResponse -> Bool
== :: ListThingGroupsResponse -> ListThingGroupsResponse -> Bool
$c== :: ListThingGroupsResponse -> ListThingGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListThingGroupsResponse]
ReadPrec ListThingGroupsResponse
Int -> ReadS ListThingGroupsResponse
ReadS [ListThingGroupsResponse]
(Int -> ReadS ListThingGroupsResponse)
-> ReadS [ListThingGroupsResponse]
-> ReadPrec ListThingGroupsResponse
-> ReadPrec [ListThingGroupsResponse]
-> Read ListThingGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingGroupsResponse]
$creadListPrec :: ReadPrec [ListThingGroupsResponse]
readPrec :: ReadPrec ListThingGroupsResponse
$creadPrec :: ReadPrec ListThingGroupsResponse
readList :: ReadS [ListThingGroupsResponse]
$creadList :: ReadS [ListThingGroupsResponse]
readsPrec :: Int -> ReadS ListThingGroupsResponse
$creadsPrec :: Int -> ReadS ListThingGroupsResponse
Prelude.Read, Int -> ListThingGroupsResponse -> ShowS
[ListThingGroupsResponse] -> ShowS
ListThingGroupsResponse -> String
(Int -> ListThingGroupsResponse -> ShowS)
-> (ListThingGroupsResponse -> String)
-> ([ListThingGroupsResponse] -> ShowS)
-> Show ListThingGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingGroupsResponse] -> ShowS
$cshowList :: [ListThingGroupsResponse] -> ShowS
show :: ListThingGroupsResponse -> String
$cshow :: ListThingGroupsResponse -> String
showsPrec :: Int -> ListThingGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListThingGroupsResponse -> ShowS
Prelude.Show, (forall x.
ListThingGroupsResponse -> Rep ListThingGroupsResponse x)
-> (forall x.
Rep ListThingGroupsResponse x -> ListThingGroupsResponse)
-> Generic ListThingGroupsResponse
forall x. Rep ListThingGroupsResponse x -> ListThingGroupsResponse
forall x. ListThingGroupsResponse -> Rep ListThingGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListThingGroupsResponse x -> ListThingGroupsResponse
$cfrom :: forall x. ListThingGroupsResponse -> Rep ListThingGroupsResponse x
Prelude.Generic)
newListThingGroupsResponse ::
Prelude.Int ->
ListThingGroupsResponse
newListThingGroupsResponse :: Int -> ListThingGroupsResponse
newListThingGroupsResponse Int
pHttpStatus_ =
ListThingGroupsResponse' :: Maybe [GroupNameAndArn]
-> Maybe Text -> Int -> ListThingGroupsResponse
ListThingGroupsResponse'
{ $sel:thingGroups:ListThingGroupsResponse' :: Maybe [GroupNameAndArn]
thingGroups =
Maybe [GroupNameAndArn]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListThingGroupsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListThingGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listThingGroupsResponse_thingGroups :: Lens.Lens' ListThingGroupsResponse (Prelude.Maybe [GroupNameAndArn])
listThingGroupsResponse_thingGroups :: (Maybe [GroupNameAndArn] -> f (Maybe [GroupNameAndArn]))
-> ListThingGroupsResponse -> f ListThingGroupsResponse
listThingGroupsResponse_thingGroups = (ListThingGroupsResponse -> Maybe [GroupNameAndArn])
-> (ListThingGroupsResponse
-> Maybe [GroupNameAndArn] -> ListThingGroupsResponse)
-> Lens' ListThingGroupsResponse (Maybe [GroupNameAndArn])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroupsResponse' {Maybe [GroupNameAndArn]
thingGroups :: Maybe [GroupNameAndArn]
$sel:thingGroups:ListThingGroupsResponse' :: ListThingGroupsResponse -> Maybe [GroupNameAndArn]
thingGroups} -> Maybe [GroupNameAndArn]
thingGroups) (\s :: ListThingGroupsResponse
s@ListThingGroupsResponse' {} Maybe [GroupNameAndArn]
a -> ListThingGroupsResponse
s {$sel:thingGroups:ListThingGroupsResponse' :: Maybe [GroupNameAndArn]
thingGroups = Maybe [GroupNameAndArn]
a} :: ListThingGroupsResponse) ((Maybe [GroupNameAndArn] -> f (Maybe [GroupNameAndArn]))
-> ListThingGroupsResponse -> f ListThingGroupsResponse)
-> ((Maybe [GroupNameAndArn] -> f (Maybe [GroupNameAndArn]))
-> Maybe [GroupNameAndArn] -> f (Maybe [GroupNameAndArn]))
-> (Maybe [GroupNameAndArn] -> f (Maybe [GroupNameAndArn]))
-> ListThingGroupsResponse
-> f ListThingGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[GroupNameAndArn]
[GroupNameAndArn]
[GroupNameAndArn]
[GroupNameAndArn]
-> Iso
(Maybe [GroupNameAndArn])
(Maybe [GroupNameAndArn])
(Maybe [GroupNameAndArn])
(Maybe [GroupNameAndArn])
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
[GroupNameAndArn]
[GroupNameAndArn]
[GroupNameAndArn]
[GroupNameAndArn]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listThingGroupsResponse_nextToken :: Lens.Lens' ListThingGroupsResponse (Prelude.Maybe Prelude.Text)
listThingGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListThingGroupsResponse -> f ListThingGroupsResponse
listThingGroupsResponse_nextToken = (ListThingGroupsResponse -> Maybe Text)
-> (ListThingGroupsResponse
-> Maybe Text -> ListThingGroupsResponse)
-> Lens' ListThingGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThingGroupsResponse' :: ListThingGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThingGroupsResponse
s@ListThingGroupsResponse' {} Maybe Text
a -> ListThingGroupsResponse
s {$sel:nextToken:ListThingGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListThingGroupsResponse)
listThingGroupsResponse_httpStatus :: Lens.Lens' ListThingGroupsResponse Prelude.Int
listThingGroupsResponse_httpStatus :: (Int -> f Int)
-> ListThingGroupsResponse -> f ListThingGroupsResponse
listThingGroupsResponse_httpStatus = (ListThingGroupsResponse -> Int)
-> (ListThingGroupsResponse -> Int -> ListThingGroupsResponse)
-> Lens ListThingGroupsResponse ListThingGroupsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListThingGroupsResponse' :: ListThingGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListThingGroupsResponse
s@ListThingGroupsResponse' {} Int
a -> ListThingGroupsResponse
s {$sel:httpStatus:ListThingGroupsResponse' :: Int
httpStatus = Int
a} :: ListThingGroupsResponse)
instance Prelude.NFData ListThingGroupsResponse