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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(BatchAttachToIndexResponse -> BatchAttachToIndexResponse -> Bool)
-> (BatchAttachToIndexResponse
    -> BatchAttachToIndexResponse -> Bool)
-> Eq BatchAttachToIndexResponse
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]
(Int -> ReadS BatchAttachToIndexResponse)
-> ReadS [BatchAttachToIndexResponse]
-> ReadPrec BatchAttachToIndexResponse
-> ReadPrec [BatchAttachToIndexResponse]
-> Read 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
(Int -> BatchAttachToIndexResponse -> ShowS)
-> (BatchAttachToIndexResponse -> String)
-> ([BatchAttachToIndexResponse] -> ShowS)
-> Show BatchAttachToIndexResponse
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.
 BatchAttachToIndexResponse -> Rep BatchAttachToIndexResponse x)
-> (forall x.
    Rep BatchAttachToIndexResponse x -> BatchAttachToIndexResponse)
-> Generic BatchAttachToIndexResponse
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' :: Maybe Text -> BatchAttachToIndexResponse
BatchAttachToIndexResponse'
    { $sel:attachedObjectIdentifier:BatchAttachToIndexResponse' :: Maybe Text
attachedObjectIdentifier =
        Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> BatchAttachToIndexResponse -> f BatchAttachToIndexResponse
batchAttachToIndexResponse_attachedObjectIdentifier = (BatchAttachToIndexResponse -> Maybe Text)
-> (BatchAttachToIndexResponse
    -> Maybe Text -> BatchAttachToIndexResponse)
-> Lens
     BatchAttachToIndexResponse
     BatchAttachToIndexResponse
     (Maybe Text)
     (Maybe Text)
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 Core.FromJSON BatchAttachToIndexResponse where
  parseJSON :: Value -> Parser BatchAttachToIndexResponse
parseJSON =
    String
-> (Object -> Parser BatchAttachToIndexResponse)
-> Value
-> Parser BatchAttachToIndexResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchAttachToIndexResponse"
      ( \Object
x ->
          Maybe Text -> BatchAttachToIndexResponse
BatchAttachToIndexResponse'
            (Maybe Text -> BatchAttachToIndexResponse)
-> Parser (Maybe Text) -> Parser BatchAttachToIndexResponse
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
"AttachedObjectIdentifier")
      )

instance Prelude.Hashable BatchAttachToIndexResponse

instance Prelude.NFData BatchAttachToIndexResponse