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

import Amazonka.CloudDirectory.Types.TypedLinkSpecifier
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 attributes that are associated with a typed link inside a
-- BatchRead operation. For more information, see GetLinkAttributes and
-- BatchReadRequest$Operations.
--
-- /See:/ 'newBatchGetLinkAttributes' smart constructor.
data BatchGetLinkAttributes = BatchGetLinkAttributes'
  { -- | Allows a typed link specifier to be accepted as input.
    BatchGetLinkAttributes -> TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier,
    -- | A list of attribute names whose values will be retrieved.
    BatchGetLinkAttributes -> [Text]
attributeNames :: [Prelude.Text]
  }
  deriving (BatchGetLinkAttributes -> BatchGetLinkAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetLinkAttributes -> BatchGetLinkAttributes -> Bool
$c/= :: BatchGetLinkAttributes -> BatchGetLinkAttributes -> Bool
== :: BatchGetLinkAttributes -> BatchGetLinkAttributes -> Bool
$c== :: BatchGetLinkAttributes -> BatchGetLinkAttributes -> Bool
Prelude.Eq, ReadPrec [BatchGetLinkAttributes]
ReadPrec BatchGetLinkAttributes
Int -> ReadS BatchGetLinkAttributes
ReadS [BatchGetLinkAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetLinkAttributes]
$creadListPrec :: ReadPrec [BatchGetLinkAttributes]
readPrec :: ReadPrec BatchGetLinkAttributes
$creadPrec :: ReadPrec BatchGetLinkAttributes
readList :: ReadS [BatchGetLinkAttributes]
$creadList :: ReadS [BatchGetLinkAttributes]
readsPrec :: Int -> ReadS BatchGetLinkAttributes
$creadsPrec :: Int -> ReadS BatchGetLinkAttributes
Prelude.Read, Int -> BatchGetLinkAttributes -> ShowS
[BatchGetLinkAttributes] -> ShowS
BatchGetLinkAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetLinkAttributes] -> ShowS
$cshowList :: [BatchGetLinkAttributes] -> ShowS
show :: BatchGetLinkAttributes -> String
$cshow :: BatchGetLinkAttributes -> String
showsPrec :: Int -> BatchGetLinkAttributes -> ShowS
$cshowsPrec :: Int -> BatchGetLinkAttributes -> ShowS
Prelude.Show, forall x. Rep BatchGetLinkAttributes x -> BatchGetLinkAttributes
forall x. BatchGetLinkAttributes -> Rep BatchGetLinkAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetLinkAttributes x -> BatchGetLinkAttributes
$cfrom :: forall x. BatchGetLinkAttributes -> Rep BatchGetLinkAttributes x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetLinkAttributes' 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:
--
-- 'typedLinkSpecifier', 'batchGetLinkAttributes_typedLinkSpecifier' - Allows a typed link specifier to be accepted as input.
--
-- 'attributeNames', 'batchGetLinkAttributes_attributeNames' - A list of attribute names whose values will be retrieved.
newBatchGetLinkAttributes ::
  -- | 'typedLinkSpecifier'
  TypedLinkSpecifier ->
  BatchGetLinkAttributes
newBatchGetLinkAttributes :: TypedLinkSpecifier -> BatchGetLinkAttributes
newBatchGetLinkAttributes TypedLinkSpecifier
pTypedLinkSpecifier_ =
  BatchGetLinkAttributes'
    { $sel:typedLinkSpecifier:BatchGetLinkAttributes' :: TypedLinkSpecifier
typedLinkSpecifier =
        TypedLinkSpecifier
pTypedLinkSpecifier_,
      $sel:attributeNames:BatchGetLinkAttributes' :: [Text]
attributeNames = forall a. Monoid a => a
Prelude.mempty
    }

-- | Allows a typed link specifier to be accepted as input.
batchGetLinkAttributes_typedLinkSpecifier :: Lens.Lens' BatchGetLinkAttributes TypedLinkSpecifier
batchGetLinkAttributes_typedLinkSpecifier :: Lens' BatchGetLinkAttributes TypedLinkSpecifier
batchGetLinkAttributes_typedLinkSpecifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetLinkAttributes' {TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
$sel:typedLinkSpecifier:BatchGetLinkAttributes' :: BatchGetLinkAttributes -> TypedLinkSpecifier
typedLinkSpecifier} -> TypedLinkSpecifier
typedLinkSpecifier) (\s :: BatchGetLinkAttributes
s@BatchGetLinkAttributes' {} TypedLinkSpecifier
a -> BatchGetLinkAttributes
s {$sel:typedLinkSpecifier:BatchGetLinkAttributes' :: TypedLinkSpecifier
typedLinkSpecifier = TypedLinkSpecifier
a} :: BatchGetLinkAttributes)

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

instance Prelude.Hashable BatchGetLinkAttributes where
  hashWithSalt :: Int -> BatchGetLinkAttributes -> Int
hashWithSalt Int
_salt BatchGetLinkAttributes' {[Text]
TypedLinkSpecifier
attributeNames :: [Text]
typedLinkSpecifier :: TypedLinkSpecifier
$sel:attributeNames:BatchGetLinkAttributes' :: BatchGetLinkAttributes -> [Text]
$sel:typedLinkSpecifier:BatchGetLinkAttributes' :: BatchGetLinkAttributes -> TypedLinkSpecifier
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TypedLinkSpecifier
typedLinkSpecifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
attributeNames

instance Prelude.NFData BatchGetLinkAttributes where
  rnf :: BatchGetLinkAttributes -> ()
rnf BatchGetLinkAttributes' {[Text]
TypedLinkSpecifier
attributeNames :: [Text]
typedLinkSpecifier :: TypedLinkSpecifier
$sel:attributeNames:BatchGetLinkAttributes' :: BatchGetLinkAttributes -> [Text]
$sel:typedLinkSpecifier:BatchGetLinkAttributes' :: BatchGetLinkAttributes -> TypedLinkSpecifier
..} =
    forall a. NFData a => a -> ()
Prelude.rnf TypedLinkSpecifier
typedLinkSpecifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
attributeNames

instance Data.ToJSON BatchGetLinkAttributes where
  toJSON :: BatchGetLinkAttributes -> Value
toJSON BatchGetLinkAttributes' {[Text]
TypedLinkSpecifier
attributeNames :: [Text]
typedLinkSpecifier :: TypedLinkSpecifier
$sel:attributeNames:BatchGetLinkAttributes' :: BatchGetLinkAttributes -> [Text]
$sel:typedLinkSpecifier:BatchGetLinkAttributes' :: BatchGetLinkAttributes -> TypedLinkSpecifier
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"TypedLinkSpecifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TypedLinkSpecifier
typedLinkSpecifier),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"AttributeNames" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
attributeNames)
          ]
      )