{-# 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.ListFacetAttributes
-- 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 attributes attached to the facet.
--
-- This operation returns paginated results.
module Amazonka.CloudDirectory.ListFacetAttributes
  ( -- * Creating a Request
    ListFacetAttributes (..),
    newListFacetAttributes,

    -- * Request Lenses
    listFacetAttributes_nextToken,
    listFacetAttributes_maxResults,
    listFacetAttributes_schemaArn,
    listFacetAttributes_name,

    -- * Destructuring the Response
    ListFacetAttributesResponse (..),
    newListFacetAttributesResponse,

    -- * Response Lenses
    listFacetAttributesResponse_nextToken,
    listFacetAttributesResponse_attributes,
    listFacetAttributesResponse_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:/ 'newListFacetAttributes' smart constructor.
data ListFacetAttributes = ListFacetAttributes'
  { -- | The pagination token.
    ListFacetAttributes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to retrieve.
    ListFacetAttributes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ARN of the schema where the facet resides.
    ListFacetAttributes -> Text
schemaArn :: Prelude.Text,
    -- | The name of the facet whose attributes will be retrieved.
    ListFacetAttributes -> Text
name :: Prelude.Text
  }
  deriving (ListFacetAttributes -> ListFacetAttributes -> Bool
(ListFacetAttributes -> ListFacetAttributes -> Bool)
-> (ListFacetAttributes -> ListFacetAttributes -> Bool)
-> Eq ListFacetAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFacetAttributes -> ListFacetAttributes -> Bool
$c/= :: ListFacetAttributes -> ListFacetAttributes -> Bool
== :: ListFacetAttributes -> ListFacetAttributes -> Bool
$c== :: ListFacetAttributes -> ListFacetAttributes -> Bool
Prelude.Eq, ReadPrec [ListFacetAttributes]
ReadPrec ListFacetAttributes
Int -> ReadS ListFacetAttributes
ReadS [ListFacetAttributes]
(Int -> ReadS ListFacetAttributes)
-> ReadS [ListFacetAttributes]
-> ReadPrec ListFacetAttributes
-> ReadPrec [ListFacetAttributes]
-> Read ListFacetAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFacetAttributes]
$creadListPrec :: ReadPrec [ListFacetAttributes]
readPrec :: ReadPrec ListFacetAttributes
$creadPrec :: ReadPrec ListFacetAttributes
readList :: ReadS [ListFacetAttributes]
$creadList :: ReadS [ListFacetAttributes]
readsPrec :: Int -> ReadS ListFacetAttributes
$creadsPrec :: Int -> ReadS ListFacetAttributes
Prelude.Read, Int -> ListFacetAttributes -> ShowS
[ListFacetAttributes] -> ShowS
ListFacetAttributes -> String
(Int -> ListFacetAttributes -> ShowS)
-> (ListFacetAttributes -> String)
-> ([ListFacetAttributes] -> ShowS)
-> Show ListFacetAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFacetAttributes] -> ShowS
$cshowList :: [ListFacetAttributes] -> ShowS
show :: ListFacetAttributes -> String
$cshow :: ListFacetAttributes -> String
showsPrec :: Int -> ListFacetAttributes -> ShowS
$cshowsPrec :: Int -> ListFacetAttributes -> ShowS
Prelude.Show, (forall x. ListFacetAttributes -> Rep ListFacetAttributes x)
-> (forall x. Rep ListFacetAttributes x -> ListFacetAttributes)
-> Generic ListFacetAttributes
forall x. Rep ListFacetAttributes x -> ListFacetAttributes
forall x. ListFacetAttributes -> Rep ListFacetAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFacetAttributes x -> ListFacetAttributes
$cfrom :: forall x. ListFacetAttributes -> Rep ListFacetAttributes x
Prelude.Generic)

-- |
-- Create a value of 'ListFacetAttributes' 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', 'listFacetAttributes_nextToken' - The pagination token.
--
-- 'maxResults', 'listFacetAttributes_maxResults' - The maximum number of results to retrieve.
--
-- 'schemaArn', 'listFacetAttributes_schemaArn' - The ARN of the schema where the facet resides.
--
-- 'name', 'listFacetAttributes_name' - The name of the facet whose attributes will be retrieved.
newListFacetAttributes ::
  -- | 'schemaArn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  ListFacetAttributes
newListFacetAttributes :: Text -> Text -> ListFacetAttributes
newListFacetAttributes Text
pSchemaArn_ Text
pName_ =
  ListFacetAttributes' :: Maybe Text -> Maybe Natural -> Text -> Text -> ListFacetAttributes
ListFacetAttributes'
    { $sel:nextToken:ListFacetAttributes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFacetAttributes' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:ListFacetAttributes' :: Text
schemaArn = Text
pSchemaArn_,
      $sel:name:ListFacetAttributes' :: Text
name = Text
pName_
    }

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

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

-- | The ARN of the schema where the facet resides.
listFacetAttributes_schemaArn :: Lens.Lens' ListFacetAttributes Prelude.Text
listFacetAttributes_schemaArn :: (Text -> f Text) -> ListFacetAttributes -> f ListFacetAttributes
listFacetAttributes_schemaArn = (ListFacetAttributes -> Text)
-> (ListFacetAttributes -> Text -> ListFacetAttributes)
-> Lens ListFacetAttributes ListFacetAttributes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFacetAttributes' {Text
schemaArn :: Text
$sel:schemaArn:ListFacetAttributes' :: ListFacetAttributes -> Text
schemaArn} -> Text
schemaArn) (\s :: ListFacetAttributes
s@ListFacetAttributes' {} Text
a -> ListFacetAttributes
s {$sel:schemaArn:ListFacetAttributes' :: Text
schemaArn = Text
a} :: ListFacetAttributes)

-- | The name of the facet whose attributes will be retrieved.
listFacetAttributes_name :: Lens.Lens' ListFacetAttributes Prelude.Text
listFacetAttributes_name :: (Text -> f Text) -> ListFacetAttributes -> f ListFacetAttributes
listFacetAttributes_name = (ListFacetAttributes -> Text)
-> (ListFacetAttributes -> Text -> ListFacetAttributes)
-> Lens ListFacetAttributes ListFacetAttributes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFacetAttributes' {Text
name :: Text
$sel:name:ListFacetAttributes' :: ListFacetAttributes -> Text
name} -> Text
name) (\s :: ListFacetAttributes
s@ListFacetAttributes' {} Text
a -> ListFacetAttributes
s {$sel:name:ListFacetAttributes' :: Text
name = Text
a} :: ListFacetAttributes)

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

instance Prelude.NFData ListFacetAttributes

instance Core.ToHeaders ListFacetAttributes where
  toHeaders :: ListFacetAttributes -> ResponseHeaders
toHeaders ListFacetAttributes' {Maybe Natural
Maybe Text
Text
name :: Text
schemaArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:name:ListFacetAttributes' :: ListFacetAttributes -> Text
$sel:schemaArn:ListFacetAttributes' :: ListFacetAttributes -> Text
$sel:maxResults:ListFacetAttributes' :: ListFacetAttributes -> Maybe Natural
$sel:nextToken:ListFacetAttributes' :: ListFacetAttributes -> 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 ListFacetAttributes where
  toJSON :: ListFacetAttributes -> Value
toJSON ListFacetAttributes' {Maybe Natural
Maybe Text
Text
name :: Text
schemaArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:name:ListFacetAttributes' :: ListFacetAttributes -> Text
$sel:schemaArn:ListFacetAttributes' :: ListFacetAttributes -> Text
$sel:maxResults:ListFacetAttributes' :: ListFacetAttributes -> Maybe Natural
$sel:nextToken:ListFacetAttributes' :: ListFacetAttributes -> 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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

instance Core.ToPath ListFacetAttributes where
  toPath :: ListFacetAttributes -> ByteString
toPath =
    ByteString -> ListFacetAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/amazonclouddirectory/2017-01-11/facet/attributes"

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

-- | /See:/ 'newListFacetAttributesResponse' smart constructor.
data ListFacetAttributesResponse = ListFacetAttributesResponse'
  { -- | The pagination token.
    ListFacetAttributesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The attributes attached to the facet.
    ListFacetAttributesResponse -> Maybe [FacetAttribute]
attributes :: Prelude.Maybe [FacetAttribute],
    -- | The response's http status code.
    ListFacetAttributesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFacetAttributesResponse -> ListFacetAttributesResponse -> Bool
(ListFacetAttributesResponse
 -> ListFacetAttributesResponse -> Bool)
-> (ListFacetAttributesResponse
    -> ListFacetAttributesResponse -> Bool)
-> Eq ListFacetAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFacetAttributesResponse -> ListFacetAttributesResponse -> Bool
$c/= :: ListFacetAttributesResponse -> ListFacetAttributesResponse -> Bool
== :: ListFacetAttributesResponse -> ListFacetAttributesResponse -> Bool
$c== :: ListFacetAttributesResponse -> ListFacetAttributesResponse -> Bool
Prelude.Eq, ReadPrec [ListFacetAttributesResponse]
ReadPrec ListFacetAttributesResponse
Int -> ReadS ListFacetAttributesResponse
ReadS [ListFacetAttributesResponse]
(Int -> ReadS ListFacetAttributesResponse)
-> ReadS [ListFacetAttributesResponse]
-> ReadPrec ListFacetAttributesResponse
-> ReadPrec [ListFacetAttributesResponse]
-> Read ListFacetAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFacetAttributesResponse]
$creadListPrec :: ReadPrec [ListFacetAttributesResponse]
readPrec :: ReadPrec ListFacetAttributesResponse
$creadPrec :: ReadPrec ListFacetAttributesResponse
readList :: ReadS [ListFacetAttributesResponse]
$creadList :: ReadS [ListFacetAttributesResponse]
readsPrec :: Int -> ReadS ListFacetAttributesResponse
$creadsPrec :: Int -> ReadS ListFacetAttributesResponse
Prelude.Read, Int -> ListFacetAttributesResponse -> ShowS
[ListFacetAttributesResponse] -> ShowS
ListFacetAttributesResponse -> String
(Int -> ListFacetAttributesResponse -> ShowS)
-> (ListFacetAttributesResponse -> String)
-> ([ListFacetAttributesResponse] -> ShowS)
-> Show ListFacetAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFacetAttributesResponse] -> ShowS
$cshowList :: [ListFacetAttributesResponse] -> ShowS
show :: ListFacetAttributesResponse -> String
$cshow :: ListFacetAttributesResponse -> String
showsPrec :: Int -> ListFacetAttributesResponse -> ShowS
$cshowsPrec :: Int -> ListFacetAttributesResponse -> ShowS
Prelude.Show, (forall x.
 ListFacetAttributesResponse -> Rep ListFacetAttributesResponse x)
-> (forall x.
    Rep ListFacetAttributesResponse x -> ListFacetAttributesResponse)
-> Generic ListFacetAttributesResponse
forall x.
Rep ListFacetAttributesResponse x -> ListFacetAttributesResponse
forall x.
ListFacetAttributesResponse -> Rep ListFacetAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFacetAttributesResponse x -> ListFacetAttributesResponse
$cfrom :: forall x.
ListFacetAttributesResponse -> Rep ListFacetAttributesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFacetAttributesResponse' 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', 'listFacetAttributesResponse_nextToken' - The pagination token.
--
-- 'attributes', 'listFacetAttributesResponse_attributes' - The attributes attached to the facet.
--
-- 'httpStatus', 'listFacetAttributesResponse_httpStatus' - The response's http status code.
newListFacetAttributesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFacetAttributesResponse
newListFacetAttributesResponse :: Int -> ListFacetAttributesResponse
newListFacetAttributesResponse Int
pHttpStatus_ =
  ListFacetAttributesResponse' :: Maybe Text
-> Maybe [FacetAttribute] -> Int -> ListFacetAttributesResponse
ListFacetAttributesResponse'
    { $sel:nextToken:ListFacetAttributesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:ListFacetAttributesResponse' :: Maybe [FacetAttribute]
attributes = Maybe [FacetAttribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFacetAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The attributes attached to the facet.
listFacetAttributesResponse_attributes :: Lens.Lens' ListFacetAttributesResponse (Prelude.Maybe [FacetAttribute])
listFacetAttributesResponse_attributes :: (Maybe [FacetAttribute] -> f (Maybe [FacetAttribute]))
-> ListFacetAttributesResponse -> f ListFacetAttributesResponse
listFacetAttributesResponse_attributes = (ListFacetAttributesResponse -> Maybe [FacetAttribute])
-> (ListFacetAttributesResponse
    -> Maybe [FacetAttribute] -> ListFacetAttributesResponse)
-> Lens' ListFacetAttributesResponse (Maybe [FacetAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFacetAttributesResponse' {Maybe [FacetAttribute]
attributes :: Maybe [FacetAttribute]
$sel:attributes:ListFacetAttributesResponse' :: ListFacetAttributesResponse -> Maybe [FacetAttribute]
attributes} -> Maybe [FacetAttribute]
attributes) (\s :: ListFacetAttributesResponse
s@ListFacetAttributesResponse' {} Maybe [FacetAttribute]
a -> ListFacetAttributesResponse
s {$sel:attributes:ListFacetAttributesResponse' :: Maybe [FacetAttribute]
attributes = Maybe [FacetAttribute]
a} :: ListFacetAttributesResponse) ((Maybe [FacetAttribute] -> f (Maybe [FacetAttribute]))
 -> ListFacetAttributesResponse -> f ListFacetAttributesResponse)
-> ((Maybe [FacetAttribute] -> f (Maybe [FacetAttribute]))
    -> Maybe [FacetAttribute] -> f (Maybe [FacetAttribute]))
-> (Maybe [FacetAttribute] -> f (Maybe [FacetAttribute]))
-> ListFacetAttributesResponse
-> f ListFacetAttributesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FacetAttribute] [FacetAttribute] [FacetAttribute] [FacetAttribute]
-> Iso
     (Maybe [FacetAttribute])
     (Maybe [FacetAttribute])
     (Maybe [FacetAttribute])
     (Maybe [FacetAttribute])
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
  [FacetAttribute] [FacetAttribute] [FacetAttribute] [FacetAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListFacetAttributesResponse