{-# 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.Location.ListTrackerConsumers
-- 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 geofence collections currently associated to the given tracker
-- resource.
--
-- This operation returns paginated results.
module Amazonka.Location.ListTrackerConsumers
  ( -- * Creating a Request
    ListTrackerConsumers (..),
    newListTrackerConsumers,

    -- * Request Lenses
    listTrackerConsumers_nextToken,
    listTrackerConsumers_maxResults,
    listTrackerConsumers_trackerName,

    -- * Destructuring the Response
    ListTrackerConsumersResponse (..),
    newListTrackerConsumersResponse,

    -- * Response Lenses
    listTrackerConsumersResponse_nextToken,
    listTrackerConsumersResponse_httpStatus,
    listTrackerConsumersResponse_consumerArns,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListTrackerConsumers' smart constructor.
data ListTrackerConsumers = ListTrackerConsumers'
  { -- | The pagination token specifying which page of results to return in the
    -- response. If no token is provided, the default page is the first page.
    --
    -- Default value: @null@
    ListTrackerConsumers -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An optional limit for the number of resources returned in a single call.
    --
    -- Default value: @100@
    ListTrackerConsumers -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The tracker resource whose associated geofence collections you want to
    -- list.
    ListTrackerConsumers -> Text
trackerName :: Prelude.Text
  }
  deriving (ListTrackerConsumers -> ListTrackerConsumers -> Bool
(ListTrackerConsumers -> ListTrackerConsumers -> Bool)
-> (ListTrackerConsumers -> ListTrackerConsumers -> Bool)
-> Eq ListTrackerConsumers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTrackerConsumers -> ListTrackerConsumers -> Bool
$c/= :: ListTrackerConsumers -> ListTrackerConsumers -> Bool
== :: ListTrackerConsumers -> ListTrackerConsumers -> Bool
$c== :: ListTrackerConsumers -> ListTrackerConsumers -> Bool
Prelude.Eq, ReadPrec [ListTrackerConsumers]
ReadPrec ListTrackerConsumers
Int -> ReadS ListTrackerConsumers
ReadS [ListTrackerConsumers]
(Int -> ReadS ListTrackerConsumers)
-> ReadS [ListTrackerConsumers]
-> ReadPrec ListTrackerConsumers
-> ReadPrec [ListTrackerConsumers]
-> Read ListTrackerConsumers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTrackerConsumers]
$creadListPrec :: ReadPrec [ListTrackerConsumers]
readPrec :: ReadPrec ListTrackerConsumers
$creadPrec :: ReadPrec ListTrackerConsumers
readList :: ReadS [ListTrackerConsumers]
$creadList :: ReadS [ListTrackerConsumers]
readsPrec :: Int -> ReadS ListTrackerConsumers
$creadsPrec :: Int -> ReadS ListTrackerConsumers
Prelude.Read, Int -> ListTrackerConsumers -> ShowS
[ListTrackerConsumers] -> ShowS
ListTrackerConsumers -> String
(Int -> ListTrackerConsumers -> ShowS)
-> (ListTrackerConsumers -> String)
-> ([ListTrackerConsumers] -> ShowS)
-> Show ListTrackerConsumers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTrackerConsumers] -> ShowS
$cshowList :: [ListTrackerConsumers] -> ShowS
show :: ListTrackerConsumers -> String
$cshow :: ListTrackerConsumers -> String
showsPrec :: Int -> ListTrackerConsumers -> ShowS
$cshowsPrec :: Int -> ListTrackerConsumers -> ShowS
Prelude.Show, (forall x. ListTrackerConsumers -> Rep ListTrackerConsumers x)
-> (forall x. Rep ListTrackerConsumers x -> ListTrackerConsumers)
-> Generic ListTrackerConsumers
forall x. Rep ListTrackerConsumers x -> ListTrackerConsumers
forall x. ListTrackerConsumers -> Rep ListTrackerConsumers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTrackerConsumers x -> ListTrackerConsumers
$cfrom :: forall x. ListTrackerConsumers -> Rep ListTrackerConsumers x
Prelude.Generic)

-- |
-- Create a value of 'ListTrackerConsumers' 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', 'listTrackerConsumers_nextToken' - The pagination token specifying which page of results to return in the
-- response. If no token is provided, the default page is the first page.
--
-- Default value: @null@
--
-- 'maxResults', 'listTrackerConsumers_maxResults' - An optional limit for the number of resources returned in a single call.
--
-- Default value: @100@
--
-- 'trackerName', 'listTrackerConsumers_trackerName' - The tracker resource whose associated geofence collections you want to
-- list.
newListTrackerConsumers ::
  -- | 'trackerName'
  Prelude.Text ->
  ListTrackerConsumers
newListTrackerConsumers :: Text -> ListTrackerConsumers
newListTrackerConsumers Text
pTrackerName_ =
  ListTrackerConsumers' :: Maybe Text -> Maybe Natural -> Text -> ListTrackerConsumers
ListTrackerConsumers'
    { $sel:nextToken:ListTrackerConsumers' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListTrackerConsumers' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:trackerName:ListTrackerConsumers' :: Text
trackerName = Text
pTrackerName_
    }

-- | The pagination token specifying which page of results to return in the
-- response. If no token is provided, the default page is the first page.
--
-- Default value: @null@
listTrackerConsumers_nextToken :: Lens.Lens' ListTrackerConsumers (Prelude.Maybe Prelude.Text)
listTrackerConsumers_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTrackerConsumers -> f ListTrackerConsumers
listTrackerConsumers_nextToken = (ListTrackerConsumers -> Maybe Text)
-> (ListTrackerConsumers -> Maybe Text -> ListTrackerConsumers)
-> Lens
     ListTrackerConsumers ListTrackerConsumers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackerConsumers' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTrackerConsumers' :: ListTrackerConsumers -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTrackerConsumers
s@ListTrackerConsumers' {} Maybe Text
a -> ListTrackerConsumers
s {$sel:nextToken:ListTrackerConsumers' :: Maybe Text
nextToken = Maybe Text
a} :: ListTrackerConsumers)

-- | An optional limit for the number of resources returned in a single call.
--
-- Default value: @100@
listTrackerConsumers_maxResults :: Lens.Lens' ListTrackerConsumers (Prelude.Maybe Prelude.Natural)
listTrackerConsumers_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListTrackerConsumers -> f ListTrackerConsumers
listTrackerConsumers_maxResults = (ListTrackerConsumers -> Maybe Natural)
-> (ListTrackerConsumers -> Maybe Natural -> ListTrackerConsumers)
-> Lens
     ListTrackerConsumers
     ListTrackerConsumers
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackerConsumers' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListTrackerConsumers' :: ListTrackerConsumers -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListTrackerConsumers
s@ListTrackerConsumers' {} Maybe Natural
a -> ListTrackerConsumers
s {$sel:maxResults:ListTrackerConsumers' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListTrackerConsumers)

-- | The tracker resource whose associated geofence collections you want to
-- list.
listTrackerConsumers_trackerName :: Lens.Lens' ListTrackerConsumers Prelude.Text
listTrackerConsumers_trackerName :: (Text -> f Text) -> ListTrackerConsumers -> f ListTrackerConsumers
listTrackerConsumers_trackerName = (ListTrackerConsumers -> Text)
-> (ListTrackerConsumers -> Text -> ListTrackerConsumers)
-> Lens ListTrackerConsumers ListTrackerConsumers Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackerConsumers' {Text
trackerName :: Text
$sel:trackerName:ListTrackerConsumers' :: ListTrackerConsumers -> Text
trackerName} -> Text
trackerName) (\s :: ListTrackerConsumers
s@ListTrackerConsumers' {} Text
a -> ListTrackerConsumers
s {$sel:trackerName:ListTrackerConsumers' :: Text
trackerName = Text
a} :: ListTrackerConsumers)

instance Core.AWSPager ListTrackerConsumers where
  page :: ListTrackerConsumers
-> AWSResponse ListTrackerConsumers -> Maybe ListTrackerConsumers
page ListTrackerConsumers
rq AWSResponse ListTrackerConsumers
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTrackerConsumers
ListTrackerConsumersResponse
rs
            ListTrackerConsumersResponse
-> Getting (First Text) ListTrackerConsumersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTrackerConsumersResponse
-> Const (First Text) ListTrackerConsumersResponse
Lens' ListTrackerConsumersResponse (Maybe Text)
listTrackerConsumersResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTrackerConsumersResponse
 -> Const (First Text) ListTrackerConsumersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTrackerConsumersResponse 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 ListTrackerConsumers
forall a. Maybe a
Prelude.Nothing
    | [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTrackerConsumers
ListTrackerConsumersResponse
rs
            ListTrackerConsumersResponse
-> Getting [Text] ListTrackerConsumersResponse [Text] -> [Text]
forall s a. s -> Getting a s a -> a
Lens.^. Getting [Text] ListTrackerConsumersResponse [Text]
Lens' ListTrackerConsumersResponse [Text]
listTrackerConsumersResponse_consumerArns
        ) =
      Maybe ListTrackerConsumers
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListTrackerConsumers -> Maybe ListTrackerConsumers
forall a. a -> Maybe a
Prelude.Just (ListTrackerConsumers -> Maybe ListTrackerConsumers)
-> ListTrackerConsumers -> Maybe ListTrackerConsumers
forall a b. (a -> b) -> a -> b
Prelude.$
        ListTrackerConsumers
rq
          ListTrackerConsumers
-> (ListTrackerConsumers -> ListTrackerConsumers)
-> ListTrackerConsumers
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListTrackerConsumers -> Identity ListTrackerConsumers
Lens
  ListTrackerConsumers ListTrackerConsumers (Maybe Text) (Maybe Text)
listTrackerConsumers_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListTrackerConsumers -> Identity ListTrackerConsumers)
-> Maybe Text -> ListTrackerConsumers -> ListTrackerConsumers
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTrackerConsumers
ListTrackerConsumersResponse
rs
          ListTrackerConsumersResponse
-> Getting (First Text) ListTrackerConsumersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTrackerConsumersResponse
-> Const (First Text) ListTrackerConsumersResponse
Lens' ListTrackerConsumersResponse (Maybe Text)
listTrackerConsumersResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTrackerConsumersResponse
 -> Const (First Text) ListTrackerConsumersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTrackerConsumersResponse 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 ListTrackerConsumers where
  type
    AWSResponse ListTrackerConsumers =
      ListTrackerConsumersResponse
  request :: ListTrackerConsumers -> Request ListTrackerConsumers
request = Service -> ListTrackerConsumers -> Request ListTrackerConsumers
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListTrackerConsumers
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTrackerConsumers)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListTrackerConsumers))
-> Logger
-> Service
-> Proxy ListTrackerConsumers
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListTrackerConsumers)))
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 -> Int -> [Text] -> ListTrackerConsumersResponse
ListTrackerConsumersResponse'
            (Maybe Text -> Int -> [Text] -> ListTrackerConsumersResponse)
-> Either String (Maybe Text)
-> Either String (Int -> [Text] -> ListTrackerConsumersResponse)
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 (Int -> [Text] -> ListTrackerConsumersResponse)
-> Either String Int
-> Either String ([Text] -> ListTrackerConsumersResponse)
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))
            Either String ([Text] -> ListTrackerConsumersResponse)
-> Either String [Text]
-> Either String ListTrackerConsumersResponse
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
"ConsumerArns" Either String (Maybe [Text]) -> [Text] -> Either String [Text]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Text]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListTrackerConsumers

instance Prelude.NFData ListTrackerConsumers

instance Core.ToHeaders ListTrackerConsumers where
  toHeaders :: ListTrackerConsumers -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListTrackerConsumers -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListTrackerConsumers where
  toJSON :: ListTrackerConsumers -> Value
toJSON ListTrackerConsumers' {Maybe Natural
Maybe Text
Text
trackerName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:trackerName:ListTrackerConsumers' :: ListTrackerConsumers -> Text
$sel:maxResults:ListTrackerConsumers' :: ListTrackerConsumers -> Maybe Natural
$sel:nextToken:ListTrackerConsumers' :: ListTrackerConsumers -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

instance Core.ToPath ListTrackerConsumers where
  toPath :: ListTrackerConsumers -> ByteString
toPath ListTrackerConsumers' {Maybe Natural
Maybe Text
Text
trackerName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:trackerName:ListTrackerConsumers' :: ListTrackerConsumers -> Text
$sel:maxResults:ListTrackerConsumers' :: ListTrackerConsumers -> Maybe Natural
$sel:nextToken:ListTrackerConsumers' :: ListTrackerConsumers -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/tracking/v0/trackers/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
trackerName,
        ByteString
"/list-consumers"
      ]

instance Core.ToQuery ListTrackerConsumers where
  toQuery :: ListTrackerConsumers -> QueryString
toQuery = QueryString -> ListTrackerConsumers -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListTrackerConsumersResponse' smart constructor.
data ListTrackerConsumersResponse = ListTrackerConsumersResponse'
  { -- | A pagination token indicating there are additional pages available. You
    -- can use the token in a following request to fetch the next set of
    -- results.
    ListTrackerConsumersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListTrackerConsumersResponse -> Int
httpStatus :: Prelude.Int,
    -- | Contains the list of geofence collection ARNs associated to the tracker
    -- resource.
    ListTrackerConsumersResponse -> [Text]
consumerArns :: [Prelude.Text]
  }
  deriving (ListTrackerConsumersResponse
-> ListTrackerConsumersResponse -> Bool
(ListTrackerConsumersResponse
 -> ListTrackerConsumersResponse -> Bool)
-> (ListTrackerConsumersResponse
    -> ListTrackerConsumersResponse -> Bool)
-> Eq ListTrackerConsumersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTrackerConsumersResponse
-> ListTrackerConsumersResponse -> Bool
$c/= :: ListTrackerConsumersResponse
-> ListTrackerConsumersResponse -> Bool
== :: ListTrackerConsumersResponse
-> ListTrackerConsumersResponse -> Bool
$c== :: ListTrackerConsumersResponse
-> ListTrackerConsumersResponse -> Bool
Prelude.Eq, ReadPrec [ListTrackerConsumersResponse]
ReadPrec ListTrackerConsumersResponse
Int -> ReadS ListTrackerConsumersResponse
ReadS [ListTrackerConsumersResponse]
(Int -> ReadS ListTrackerConsumersResponse)
-> ReadS [ListTrackerConsumersResponse]
-> ReadPrec ListTrackerConsumersResponse
-> ReadPrec [ListTrackerConsumersResponse]
-> Read ListTrackerConsumersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTrackerConsumersResponse]
$creadListPrec :: ReadPrec [ListTrackerConsumersResponse]
readPrec :: ReadPrec ListTrackerConsumersResponse
$creadPrec :: ReadPrec ListTrackerConsumersResponse
readList :: ReadS [ListTrackerConsumersResponse]
$creadList :: ReadS [ListTrackerConsumersResponse]
readsPrec :: Int -> ReadS ListTrackerConsumersResponse
$creadsPrec :: Int -> ReadS ListTrackerConsumersResponse
Prelude.Read, Int -> ListTrackerConsumersResponse -> ShowS
[ListTrackerConsumersResponse] -> ShowS
ListTrackerConsumersResponse -> String
(Int -> ListTrackerConsumersResponse -> ShowS)
-> (ListTrackerConsumersResponse -> String)
-> ([ListTrackerConsumersResponse] -> ShowS)
-> Show ListTrackerConsumersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTrackerConsumersResponse] -> ShowS
$cshowList :: [ListTrackerConsumersResponse] -> ShowS
show :: ListTrackerConsumersResponse -> String
$cshow :: ListTrackerConsumersResponse -> String
showsPrec :: Int -> ListTrackerConsumersResponse -> ShowS
$cshowsPrec :: Int -> ListTrackerConsumersResponse -> ShowS
Prelude.Show, (forall x.
 ListTrackerConsumersResponse -> Rep ListTrackerConsumersResponse x)
-> (forall x.
    Rep ListTrackerConsumersResponse x -> ListTrackerConsumersResponse)
-> Generic ListTrackerConsumersResponse
forall x.
Rep ListTrackerConsumersResponse x -> ListTrackerConsumersResponse
forall x.
ListTrackerConsumersResponse -> Rep ListTrackerConsumersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTrackerConsumersResponse x -> ListTrackerConsumersResponse
$cfrom :: forall x.
ListTrackerConsumersResponse -> Rep ListTrackerConsumersResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTrackerConsumersResponse' 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', 'listTrackerConsumersResponse_nextToken' - A pagination token indicating there are additional pages available. You
-- can use the token in a following request to fetch the next set of
-- results.
--
-- 'httpStatus', 'listTrackerConsumersResponse_httpStatus' - The response's http status code.
--
-- 'consumerArns', 'listTrackerConsumersResponse_consumerArns' - Contains the list of geofence collection ARNs associated to the tracker
-- resource.
newListTrackerConsumersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTrackerConsumersResponse
newListTrackerConsumersResponse :: Int -> ListTrackerConsumersResponse
newListTrackerConsumersResponse Int
pHttpStatus_ =
  ListTrackerConsumersResponse' :: Maybe Text -> Int -> [Text] -> ListTrackerConsumersResponse
ListTrackerConsumersResponse'
    { $sel:nextToken:ListTrackerConsumersResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTrackerConsumersResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:consumerArns:ListTrackerConsumersResponse' :: [Text]
consumerArns = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A pagination token indicating there are additional pages available. You
-- can use the token in a following request to fetch the next set of
-- results.
listTrackerConsumersResponse_nextToken :: Lens.Lens' ListTrackerConsumersResponse (Prelude.Maybe Prelude.Text)
listTrackerConsumersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTrackerConsumersResponse -> f ListTrackerConsumersResponse
listTrackerConsumersResponse_nextToken = (ListTrackerConsumersResponse -> Maybe Text)
-> (ListTrackerConsumersResponse
    -> Maybe Text -> ListTrackerConsumersResponse)
-> Lens' ListTrackerConsumersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackerConsumersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTrackerConsumersResponse' :: ListTrackerConsumersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTrackerConsumersResponse
s@ListTrackerConsumersResponse' {} Maybe Text
a -> ListTrackerConsumersResponse
s {$sel:nextToken:ListTrackerConsumersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTrackerConsumersResponse)

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

-- | Contains the list of geofence collection ARNs associated to the tracker
-- resource.
listTrackerConsumersResponse_consumerArns :: Lens.Lens' ListTrackerConsumersResponse [Prelude.Text]
listTrackerConsumersResponse_consumerArns :: ([Text] -> f [Text])
-> ListTrackerConsumersResponse -> f ListTrackerConsumersResponse
listTrackerConsumersResponse_consumerArns = (ListTrackerConsumersResponse -> [Text])
-> (ListTrackerConsumersResponse
    -> [Text] -> ListTrackerConsumersResponse)
-> Lens' ListTrackerConsumersResponse [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTrackerConsumersResponse' {[Text]
consumerArns :: [Text]
$sel:consumerArns:ListTrackerConsumersResponse' :: ListTrackerConsumersResponse -> [Text]
consumerArns} -> [Text]
consumerArns) (\s :: ListTrackerConsumersResponse
s@ListTrackerConsumersResponse' {} [Text]
a -> ListTrackerConsumersResponse
s {$sel:consumerArns:ListTrackerConsumersResponse' :: [Text]
consumerArns = [Text]
a} :: ListTrackerConsumersResponse) (([Text] -> f [Text])
 -> ListTrackerConsumersResponse -> f ListTrackerConsumersResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ListTrackerConsumersResponse
-> f ListTrackerConsumersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListTrackerConsumersResponse