{-# 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.CloudDirectory.ListFacetNames
-- 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)
--
-- Retrieves the names of facets that exist in a schema.
--
-- This operation returns paginated results.
module Amazonka.CloudDirectory.ListFacetNames
  ( -- * Creating a Request
    ListFacetNames (..),
    newListFacetNames,

    -- * Request Lenses
    listFacetNames_nextToken,
    listFacetNames_maxResults,
    listFacetNames_schemaArn,

    -- * Destructuring the Response
    ListFacetNamesResponse (..),
    newListFacetNamesResponse,

    -- * Response Lenses
    listFacetNamesResponse_nextToken,
    listFacetNamesResponse_facetNames,
    listFacetNamesResponse_httpStatus,
  )
where

import Amazonka.CloudDirectory.Types
import qualified Amazonka.Core as Core
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:/ 'newListFacetNames' smart constructor.
data ListFacetNames = ListFacetNames'
  { -- | The pagination token.
    ListFacetNames -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to retrieve.
    ListFacetNames -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) to retrieve facet names from.
    ListFacetNames -> Text
schemaArn :: Prelude.Text
  }
  deriving (ListFacetNames -> ListFacetNames -> Bool
(ListFacetNames -> ListFacetNames -> Bool)
-> (ListFacetNames -> ListFacetNames -> Bool) -> Eq ListFacetNames
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFacetNames -> ListFacetNames -> Bool
$c/= :: ListFacetNames -> ListFacetNames -> Bool
== :: ListFacetNames -> ListFacetNames -> Bool
$c== :: ListFacetNames -> ListFacetNames -> Bool
Prelude.Eq, ReadPrec [ListFacetNames]
ReadPrec ListFacetNames
Int -> ReadS ListFacetNames
ReadS [ListFacetNames]
(Int -> ReadS ListFacetNames)
-> ReadS [ListFacetNames]
-> ReadPrec ListFacetNames
-> ReadPrec [ListFacetNames]
-> Read ListFacetNames
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFacetNames]
$creadListPrec :: ReadPrec [ListFacetNames]
readPrec :: ReadPrec ListFacetNames
$creadPrec :: ReadPrec ListFacetNames
readList :: ReadS [ListFacetNames]
$creadList :: ReadS [ListFacetNames]
readsPrec :: Int -> ReadS ListFacetNames
$creadsPrec :: Int -> ReadS ListFacetNames
Prelude.Read, Int -> ListFacetNames -> ShowS
[ListFacetNames] -> ShowS
ListFacetNames -> String
(Int -> ListFacetNames -> ShowS)
-> (ListFacetNames -> String)
-> ([ListFacetNames] -> ShowS)
-> Show ListFacetNames
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFacetNames] -> ShowS
$cshowList :: [ListFacetNames] -> ShowS
show :: ListFacetNames -> String
$cshow :: ListFacetNames -> String
showsPrec :: Int -> ListFacetNames -> ShowS
$cshowsPrec :: Int -> ListFacetNames -> ShowS
Prelude.Show, (forall x. ListFacetNames -> Rep ListFacetNames x)
-> (forall x. Rep ListFacetNames x -> ListFacetNames)
-> Generic ListFacetNames
forall x. Rep ListFacetNames x -> ListFacetNames
forall x. ListFacetNames -> Rep ListFacetNames x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFacetNames x -> ListFacetNames
$cfrom :: forall x. ListFacetNames -> Rep ListFacetNames x
Prelude.Generic)

-- |
-- Create a value of 'ListFacetNames' 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', 'listFacetNames_nextToken' - The pagination token.
--
-- 'maxResults', 'listFacetNames_maxResults' - The maximum number of results to retrieve.
--
-- 'schemaArn', 'listFacetNames_schemaArn' - The Amazon Resource Name (ARN) to retrieve facet names from.
newListFacetNames ::
  -- | 'schemaArn'
  Prelude.Text ->
  ListFacetNames
newListFacetNames :: Text -> ListFacetNames
newListFacetNames Text
pSchemaArn_ =
  ListFacetNames' :: Maybe Text -> Maybe Natural -> Text -> ListFacetNames
ListFacetNames'
    { $sel:nextToken:ListFacetNames' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFacetNames' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:ListFacetNames' :: Text
schemaArn = Text
pSchemaArn_
    }

-- | The pagination token.
listFacetNames_nextToken :: Lens.Lens' ListFacetNames (Prelude.Maybe Prelude.Text)
listFacetNames_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFacetNames -> f ListFacetNames
listFacetNames_nextToken = (ListFacetNames -> Maybe Text)
-> (ListFacetNames -> Maybe Text -> ListFacetNames)
-> Lens ListFacetNames ListFacetNames (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFacetNames' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFacetNames' :: ListFacetNames -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFacetNames
s@ListFacetNames' {} Maybe Text
a -> ListFacetNames
s {$sel:nextToken:ListFacetNames' :: Maybe Text
nextToken = Maybe Text
a} :: ListFacetNames)

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

-- | The Amazon Resource Name (ARN) to retrieve facet names from.
listFacetNames_schemaArn :: Lens.Lens' ListFacetNames Prelude.Text
listFacetNames_schemaArn :: (Text -> f Text) -> ListFacetNames -> f ListFacetNames
listFacetNames_schemaArn = (ListFacetNames -> Text)
-> (ListFacetNames -> Text -> ListFacetNames)
-> Lens ListFacetNames ListFacetNames Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFacetNames' {Text
schemaArn :: Text
$sel:schemaArn:ListFacetNames' :: ListFacetNames -> Text
schemaArn} -> Text
schemaArn) (\s :: ListFacetNames
s@ListFacetNames' {} Text
a -> ListFacetNames
s {$sel:schemaArn:ListFacetNames' :: Text
schemaArn = Text
a} :: ListFacetNames)

instance Core.AWSPager ListFacetNames where
  page :: ListFacetNames
-> AWSResponse ListFacetNames -> Maybe ListFacetNames
page ListFacetNames
rq AWSResponse ListFacetNames
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFacetNames
ListFacetNamesResponse
rs
            ListFacetNamesResponse
-> Getting (First Text) ListFacetNamesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListFacetNamesResponse
-> Const (First Text) ListFacetNamesResponse
Lens' ListFacetNamesResponse (Maybe Text)
listFacetNamesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListFacetNamesResponse
 -> Const (First Text) ListFacetNamesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListFacetNamesResponse 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 ListFacetNames
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFacetNames
ListFacetNamesResponse
rs
            ListFacetNamesResponse
-> Getting (First [Text]) ListFacetNamesResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListFacetNamesResponse
-> Const (First [Text]) ListFacetNamesResponse
Lens' ListFacetNamesResponse (Maybe [Text])
listFacetNamesResponse_facetNames
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListFacetNamesResponse
 -> Const (First [Text]) ListFacetNamesResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListFacetNamesResponse [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 ListFacetNames
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListFacetNames -> Maybe ListFacetNames
forall a. a -> Maybe a
Prelude.Just (ListFacetNames -> Maybe ListFacetNames)
-> ListFacetNames -> Maybe ListFacetNames
forall a b. (a -> b) -> a -> b
Prelude.$
        ListFacetNames
rq
          ListFacetNames
-> (ListFacetNames -> ListFacetNames) -> ListFacetNames
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListFacetNames -> Identity ListFacetNames
Lens ListFacetNames ListFacetNames (Maybe Text) (Maybe Text)
listFacetNames_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListFacetNames -> Identity ListFacetNames)
-> Maybe Text -> ListFacetNames -> ListFacetNames
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFacetNames
ListFacetNamesResponse
rs
          ListFacetNamesResponse
-> Getting (First Text) ListFacetNamesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListFacetNamesResponse
-> Const (First Text) ListFacetNamesResponse
Lens' ListFacetNamesResponse (Maybe Text)
listFacetNamesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListFacetNamesResponse
 -> Const (First Text) ListFacetNamesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListFacetNamesResponse 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 ListFacetNames where
  type
    AWSResponse ListFacetNames =
      ListFacetNamesResponse
  request :: ListFacetNames -> Request ListFacetNames
request = Service -> ListFacetNames -> Request ListFacetNames
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListFacetNames
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListFacetNames)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListFacetNames))
-> Logger
-> Service
-> Proxy ListFacetNames
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListFacetNames)))
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 -> ListFacetNamesResponse
ListFacetNamesResponse'
            (Maybe Text -> Maybe [Text] -> Int -> ListFacetNamesResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Text] -> Int -> ListFacetNamesResponse)
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 -> ListFacetNamesResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> ListFacetNamesResponse)
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
"FacetNames" 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 -> ListFacetNamesResponse)
-> Either String Int -> Either String ListFacetNamesResponse
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 ListFacetNames

instance Prelude.NFData ListFacetNames

instance Core.ToHeaders ListFacetNames where
  toHeaders :: ListFacetNames -> ResponseHeaders
toHeaders ListFacetNames' {Maybe Natural
Maybe Text
Text
schemaArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:schemaArn:ListFacetNames' :: ListFacetNames -> Text
$sel:maxResults:ListFacetNames' :: ListFacetNames -> Maybe Natural
$sel:nextToken:ListFacetNames' :: ListFacetNames -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [HeaderName
"x-amz-data-partition" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
schemaArn]

instance Core.ToJSON ListFacetNames where
  toJSON :: ListFacetNames -> Value
toJSON ListFacetNames' {Maybe Natural
Maybe Text
Text
schemaArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:schemaArn:ListFacetNames' :: ListFacetNames -> Text
$sel:maxResults:ListFacetNames' :: ListFacetNames -> Maybe Natural
$sel:nextToken:ListFacetNames' :: ListFacetNames -> 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 ListFacetNames where
  toPath :: ListFacetNames -> ByteString
toPath =
    ByteString -> ListFacetNames -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/amazonclouddirectory/2017-01-11/facet/list"

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

-- | /See:/ 'newListFacetNamesResponse' smart constructor.
data ListFacetNamesResponse = ListFacetNamesResponse'
  { -- | The pagination token.
    ListFacetNamesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The names of facets that exist within the schema.
    ListFacetNamesResponse -> Maybe [Text]
facetNames :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListFacetNamesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFacetNamesResponse -> ListFacetNamesResponse -> Bool
(ListFacetNamesResponse -> ListFacetNamesResponse -> Bool)
-> (ListFacetNamesResponse -> ListFacetNamesResponse -> Bool)
-> Eq ListFacetNamesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFacetNamesResponse -> ListFacetNamesResponse -> Bool
$c/= :: ListFacetNamesResponse -> ListFacetNamesResponse -> Bool
== :: ListFacetNamesResponse -> ListFacetNamesResponse -> Bool
$c== :: ListFacetNamesResponse -> ListFacetNamesResponse -> Bool
Prelude.Eq, ReadPrec [ListFacetNamesResponse]
ReadPrec ListFacetNamesResponse
Int -> ReadS ListFacetNamesResponse
ReadS [ListFacetNamesResponse]
(Int -> ReadS ListFacetNamesResponse)
-> ReadS [ListFacetNamesResponse]
-> ReadPrec ListFacetNamesResponse
-> ReadPrec [ListFacetNamesResponse]
-> Read ListFacetNamesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFacetNamesResponse]
$creadListPrec :: ReadPrec [ListFacetNamesResponse]
readPrec :: ReadPrec ListFacetNamesResponse
$creadPrec :: ReadPrec ListFacetNamesResponse
readList :: ReadS [ListFacetNamesResponse]
$creadList :: ReadS [ListFacetNamesResponse]
readsPrec :: Int -> ReadS ListFacetNamesResponse
$creadsPrec :: Int -> ReadS ListFacetNamesResponse
Prelude.Read, Int -> ListFacetNamesResponse -> ShowS
[ListFacetNamesResponse] -> ShowS
ListFacetNamesResponse -> String
(Int -> ListFacetNamesResponse -> ShowS)
-> (ListFacetNamesResponse -> String)
-> ([ListFacetNamesResponse] -> ShowS)
-> Show ListFacetNamesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFacetNamesResponse] -> ShowS
$cshowList :: [ListFacetNamesResponse] -> ShowS
show :: ListFacetNamesResponse -> String
$cshow :: ListFacetNamesResponse -> String
showsPrec :: Int -> ListFacetNamesResponse -> ShowS
$cshowsPrec :: Int -> ListFacetNamesResponse -> ShowS
Prelude.Show, (forall x. ListFacetNamesResponse -> Rep ListFacetNamesResponse x)
-> (forall x.
    Rep ListFacetNamesResponse x -> ListFacetNamesResponse)
-> Generic ListFacetNamesResponse
forall x. Rep ListFacetNamesResponse x -> ListFacetNamesResponse
forall x. ListFacetNamesResponse -> Rep ListFacetNamesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFacetNamesResponse x -> ListFacetNamesResponse
$cfrom :: forall x. ListFacetNamesResponse -> Rep ListFacetNamesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFacetNamesResponse' 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', 'listFacetNamesResponse_nextToken' - The pagination token.
--
-- 'facetNames', 'listFacetNamesResponse_facetNames' - The names of facets that exist within the schema.
--
-- 'httpStatus', 'listFacetNamesResponse_httpStatus' - The response's http status code.
newListFacetNamesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFacetNamesResponse
newListFacetNamesResponse :: Int -> ListFacetNamesResponse
newListFacetNamesResponse Int
pHttpStatus_ =
  ListFacetNamesResponse' :: Maybe Text -> Maybe [Text] -> Int -> ListFacetNamesResponse
ListFacetNamesResponse'
    { $sel:nextToken:ListFacetNamesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:facetNames:ListFacetNamesResponse' :: Maybe [Text]
facetNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFacetNamesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The pagination token.
listFacetNamesResponse_nextToken :: Lens.Lens' ListFacetNamesResponse (Prelude.Maybe Prelude.Text)
listFacetNamesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFacetNamesResponse -> f ListFacetNamesResponse
listFacetNamesResponse_nextToken = (ListFacetNamesResponse -> Maybe Text)
-> (ListFacetNamesResponse -> Maybe Text -> ListFacetNamesResponse)
-> Lens' ListFacetNamesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFacetNamesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFacetNamesResponse' :: ListFacetNamesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFacetNamesResponse
s@ListFacetNamesResponse' {} Maybe Text
a -> ListFacetNamesResponse
s {$sel:nextToken:ListFacetNamesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFacetNamesResponse)

-- | The names of facets that exist within the schema.
listFacetNamesResponse_facetNames :: Lens.Lens' ListFacetNamesResponse (Prelude.Maybe [Prelude.Text])
listFacetNamesResponse_facetNames :: (Maybe [Text] -> f (Maybe [Text]))
-> ListFacetNamesResponse -> f ListFacetNamesResponse
listFacetNamesResponse_facetNames = (ListFacetNamesResponse -> Maybe [Text])
-> (ListFacetNamesResponse
    -> Maybe [Text] -> ListFacetNamesResponse)
-> Lens' ListFacetNamesResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFacetNamesResponse' {Maybe [Text]
facetNames :: Maybe [Text]
$sel:facetNames:ListFacetNamesResponse' :: ListFacetNamesResponse -> Maybe [Text]
facetNames} -> Maybe [Text]
facetNames) (\s :: ListFacetNamesResponse
s@ListFacetNamesResponse' {} Maybe [Text]
a -> ListFacetNamesResponse
s {$sel:facetNames:ListFacetNamesResponse' :: Maybe [Text]
facetNames = Maybe [Text]
a} :: ListFacetNamesResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListFacetNamesResponse -> f ListFacetNamesResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListFacetNamesResponse
-> f ListFacetNamesResponse
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.
listFacetNamesResponse_httpStatus :: Lens.Lens' ListFacetNamesResponse Prelude.Int
listFacetNamesResponse_httpStatus :: (Int -> f Int)
-> ListFacetNamesResponse -> f ListFacetNamesResponse
listFacetNamesResponse_httpStatus = (ListFacetNamesResponse -> Int)
-> (ListFacetNamesResponse -> Int -> ListFacetNamesResponse)
-> Lens ListFacetNamesResponse ListFacetNamesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFacetNamesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListFacetNamesResponse' :: ListFacetNamesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListFacetNamesResponse
s@ListFacetNamesResponse' {} Int
a -> ListFacetNamesResponse
s {$sel:httpStatus:ListFacetNamesResponse' :: Int
httpStatus = Int
a} :: ListFacetNamesResponse)

instance Prelude.NFData ListFacetNamesResponse