{-# 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.BatchGetObjectAttributes
-- 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.BatchGetObjectAttributes 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

-- | Retrieves attributes within a facet that are associated with an object
-- inside an BatchRead operation. For more information, see
-- GetObjectAttributes and BatchReadRequest$Operations.
--
-- /See:/ 'newBatchGetObjectAttributes' smart constructor.
data BatchGetObjectAttributes = BatchGetObjectAttributes'
  { -- | Reference that identifies the object whose attributes will be retrieved.
    BatchGetObjectAttributes -> ObjectReference
objectReference :: ObjectReference,
    -- | Identifier for the facet whose attributes will be retrieved. See
    -- SchemaFacet for details.
    BatchGetObjectAttributes -> SchemaFacet
schemaFacet :: SchemaFacet,
    -- | List of attribute names whose values will be retrieved.
    BatchGetObjectAttributes -> [Text]
attributeNames :: [Prelude.Text]
  }
  deriving (BatchGetObjectAttributes -> BatchGetObjectAttributes -> Bool
(BatchGetObjectAttributes -> BatchGetObjectAttributes -> Bool)
-> (BatchGetObjectAttributes -> BatchGetObjectAttributes -> Bool)
-> Eq BatchGetObjectAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetObjectAttributes -> BatchGetObjectAttributes -> Bool
$c/= :: BatchGetObjectAttributes -> BatchGetObjectAttributes -> Bool
== :: BatchGetObjectAttributes -> BatchGetObjectAttributes -> Bool
$c== :: BatchGetObjectAttributes -> BatchGetObjectAttributes -> Bool
Prelude.Eq, ReadPrec [BatchGetObjectAttributes]
ReadPrec BatchGetObjectAttributes
Int -> ReadS BatchGetObjectAttributes
ReadS [BatchGetObjectAttributes]
(Int -> ReadS BatchGetObjectAttributes)
-> ReadS [BatchGetObjectAttributes]
-> ReadPrec BatchGetObjectAttributes
-> ReadPrec [BatchGetObjectAttributes]
-> Read BatchGetObjectAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetObjectAttributes]
$creadListPrec :: ReadPrec [BatchGetObjectAttributes]
readPrec :: ReadPrec BatchGetObjectAttributes
$creadPrec :: ReadPrec BatchGetObjectAttributes
readList :: ReadS [BatchGetObjectAttributes]
$creadList :: ReadS [BatchGetObjectAttributes]
readsPrec :: Int -> ReadS BatchGetObjectAttributes
$creadsPrec :: Int -> ReadS BatchGetObjectAttributes
Prelude.Read, Int -> BatchGetObjectAttributes -> ShowS
[BatchGetObjectAttributes] -> ShowS
BatchGetObjectAttributes -> String
(Int -> BatchGetObjectAttributes -> ShowS)
-> (BatchGetObjectAttributes -> String)
-> ([BatchGetObjectAttributes] -> ShowS)
-> Show BatchGetObjectAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetObjectAttributes] -> ShowS
$cshowList :: [BatchGetObjectAttributes] -> ShowS
show :: BatchGetObjectAttributes -> String
$cshow :: BatchGetObjectAttributes -> String
showsPrec :: Int -> BatchGetObjectAttributes -> ShowS
$cshowsPrec :: Int -> BatchGetObjectAttributes -> ShowS
Prelude.Show, (forall x.
 BatchGetObjectAttributes -> Rep BatchGetObjectAttributes x)
-> (forall x.
    Rep BatchGetObjectAttributes x -> BatchGetObjectAttributes)
-> Generic BatchGetObjectAttributes
forall x.
Rep BatchGetObjectAttributes x -> BatchGetObjectAttributes
forall x.
BatchGetObjectAttributes -> Rep BatchGetObjectAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetObjectAttributes x -> BatchGetObjectAttributes
$cfrom :: forall x.
BatchGetObjectAttributes -> Rep BatchGetObjectAttributes x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetObjectAttributes' 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', 'batchGetObjectAttributes_objectReference' - Reference that identifies the object whose attributes will be retrieved.
--
-- 'schemaFacet', 'batchGetObjectAttributes_schemaFacet' - Identifier for the facet whose attributes will be retrieved. See
-- SchemaFacet for details.
--
-- 'attributeNames', 'batchGetObjectAttributes_attributeNames' - List of attribute names whose values will be retrieved.
newBatchGetObjectAttributes ::
  -- | 'objectReference'
  ObjectReference ->
  -- | 'schemaFacet'
  SchemaFacet ->
  BatchGetObjectAttributes
newBatchGetObjectAttributes :: ObjectReference -> SchemaFacet -> BatchGetObjectAttributes
newBatchGetObjectAttributes
  ObjectReference
pObjectReference_
  SchemaFacet
pSchemaFacet_ =
    BatchGetObjectAttributes' :: ObjectReference
-> SchemaFacet -> [Text] -> BatchGetObjectAttributes
BatchGetObjectAttributes'
      { $sel:objectReference:BatchGetObjectAttributes' :: ObjectReference
objectReference =
          ObjectReference
pObjectReference_,
        $sel:schemaFacet:BatchGetObjectAttributes' :: SchemaFacet
schemaFacet = SchemaFacet
pSchemaFacet_,
        $sel:attributeNames:BatchGetObjectAttributes' :: [Text]
attributeNames = [Text]
forall a. Monoid a => a
Prelude.mempty
      }

-- | Reference that identifies the object whose attributes will be retrieved.
batchGetObjectAttributes_objectReference :: Lens.Lens' BatchGetObjectAttributes ObjectReference
batchGetObjectAttributes_objectReference :: (ObjectReference -> f ObjectReference)
-> BatchGetObjectAttributes -> f BatchGetObjectAttributes
batchGetObjectAttributes_objectReference = (BatchGetObjectAttributes -> ObjectReference)
-> (BatchGetObjectAttributes
    -> ObjectReference -> BatchGetObjectAttributes)
-> Lens
     BatchGetObjectAttributes
     BatchGetObjectAttributes
     ObjectReference
     ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetObjectAttributes' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchGetObjectAttributes' :: BatchGetObjectAttributes -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchGetObjectAttributes
s@BatchGetObjectAttributes' {} ObjectReference
a -> BatchGetObjectAttributes
s {$sel:objectReference:BatchGetObjectAttributes' :: ObjectReference
objectReference = ObjectReference
a} :: BatchGetObjectAttributes)

-- | Identifier for the facet whose attributes will be retrieved. See
-- SchemaFacet for details.
batchGetObjectAttributes_schemaFacet :: Lens.Lens' BatchGetObjectAttributes SchemaFacet
batchGetObjectAttributes_schemaFacet :: (SchemaFacet -> f SchemaFacet)
-> BatchGetObjectAttributes -> f BatchGetObjectAttributes
batchGetObjectAttributes_schemaFacet = (BatchGetObjectAttributes -> SchemaFacet)
-> (BatchGetObjectAttributes
    -> SchemaFacet -> BatchGetObjectAttributes)
-> Lens
     BatchGetObjectAttributes
     BatchGetObjectAttributes
     SchemaFacet
     SchemaFacet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetObjectAttributes' {SchemaFacet
schemaFacet :: SchemaFacet
$sel:schemaFacet:BatchGetObjectAttributes' :: BatchGetObjectAttributes -> SchemaFacet
schemaFacet} -> SchemaFacet
schemaFacet) (\s :: BatchGetObjectAttributes
s@BatchGetObjectAttributes' {} SchemaFacet
a -> BatchGetObjectAttributes
s {$sel:schemaFacet:BatchGetObjectAttributes' :: SchemaFacet
schemaFacet = SchemaFacet
a} :: BatchGetObjectAttributes)

-- | List of attribute names whose values will be retrieved.
batchGetObjectAttributes_attributeNames :: Lens.Lens' BatchGetObjectAttributes [Prelude.Text]
batchGetObjectAttributes_attributeNames :: ([Text] -> f [Text])
-> BatchGetObjectAttributes -> f BatchGetObjectAttributes
batchGetObjectAttributes_attributeNames = (BatchGetObjectAttributes -> [Text])
-> (BatchGetObjectAttributes -> [Text] -> BatchGetObjectAttributes)
-> Lens
     BatchGetObjectAttributes BatchGetObjectAttributes [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetObjectAttributes' {[Text]
attributeNames :: [Text]
$sel:attributeNames:BatchGetObjectAttributes' :: BatchGetObjectAttributes -> [Text]
attributeNames} -> [Text]
attributeNames) (\s :: BatchGetObjectAttributes
s@BatchGetObjectAttributes' {} [Text]
a -> BatchGetObjectAttributes
s {$sel:attributeNames:BatchGetObjectAttributes' :: [Text]
attributeNames = [Text]
a} :: BatchGetObjectAttributes) (([Text] -> f [Text])
 -> BatchGetObjectAttributes -> f BatchGetObjectAttributes)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> BatchGetObjectAttributes
-> f BatchGetObjectAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.Hashable BatchGetObjectAttributes

instance Prelude.NFData BatchGetObjectAttributes

instance Core.ToJSON BatchGetObjectAttributes where
  toJSON :: BatchGetObjectAttributes -> Value
toJSON BatchGetObjectAttributes' {[Text]
ObjectReference
SchemaFacet
attributeNames :: [Text]
schemaFacet :: SchemaFacet
objectReference :: ObjectReference
$sel:attributeNames:BatchGetObjectAttributes' :: BatchGetObjectAttributes -> [Text]
$sel:schemaFacet:BatchGetObjectAttributes' :: BatchGetObjectAttributes -> SchemaFacet
$sel:objectReference:BatchGetObjectAttributes' :: BatchGetObjectAttributes -> 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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SchemaFacet" Text -> SchemaFacet -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SchemaFacet
schemaFacet),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AttributeNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
attributeNames)
          ]
      )