{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoT.ListThingGroups
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- List the thing groups in your account.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListThingGroups>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListThingGroups
  ( -- * Creating a Request
    ListThingGroups (..),
    newListThingGroups,

    -- * Request Lenses
    listThingGroups_maxResults,
    listThingGroups_namePrefixFilter,
    listThingGroups_nextToken,
    listThingGroups_parentGroup,
    listThingGroups_recursive,

    -- * Destructuring the Response
    ListThingGroupsResponse (..),
    newListThingGroupsResponse,

    -- * Response Lenses
    listThingGroupsResponse_nextToken,
    listThingGroupsResponse_thingGroups,
    listThingGroupsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListThingGroups' smart constructor.
data ListThingGroups = ListThingGroups'
  { -- | The maximum number of results to return at one time.
    ListThingGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | A filter that limits the results to those with the specified name
    -- prefix.
    ListThingGroups -> Maybe Text
namePrefixFilter :: Prelude.Maybe Prelude.Text,
    -- | To retrieve the next set of results, the @nextToken@ value from a
    -- previous response; otherwise __null__ to receive the first set of
    -- results.
    ListThingGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A filter that limits the results to those with the specified parent
    -- group.
    ListThingGroups -> Maybe Text
parentGroup :: Prelude.Maybe Prelude.Text,
    -- | If true, return child groups as well.
    ListThingGroups -> Maybe Bool
recursive :: Prelude.Maybe Prelude.Bool
  }
  deriving (ListThingGroups -> ListThingGroups -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'ListThingGroups' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'maxResults', 'listThingGroups_maxResults' - The maximum number of results to return at one time.
--
-- 'namePrefixFilter', 'listThingGroups_namePrefixFilter' - A filter that limits the results to those with the specified name
-- prefix.
--
-- 'nextToken', 'listThingGroups_nextToken' - To retrieve the next set of results, the @nextToken@ value from a
-- previous response; otherwise __null__ to receive the first set of
-- results.
--
-- 'parentGroup', 'listThingGroups_parentGroup' - A filter that limits the results to those with the specified parent
-- group.
--
-- 'recursive', 'listThingGroups_recursive' - If true, return child groups as well.
newListThingGroups ::
  ListThingGroups
newListThingGroups :: ListThingGroups
newListThingGroups =
  ListThingGroups'
    { $sel:maxResults:ListThingGroups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:namePrefixFilter:ListThingGroups' :: Maybe Text
namePrefixFilter = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListThingGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:parentGroup:ListThingGroups' :: Maybe Text
parentGroup = forall a. Maybe a
Prelude.Nothing,
      $sel:recursive:ListThingGroups' :: Maybe Bool
recursive = forall a. Maybe a
Prelude.Nothing
    }

-- | The maximum number of results to return at one time.
listThingGroups_maxResults :: Lens.Lens' ListThingGroups (Prelude.Maybe Prelude.Natural)
listThingGroups_maxResults :: Lens' ListThingGroups (Maybe Natural)
listThingGroups_maxResults = 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)

-- | A filter that limits the results to those with the specified name
-- prefix.
listThingGroups_namePrefixFilter :: Lens.Lens' ListThingGroups (Prelude.Maybe Prelude.Text)
listThingGroups_namePrefixFilter :: Lens' ListThingGroups (Maybe Text)
listThingGroups_namePrefixFilter = 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)

-- | To retrieve the next set of results, the @nextToken@ value from a
-- previous response; otherwise __null__ to receive the first set of
-- results.
listThingGroups_nextToken :: Lens.Lens' ListThingGroups (Prelude.Maybe Prelude.Text)
listThingGroups_nextToken :: Lens' ListThingGroups (Maybe Text)
listThingGroups_nextToken = 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)

-- | A filter that limits the results to those with the specified parent
-- group.
listThingGroups_parentGroup :: Lens.Lens' ListThingGroups (Prelude.Maybe Prelude.Text)
listThingGroups_parentGroup :: Lens' ListThingGroups (Maybe Text)
listThingGroups_parentGroup = 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)

-- | If true, return child groups as well.
listThingGroups_recursive :: Lens.Lens' ListThingGroups (Prelude.Maybe Prelude.Bool)
listThingGroups_recursive :: Lens' ListThingGroups (Maybe Bool)
listThingGroups_recursive = 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)

instance Core.AWSPager ListThingGroups where
  page :: ListThingGroups
-> AWSResponse ListThingGroups -> Maybe ListThingGroups
page ListThingGroups
rq AWSResponse ListThingGroups
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListThingGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListThingGroupsResponse (Maybe Text)
listThingGroupsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListThingGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListThingGroupsResponse (Maybe [GroupNameAndArn])
listThingGroupsResponse_thingGroups
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListThingGroups
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListThingGroups (Maybe Text)
listThingGroups_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListThingGroups
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListThingGroupsResponse (Maybe Text)
listThingGroupsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListThingGroups where
  type
    AWSResponse ListThingGroups =
      ListThingGroupsResponse
  request :: (Service -> Service) -> ListThingGroups -> Request ListThingGroups
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 ListThingGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListThingGroups)))
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 [GroupNameAndArn] -> Int -> ListThingGroupsResponse
ListThingGroupsResponse'
            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
"thingGroups" 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 ListThingGroups where
  hashWithSalt :: Int -> ListThingGroups -> Int
hashWithSalt Int
_salt ListThingGroups' {Maybe Bool
Maybe Natural
Maybe Text
recursive :: Maybe Bool
parentGroup :: Maybe Text
nextToken :: Maybe Text
namePrefixFilter :: Maybe Text
maxResults :: Maybe Natural
$sel:recursive:ListThingGroups' :: ListThingGroups -> Maybe Bool
$sel:parentGroup:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:nextToken:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:namePrefixFilter:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:maxResults:ListThingGroups' :: ListThingGroups -> 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
namePrefixFilter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parentGroup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
recursive

instance Prelude.NFData ListThingGroups where
  rnf :: ListThingGroups -> ()
rnf ListThingGroups' {Maybe Bool
Maybe Natural
Maybe Text
recursive :: Maybe Bool
parentGroup :: Maybe Text
nextToken :: Maybe Text
namePrefixFilter :: Maybe Text
maxResults :: Maybe Natural
$sel:recursive:ListThingGroups' :: ListThingGroups -> Maybe Bool
$sel:parentGroup:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:nextToken:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:namePrefixFilter:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:maxResults:ListThingGroups' :: ListThingGroups -> 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
namePrefixFilter
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
parentGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
recursive

instance Data.ToHeaders ListThingGroups where
  toHeaders :: ListThingGroups -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath ListThingGroups where
  toPath :: ListThingGroups -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/thing-groups"

instance Data.ToQuery ListThingGroups where
  toQuery :: ListThingGroups -> QueryString
toQuery ListThingGroups' {Maybe Bool
Maybe Natural
Maybe Text
recursive :: Maybe Bool
parentGroup :: Maybe Text
nextToken :: Maybe Text
namePrefixFilter :: Maybe Text
maxResults :: Maybe Natural
$sel:recursive:ListThingGroups' :: ListThingGroups -> Maybe Bool
$sel:parentGroup:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:nextToken:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:namePrefixFilter:ListThingGroups' :: ListThingGroups -> Maybe Text
$sel:maxResults:ListThingGroups' :: ListThingGroups -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"namePrefixFilter" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
namePrefixFilter,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"parentGroup" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
parentGroup,
        ByteString
"recursive" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
recursive
      ]

-- | /See:/ 'newListThingGroupsResponse' smart constructor.
data ListThingGroupsResponse = ListThingGroupsResponse'
  { -- | The token to use to get the next set of results. Will not be returned if
    -- operation has returned all results.
    ListThingGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The thing groups.
    ListThingGroupsResponse -> Maybe [GroupNameAndArn]
thingGroups :: Prelude.Maybe [GroupNameAndArn],
    -- | The response's http status code.
    ListThingGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListThingGroupsResponse -> ListThingGroupsResponse -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'ListThingGroupsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listThingGroupsResponse_nextToken' - The token to use to get the next set of results. Will not be returned if
-- operation has returned all results.
--
-- 'thingGroups', 'listThingGroupsResponse_thingGroups' - The thing groups.
--
-- 'httpStatus', 'listThingGroupsResponse_httpStatus' - The response's http status code.
newListThingGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListThingGroupsResponse
newListThingGroupsResponse :: Int -> ListThingGroupsResponse
newListThingGroupsResponse Int
pHttpStatus_ =
  ListThingGroupsResponse'
    { $sel:nextToken:ListThingGroupsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:thingGroups:ListThingGroupsResponse' :: Maybe [GroupNameAndArn]
thingGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListThingGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to use to get the next set of results. Will not be returned if
-- operation has returned all results.
listThingGroupsResponse_nextToken :: Lens.Lens' ListThingGroupsResponse (Prelude.Maybe Prelude.Text)
listThingGroupsResponse_nextToken :: Lens' ListThingGroupsResponse (Maybe Text)
listThingGroupsResponse_nextToken = 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)

-- | The thing groups.
listThingGroupsResponse_thingGroups :: Lens.Lens' ListThingGroupsResponse (Prelude.Maybe [GroupNameAndArn])
listThingGroupsResponse_thingGroups :: Lens' ListThingGroupsResponse (Maybe [GroupNameAndArn])
listThingGroupsResponse_thingGroups = 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) 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

-- | The response's http status code.
listThingGroupsResponse_httpStatus :: Lens.Lens' ListThingGroupsResponse Prelude.Int
listThingGroupsResponse_httpStatus :: Lens' ListThingGroupsResponse Int
listThingGroupsResponse_httpStatus = 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 where
  rnf :: ListThingGroupsResponse -> ()
rnf ListThingGroupsResponse' {Int
Maybe [GroupNameAndArn]
Maybe Text
httpStatus :: Int
thingGroups :: Maybe [GroupNameAndArn]
nextToken :: Maybe Text
$sel:httpStatus:ListThingGroupsResponse' :: ListThingGroupsResponse -> Int
$sel:thingGroups:ListThingGroupsResponse' :: ListThingGroupsResponse -> Maybe [GroupNameAndArn]
$sel:nextToken:ListThingGroupsResponse' :: ListThingGroupsResponse -> 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 [GroupNameAndArn]
thingGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus