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

import Amazonka.CloudDirectory.Types.ObjectReference
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Retrieves metadata about an object inside a BatchRead operation. For
-- more information, see GetObjectInformation and
-- BatchReadRequest$Operations.
--
-- /See:/ 'newBatchGetObjectInformation' smart constructor.
data BatchGetObjectInformation = BatchGetObjectInformation'
  { -- | A reference to the object.
    BatchGetObjectInformation -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (BatchGetObjectInformation -> BatchGetObjectInformation -> Bool
(BatchGetObjectInformation -> BatchGetObjectInformation -> Bool)
-> (BatchGetObjectInformation -> BatchGetObjectInformation -> Bool)
-> Eq BatchGetObjectInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetObjectInformation -> BatchGetObjectInformation -> Bool
$c/= :: BatchGetObjectInformation -> BatchGetObjectInformation -> Bool
== :: BatchGetObjectInformation -> BatchGetObjectInformation -> Bool
$c== :: BatchGetObjectInformation -> BatchGetObjectInformation -> Bool
Prelude.Eq, ReadPrec [BatchGetObjectInformation]
ReadPrec BatchGetObjectInformation
Int -> ReadS BatchGetObjectInformation
ReadS [BatchGetObjectInformation]
(Int -> ReadS BatchGetObjectInformation)
-> ReadS [BatchGetObjectInformation]
-> ReadPrec BatchGetObjectInformation
-> ReadPrec [BatchGetObjectInformation]
-> Read BatchGetObjectInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetObjectInformation]
$creadListPrec :: ReadPrec [BatchGetObjectInformation]
readPrec :: ReadPrec BatchGetObjectInformation
$creadPrec :: ReadPrec BatchGetObjectInformation
readList :: ReadS [BatchGetObjectInformation]
$creadList :: ReadS [BatchGetObjectInformation]
readsPrec :: Int -> ReadS BatchGetObjectInformation
$creadsPrec :: Int -> ReadS BatchGetObjectInformation
Prelude.Read, Int -> BatchGetObjectInformation -> ShowS
[BatchGetObjectInformation] -> ShowS
BatchGetObjectInformation -> String
(Int -> BatchGetObjectInformation -> ShowS)
-> (BatchGetObjectInformation -> String)
-> ([BatchGetObjectInformation] -> ShowS)
-> Show BatchGetObjectInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetObjectInformation] -> ShowS
$cshowList :: [BatchGetObjectInformation] -> ShowS
show :: BatchGetObjectInformation -> String
$cshow :: BatchGetObjectInformation -> String
showsPrec :: Int -> BatchGetObjectInformation -> ShowS
$cshowsPrec :: Int -> BatchGetObjectInformation -> ShowS
Prelude.Show, (forall x.
 BatchGetObjectInformation -> Rep BatchGetObjectInformation x)
-> (forall x.
    Rep BatchGetObjectInformation x -> BatchGetObjectInformation)
-> Generic BatchGetObjectInformation
forall x.
Rep BatchGetObjectInformation x -> BatchGetObjectInformation
forall x.
BatchGetObjectInformation -> Rep BatchGetObjectInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetObjectInformation x -> BatchGetObjectInformation
$cfrom :: forall x.
BatchGetObjectInformation -> Rep BatchGetObjectInformation x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetObjectInformation' 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:
--
-- 'objectReference', 'batchGetObjectInformation_objectReference' - A reference to the object.
newBatchGetObjectInformation ::
  -- | 'objectReference'
  ObjectReference ->
  BatchGetObjectInformation
newBatchGetObjectInformation :: ObjectReference -> BatchGetObjectInformation
newBatchGetObjectInformation ObjectReference
pObjectReference_ =
  BatchGetObjectInformation' :: ObjectReference -> BatchGetObjectInformation
BatchGetObjectInformation'
    { $sel:objectReference:BatchGetObjectInformation' :: ObjectReference
objectReference =
        ObjectReference
pObjectReference_
    }

-- | A reference to the object.
batchGetObjectInformation_objectReference :: Lens.Lens' BatchGetObjectInformation ObjectReference
batchGetObjectInformation_objectReference :: (ObjectReference -> f ObjectReference)
-> BatchGetObjectInformation -> f BatchGetObjectInformation
batchGetObjectInformation_objectReference = (BatchGetObjectInformation -> ObjectReference)
-> (BatchGetObjectInformation
    -> ObjectReference -> BatchGetObjectInformation)
-> Lens
     BatchGetObjectInformation
     BatchGetObjectInformation
     ObjectReference
     ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetObjectInformation' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchGetObjectInformation' :: BatchGetObjectInformation -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchGetObjectInformation
s@BatchGetObjectInformation' {} ObjectReference
a -> BatchGetObjectInformation
s {$sel:objectReference:BatchGetObjectInformation' :: ObjectReference
objectReference = ObjectReference
a} :: BatchGetObjectInformation)

instance Prelude.Hashable BatchGetObjectInformation

instance Prelude.NFData BatchGetObjectInformation

instance Core.ToJSON BatchGetObjectInformation where
  toJSON :: BatchGetObjectInformation -> Value
toJSON BatchGetObjectInformation' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchGetObjectInformation' :: BatchGetObjectInformation -> ObjectReference
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ 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)
          ]
      )