{-# 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-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.BatchListObjectAttributesResponse 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 ListObjectAttributes response operation.
--
-- /See:/ 'newBatchListObjectAttributesResponse' smart constructor.
data BatchListObjectAttributesResponse = BatchListObjectAttributesResponse'
  { -- | The pagination token.
    BatchListObjectAttributesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | 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]
  }
  deriving (BatchListObjectAttributesResponse
-> BatchListObjectAttributesResponse -> Bool
(BatchListObjectAttributesResponse
 -> BatchListObjectAttributesResponse -> Bool)
-> (BatchListObjectAttributesResponse
    -> BatchListObjectAttributesResponse -> Bool)
-> Eq BatchListObjectAttributesResponse
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]
(Int -> ReadS BatchListObjectAttributesResponse)
-> ReadS [BatchListObjectAttributesResponse]
-> ReadPrec BatchListObjectAttributesResponse
-> ReadPrec [BatchListObjectAttributesResponse]
-> Read 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
(Int -> BatchListObjectAttributesResponse -> ShowS)
-> (BatchListObjectAttributesResponse -> String)
-> ([BatchListObjectAttributesResponse] -> ShowS)
-> Show BatchListObjectAttributesResponse
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.
 BatchListObjectAttributesResponse
 -> Rep BatchListObjectAttributesResponse x)
-> (forall x.
    Rep BatchListObjectAttributesResponse x
    -> BatchListObjectAttributesResponse)
-> Generic BatchListObjectAttributesResponse
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:
--
-- 'nextToken', 'batchListObjectAttributesResponse_nextToken' - The pagination token.
--
-- 'attributes', 'batchListObjectAttributesResponse_attributes' - The attributes map that is associated with the object. @AttributeArn@ is
-- the key; attribute value is the value.
newBatchListObjectAttributesResponse ::
  BatchListObjectAttributesResponse
newBatchListObjectAttributesResponse :: BatchListObjectAttributesResponse
newBatchListObjectAttributesResponse =
  BatchListObjectAttributesResponse' :: Maybe Text
-> Maybe [AttributeKeyAndValue]
-> BatchListObjectAttributesResponse
BatchListObjectAttributesResponse'
    { $sel:nextToken:BatchListObjectAttributesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:BatchListObjectAttributesResponse' :: Maybe [AttributeKeyAndValue]
attributes = Maybe [AttributeKeyAndValue]
forall a. Maybe a
Prelude.Nothing
    }

-- | The pagination token.
batchListObjectAttributesResponse_nextToken :: Lens.Lens' BatchListObjectAttributesResponse (Prelude.Maybe Prelude.Text)
batchListObjectAttributesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> BatchListObjectAttributesResponse
-> f BatchListObjectAttributesResponse
batchListObjectAttributesResponse_nextToken = (BatchListObjectAttributesResponse -> Maybe Text)
-> (BatchListObjectAttributesResponse
    -> Maybe Text -> BatchListObjectAttributesResponse)
-> Lens
     BatchListObjectAttributesResponse
     BatchListObjectAttributesResponse
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
-> BatchListObjectAttributesResponse
-> f BatchListObjectAttributesResponse
batchListObjectAttributesResponse_attributes = (BatchListObjectAttributesResponse -> Maybe [AttributeKeyAndValue])
-> (BatchListObjectAttributesResponse
    -> Maybe [AttributeKeyAndValue]
    -> BatchListObjectAttributesResponse)
-> Lens
     BatchListObjectAttributesResponse
     BatchListObjectAttributesResponse
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
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) ((Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
 -> BatchListObjectAttributesResponse
 -> f BatchListObjectAttributesResponse)
-> ((Maybe [AttributeKeyAndValue]
     -> f (Maybe [AttributeKeyAndValue]))
    -> Maybe [AttributeKeyAndValue]
    -> f (Maybe [AttributeKeyAndValue]))
-> (Maybe [AttributeKeyAndValue]
    -> f (Maybe [AttributeKeyAndValue]))
-> BatchListObjectAttributesResponse
-> f BatchListObjectAttributesResponse
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
    BatchListObjectAttributesResponse
  where
  parseJSON :: Value -> Parser BatchListObjectAttributesResponse
parseJSON =
    String
-> (Object -> Parser BatchListObjectAttributesResponse)
-> Value
-> Parser BatchListObjectAttributesResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchListObjectAttributesResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe [AttributeKeyAndValue]
-> BatchListObjectAttributesResponse
BatchListObjectAttributesResponse'
            (Maybe Text
 -> Maybe [AttributeKeyAndValue]
 -> BatchListObjectAttributesResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AttributeKeyAndValue] -> BatchListObjectAttributesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NextToken")
            Parser
  (Maybe [AttributeKeyAndValue] -> BatchListObjectAttributesResponse)
-> Parser (Maybe [AttributeKeyAndValue])
-> Parser BatchListObjectAttributesResponse
forall (f :: * -> *) a b. Applicative f => 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
    BatchListObjectAttributesResponse

instance
  Prelude.NFData
    BatchListObjectAttributesResponse