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

import Amazonka.CloudDirectory.Types.AttributeKeyAndValue
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

-- | Represents the output of a ListObjectAttributes response operation.
--
-- /See:/ 'newBatchListObjectAttributesResponse' smart constructor.
data BatchListObjectAttributesResponse = BatchListObjectAttributesResponse'
  { -- | The attributes map that is associated with the object. @AttributeArn@ is
    -- the key; attribute value is the value.
    BatchListObjectAttributesResponse -> Maybe [AttributeKeyAndValue]
attributes :: Prelude.Maybe [AttributeKeyAndValue],
    -- | The pagination token.
    BatchListObjectAttributesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchListObjectAttributesResponse
-> BatchListObjectAttributesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchListObjectAttributesResponse
-> BatchListObjectAttributesResponse -> Bool
$c/= :: BatchListObjectAttributesResponse
-> BatchListObjectAttributesResponse -> Bool
== :: BatchListObjectAttributesResponse
-> BatchListObjectAttributesResponse -> Bool
$c== :: BatchListObjectAttributesResponse
-> BatchListObjectAttributesResponse -> Bool
Prelude.Eq, ReadPrec [BatchListObjectAttributesResponse]
ReadPrec BatchListObjectAttributesResponse
Int -> ReadS BatchListObjectAttributesResponse
ReadS [BatchListObjectAttributesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchListObjectAttributesResponse]
$creadListPrec :: ReadPrec [BatchListObjectAttributesResponse]
readPrec :: ReadPrec BatchListObjectAttributesResponse
$creadPrec :: ReadPrec BatchListObjectAttributesResponse
readList :: ReadS [BatchListObjectAttributesResponse]
$creadList :: ReadS [BatchListObjectAttributesResponse]
readsPrec :: Int -> ReadS BatchListObjectAttributesResponse
$creadsPrec :: Int -> ReadS BatchListObjectAttributesResponse
Prelude.Read, Int -> BatchListObjectAttributesResponse -> ShowS
[BatchListObjectAttributesResponse] -> ShowS
BatchListObjectAttributesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchListObjectAttributesResponse] -> ShowS
$cshowList :: [BatchListObjectAttributesResponse] -> ShowS
show :: BatchListObjectAttributesResponse -> String
$cshow :: BatchListObjectAttributesResponse -> String
showsPrec :: Int -> BatchListObjectAttributesResponse -> ShowS
$cshowsPrec :: Int -> BatchListObjectAttributesResponse -> ShowS
Prelude.Show, forall x.
Rep BatchListObjectAttributesResponse x
-> BatchListObjectAttributesResponse
forall x.
BatchListObjectAttributesResponse
-> Rep BatchListObjectAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchListObjectAttributesResponse x
-> BatchListObjectAttributesResponse
$cfrom :: forall x.
BatchListObjectAttributesResponse
-> Rep BatchListObjectAttributesResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchListObjectAttributesResponse' 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', 'batchListObjectAttributesResponse_attributes' - The attributes map that is associated with the object. @AttributeArn@ is
-- the key; attribute value is the value.
--
-- 'nextToken', 'batchListObjectAttributesResponse_nextToken' - The pagination token.
newBatchListObjectAttributesResponse ::
  BatchListObjectAttributesResponse
newBatchListObjectAttributesResponse :: BatchListObjectAttributesResponse
newBatchListObjectAttributesResponse =
  BatchListObjectAttributesResponse'
    { $sel:attributes:BatchListObjectAttributesResponse' :: Maybe [AttributeKeyAndValue]
attributes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:BatchListObjectAttributesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | The attributes map that is associated with the object. @AttributeArn@ is
-- the key; attribute value is the value.
batchListObjectAttributesResponse_attributes :: Lens.Lens' BatchListObjectAttributesResponse (Prelude.Maybe [AttributeKeyAndValue])
batchListObjectAttributesResponse_attributes :: Lens'
  BatchListObjectAttributesResponse (Maybe [AttributeKeyAndValue])
batchListObjectAttributesResponse_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListObjectAttributesResponse' {Maybe [AttributeKeyAndValue]
attributes :: Maybe [AttributeKeyAndValue]
$sel:attributes:BatchListObjectAttributesResponse' :: BatchListObjectAttributesResponse -> Maybe [AttributeKeyAndValue]
attributes} -> Maybe [AttributeKeyAndValue]
attributes) (\s :: BatchListObjectAttributesResponse
s@BatchListObjectAttributesResponse' {} Maybe [AttributeKeyAndValue]
a -> BatchListObjectAttributesResponse
s {$sel:attributes:BatchListObjectAttributesResponse' :: Maybe [AttributeKeyAndValue]
attributes = Maybe [AttributeKeyAndValue]
a} :: BatchListObjectAttributesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token.
batchListObjectAttributesResponse_nextToken :: Lens.Lens' BatchListObjectAttributesResponse (Prelude.Maybe Prelude.Text)
batchListObjectAttributesResponse_nextToken :: Lens' BatchListObjectAttributesResponse (Maybe Text)
batchListObjectAttributesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchListObjectAttributesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:BatchListObjectAttributesResponse' :: BatchListObjectAttributesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: BatchListObjectAttributesResponse
s@BatchListObjectAttributesResponse' {} Maybe Text
a -> BatchListObjectAttributesResponse
s {$sel:nextToken:BatchListObjectAttributesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: BatchListObjectAttributesResponse)

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

instance
  Prelude.Hashable
    BatchListObjectAttributesResponse
  where
  hashWithSalt :: Int -> BatchListObjectAttributesResponse -> Int
hashWithSalt
    Int
_salt
    BatchListObjectAttributesResponse' {Maybe [AttributeKeyAndValue]
Maybe Text
nextToken :: Maybe Text
attributes :: Maybe [AttributeKeyAndValue]
$sel:nextToken:BatchListObjectAttributesResponse' :: BatchListObjectAttributesResponse -> Maybe Text
$sel:attributes:BatchListObjectAttributesResponse' :: BatchListObjectAttributesResponse -> Maybe [AttributeKeyAndValue]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AttributeKeyAndValue]
attributes
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance
  Prelude.NFData
    BatchListObjectAttributesResponse
  where
  rnf :: BatchListObjectAttributesResponse -> ()
rnf BatchListObjectAttributesResponse' {Maybe [AttributeKeyAndValue]
Maybe Text
nextToken :: Maybe Text
attributes :: Maybe [AttributeKeyAndValue]
$sel:nextToken:BatchListObjectAttributesResponse' :: BatchListObjectAttributesResponse -> Maybe Text
$sel:attributes:BatchListObjectAttributesResponse' :: BatchListObjectAttributesResponse -> Maybe [AttributeKeyAndValue]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AttributeKeyAndValue]
attributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken