{-# 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.ListThingGroupsForThing
-- 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 to which the specified thing belongs.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListThingGroupsForThing>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListThingGroupsForThing
  ( -- * Creating a Request
    ListThingGroupsForThing (..),
    newListThingGroupsForThing,

    -- * Request Lenses
    listThingGroupsForThing_maxResults,
    listThingGroupsForThing_nextToken,
    listThingGroupsForThing_thingName,

    -- * Destructuring the Response
    ListThingGroupsForThingResponse (..),
    newListThingGroupsForThingResponse,

    -- * Response Lenses
    listThingGroupsForThingResponse_nextToken,
    listThingGroupsForThingResponse_thingGroups,
    listThingGroupsForThingResponse_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:/ 'newListThingGroupsForThing' smart constructor.
data ListThingGroupsForThing = ListThingGroupsForThing'
  { -- | The maximum number of results to return at one time.
    ListThingGroupsForThing -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | To retrieve the next set of results, the @nextToken@ value from a
    -- previous response; otherwise __null__ to receive the first set of
    -- results.
    ListThingGroupsForThing -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The thing name.
    ListThingGroupsForThing -> Text
thingName :: Prelude.Text
  }
  deriving (ListThingGroupsForThing -> ListThingGroupsForThing -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingGroupsForThing -> ListThingGroupsForThing -> Bool
$c/= :: ListThingGroupsForThing -> ListThingGroupsForThing -> Bool
== :: ListThingGroupsForThing -> ListThingGroupsForThing -> Bool
$c== :: ListThingGroupsForThing -> ListThingGroupsForThing -> Bool
Prelude.Eq, ReadPrec [ListThingGroupsForThing]
ReadPrec ListThingGroupsForThing
Int -> ReadS ListThingGroupsForThing
ReadS [ListThingGroupsForThing]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingGroupsForThing]
$creadListPrec :: ReadPrec [ListThingGroupsForThing]
readPrec :: ReadPrec ListThingGroupsForThing
$creadPrec :: ReadPrec ListThingGroupsForThing
readList :: ReadS [ListThingGroupsForThing]
$creadList :: ReadS [ListThingGroupsForThing]
readsPrec :: Int -> ReadS ListThingGroupsForThing
$creadsPrec :: Int -> ReadS ListThingGroupsForThing
Prelude.Read, Int -> ListThingGroupsForThing -> ShowS
[ListThingGroupsForThing] -> ShowS
ListThingGroupsForThing -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingGroupsForThing] -> ShowS
$cshowList :: [ListThingGroupsForThing] -> ShowS
show :: ListThingGroupsForThing -> String
$cshow :: ListThingGroupsForThing -> String
showsPrec :: Int -> ListThingGroupsForThing -> ShowS
$cshowsPrec :: Int -> ListThingGroupsForThing -> ShowS
Prelude.Show, forall x. Rep ListThingGroupsForThing x -> ListThingGroupsForThing
forall x. ListThingGroupsForThing -> Rep ListThingGroupsForThing x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListThingGroupsForThing x -> ListThingGroupsForThing
$cfrom :: forall x. ListThingGroupsForThing -> Rep ListThingGroupsForThing x
Prelude.Generic)

-- |
-- Create a value of 'ListThingGroupsForThing' 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', 'listThingGroupsForThing_maxResults' - The maximum number of results to return at one time.
--
-- 'nextToken', 'listThingGroupsForThing_nextToken' - To retrieve the next set of results, the @nextToken@ value from a
-- previous response; otherwise __null__ to receive the first set of
-- results.
--
-- 'thingName', 'listThingGroupsForThing_thingName' - The thing name.
newListThingGroupsForThing ::
  -- | 'thingName'
  Prelude.Text ->
  ListThingGroupsForThing
newListThingGroupsForThing :: Text -> ListThingGroupsForThing
newListThingGroupsForThing Text
pThingName_ =
  ListThingGroupsForThing'
    { $sel:maxResults:ListThingGroupsForThing' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListThingGroupsForThing' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:thingName:ListThingGroupsForThing' :: Text
thingName = Text
pThingName_
    }

-- | The maximum number of results to return at one time.
listThingGroupsForThing_maxResults :: Lens.Lens' ListThingGroupsForThing (Prelude.Maybe Prelude.Natural)
listThingGroupsForThing_maxResults :: Lens' ListThingGroupsForThing (Maybe Natural)
listThingGroupsForThing_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroupsForThing' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListThingGroupsForThing' :: ListThingGroupsForThing -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListThingGroupsForThing
s@ListThingGroupsForThing' {} Maybe Natural
a -> ListThingGroupsForThing
s {$sel:maxResults:ListThingGroupsForThing' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListThingGroupsForThing)

-- | To retrieve the next set of results, the @nextToken@ value from a
-- previous response; otherwise __null__ to receive the first set of
-- results.
listThingGroupsForThing_nextToken :: Lens.Lens' ListThingGroupsForThing (Prelude.Maybe Prelude.Text)
listThingGroupsForThing_nextToken :: Lens' ListThingGroupsForThing (Maybe Text)
listThingGroupsForThing_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroupsForThing' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThingGroupsForThing' :: ListThingGroupsForThing -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThingGroupsForThing
s@ListThingGroupsForThing' {} Maybe Text
a -> ListThingGroupsForThing
s {$sel:nextToken:ListThingGroupsForThing' :: Maybe Text
nextToken = Maybe Text
a} :: ListThingGroupsForThing)

-- | The thing name.
listThingGroupsForThing_thingName :: Lens.Lens' ListThingGroupsForThing Prelude.Text
listThingGroupsForThing_thingName :: Lens' ListThingGroupsForThing Text
listThingGroupsForThing_thingName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroupsForThing' {Text
thingName :: Text
$sel:thingName:ListThingGroupsForThing' :: ListThingGroupsForThing -> Text
thingName} -> Text
thingName) (\s :: ListThingGroupsForThing
s@ListThingGroupsForThing' {} Text
a -> ListThingGroupsForThing
s {$sel:thingName:ListThingGroupsForThing' :: Text
thingName = Text
a} :: ListThingGroupsForThing)

instance Core.AWSPager ListThingGroupsForThing where
  page :: ListThingGroupsForThing
-> AWSResponse ListThingGroupsForThing
-> Maybe ListThingGroupsForThing
page ListThingGroupsForThing
rq AWSResponse ListThingGroupsForThing
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListThingGroupsForThing
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListThingGroupsForThingResponse (Maybe Text)
listThingGroupsForThingResponse_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 ListThingGroupsForThing
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListThingGroupsForThingResponse (Maybe [GroupNameAndArn])
listThingGroupsForThingResponse_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.$ ListThingGroupsForThing
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListThingGroupsForThing (Maybe Text)
listThingGroupsForThing_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListThingGroupsForThing
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListThingGroupsForThingResponse (Maybe Text)
listThingGroupsForThingResponse_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 ListThingGroupsForThing where
  type
    AWSResponse ListThingGroupsForThing =
      ListThingGroupsForThingResponse
  request :: (Service -> Service)
-> ListThingGroupsForThing -> Request ListThingGroupsForThing
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 ListThingGroupsForThing
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListThingGroupsForThing)))
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
-> ListThingGroupsForThingResponse
ListThingGroupsForThingResponse'
            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 ListThingGroupsForThing where
  hashWithSalt :: Int -> ListThingGroupsForThing -> Int
hashWithSalt Int
_salt ListThingGroupsForThing' {Maybe Natural
Maybe Text
Text
thingName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:thingName:ListThingGroupsForThing' :: ListThingGroupsForThing -> Text
$sel:nextToken:ListThingGroupsForThing' :: ListThingGroupsForThing -> Maybe Text
$sel:maxResults:ListThingGroupsForThing' :: ListThingGroupsForThing -> 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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
thingName

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

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

instance Data.ToPath ListThingGroupsForThing where
  toPath :: ListThingGroupsForThing -> ByteString
toPath ListThingGroupsForThing' {Maybe Natural
Maybe Text
Text
thingName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:thingName:ListThingGroupsForThing' :: ListThingGroupsForThing -> Text
$sel:nextToken:ListThingGroupsForThing' :: ListThingGroupsForThing -> Maybe Text
$sel:maxResults:ListThingGroupsForThing' :: ListThingGroupsForThing -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/things/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
thingName, ByteString
"/thing-groups"]

instance Data.ToQuery ListThingGroupsForThing where
  toQuery :: ListThingGroupsForThing -> QueryString
toQuery ListThingGroupsForThing' {Maybe Natural
Maybe Text
Text
thingName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:thingName:ListThingGroupsForThing' :: ListThingGroupsForThing -> Text
$sel:nextToken:ListThingGroupsForThing' :: ListThingGroupsForThing -> Maybe Text
$sel:maxResults:ListThingGroupsForThing' :: ListThingGroupsForThing -> 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
      ]

-- | /See:/ 'newListThingGroupsForThingResponse' smart constructor.
data ListThingGroupsForThingResponse = ListThingGroupsForThingResponse'
  { -- | The token to use to get the next set of results, or __null__ if there
    -- are no additional results.
    ListThingGroupsForThingResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The thing groups.
    ListThingGroupsForThingResponse -> Maybe [GroupNameAndArn]
thingGroups :: Prelude.Maybe [GroupNameAndArn],
    -- | The response's http status code.
    ListThingGroupsForThingResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListThingGroupsForThingResponse
-> ListThingGroupsForThingResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingGroupsForThingResponse
-> ListThingGroupsForThingResponse -> Bool
$c/= :: ListThingGroupsForThingResponse
-> ListThingGroupsForThingResponse -> Bool
== :: ListThingGroupsForThingResponse
-> ListThingGroupsForThingResponse -> Bool
$c== :: ListThingGroupsForThingResponse
-> ListThingGroupsForThingResponse -> Bool
Prelude.Eq, ReadPrec [ListThingGroupsForThingResponse]
ReadPrec ListThingGroupsForThingResponse
Int -> ReadS ListThingGroupsForThingResponse
ReadS [ListThingGroupsForThingResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingGroupsForThingResponse]
$creadListPrec :: ReadPrec [ListThingGroupsForThingResponse]
readPrec :: ReadPrec ListThingGroupsForThingResponse
$creadPrec :: ReadPrec ListThingGroupsForThingResponse
readList :: ReadS [ListThingGroupsForThingResponse]
$creadList :: ReadS [ListThingGroupsForThingResponse]
readsPrec :: Int -> ReadS ListThingGroupsForThingResponse
$creadsPrec :: Int -> ReadS ListThingGroupsForThingResponse
Prelude.Read, Int -> ListThingGroupsForThingResponse -> ShowS
[ListThingGroupsForThingResponse] -> ShowS
ListThingGroupsForThingResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingGroupsForThingResponse] -> ShowS
$cshowList :: [ListThingGroupsForThingResponse] -> ShowS
show :: ListThingGroupsForThingResponse -> String
$cshow :: ListThingGroupsForThingResponse -> String
showsPrec :: Int -> ListThingGroupsForThingResponse -> ShowS
$cshowsPrec :: Int -> ListThingGroupsForThingResponse -> ShowS
Prelude.Show, forall x.
Rep ListThingGroupsForThingResponse x
-> ListThingGroupsForThingResponse
forall x.
ListThingGroupsForThingResponse
-> Rep ListThingGroupsForThingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListThingGroupsForThingResponse x
-> ListThingGroupsForThingResponse
$cfrom :: forall x.
ListThingGroupsForThingResponse
-> Rep ListThingGroupsForThingResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListThingGroupsForThingResponse' 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', 'listThingGroupsForThingResponse_nextToken' - The token to use to get the next set of results, or __null__ if there
-- are no additional results.
--
-- 'thingGroups', 'listThingGroupsForThingResponse_thingGroups' - The thing groups.
--
-- 'httpStatus', 'listThingGroupsForThingResponse_httpStatus' - The response's http status code.
newListThingGroupsForThingResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListThingGroupsForThingResponse
newListThingGroupsForThingResponse :: Int -> ListThingGroupsForThingResponse
newListThingGroupsForThingResponse Int
pHttpStatus_ =
  ListThingGroupsForThingResponse'
    { $sel:nextToken:ListThingGroupsForThingResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:thingGroups:ListThingGroupsForThingResponse' :: Maybe [GroupNameAndArn]
thingGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListThingGroupsForThingResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to use to get the next set of results, or __null__ if there
-- are no additional results.
listThingGroupsForThingResponse_nextToken :: Lens.Lens' ListThingGroupsForThingResponse (Prelude.Maybe Prelude.Text)
listThingGroupsForThingResponse_nextToken :: Lens' ListThingGroupsForThingResponse (Maybe Text)
listThingGroupsForThingResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroupsForThingResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThingGroupsForThingResponse' :: ListThingGroupsForThingResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThingGroupsForThingResponse
s@ListThingGroupsForThingResponse' {} Maybe Text
a -> ListThingGroupsForThingResponse
s {$sel:nextToken:ListThingGroupsForThingResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListThingGroupsForThingResponse)

-- | The thing groups.
listThingGroupsForThingResponse_thingGroups :: Lens.Lens' ListThingGroupsForThingResponse (Prelude.Maybe [GroupNameAndArn])
listThingGroupsForThingResponse_thingGroups :: Lens' ListThingGroupsForThingResponse (Maybe [GroupNameAndArn])
listThingGroupsForThingResponse_thingGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroupsForThingResponse' {Maybe [GroupNameAndArn]
thingGroups :: Maybe [GroupNameAndArn]
$sel:thingGroups:ListThingGroupsForThingResponse' :: ListThingGroupsForThingResponse -> Maybe [GroupNameAndArn]
thingGroups} -> Maybe [GroupNameAndArn]
thingGroups) (\s :: ListThingGroupsForThingResponse
s@ListThingGroupsForThingResponse' {} Maybe [GroupNameAndArn]
a -> ListThingGroupsForThingResponse
s {$sel:thingGroups:ListThingGroupsForThingResponse' :: Maybe [GroupNameAndArn]
thingGroups = Maybe [GroupNameAndArn]
a} :: ListThingGroupsForThingResponse) 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.
listThingGroupsForThingResponse_httpStatus :: Lens.Lens' ListThingGroupsForThingResponse Prelude.Int
listThingGroupsForThingResponse_httpStatus :: Lens' ListThingGroupsForThingResponse Int
listThingGroupsForThingResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingGroupsForThingResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListThingGroupsForThingResponse' :: ListThingGroupsForThingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListThingGroupsForThingResponse
s@ListThingGroupsForThingResponse' {} Int
a -> ListThingGroupsForThingResponse
s {$sel:httpStatus:ListThingGroupsForThingResponse' :: Int
httpStatus = Int
a} :: ListThingGroupsForThingResponse)

instance
  Prelude.NFData
    ListThingGroupsForThingResponse
  where
  rnf :: ListThingGroupsForThingResponse -> ()
rnf ListThingGroupsForThingResponse' {Int
Maybe [GroupNameAndArn]
Maybe Text
httpStatus :: Int
thingGroups :: Maybe [GroupNameAndArn]
nextToken :: Maybe Text
$sel:httpStatus:ListThingGroupsForThingResponse' :: ListThingGroupsForThingResponse -> Int
$sel:thingGroups:ListThingGroupsForThingResponse' :: ListThingGroupsForThingResponse -> Maybe [GroupNameAndArn]
$sel:nextToken:ListThingGroupsForThingResponse' :: ListThingGroupsForThingResponse -> 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