{-# 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-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)
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.Lens as Lens
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 pagination token.
    BatchListObjectAttributes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | Reference of the object whose attributes need to be listed.
    BatchListObjectAttributes -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (BatchListObjectAttributes -> BatchListObjectAttributes -> Bool
(BatchListObjectAttributes -> BatchListObjectAttributes -> Bool)
-> (BatchListObjectAttributes -> BatchListObjectAttributes -> Bool)
-> Eq BatchListObjectAttributes
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]
(Int -> ReadS BatchListObjectAttributes)
-> ReadS [BatchListObjectAttributes]
-> ReadPrec BatchListObjectAttributes
-> ReadPrec [BatchListObjectAttributes]
-> Read 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
(Int -> BatchListObjectAttributes -> ShowS)
-> (BatchListObjectAttributes -> String)
-> ([BatchListObjectAttributes] -> ShowS)
-> Show BatchListObjectAttributes
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.
 BatchListObjectAttributes -> Rep BatchListObjectAttributes x)
-> (forall x.
    Rep BatchListObjectAttributes x -> BatchListObjectAttributes)
-> Generic BatchListObjectAttributes
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.
--
-- 'nextToken', 'batchListObjectAttributes_nextToken' - The pagination token.
--
-- 'maxResults', 'batchListObjectAttributes_maxResults' - The maximum number of items to be retrieved in a single call. This is an
-- approximate number.
--
-- 'objectReference', 'batchListObjectAttributes_objectReference' - Reference of the object whose attributes need to be listed.
newBatchListObjectAttributes ::
  -- | 'objectReference'
  ObjectReference ->
  BatchListObjectAttributes
newBatchListObjectAttributes :: ObjectReference -> BatchListObjectAttributes
newBatchListObjectAttributes ObjectReference
pObjectReference_ =
  BatchListObjectAttributes' :: Maybe SchemaFacet
-> Maybe Text
-> Maybe Natural
-> ObjectReference
-> BatchListObjectAttributes
BatchListObjectAttributes'
    { $sel:facetFilter:BatchListObjectAttributes' :: Maybe SchemaFacet
facetFilter =
        Maybe SchemaFacet
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchListObjectAttributes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:BatchListObjectAttributes' :: Maybe Natural
maxResults = Maybe Natural
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 :: (Maybe SchemaFacet -> f (Maybe SchemaFacet))
-> BatchListObjectAttributes -> f BatchListObjectAttributes
batchListObjectAttributes_facetFilter = (BatchListObjectAttributes -> Maybe SchemaFacet)
-> (BatchListObjectAttributes
    -> Maybe SchemaFacet -> BatchListObjectAttributes)
-> Lens
     BatchListObjectAttributes
     BatchListObjectAttributes
     (Maybe SchemaFacet)
     (Maybe SchemaFacet)
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 pagination token.
batchListObjectAttributes_nextToken :: Lens.Lens' BatchListObjectAttributes (Prelude.Maybe Prelude.Text)
batchListObjectAttributes_nextToken :: (Maybe Text -> f (Maybe Text))
-> BatchListObjectAttributes -> f BatchListObjectAttributes
batchListObjectAttributes_nextToken = (BatchListObjectAttributes -> Maybe Text)
-> (BatchListObjectAttributes
    -> Maybe Text -> BatchListObjectAttributes)
-> Lens
     BatchListObjectAttributes
     BatchListObjectAttributes
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Natural -> f (Maybe Natural))
-> BatchListObjectAttributes -> f BatchListObjectAttributes
batchListObjectAttributes_maxResults = (BatchListObjectAttributes -> Maybe Natural)
-> (BatchListObjectAttributes
    -> Maybe Natural -> BatchListObjectAttributes)
-> Lens
     BatchListObjectAttributes
     BatchListObjectAttributes
     (Maybe Natural)
     (Maybe Natural)
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)

-- | Reference of the object whose attributes need to be listed.
batchListObjectAttributes_objectReference :: Lens.Lens' BatchListObjectAttributes ObjectReference
batchListObjectAttributes_objectReference :: (ObjectReference -> f ObjectReference)
-> BatchListObjectAttributes -> f BatchListObjectAttributes
batchListObjectAttributes_objectReference = (BatchListObjectAttributes -> ObjectReference)
-> (BatchListObjectAttributes
    -> ObjectReference -> BatchListObjectAttributes)
-> Lens
     BatchListObjectAttributes
     BatchListObjectAttributes
     ObjectReference
     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

instance Prelude.NFData BatchListObjectAttributes

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