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

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

-- | Represents the output of a GetLinkAttributes response operation.
--
-- /See:/ 'newBatchGetLinkAttributesResponse' smart constructor.
data BatchGetLinkAttributesResponse = BatchGetLinkAttributesResponse'
  { -- | The attributes that are associated with the typed link.
    BatchGetLinkAttributesResponse -> Maybe [AttributeKeyAndValue]
attributes :: Prelude.Maybe [AttributeKeyAndValue]
  }
  deriving (BatchGetLinkAttributesResponse
-> BatchGetLinkAttributesResponse -> Bool
(BatchGetLinkAttributesResponse
 -> BatchGetLinkAttributesResponse -> Bool)
-> (BatchGetLinkAttributesResponse
    -> BatchGetLinkAttributesResponse -> Bool)
-> Eq BatchGetLinkAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetLinkAttributesResponse
-> BatchGetLinkAttributesResponse -> Bool
$c/= :: BatchGetLinkAttributesResponse
-> BatchGetLinkAttributesResponse -> Bool
== :: BatchGetLinkAttributesResponse
-> BatchGetLinkAttributesResponse -> Bool
$c== :: BatchGetLinkAttributesResponse
-> BatchGetLinkAttributesResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetLinkAttributesResponse]
ReadPrec BatchGetLinkAttributesResponse
Int -> ReadS BatchGetLinkAttributesResponse
ReadS [BatchGetLinkAttributesResponse]
(Int -> ReadS BatchGetLinkAttributesResponse)
-> ReadS [BatchGetLinkAttributesResponse]
-> ReadPrec BatchGetLinkAttributesResponse
-> ReadPrec [BatchGetLinkAttributesResponse]
-> Read BatchGetLinkAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetLinkAttributesResponse]
$creadListPrec :: ReadPrec [BatchGetLinkAttributesResponse]
readPrec :: ReadPrec BatchGetLinkAttributesResponse
$creadPrec :: ReadPrec BatchGetLinkAttributesResponse
readList :: ReadS [BatchGetLinkAttributesResponse]
$creadList :: ReadS [BatchGetLinkAttributesResponse]
readsPrec :: Int -> ReadS BatchGetLinkAttributesResponse
$creadsPrec :: Int -> ReadS BatchGetLinkAttributesResponse
Prelude.Read, Int -> BatchGetLinkAttributesResponse -> ShowS
[BatchGetLinkAttributesResponse] -> ShowS
BatchGetLinkAttributesResponse -> String
(Int -> BatchGetLinkAttributesResponse -> ShowS)
-> (BatchGetLinkAttributesResponse -> String)
-> ([BatchGetLinkAttributesResponse] -> ShowS)
-> Show BatchGetLinkAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetLinkAttributesResponse] -> ShowS
$cshowList :: [BatchGetLinkAttributesResponse] -> ShowS
show :: BatchGetLinkAttributesResponse -> String
$cshow :: BatchGetLinkAttributesResponse -> String
showsPrec :: Int -> BatchGetLinkAttributesResponse -> ShowS
$cshowsPrec :: Int -> BatchGetLinkAttributesResponse -> ShowS
Prelude.Show, (forall x.
 BatchGetLinkAttributesResponse
 -> Rep BatchGetLinkAttributesResponse x)
-> (forall x.
    Rep BatchGetLinkAttributesResponse x
    -> BatchGetLinkAttributesResponse)
-> Generic BatchGetLinkAttributesResponse
forall x.
Rep BatchGetLinkAttributesResponse x
-> BatchGetLinkAttributesResponse
forall x.
BatchGetLinkAttributesResponse
-> Rep BatchGetLinkAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetLinkAttributesResponse x
-> BatchGetLinkAttributesResponse
$cfrom :: forall x.
BatchGetLinkAttributesResponse
-> Rep BatchGetLinkAttributesResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetLinkAttributesResponse' 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:
--
-- 'attributes', 'batchGetLinkAttributesResponse_attributes' - The attributes that are associated with the typed link.
newBatchGetLinkAttributesResponse ::
  BatchGetLinkAttributesResponse
newBatchGetLinkAttributesResponse :: BatchGetLinkAttributesResponse
newBatchGetLinkAttributesResponse =
  BatchGetLinkAttributesResponse' :: Maybe [AttributeKeyAndValue] -> BatchGetLinkAttributesResponse
BatchGetLinkAttributesResponse'
    { $sel:attributes:BatchGetLinkAttributesResponse' :: Maybe [AttributeKeyAndValue]
attributes =
        Maybe [AttributeKeyAndValue]
forall a. Maybe a
Prelude.Nothing
    }

-- | The attributes that are associated with the typed link.
batchGetLinkAttributesResponse_attributes :: Lens.Lens' BatchGetLinkAttributesResponse (Prelude.Maybe [AttributeKeyAndValue])
batchGetLinkAttributesResponse_attributes :: (Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
-> BatchGetLinkAttributesResponse
-> f BatchGetLinkAttributesResponse
batchGetLinkAttributesResponse_attributes = (BatchGetLinkAttributesResponse -> Maybe [AttributeKeyAndValue])
-> (BatchGetLinkAttributesResponse
    -> Maybe [AttributeKeyAndValue] -> BatchGetLinkAttributesResponse)
-> Lens
     BatchGetLinkAttributesResponse
     BatchGetLinkAttributesResponse
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetLinkAttributesResponse' {Maybe [AttributeKeyAndValue]
attributes :: Maybe [AttributeKeyAndValue]
$sel:attributes:BatchGetLinkAttributesResponse' :: BatchGetLinkAttributesResponse -> Maybe [AttributeKeyAndValue]
attributes} -> Maybe [AttributeKeyAndValue]
attributes) (\s :: BatchGetLinkAttributesResponse
s@BatchGetLinkAttributesResponse' {} Maybe [AttributeKeyAndValue]
a -> BatchGetLinkAttributesResponse
s {$sel:attributes:BatchGetLinkAttributesResponse' :: Maybe [AttributeKeyAndValue]
attributes = Maybe [AttributeKeyAndValue]
a} :: BatchGetLinkAttributesResponse) ((Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
 -> BatchGetLinkAttributesResponse
 -> f BatchGetLinkAttributesResponse)
-> ((Maybe [AttributeKeyAndValue]
     -> f (Maybe [AttributeKeyAndValue]))
    -> Maybe [AttributeKeyAndValue]
    -> f (Maybe [AttributeKeyAndValue]))
-> (Maybe [AttributeKeyAndValue]
    -> f (Maybe [AttributeKeyAndValue]))
-> BatchGetLinkAttributesResponse
-> f BatchGetLinkAttributesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
-> Iso
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON BatchGetLinkAttributesResponse where
  parseJSON :: Value -> Parser BatchGetLinkAttributesResponse
parseJSON =
    String
-> (Object -> Parser BatchGetLinkAttributesResponse)
-> Value
-> Parser BatchGetLinkAttributesResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchGetLinkAttributesResponse"
      ( \Object
x ->
          Maybe [AttributeKeyAndValue] -> BatchGetLinkAttributesResponse
BatchGetLinkAttributesResponse'
            (Maybe [AttributeKeyAndValue] -> BatchGetLinkAttributesResponse)
-> Parser (Maybe [AttributeKeyAndValue])
-> Parser BatchGetLinkAttributesResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [AttributeKeyAndValue]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Attributes" Parser (Maybe (Maybe [AttributeKeyAndValue]))
-> Maybe [AttributeKeyAndValue]
-> Parser (Maybe [AttributeKeyAndValue])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AttributeKeyAndValue]
forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    BatchGetLinkAttributesResponse

instance
  Prelude.NFData
    BatchGetLinkAttributesResponse