{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_maxResults,
    listFacetAttributes_nextToken,
    listFacetAttributes_schemaArn,
    listFacetAttributes_name,

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

    -- * Response Lenses
    listFacetAttributesResponse_attributes,
    listFacetAttributesResponse_nextToken,
    listFacetAttributesResponse_httpStatus,
  )
where

import Amazonka.CloudDirectory.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 maximum number of results to retrieve.
    ListFacetAttributes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The pagination token.
    ListFacetAttributes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | 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
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]
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
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. 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:
--
-- 'maxResults', 'listFacetAttributes_maxResults' - The maximum number of results to retrieve.
--
-- 'nextToken', 'listFacetAttributes_nextToken' - The pagination token.
--
-- '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'
    { $sel:maxResults:ListFacetAttributes' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListFacetAttributes' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:ListFacetAttributes' :: Text
schemaArn = Text
pSchemaArn_,
      $sel:name:ListFacetAttributes' :: Text
name = Text
pName_
    }

-- | The maximum number of results to retrieve.
listFacetAttributes_maxResults :: Lens.Lens' ListFacetAttributes (Prelude.Maybe Prelude.Natural)
listFacetAttributes_maxResults :: Lens' ListFacetAttributes (Maybe Natural)
listFacetAttributes_maxResults = 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 pagination token.
listFacetAttributes_nextToken :: Lens.Lens' ListFacetAttributes (Prelude.Maybe Prelude.Text)
listFacetAttributes_nextToken :: Lens' ListFacetAttributes (Maybe Text)
listFacetAttributes_nextToken = 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 ARN of the schema where the facet resides.
listFacetAttributes_schemaArn :: Lens.Lens' ListFacetAttributes Prelude.Text
listFacetAttributes_schemaArn :: Lens' ListFacetAttributes Text
listFacetAttributes_schemaArn = 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 :: Lens' ListFacetAttributes Text
listFacetAttributes_name = 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
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFacetAttributes
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFacetAttributesResponse (Maybe Text)
listFacetAttributesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListFacetAttributes
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFacetAttributesResponse (Maybe [FacetAttribute])
listFacetAttributesResponse_attributes
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListFacetAttributes
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListFacetAttributes (Maybe Text)
listFacetAttributes_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFacetAttributes
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFacetAttributesResponse (Maybe Text)
listFacetAttributesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListFacetAttributes where
  type
    AWSResponse ListFacetAttributes =
      ListFacetAttributesResponse
  request :: (Service -> Service)
-> ListFacetAttributes -> Request ListFacetAttributes
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListFacetAttributes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFacetAttributes)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [FacetAttribute]
-> Maybe Text -> Int -> ListFacetAttributesResponse
ListFacetAttributesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Attributes" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListFacetAttributes where
  hashWithSalt :: Int -> ListFacetAttributes -> Int
hashWithSalt Int
_salt ListFacetAttributes' {Maybe Natural
Maybe Text
Text
name :: Text
schemaArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:name:ListFacetAttributes' :: ListFacetAttributes -> Text
$sel:schemaArn:ListFacetAttributes' :: ListFacetAttributes -> Text
$sel:nextToken:ListFacetAttributes' :: ListFacetAttributes -> Maybe Text
$sel:maxResults:ListFacetAttributes' :: ListFacetAttributes -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
schemaArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData ListFacetAttributes where
  rnf :: ListFacetAttributes -> ()
rnf ListFacetAttributes' {Maybe Natural
Maybe Text
Text
name :: Text
schemaArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:name:ListFacetAttributes' :: ListFacetAttributes -> Text
$sel:schemaArn:ListFacetAttributes' :: ListFacetAttributes -> Text
$sel:nextToken:ListFacetAttributes' :: ListFacetAttributes -> Maybe Text
$sel:maxResults:ListFacetAttributes' :: ListFacetAttributes -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
schemaArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

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

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

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

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

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

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

-- | The pagination token.
listFacetAttributesResponse_nextToken :: Lens.Lens' ListFacetAttributesResponse (Prelude.Maybe Prelude.Text)
listFacetAttributesResponse_nextToken :: Lens' ListFacetAttributesResponse (Maybe Text)
listFacetAttributesResponse_nextToken = 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 response's http status code.
listFacetAttributesResponse_httpStatus :: Lens.Lens' ListFacetAttributesResponse Prelude.Int
listFacetAttributesResponse_httpStatus :: Lens' ListFacetAttributesResponse Int
listFacetAttributesResponse_httpStatus = 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 where
  rnf :: ListFacetAttributesResponse -> ()
rnf ListFacetAttributesResponse' {Int
Maybe [FacetAttribute]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
attributes :: Maybe [FacetAttribute]
$sel:httpStatus:ListFacetAttributesResponse' :: ListFacetAttributesResponse -> Int
$sel:nextToken:ListFacetAttributesResponse' :: ListFacetAttributesResponse -> Maybe Text
$sel:attributes:ListFacetAttributesResponse' :: ListFacetAttributesResponse -> Maybe [FacetAttribute]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [FacetAttribute]
attributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus