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

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 AttachToIndex response operation.
--
-- /See:/ 'newBatchAttachToIndexResponse' smart constructor.
data BatchAttachToIndexResponse = BatchAttachToIndexResponse'
  { -- | The @ObjectIdentifier@ of the object that was attached to the index.
    BatchAttachToIndexResponse -> Maybe Text
attachedObjectIdentifier :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchAttachToIndexResponse -> BatchAttachToIndexResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAttachToIndexResponse -> BatchAttachToIndexResponse -> Bool
$c/= :: BatchAttachToIndexResponse -> BatchAttachToIndexResponse -> Bool
== :: BatchAttachToIndexResponse -> BatchAttachToIndexResponse -> Bool
$c== :: BatchAttachToIndexResponse -> BatchAttachToIndexResponse -> Bool
Prelude.Eq, ReadPrec [BatchAttachToIndexResponse]
ReadPrec BatchAttachToIndexResponse
Int -> ReadS BatchAttachToIndexResponse
ReadS [BatchAttachToIndexResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchAttachToIndexResponse]
$creadListPrec :: ReadPrec [BatchAttachToIndexResponse]
readPrec :: ReadPrec BatchAttachToIndexResponse
$creadPrec :: ReadPrec BatchAttachToIndexResponse
readList :: ReadS [BatchAttachToIndexResponse]
$creadList :: ReadS [BatchAttachToIndexResponse]
readsPrec :: Int -> ReadS BatchAttachToIndexResponse
$creadsPrec :: Int -> ReadS BatchAttachToIndexResponse
Prelude.Read, Int -> BatchAttachToIndexResponse -> ShowS
[BatchAttachToIndexResponse] -> ShowS
BatchAttachToIndexResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAttachToIndexResponse] -> ShowS
$cshowList :: [BatchAttachToIndexResponse] -> ShowS
show :: BatchAttachToIndexResponse -> String
$cshow :: BatchAttachToIndexResponse -> String
showsPrec :: Int -> BatchAttachToIndexResponse -> ShowS
$cshowsPrec :: Int -> BatchAttachToIndexResponse -> ShowS
Prelude.Show, forall x.
Rep BatchAttachToIndexResponse x -> BatchAttachToIndexResponse
forall x.
BatchAttachToIndexResponse -> Rep BatchAttachToIndexResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchAttachToIndexResponse x -> BatchAttachToIndexResponse
$cfrom :: forall x.
BatchAttachToIndexResponse -> Rep BatchAttachToIndexResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchAttachToIndexResponse' 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:
--
-- 'attachedObjectIdentifier', 'batchAttachToIndexResponse_attachedObjectIdentifier' - The @ObjectIdentifier@ of the object that was attached to the index.
newBatchAttachToIndexResponse ::
  BatchAttachToIndexResponse
newBatchAttachToIndexResponse :: BatchAttachToIndexResponse
newBatchAttachToIndexResponse =
  BatchAttachToIndexResponse'
    { $sel:attachedObjectIdentifier:BatchAttachToIndexResponse' :: Maybe Text
attachedObjectIdentifier =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The @ObjectIdentifier@ of the object that was attached to the index.
batchAttachToIndexResponse_attachedObjectIdentifier :: Lens.Lens' BatchAttachToIndexResponse (Prelude.Maybe Prelude.Text)
batchAttachToIndexResponse_attachedObjectIdentifier :: Lens' BatchAttachToIndexResponse (Maybe Text)
batchAttachToIndexResponse_attachedObjectIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachToIndexResponse' {Maybe Text
attachedObjectIdentifier :: Maybe Text
$sel:attachedObjectIdentifier:BatchAttachToIndexResponse' :: BatchAttachToIndexResponse -> Maybe Text
attachedObjectIdentifier} -> Maybe Text
attachedObjectIdentifier) (\s :: BatchAttachToIndexResponse
s@BatchAttachToIndexResponse' {} Maybe Text
a -> BatchAttachToIndexResponse
s {$sel:attachedObjectIdentifier:BatchAttachToIndexResponse' :: Maybe Text
attachedObjectIdentifier = Maybe Text
a} :: BatchAttachToIndexResponse)

instance Data.FromJSON BatchAttachToIndexResponse where
  parseJSON :: Value -> Parser BatchAttachToIndexResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchAttachToIndexResponse"
      ( \Object
x ->
          Maybe Text -> BatchAttachToIndexResponse
BatchAttachToIndexResponse'
            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
"AttachedObjectIdentifier")
      )

instance Prelude.Hashable BatchAttachToIndexResponse where
  hashWithSalt :: Int -> BatchAttachToIndexResponse -> Int
hashWithSalt Int
_salt BatchAttachToIndexResponse' {Maybe Text
attachedObjectIdentifier :: Maybe Text
$sel:attachedObjectIdentifier:BatchAttachToIndexResponse' :: BatchAttachToIndexResponse -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attachedObjectIdentifier

instance Prelude.NFData BatchAttachToIndexResponse where
  rnf :: BatchAttachToIndexResponse -> ()
rnf BatchAttachToIndexResponse' {Maybe Text
attachedObjectIdentifier :: Maybe Text
$sel:attachedObjectIdentifier:BatchAttachToIndexResponse' :: BatchAttachToIndexResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attachedObjectIdentifier