{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.BatchListObjectAttributes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudDirectory.Types.BatchListObjectAttributes where

import Amazonka.CloudDirectory.Types.ObjectReference
import Amazonka.CloudDirectory.Types.SchemaFacet
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

-- | Represents the output of a ListObjectAttributes operation.
--
-- /See:/ 'newBatchListObjectAttributes' smart constructor.
data BatchListObjectAttributes = BatchListObjectAttributes'
  { -- | Used to filter the list of object attributes that are associated with a
    -- certain facet.
    BatchListObjectAttributes -> Maybe SchemaFacet
facetFilter :: Prelude.Maybe SchemaFacet,
    -- | The maximum number of items to be retrieved in a single call. This is an
    -- approximate number.
    BatchListObjectAttributes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The pagination token.
    BatchListObjectAttributes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Reference of the object whose attributes need to be listed.
    BatchListObjectAttributes -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (BatchListObjectAttributes -> BatchListObjectAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchListObjectAttributes -> BatchListObjectAttributes -> Bool
$c/= :: BatchListObjectAttributes -> BatchListObjectAttributes -> Bool
== :: BatchListObjectAttributes -> BatchListObjectAttributes -> Bool
$c== :: BatchListObjectAttributes -> BatchListObjectAttributes -> Bool
Prelude.Eq, ReadPrec [BatchListObjectAttributes]
ReadPrec BatchListObjectAttributes
Int -> ReadS BatchListObjectAttributes
ReadS [BatchListObjectAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchListObjectAttributes]
$creadListPrec :: ReadPrec [BatchListObjectAttributes]
readPrec :: ReadPrec BatchListObjectAttributes
$creadPrec :: ReadPrec BatchListObjectAttributes
readList :: ReadS [BatchListObjectAttributes]
$creadList :: ReadS [BatchListObjectAttributes]
readsPrec :: Int -> ReadS BatchListObjectAttributes
$creadsPrec :: Int -> ReadS BatchListObjectAttributes
Prelude.Read, Int -> BatchListObjectAttributes -> ShowS
[BatchListObjectAttributes] -> ShowS
BatchListObjectAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchListObjectAttributes] -> ShowS
$cshowList :: [BatchListObjectAttributes] -> ShowS
show :: BatchListObjectAttributes -> String
$cshow :: BatchListObjectAttributes -> String
showsPrec :: Int -> BatchListObjectAttributes -> ShowS
$cshowsPrec :: Int -> BatchListObjectAttributes -> ShowS
Prelude.Show, forall x.
Rep BatchListObjectAttributes x -> BatchListObjectAttributes
forall x.
BatchListObjectAttributes -> Rep BatchListObjectAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchListObjectAttributes x -> BatchListObjectAttributes
$cfrom :: forall x.
BatchListObjectAttributes -> Rep BatchListObjectAttributes x
Prelude.Generic)

-- |
-- Create a value of 'BatchListObjectAttributes' 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:
--
-- 'facetFilter', 'batchListObjectAttributes_facetFilter' - Used to filter the list of object attributes that are associated with a
-- certain facet.
--
-- 'maxResults', 'batchListObjectAttributes_maxResults' - The maximum number of items to be retrieved in a single call. This is an
-- approximate number.
--
-- 'nextToken', 'batchListObjectAttributes_nextToken' - The pagination token.
--
-- 'objectReference', 'batchListObjectAttributes_objectReference' - Reference of the object whose attributes need to be listed.
newBatchListObjectAttributes ::
  -- | 'objectReference'
  ObjectReference ->
  BatchListObjectAttributes
newBatchListObjectAttributes :: ObjectReference -> BatchListObjectAttributes
newBatchListObjectAttributes ObjectReference
pObjectReference_ =
  BatchListObjectAttributes'
    { $sel:facetFilter:BatchListObjectAttributes' :: Maybe SchemaFacet
facetFilter =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:BatchListObjectAttributes' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchListObjectAttributes' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:objectReference:BatchListObjectAttributes' :: ObjectReference
objectReference = ObjectReference
pObjectReference_
    }

-- | Used to filter the list of object attributes that are associated with a
-- certain facet.
batchListObjectAttributes_facetFilter :: Lens.Lens' BatchListObjectAttributes (Prelude.Maybe SchemaFacet)
batchListObjectAttributes_facetFilter :: Lens' BatchListObjectAttributes (Maybe SchemaFacet)
batchListObjectAttributes_facetFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListObjectAttributes' {Maybe SchemaFacet
facetFilter :: Maybe SchemaFacet
$sel:facetFilter:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe SchemaFacet
facetFilter} -> Maybe SchemaFacet
facetFilter) (\s :: BatchListObjectAttributes
s@BatchListObjectAttributes' {} Maybe SchemaFacet
a -> BatchListObjectAttributes
s {$sel:facetFilter:BatchListObjectAttributes' :: Maybe SchemaFacet
facetFilter = Maybe SchemaFacet
a} :: BatchListObjectAttributes)

-- | The maximum number of items to be retrieved in a single call. This is an
-- approximate number.
batchListObjectAttributes_maxResults :: Lens.Lens' BatchListObjectAttributes (Prelude.Maybe Prelude.Natural)
batchListObjectAttributes_maxResults :: Lens' BatchListObjectAttributes (Maybe Natural)
batchListObjectAttributes_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListObjectAttributes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: BatchListObjectAttributes
s@BatchListObjectAttributes' {} Maybe Natural
a -> BatchListObjectAttributes
s {$sel:maxResults:BatchListObjectAttributes' :: Maybe Natural
maxResults = Maybe Natural
a} :: BatchListObjectAttributes)

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

-- | Reference of the object whose attributes need to be listed.
batchListObjectAttributes_objectReference :: Lens.Lens' BatchListObjectAttributes ObjectReference
batchListObjectAttributes_objectReference :: Lens' BatchListObjectAttributes ObjectReference
batchListObjectAttributes_objectReference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListObjectAttributes' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchListObjectAttributes' :: BatchListObjectAttributes -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchListObjectAttributes
s@BatchListObjectAttributes' {} ObjectReference
a -> BatchListObjectAttributes
s {$sel:objectReference:BatchListObjectAttributes' :: ObjectReference
objectReference = ObjectReference
a} :: BatchListObjectAttributes)

instance Prelude.Hashable BatchListObjectAttributes where
  hashWithSalt :: Int -> BatchListObjectAttributes -> Int
hashWithSalt Int
_salt BatchListObjectAttributes' {Maybe Natural
Maybe Text
Maybe SchemaFacet
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
facetFilter :: Maybe SchemaFacet
$sel:objectReference:BatchListObjectAttributes' :: BatchListObjectAttributes -> ObjectReference
$sel:nextToken:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe Text
$sel:maxResults:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe Natural
$sel:facetFilter:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe SchemaFacet
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SchemaFacet
facetFilter
      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` ObjectReference
objectReference

instance Prelude.NFData BatchListObjectAttributes where
  rnf :: BatchListObjectAttributes -> ()
rnf BatchListObjectAttributes' {Maybe Natural
Maybe Text
Maybe SchemaFacet
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
facetFilter :: Maybe SchemaFacet
$sel:objectReference:BatchListObjectAttributes' :: BatchListObjectAttributes -> ObjectReference
$sel:nextToken:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe Text
$sel:maxResults:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe Natural
$sel:facetFilter:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe SchemaFacet
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SchemaFacet
facetFilter
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 ObjectReference
objectReference

instance Data.ToJSON BatchListObjectAttributes where
  toJSON :: BatchListObjectAttributes -> Value
toJSON BatchListObjectAttributes' {Maybe Natural
Maybe Text
Maybe SchemaFacet
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
facetFilter :: Maybe SchemaFacet
$sel:objectReference:BatchListObjectAttributes' :: BatchListObjectAttributes -> ObjectReference
$sel:nextToken:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe Text
$sel:maxResults:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe Natural
$sel:facetFilter:BatchListObjectAttributes' :: BatchListObjectAttributes -> Maybe SchemaFacet
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"FacetFilter" 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 SchemaFacet
facetFilter,
            (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
"ObjectReference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
objectReference)
          ]
      )