{-# 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.BatchListObjectParentPaths
-- 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.BatchListObjectParentPaths where

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

-- | Retrieves all available parent paths for any object type such as node,
-- leaf node, policy node, and index node objects inside a BatchRead
-- operation. For more information, see ListObjectParentPaths and
-- BatchReadRequest$Operations.
--
-- /See:/ 'newBatchListObjectParentPaths' smart constructor.
data BatchListObjectParentPaths = BatchListObjectParentPaths'
  { -- | The maximum number of results to retrieve.
    BatchListObjectParentPaths -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The pagination token.
    BatchListObjectParentPaths -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The reference that identifies the object whose attributes will be
    -- listed.
    BatchListObjectParentPaths -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (BatchListObjectParentPaths -> BatchListObjectParentPaths -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchListObjectParentPaths -> BatchListObjectParentPaths -> Bool
$c/= :: BatchListObjectParentPaths -> BatchListObjectParentPaths -> Bool
== :: BatchListObjectParentPaths -> BatchListObjectParentPaths -> Bool
$c== :: BatchListObjectParentPaths -> BatchListObjectParentPaths -> Bool
Prelude.Eq, ReadPrec [BatchListObjectParentPaths]
ReadPrec BatchListObjectParentPaths
Int -> ReadS BatchListObjectParentPaths
ReadS [BatchListObjectParentPaths]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchListObjectParentPaths]
$creadListPrec :: ReadPrec [BatchListObjectParentPaths]
readPrec :: ReadPrec BatchListObjectParentPaths
$creadPrec :: ReadPrec BatchListObjectParentPaths
readList :: ReadS [BatchListObjectParentPaths]
$creadList :: ReadS [BatchListObjectParentPaths]
readsPrec :: Int -> ReadS BatchListObjectParentPaths
$creadsPrec :: Int -> ReadS BatchListObjectParentPaths
Prelude.Read, Int -> BatchListObjectParentPaths -> ShowS
[BatchListObjectParentPaths] -> ShowS
BatchListObjectParentPaths -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchListObjectParentPaths] -> ShowS
$cshowList :: [BatchListObjectParentPaths] -> ShowS
show :: BatchListObjectParentPaths -> String
$cshow :: BatchListObjectParentPaths -> String
showsPrec :: Int -> BatchListObjectParentPaths -> ShowS
$cshowsPrec :: Int -> BatchListObjectParentPaths -> ShowS
Prelude.Show, forall x.
Rep BatchListObjectParentPaths x -> BatchListObjectParentPaths
forall x.
BatchListObjectParentPaths -> Rep BatchListObjectParentPaths x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchListObjectParentPaths x -> BatchListObjectParentPaths
$cfrom :: forall x.
BatchListObjectParentPaths -> Rep BatchListObjectParentPaths x
Prelude.Generic)

-- |
-- Create a value of 'BatchListObjectParentPaths' 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', 'batchListObjectParentPaths_maxResults' - The maximum number of results to retrieve.
--
-- 'nextToken', 'batchListObjectParentPaths_nextToken' - The pagination token.
--
-- 'objectReference', 'batchListObjectParentPaths_objectReference' - The reference that identifies the object whose attributes will be
-- listed.
newBatchListObjectParentPaths ::
  -- | 'objectReference'
  ObjectReference ->
  BatchListObjectParentPaths
newBatchListObjectParentPaths :: ObjectReference -> BatchListObjectParentPaths
newBatchListObjectParentPaths ObjectReference
pObjectReference_ =
  BatchListObjectParentPaths'
    { $sel:maxResults:BatchListObjectParentPaths' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchListObjectParentPaths' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:objectReference:BatchListObjectParentPaths' :: ObjectReference
objectReference = ObjectReference
pObjectReference_
    }

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

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

-- | The reference that identifies the object whose attributes will be
-- listed.
batchListObjectParentPaths_objectReference :: Lens.Lens' BatchListObjectParentPaths ObjectReference
batchListObjectParentPaths_objectReference :: Lens' BatchListObjectParentPaths ObjectReference
batchListObjectParentPaths_objectReference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListObjectParentPaths' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchListObjectParentPaths' :: BatchListObjectParentPaths -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchListObjectParentPaths
s@BatchListObjectParentPaths' {} ObjectReference
a -> BatchListObjectParentPaths
s {$sel:objectReference:BatchListObjectParentPaths' :: ObjectReference
objectReference = ObjectReference
a} :: BatchListObjectParentPaths)

instance Prelude.Hashable BatchListObjectParentPaths where
  hashWithSalt :: Int -> BatchListObjectParentPaths -> Int
hashWithSalt Int
_salt BatchListObjectParentPaths' {Maybe Natural
Maybe Text
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:objectReference:BatchListObjectParentPaths' :: BatchListObjectParentPaths -> ObjectReference
$sel:nextToken:BatchListObjectParentPaths' :: BatchListObjectParentPaths -> Maybe Text
$sel:maxResults:BatchListObjectParentPaths' :: BatchListObjectParentPaths -> 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` ObjectReference
objectReference

instance Prelude.NFData BatchListObjectParentPaths where
  rnf :: BatchListObjectParentPaths -> ()
rnf BatchListObjectParentPaths' {Maybe Natural
Maybe Text
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:objectReference:BatchListObjectParentPaths' :: BatchListObjectParentPaths -> ObjectReference
$sel:nextToken:BatchListObjectParentPaths' :: BatchListObjectParentPaths -> Maybe Text
$sel:maxResults:BatchListObjectParentPaths' :: BatchListObjectParentPaths -> 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 ObjectReference
objectReference

instance Data.ToJSON BatchListObjectParentPaths where
  toJSON :: BatchListObjectParentPaths -> Value
toJSON BatchListObjectParentPaths' {Maybe Natural
Maybe Text
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:objectReference:BatchListObjectParentPaths' :: BatchListObjectParentPaths -> ObjectReference
$sel:nextToken:BatchListObjectParentPaths' :: BatchListObjectParentPaths -> Maybe Text
$sel:maxResults:BatchListObjectParentPaths' :: BatchListObjectParentPaths -> 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
"ObjectReference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
objectReference)
          ]
      )