{-# 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.ListThingsInBillingGroup
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the things you have added to the given billing group.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListThingsInBillingGroup>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListThingsInBillingGroup
  ( -- * Creating a Request
    ListThingsInBillingGroup (..),
    newListThingsInBillingGroup,

    -- * Request Lenses
    listThingsInBillingGroup_nextToken,
    listThingsInBillingGroup_maxResults,
    listThingsInBillingGroup_billingGroupName,

    -- * Destructuring the Response
    ListThingsInBillingGroupResponse (..),
    newListThingsInBillingGroupResponse,

    -- * Response Lenses
    listThingsInBillingGroupResponse_nextToken,
    listThingsInBillingGroupResponse_things,
    listThingsInBillingGroupResponse_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

-- | /See:/ 'newListThingsInBillingGroup' smart constructor.
data ListThingsInBillingGroup = ListThingsInBillingGroup'
  { -- | To retrieve the next set of results, the @nextToken@ value from a
    -- previous response; otherwise __null__ to receive the first set of
    -- results.
    ListThingsInBillingGroup -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return per request.
    ListThingsInBillingGroup -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the billing group.
    ListThingsInBillingGroup -> Text
billingGroupName :: Prelude.Text
  }
  deriving (ListThingsInBillingGroup -> ListThingsInBillingGroup -> Bool
(ListThingsInBillingGroup -> ListThingsInBillingGroup -> Bool)
-> (ListThingsInBillingGroup -> ListThingsInBillingGroup -> Bool)
-> Eq ListThingsInBillingGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingsInBillingGroup -> ListThingsInBillingGroup -> Bool
$c/= :: ListThingsInBillingGroup -> ListThingsInBillingGroup -> Bool
== :: ListThingsInBillingGroup -> ListThingsInBillingGroup -> Bool
$c== :: ListThingsInBillingGroup -> ListThingsInBillingGroup -> Bool
Prelude.Eq, ReadPrec [ListThingsInBillingGroup]
ReadPrec ListThingsInBillingGroup
Int -> ReadS ListThingsInBillingGroup
ReadS [ListThingsInBillingGroup]
(Int -> ReadS ListThingsInBillingGroup)
-> ReadS [ListThingsInBillingGroup]
-> ReadPrec ListThingsInBillingGroup
-> ReadPrec [ListThingsInBillingGroup]
-> Read ListThingsInBillingGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingsInBillingGroup]
$creadListPrec :: ReadPrec [ListThingsInBillingGroup]
readPrec :: ReadPrec ListThingsInBillingGroup
$creadPrec :: ReadPrec ListThingsInBillingGroup
readList :: ReadS [ListThingsInBillingGroup]
$creadList :: ReadS [ListThingsInBillingGroup]
readsPrec :: Int -> ReadS ListThingsInBillingGroup
$creadsPrec :: Int -> ReadS ListThingsInBillingGroup
Prelude.Read, Int -> ListThingsInBillingGroup -> ShowS
[ListThingsInBillingGroup] -> ShowS
ListThingsInBillingGroup -> String
(Int -> ListThingsInBillingGroup -> ShowS)
-> (ListThingsInBillingGroup -> String)
-> ([ListThingsInBillingGroup] -> ShowS)
-> Show ListThingsInBillingGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingsInBillingGroup] -> ShowS
$cshowList :: [ListThingsInBillingGroup] -> ShowS
show :: ListThingsInBillingGroup -> String
$cshow :: ListThingsInBillingGroup -> String
showsPrec :: Int -> ListThingsInBillingGroup -> ShowS
$cshowsPrec :: Int -> ListThingsInBillingGroup -> ShowS
Prelude.Show, (forall x.
 ListThingsInBillingGroup -> Rep ListThingsInBillingGroup x)
-> (forall x.
    Rep ListThingsInBillingGroup x -> ListThingsInBillingGroup)
-> Generic ListThingsInBillingGroup
forall x.
Rep ListThingsInBillingGroup x -> ListThingsInBillingGroup
forall x.
ListThingsInBillingGroup -> Rep ListThingsInBillingGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListThingsInBillingGroup x -> ListThingsInBillingGroup
$cfrom :: forall x.
ListThingsInBillingGroup -> Rep ListThingsInBillingGroup x
Prelude.Generic)

-- |
-- Create a value of 'ListThingsInBillingGroup' 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', 'listThingsInBillingGroup_nextToken' - To retrieve the next set of results, the @nextToken@ value from a
-- previous response; otherwise __null__ to receive the first set of
-- results.
--
-- 'maxResults', 'listThingsInBillingGroup_maxResults' - The maximum number of results to return per request.
--
-- 'billingGroupName', 'listThingsInBillingGroup_billingGroupName' - The name of the billing group.
newListThingsInBillingGroup ::
  -- | 'billingGroupName'
  Prelude.Text ->
  ListThingsInBillingGroup
newListThingsInBillingGroup :: Text -> ListThingsInBillingGroup
newListThingsInBillingGroup Text
pBillingGroupName_ =
  ListThingsInBillingGroup' :: Maybe Text -> Maybe Natural -> Text -> ListThingsInBillingGroup
ListThingsInBillingGroup'
    { $sel:nextToken:ListThingsInBillingGroup' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListThingsInBillingGroup' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:billingGroupName:ListThingsInBillingGroup' :: Text
billingGroupName = Text
pBillingGroupName_
    }

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

-- | The maximum number of results to return per request.
listThingsInBillingGroup_maxResults :: Lens.Lens' ListThingsInBillingGroup (Prelude.Maybe Prelude.Natural)
listThingsInBillingGroup_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListThingsInBillingGroup -> f ListThingsInBillingGroup
listThingsInBillingGroup_maxResults = (ListThingsInBillingGroup -> Maybe Natural)
-> (ListThingsInBillingGroup
    -> Maybe Natural -> ListThingsInBillingGroup)
-> Lens
     ListThingsInBillingGroup
     ListThingsInBillingGroup
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingsInBillingGroup' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListThingsInBillingGroup' :: ListThingsInBillingGroup -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListThingsInBillingGroup
s@ListThingsInBillingGroup' {} Maybe Natural
a -> ListThingsInBillingGroup
s {$sel:maxResults:ListThingsInBillingGroup' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListThingsInBillingGroup)

-- | The name of the billing group.
listThingsInBillingGroup_billingGroupName :: Lens.Lens' ListThingsInBillingGroup Prelude.Text
listThingsInBillingGroup_billingGroupName :: (Text -> f Text)
-> ListThingsInBillingGroup -> f ListThingsInBillingGroup
listThingsInBillingGroup_billingGroupName = (ListThingsInBillingGroup -> Text)
-> (ListThingsInBillingGroup -> Text -> ListThingsInBillingGroup)
-> Lens ListThingsInBillingGroup ListThingsInBillingGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingsInBillingGroup' {Text
billingGroupName :: Text
$sel:billingGroupName:ListThingsInBillingGroup' :: ListThingsInBillingGroup -> Text
billingGroupName} -> Text
billingGroupName) (\s :: ListThingsInBillingGroup
s@ListThingsInBillingGroup' {} Text
a -> ListThingsInBillingGroup
s {$sel:billingGroupName:ListThingsInBillingGroup' :: Text
billingGroupName = Text
a} :: ListThingsInBillingGroup)

instance Core.AWSPager ListThingsInBillingGroup where
  page :: ListThingsInBillingGroup
-> AWSResponse ListThingsInBillingGroup
-> Maybe ListThingsInBillingGroup
page ListThingsInBillingGroup
rq AWSResponse ListThingsInBillingGroup
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListThingsInBillingGroup
ListThingsInBillingGroupResponse
rs
            ListThingsInBillingGroupResponse
-> Getting (First Text) ListThingsInBillingGroupResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListThingsInBillingGroupResponse
-> Const (First Text) ListThingsInBillingGroupResponse
Lens' ListThingsInBillingGroupResponse (Maybe Text)
listThingsInBillingGroupResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListThingsInBillingGroupResponse
 -> Const (First Text) ListThingsInBillingGroupResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListThingsInBillingGroupResponse 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 ListThingsInBillingGroup
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListThingsInBillingGroup
ListThingsInBillingGroupResponse
rs
            ListThingsInBillingGroupResponse
-> Getting (First [Text]) ListThingsInBillingGroupResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListThingsInBillingGroupResponse
-> Const (First [Text]) ListThingsInBillingGroupResponse
Lens' ListThingsInBillingGroupResponse (Maybe [Text])
listThingsInBillingGroupResponse_things
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListThingsInBillingGroupResponse
 -> Const (First [Text]) ListThingsInBillingGroupResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListThingsInBillingGroupResponse [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 ListThingsInBillingGroup
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListThingsInBillingGroup -> Maybe ListThingsInBillingGroup
forall a. a -> Maybe a
Prelude.Just (ListThingsInBillingGroup -> Maybe ListThingsInBillingGroup)
-> ListThingsInBillingGroup -> Maybe ListThingsInBillingGroup
forall a b. (a -> b) -> a -> b
Prelude.$
        ListThingsInBillingGroup
rq
          ListThingsInBillingGroup
-> (ListThingsInBillingGroup -> ListThingsInBillingGroup)
-> ListThingsInBillingGroup
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListThingsInBillingGroup -> Identity ListThingsInBillingGroup
Lens
  ListThingsInBillingGroup
  ListThingsInBillingGroup
  (Maybe Text)
  (Maybe Text)
listThingsInBillingGroup_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListThingsInBillingGroup -> Identity ListThingsInBillingGroup)
-> Maybe Text
-> ListThingsInBillingGroup
-> ListThingsInBillingGroup
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListThingsInBillingGroup
ListThingsInBillingGroupResponse
rs
          ListThingsInBillingGroupResponse
-> Getting (First Text) ListThingsInBillingGroupResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListThingsInBillingGroupResponse
-> Const (First Text) ListThingsInBillingGroupResponse
Lens' ListThingsInBillingGroupResponse (Maybe Text)
listThingsInBillingGroupResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListThingsInBillingGroupResponse
 -> Const (First Text) ListThingsInBillingGroupResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListThingsInBillingGroupResponse 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 ListThingsInBillingGroup where
  type
    AWSResponse ListThingsInBillingGroup =
      ListThingsInBillingGroupResponse
  request :: ListThingsInBillingGroup -> Request ListThingsInBillingGroup
request = Service
-> ListThingsInBillingGroup -> Request ListThingsInBillingGroup
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListThingsInBillingGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListThingsInBillingGroup)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListThingsInBillingGroup))
-> Logger
-> Service
-> Proxy ListThingsInBillingGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListThingsInBillingGroup)))
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 Text
-> Maybe [Text] -> Int -> ListThingsInBillingGroupResponse
ListThingsInBillingGroupResponse'
            (Maybe Text
 -> Maybe [Text] -> Int -> ListThingsInBillingGroupResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Text] -> Int -> ListThingsInBillingGroupResponse)
forall (f :: * -> *) a b. Functor 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 (Maybe [Text] -> Int -> ListThingsInBillingGroupResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> ListThingsInBillingGroupResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"things" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListThingsInBillingGroupResponse)
-> Either String Int
-> Either String ListThingsInBillingGroupResponse
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 ListThingsInBillingGroup

instance Prelude.NFData ListThingsInBillingGroup

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

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

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

-- | /See:/ 'newListThingsInBillingGroupResponse' smart constructor.
data ListThingsInBillingGroupResponse = ListThingsInBillingGroupResponse'
  { -- | The token to use to get the next set of results. Will not be returned if
    -- operation has returned all results.
    ListThingsInBillingGroupResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of things in the billing group.
    ListThingsInBillingGroupResponse -> Maybe [Text]
things :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListThingsInBillingGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListThingsInBillingGroupResponse
-> ListThingsInBillingGroupResponse -> Bool
(ListThingsInBillingGroupResponse
 -> ListThingsInBillingGroupResponse -> Bool)
-> (ListThingsInBillingGroupResponse
    -> ListThingsInBillingGroupResponse -> Bool)
-> Eq ListThingsInBillingGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListThingsInBillingGroupResponse
-> ListThingsInBillingGroupResponse -> Bool
$c/= :: ListThingsInBillingGroupResponse
-> ListThingsInBillingGroupResponse -> Bool
== :: ListThingsInBillingGroupResponse
-> ListThingsInBillingGroupResponse -> Bool
$c== :: ListThingsInBillingGroupResponse
-> ListThingsInBillingGroupResponse -> Bool
Prelude.Eq, ReadPrec [ListThingsInBillingGroupResponse]
ReadPrec ListThingsInBillingGroupResponse
Int -> ReadS ListThingsInBillingGroupResponse
ReadS [ListThingsInBillingGroupResponse]
(Int -> ReadS ListThingsInBillingGroupResponse)
-> ReadS [ListThingsInBillingGroupResponse]
-> ReadPrec ListThingsInBillingGroupResponse
-> ReadPrec [ListThingsInBillingGroupResponse]
-> Read ListThingsInBillingGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListThingsInBillingGroupResponse]
$creadListPrec :: ReadPrec [ListThingsInBillingGroupResponse]
readPrec :: ReadPrec ListThingsInBillingGroupResponse
$creadPrec :: ReadPrec ListThingsInBillingGroupResponse
readList :: ReadS [ListThingsInBillingGroupResponse]
$creadList :: ReadS [ListThingsInBillingGroupResponse]
readsPrec :: Int -> ReadS ListThingsInBillingGroupResponse
$creadsPrec :: Int -> ReadS ListThingsInBillingGroupResponse
Prelude.Read, Int -> ListThingsInBillingGroupResponse -> ShowS
[ListThingsInBillingGroupResponse] -> ShowS
ListThingsInBillingGroupResponse -> String
(Int -> ListThingsInBillingGroupResponse -> ShowS)
-> (ListThingsInBillingGroupResponse -> String)
-> ([ListThingsInBillingGroupResponse] -> ShowS)
-> Show ListThingsInBillingGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListThingsInBillingGroupResponse] -> ShowS
$cshowList :: [ListThingsInBillingGroupResponse] -> ShowS
show :: ListThingsInBillingGroupResponse -> String
$cshow :: ListThingsInBillingGroupResponse -> String
showsPrec :: Int -> ListThingsInBillingGroupResponse -> ShowS
$cshowsPrec :: Int -> ListThingsInBillingGroupResponse -> ShowS
Prelude.Show, (forall x.
 ListThingsInBillingGroupResponse
 -> Rep ListThingsInBillingGroupResponse x)
-> (forall x.
    Rep ListThingsInBillingGroupResponse x
    -> ListThingsInBillingGroupResponse)
-> Generic ListThingsInBillingGroupResponse
forall x.
Rep ListThingsInBillingGroupResponse x
-> ListThingsInBillingGroupResponse
forall x.
ListThingsInBillingGroupResponse
-> Rep ListThingsInBillingGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListThingsInBillingGroupResponse x
-> ListThingsInBillingGroupResponse
$cfrom :: forall x.
ListThingsInBillingGroupResponse
-> Rep ListThingsInBillingGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListThingsInBillingGroupResponse' 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', 'listThingsInBillingGroupResponse_nextToken' - The token to use to get the next set of results. Will not be returned if
-- operation has returned all results.
--
-- 'things', 'listThingsInBillingGroupResponse_things' - A list of things in the billing group.
--
-- 'httpStatus', 'listThingsInBillingGroupResponse_httpStatus' - The response's http status code.
newListThingsInBillingGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListThingsInBillingGroupResponse
newListThingsInBillingGroupResponse :: Int -> ListThingsInBillingGroupResponse
newListThingsInBillingGroupResponse Int
pHttpStatus_ =
  ListThingsInBillingGroupResponse' :: Maybe Text
-> Maybe [Text] -> Int -> ListThingsInBillingGroupResponse
ListThingsInBillingGroupResponse'
    { $sel:nextToken:ListThingsInBillingGroupResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:things:ListThingsInBillingGroupResponse' :: Maybe [Text]
things = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListThingsInBillingGroupResponse' :: 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.
listThingsInBillingGroupResponse_nextToken :: Lens.Lens' ListThingsInBillingGroupResponse (Prelude.Maybe Prelude.Text)
listThingsInBillingGroupResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListThingsInBillingGroupResponse
-> f ListThingsInBillingGroupResponse
listThingsInBillingGroupResponse_nextToken = (ListThingsInBillingGroupResponse -> Maybe Text)
-> (ListThingsInBillingGroupResponse
    -> Maybe Text -> ListThingsInBillingGroupResponse)
-> Lens' ListThingsInBillingGroupResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingsInBillingGroupResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListThingsInBillingGroupResponse' :: ListThingsInBillingGroupResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListThingsInBillingGroupResponse
s@ListThingsInBillingGroupResponse' {} Maybe Text
a -> ListThingsInBillingGroupResponse
s {$sel:nextToken:ListThingsInBillingGroupResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListThingsInBillingGroupResponse)

-- | A list of things in the billing group.
listThingsInBillingGroupResponse_things :: Lens.Lens' ListThingsInBillingGroupResponse (Prelude.Maybe [Prelude.Text])
listThingsInBillingGroupResponse_things :: (Maybe [Text] -> f (Maybe [Text]))
-> ListThingsInBillingGroupResponse
-> f ListThingsInBillingGroupResponse
listThingsInBillingGroupResponse_things = (ListThingsInBillingGroupResponse -> Maybe [Text])
-> (ListThingsInBillingGroupResponse
    -> Maybe [Text] -> ListThingsInBillingGroupResponse)
-> Lens' ListThingsInBillingGroupResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingsInBillingGroupResponse' {Maybe [Text]
things :: Maybe [Text]
$sel:things:ListThingsInBillingGroupResponse' :: ListThingsInBillingGroupResponse -> Maybe [Text]
things} -> Maybe [Text]
things) (\s :: ListThingsInBillingGroupResponse
s@ListThingsInBillingGroupResponse' {} Maybe [Text]
a -> ListThingsInBillingGroupResponse
s {$sel:things:ListThingsInBillingGroupResponse' :: Maybe [Text]
things = Maybe [Text]
a} :: ListThingsInBillingGroupResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListThingsInBillingGroupResponse
 -> f ListThingsInBillingGroupResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListThingsInBillingGroupResponse
-> f ListThingsInBillingGroupResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listThingsInBillingGroupResponse_httpStatus :: Lens.Lens' ListThingsInBillingGroupResponse Prelude.Int
listThingsInBillingGroupResponse_httpStatus :: (Int -> f Int)
-> ListThingsInBillingGroupResponse
-> f ListThingsInBillingGroupResponse
listThingsInBillingGroupResponse_httpStatus = (ListThingsInBillingGroupResponse -> Int)
-> (ListThingsInBillingGroupResponse
    -> Int -> ListThingsInBillingGroupResponse)
-> Lens
     ListThingsInBillingGroupResponse
     ListThingsInBillingGroupResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListThingsInBillingGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListThingsInBillingGroupResponse' :: ListThingsInBillingGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListThingsInBillingGroupResponse
s@ListThingsInBillingGroupResponse' {} Int
a -> ListThingsInBillingGroupResponse
s {$sel:httpStatus:ListThingsInBillingGroupResponse' :: Int
httpStatus = Int
a} :: ListThingsInBillingGroupResponse)

instance
  Prelude.NFData
    ListThingsInBillingGroupResponse