{-# 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.Personalize.ListFilters
-- 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 all filters that belong to a given dataset group.
--
-- This operation returns paginated results.
module Amazonka.Personalize.ListFilters
  ( -- * Creating a Request
    ListFilters (..),
    newListFilters,

    -- * Request Lenses
    listFilters_nextToken,
    listFilters_datasetGroupArn,
    listFilters_maxResults,

    -- * Destructuring the Response
    ListFiltersResponse (..),
    newListFiltersResponse,

    -- * Response Lenses
    listFiltersResponse_filters,
    listFiltersResponse_nextToken,
    listFiltersResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListFilters' smart constructor.
data ListFilters = ListFilters'
  { -- | A token returned from the previous call to @ListFilters@ for getting the
    -- next set of filters (if they exist).
    ListFilters -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the dataset group that contains the filters.
    ListFilters -> Maybe Text
datasetGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of filters to return.
    ListFilters -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListFilters -> ListFilters -> Bool
(ListFilters -> ListFilters -> Bool)
-> (ListFilters -> ListFilters -> Bool) -> Eq ListFilters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFilters -> ListFilters -> Bool
$c/= :: ListFilters -> ListFilters -> Bool
== :: ListFilters -> ListFilters -> Bool
$c== :: ListFilters -> ListFilters -> Bool
Prelude.Eq, ReadPrec [ListFilters]
ReadPrec ListFilters
Int -> ReadS ListFilters
ReadS [ListFilters]
(Int -> ReadS ListFilters)
-> ReadS [ListFilters]
-> ReadPrec ListFilters
-> ReadPrec [ListFilters]
-> Read ListFilters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFilters]
$creadListPrec :: ReadPrec [ListFilters]
readPrec :: ReadPrec ListFilters
$creadPrec :: ReadPrec ListFilters
readList :: ReadS [ListFilters]
$creadList :: ReadS [ListFilters]
readsPrec :: Int -> ReadS ListFilters
$creadsPrec :: Int -> ReadS ListFilters
Prelude.Read, Int -> ListFilters -> ShowS
[ListFilters] -> ShowS
ListFilters -> String
(Int -> ListFilters -> ShowS)
-> (ListFilters -> String)
-> ([ListFilters] -> ShowS)
-> Show ListFilters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFilters] -> ShowS
$cshowList :: [ListFilters] -> ShowS
show :: ListFilters -> String
$cshow :: ListFilters -> String
showsPrec :: Int -> ListFilters -> ShowS
$cshowsPrec :: Int -> ListFilters -> ShowS
Prelude.Show, (forall x. ListFilters -> Rep ListFilters x)
-> (forall x. Rep ListFilters x -> ListFilters)
-> Generic ListFilters
forall x. Rep ListFilters x -> ListFilters
forall x. ListFilters -> Rep ListFilters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFilters x -> ListFilters
$cfrom :: forall x. ListFilters -> Rep ListFilters x
Prelude.Generic)

-- |
-- Create a value of 'ListFilters' 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', 'listFilters_nextToken' - A token returned from the previous call to @ListFilters@ for getting the
-- next set of filters (if they exist).
--
-- 'datasetGroupArn', 'listFilters_datasetGroupArn' - The ARN of the dataset group that contains the filters.
--
-- 'maxResults', 'listFilters_maxResults' - The maximum number of filters to return.
newListFilters ::
  ListFilters
newListFilters :: ListFilters
newListFilters =
  ListFilters' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListFilters
ListFilters'
    { $sel:nextToken:ListFilters' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetGroupArn:ListFilters' :: Maybe Text
datasetGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFilters' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token returned from the previous call to @ListFilters@ for getting the
-- next set of filters (if they exist).
listFilters_nextToken :: Lens.Lens' ListFilters (Prelude.Maybe Prelude.Text)
listFilters_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListFilters -> f ListFilters
listFilters_nextToken = (ListFilters -> Maybe Text)
-> (ListFilters -> Maybe Text -> ListFilters)
-> Lens ListFilters ListFilters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFilters' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFilters' :: ListFilters -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFilters
s@ListFilters' {} Maybe Text
a -> ListFilters
s {$sel:nextToken:ListFilters' :: Maybe Text
nextToken = Maybe Text
a} :: ListFilters)

-- | The ARN of the dataset group that contains the filters.
listFilters_datasetGroupArn :: Lens.Lens' ListFilters (Prelude.Maybe Prelude.Text)
listFilters_datasetGroupArn :: (Maybe Text -> f (Maybe Text)) -> ListFilters -> f ListFilters
listFilters_datasetGroupArn = (ListFilters -> Maybe Text)
-> (ListFilters -> Maybe Text -> ListFilters)
-> Lens ListFilters ListFilters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFilters' {Maybe Text
datasetGroupArn :: Maybe Text
$sel:datasetGroupArn:ListFilters' :: ListFilters -> Maybe Text
datasetGroupArn} -> Maybe Text
datasetGroupArn) (\s :: ListFilters
s@ListFilters' {} Maybe Text
a -> ListFilters
s {$sel:datasetGroupArn:ListFilters' :: Maybe Text
datasetGroupArn = Maybe Text
a} :: ListFilters)

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

instance Core.AWSPager ListFilters where
  page :: ListFilters -> AWSResponse ListFilters -> Maybe ListFilters
page ListFilters
rq AWSResponse ListFilters
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFilters
ListFiltersResponse
rs
            ListFiltersResponse
-> Getting (First Text) ListFiltersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListFiltersResponse -> Const (First Text) ListFiltersResponse
Lens' ListFiltersResponse (Maybe Text)
listFiltersResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListFiltersResponse -> Const (First Text) ListFiltersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListFiltersResponse 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 ListFilters
forall a. Maybe a
Prelude.Nothing
    | Maybe [FilterSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFilters
ListFiltersResponse
rs
            ListFiltersResponse
-> Getting
     (First [FilterSummary]) ListFiltersResponse [FilterSummary]
-> Maybe [FilterSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [FilterSummary]
 -> Const (First [FilterSummary]) (Maybe [FilterSummary]))
-> ListFiltersResponse
-> Const (First [FilterSummary]) ListFiltersResponse
Lens' ListFiltersResponse (Maybe [FilterSummary])
listFiltersResponse_filters ((Maybe [FilterSummary]
  -> Const (First [FilterSummary]) (Maybe [FilterSummary]))
 -> ListFiltersResponse
 -> Const (First [FilterSummary]) ListFiltersResponse)
-> (([FilterSummary]
     -> Const (First [FilterSummary]) [FilterSummary])
    -> Maybe [FilterSummary]
    -> Const (First [FilterSummary]) (Maybe [FilterSummary]))
-> Getting
     (First [FilterSummary]) ListFiltersResponse [FilterSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([FilterSummary] -> Const (First [FilterSummary]) [FilterSummary])
-> Maybe [FilterSummary]
-> Const (First [FilterSummary]) (Maybe [FilterSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListFilters
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListFilters -> Maybe ListFilters
forall a. a -> Maybe a
Prelude.Just (ListFilters -> Maybe ListFilters)
-> ListFilters -> Maybe ListFilters
forall a b. (a -> b) -> a -> b
Prelude.$
        ListFilters
rq
          ListFilters -> (ListFilters -> ListFilters) -> ListFilters
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListFilters -> Identity ListFilters
Lens ListFilters ListFilters (Maybe Text) (Maybe Text)
listFilters_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListFilters -> Identity ListFilters)
-> Maybe Text -> ListFilters -> ListFilters
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFilters
ListFiltersResponse
rs
          ListFiltersResponse
-> Getting (First Text) ListFiltersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListFiltersResponse -> Const (First Text) ListFiltersResponse
Lens' ListFiltersResponse (Maybe Text)
listFiltersResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListFiltersResponse -> Const (First Text) ListFiltersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListFiltersResponse 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 ListFilters where
  type AWSResponse ListFilters = ListFiltersResponse
  request :: ListFilters -> Request ListFilters
request = Service -> ListFilters -> Request ListFilters
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListFilters
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListFilters)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListFilters))
-> Logger
-> Service
-> Proxy ListFilters
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListFilters)))
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 [FilterSummary] -> Maybe Text -> Int -> ListFiltersResponse
ListFiltersResponse'
            (Maybe [FilterSummary] -> Maybe Text -> Int -> ListFiltersResponse)
-> Either String (Maybe [FilterSummary])
-> Either String (Maybe Text -> Int -> ListFiltersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [FilterSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Filters" Either String (Maybe (Maybe [FilterSummary]))
-> Maybe [FilterSummary] -> Either String (Maybe [FilterSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FilterSummary]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListFiltersResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListFiltersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either String (Int -> ListFiltersResponse)
-> Either String Int -> Either String ListFiltersResponse
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 ListFilters

instance Prelude.NFData ListFilters

instance Core.ToHeaders ListFilters where
  toHeaders :: ListFilters -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListFilters -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonPersonalize.ListFilters" ::
                          Prelude.ByteString
                      ),
            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 ListFilters where
  toJSON :: ListFilters -> Value
toJSON ListFilters' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
datasetGroupArn :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:ListFilters' :: ListFilters -> Maybe Natural
$sel:datasetGroupArn:ListFilters' :: ListFilters -> Maybe Text
$sel:nextToken:ListFilters' :: ListFilters -> 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
"datasetGroupArn" 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
datasetGroupArn,
            (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 ListFilters where
  toPath :: ListFilters -> ByteString
toPath = ByteString -> ListFilters -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListFiltersResponse' smart constructor.
data ListFiltersResponse = ListFiltersResponse'
  { -- | A list of returned filters.
    ListFiltersResponse -> Maybe [FilterSummary]
filters :: Prelude.Maybe [FilterSummary],
    -- | A token for getting the next set of filters (if they exist).
    ListFiltersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListFiltersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFiltersResponse -> ListFiltersResponse -> Bool
(ListFiltersResponse -> ListFiltersResponse -> Bool)
-> (ListFiltersResponse -> ListFiltersResponse -> Bool)
-> Eq ListFiltersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFiltersResponse -> ListFiltersResponse -> Bool
$c/= :: ListFiltersResponse -> ListFiltersResponse -> Bool
== :: ListFiltersResponse -> ListFiltersResponse -> Bool
$c== :: ListFiltersResponse -> ListFiltersResponse -> Bool
Prelude.Eq, ReadPrec [ListFiltersResponse]
ReadPrec ListFiltersResponse
Int -> ReadS ListFiltersResponse
ReadS [ListFiltersResponse]
(Int -> ReadS ListFiltersResponse)
-> ReadS [ListFiltersResponse]
-> ReadPrec ListFiltersResponse
-> ReadPrec [ListFiltersResponse]
-> Read ListFiltersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFiltersResponse]
$creadListPrec :: ReadPrec [ListFiltersResponse]
readPrec :: ReadPrec ListFiltersResponse
$creadPrec :: ReadPrec ListFiltersResponse
readList :: ReadS [ListFiltersResponse]
$creadList :: ReadS [ListFiltersResponse]
readsPrec :: Int -> ReadS ListFiltersResponse
$creadsPrec :: Int -> ReadS ListFiltersResponse
Prelude.Read, Int -> ListFiltersResponse -> ShowS
[ListFiltersResponse] -> ShowS
ListFiltersResponse -> String
(Int -> ListFiltersResponse -> ShowS)
-> (ListFiltersResponse -> String)
-> ([ListFiltersResponse] -> ShowS)
-> Show ListFiltersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFiltersResponse] -> ShowS
$cshowList :: [ListFiltersResponse] -> ShowS
show :: ListFiltersResponse -> String
$cshow :: ListFiltersResponse -> String
showsPrec :: Int -> ListFiltersResponse -> ShowS
$cshowsPrec :: Int -> ListFiltersResponse -> ShowS
Prelude.Show, (forall x. ListFiltersResponse -> Rep ListFiltersResponse x)
-> (forall x. Rep ListFiltersResponse x -> ListFiltersResponse)
-> Generic ListFiltersResponse
forall x. Rep ListFiltersResponse x -> ListFiltersResponse
forall x. ListFiltersResponse -> Rep ListFiltersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFiltersResponse x -> ListFiltersResponse
$cfrom :: forall x. ListFiltersResponse -> Rep ListFiltersResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFiltersResponse' 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:
--
-- 'filters', 'listFiltersResponse_filters' - A list of returned filters.
--
-- 'nextToken', 'listFiltersResponse_nextToken' - A token for getting the next set of filters (if they exist).
--
-- 'httpStatus', 'listFiltersResponse_httpStatus' - The response's http status code.
newListFiltersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFiltersResponse
newListFiltersResponse :: Int -> ListFiltersResponse
newListFiltersResponse Int
pHttpStatus_ =
  ListFiltersResponse' :: Maybe [FilterSummary] -> Maybe Text -> Int -> ListFiltersResponse
ListFiltersResponse'
    { $sel:filters:ListFiltersResponse' :: Maybe [FilterSummary]
filters = Maybe [FilterSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListFiltersResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFiltersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of returned filters.
listFiltersResponse_filters :: Lens.Lens' ListFiltersResponse (Prelude.Maybe [FilterSummary])
listFiltersResponse_filters :: (Maybe [FilterSummary] -> f (Maybe [FilterSummary]))
-> ListFiltersResponse -> f ListFiltersResponse
listFiltersResponse_filters = (ListFiltersResponse -> Maybe [FilterSummary])
-> (ListFiltersResponse
    -> Maybe [FilterSummary] -> ListFiltersResponse)
-> Lens' ListFiltersResponse (Maybe [FilterSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFiltersResponse' {Maybe [FilterSummary]
filters :: Maybe [FilterSummary]
$sel:filters:ListFiltersResponse' :: ListFiltersResponse -> Maybe [FilterSummary]
filters} -> Maybe [FilterSummary]
filters) (\s :: ListFiltersResponse
s@ListFiltersResponse' {} Maybe [FilterSummary]
a -> ListFiltersResponse
s {$sel:filters:ListFiltersResponse' :: Maybe [FilterSummary]
filters = Maybe [FilterSummary]
a} :: ListFiltersResponse) ((Maybe [FilterSummary] -> f (Maybe [FilterSummary]))
 -> ListFiltersResponse -> f ListFiltersResponse)
-> ((Maybe [FilterSummary] -> f (Maybe [FilterSummary]))
    -> Maybe [FilterSummary] -> f (Maybe [FilterSummary]))
-> (Maybe [FilterSummary] -> f (Maybe [FilterSummary]))
-> ListFiltersResponse
-> f ListFiltersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FilterSummary] [FilterSummary] [FilterSummary] [FilterSummary]
-> Iso
     (Maybe [FilterSummary])
     (Maybe [FilterSummary])
     (Maybe [FilterSummary])
     (Maybe [FilterSummary])
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
  [FilterSummary] [FilterSummary] [FilterSummary] [FilterSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token for getting the next set of filters (if they exist).
listFiltersResponse_nextToken :: Lens.Lens' ListFiltersResponse (Prelude.Maybe Prelude.Text)
listFiltersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFiltersResponse -> f ListFiltersResponse
listFiltersResponse_nextToken = (ListFiltersResponse -> Maybe Text)
-> (ListFiltersResponse -> Maybe Text -> ListFiltersResponse)
-> Lens' ListFiltersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFiltersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFiltersResponse' :: ListFiltersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFiltersResponse
s@ListFiltersResponse' {} Maybe Text
a -> ListFiltersResponse
s {$sel:nextToken:ListFiltersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFiltersResponse)

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

instance Prelude.NFData ListFiltersResponse