{-# 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.BatchGetObjectAttributesResponse
-- 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.BatchGetObjectAttributesResponse 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 GetObjectAttributes response operation.
--
-- /See:/ 'newBatchGetObjectAttributesResponse' smart constructor.
data BatchGetObjectAttributesResponse = BatchGetObjectAttributesResponse'
  { -- | The attribute values that are associated with an object.
    BatchGetObjectAttributesResponse -> Maybe [AttributeKeyAndValue]
attributes :: Prelude.Maybe [AttributeKeyAndValue]
  }
  deriving (BatchGetObjectAttributesResponse
-> BatchGetObjectAttributesResponse -> Bool
(BatchGetObjectAttributesResponse
 -> BatchGetObjectAttributesResponse -> Bool)
-> (BatchGetObjectAttributesResponse
    -> BatchGetObjectAttributesResponse -> Bool)
-> Eq BatchGetObjectAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetObjectAttributesResponse
-> BatchGetObjectAttributesResponse -> Bool
$c/= :: BatchGetObjectAttributesResponse
-> BatchGetObjectAttributesResponse -> Bool
== :: BatchGetObjectAttributesResponse
-> BatchGetObjectAttributesResponse -> Bool
$c== :: BatchGetObjectAttributesResponse
-> BatchGetObjectAttributesResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetObjectAttributesResponse]
ReadPrec BatchGetObjectAttributesResponse
Int -> ReadS BatchGetObjectAttributesResponse
ReadS [BatchGetObjectAttributesResponse]
(Int -> ReadS BatchGetObjectAttributesResponse)
-> ReadS [BatchGetObjectAttributesResponse]
-> ReadPrec BatchGetObjectAttributesResponse
-> ReadPrec [BatchGetObjectAttributesResponse]
-> Read BatchGetObjectAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetObjectAttributesResponse]
$creadListPrec :: ReadPrec [BatchGetObjectAttributesResponse]
readPrec :: ReadPrec BatchGetObjectAttributesResponse
$creadPrec :: ReadPrec BatchGetObjectAttributesResponse
readList :: ReadS [BatchGetObjectAttributesResponse]
$creadList :: ReadS [BatchGetObjectAttributesResponse]
readsPrec :: Int -> ReadS BatchGetObjectAttributesResponse
$creadsPrec :: Int -> ReadS BatchGetObjectAttributesResponse
Prelude.Read, Int -> BatchGetObjectAttributesResponse -> ShowS
[BatchGetObjectAttributesResponse] -> ShowS
BatchGetObjectAttributesResponse -> String
(Int -> BatchGetObjectAttributesResponse -> ShowS)
-> (BatchGetObjectAttributesResponse -> String)
-> ([BatchGetObjectAttributesResponse] -> ShowS)
-> Show BatchGetObjectAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetObjectAttributesResponse] -> ShowS
$cshowList :: [BatchGetObjectAttributesResponse] -> ShowS
show :: BatchGetObjectAttributesResponse -> String
$cshow :: BatchGetObjectAttributesResponse -> String
showsPrec :: Int -> BatchGetObjectAttributesResponse -> ShowS
$cshowsPrec :: Int -> BatchGetObjectAttributesResponse -> ShowS
Prelude.Show, (forall x.
 BatchGetObjectAttributesResponse
 -> Rep BatchGetObjectAttributesResponse x)
-> (forall x.
    Rep BatchGetObjectAttributesResponse x
    -> BatchGetObjectAttributesResponse)
-> Generic BatchGetObjectAttributesResponse
forall x.
Rep BatchGetObjectAttributesResponse x
-> BatchGetObjectAttributesResponse
forall x.
BatchGetObjectAttributesResponse
-> Rep BatchGetObjectAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetObjectAttributesResponse x
-> BatchGetObjectAttributesResponse
$cfrom :: forall x.
BatchGetObjectAttributesResponse
-> Rep BatchGetObjectAttributesResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetObjectAttributesResponse' 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', 'batchGetObjectAttributesResponse_attributes' - The attribute values that are associated with an object.
newBatchGetObjectAttributesResponse ::
  BatchGetObjectAttributesResponse
newBatchGetObjectAttributesResponse :: BatchGetObjectAttributesResponse
newBatchGetObjectAttributesResponse =
  BatchGetObjectAttributesResponse' :: Maybe [AttributeKeyAndValue] -> BatchGetObjectAttributesResponse
BatchGetObjectAttributesResponse'
    { $sel:attributes:BatchGetObjectAttributesResponse' :: Maybe [AttributeKeyAndValue]
attributes =
        Maybe [AttributeKeyAndValue]
forall a. Maybe a
Prelude.Nothing
    }

-- | The attribute values that are associated with an object.
batchGetObjectAttributesResponse_attributes :: Lens.Lens' BatchGetObjectAttributesResponse (Prelude.Maybe [AttributeKeyAndValue])
batchGetObjectAttributesResponse_attributes :: (Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
-> BatchGetObjectAttributesResponse
-> f BatchGetObjectAttributesResponse
batchGetObjectAttributesResponse_attributes = (BatchGetObjectAttributesResponse -> Maybe [AttributeKeyAndValue])
-> (BatchGetObjectAttributesResponse
    -> Maybe [AttributeKeyAndValue]
    -> BatchGetObjectAttributesResponse)
-> Lens
     BatchGetObjectAttributesResponse
     BatchGetObjectAttributesResponse
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetObjectAttributesResponse' {Maybe [AttributeKeyAndValue]
attributes :: Maybe [AttributeKeyAndValue]
$sel:attributes:BatchGetObjectAttributesResponse' :: BatchGetObjectAttributesResponse -> Maybe [AttributeKeyAndValue]
attributes} -> Maybe [AttributeKeyAndValue]
attributes) (\s :: BatchGetObjectAttributesResponse
s@BatchGetObjectAttributesResponse' {} Maybe [AttributeKeyAndValue]
a -> BatchGetObjectAttributesResponse
s {$sel:attributes:BatchGetObjectAttributesResponse' :: Maybe [AttributeKeyAndValue]
attributes = Maybe [AttributeKeyAndValue]
a} :: BatchGetObjectAttributesResponse) ((Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
 -> BatchGetObjectAttributesResponse
 -> f BatchGetObjectAttributesResponse)
-> ((Maybe [AttributeKeyAndValue]
     -> f (Maybe [AttributeKeyAndValue]))
    -> Maybe [AttributeKeyAndValue]
    -> f (Maybe [AttributeKeyAndValue]))
-> (Maybe [AttributeKeyAndValue]
    -> f (Maybe [AttributeKeyAndValue]))
-> BatchGetObjectAttributesResponse
-> f BatchGetObjectAttributesResponse
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
    BatchGetObjectAttributesResponse
  where
  parseJSON :: Value -> Parser BatchGetObjectAttributesResponse
parseJSON =
    String
-> (Object -> Parser BatchGetObjectAttributesResponse)
-> Value
-> Parser BatchGetObjectAttributesResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchGetObjectAttributesResponse"
      ( \Object
x ->
          Maybe [AttributeKeyAndValue] -> BatchGetObjectAttributesResponse
BatchGetObjectAttributesResponse'
            (Maybe [AttributeKeyAndValue] -> BatchGetObjectAttributesResponse)
-> Parser (Maybe [AttributeKeyAndValue])
-> Parser BatchGetObjectAttributesResponse
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
    BatchGetObjectAttributesResponse

instance
  Prelude.NFData
    BatchGetObjectAttributesResponse