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

import Amazonka.CloudDirectory.Types.TypedLinkSpecifier
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(BatchGetLinkAttributes -> BatchGetLinkAttributes -> Bool)
-> (BatchGetLinkAttributes -> BatchGetLinkAttributes -> Bool)
-> Eq BatchGetLinkAttributes
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]
(Int -> ReadS BatchGetLinkAttributes)
-> ReadS [BatchGetLinkAttributes]
-> ReadPrec BatchGetLinkAttributes
-> ReadPrec [BatchGetLinkAttributes]
-> Read 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
(Int -> BatchGetLinkAttributes -> ShowS)
-> (BatchGetLinkAttributes -> String)
-> ([BatchGetLinkAttributes] -> ShowS)
-> Show BatchGetLinkAttributes
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. BatchGetLinkAttributes -> Rep BatchGetLinkAttributes x)
-> (forall x.
    Rep BatchGetLinkAttributes x -> BatchGetLinkAttributes)
-> Generic BatchGetLinkAttributes
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' :: TypedLinkSpecifier -> [Text] -> BatchGetLinkAttributes
BatchGetLinkAttributes'
    { $sel:typedLinkSpecifier:BatchGetLinkAttributes' :: TypedLinkSpecifier
typedLinkSpecifier =
        TypedLinkSpecifier
pTypedLinkSpecifier_,
      $sel:attributeNames:BatchGetLinkAttributes' :: [Text]
attributeNames = [Text]
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 :: (TypedLinkSpecifier -> f TypedLinkSpecifier)
-> BatchGetLinkAttributes -> f BatchGetLinkAttributes
batchGetLinkAttributes_typedLinkSpecifier = (BatchGetLinkAttributes -> TypedLinkSpecifier)
-> (BatchGetLinkAttributes
    -> TypedLinkSpecifier -> BatchGetLinkAttributes)
-> Lens
     BatchGetLinkAttributes
     BatchGetLinkAttributes
     TypedLinkSpecifier
     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 :: ([Text] -> f [Text])
-> BatchGetLinkAttributes -> f BatchGetLinkAttributes
batchGetLinkAttributes_attributeNames = (BatchGetLinkAttributes -> [Text])
-> (BatchGetLinkAttributes -> [Text] -> BatchGetLinkAttributes)
-> Lens BatchGetLinkAttributes BatchGetLinkAttributes [Text] [Text]
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) (([Text] -> f [Text])
 -> BatchGetLinkAttributes -> f BatchGetLinkAttributes)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> BatchGetLinkAttributes
-> f BatchGetLinkAttributes
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 BatchGetLinkAttributes

instance Prelude.NFData BatchGetLinkAttributes

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TypedLinkSpecifier" Text -> TypedLinkSpecifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TypedLinkSpecifier
typedLinkSpecifier),
            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)
          ]
      )