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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents the output batch AttachObject response operation.
--
-- /See:/ 'newBatchAttachObjectResponse' smart constructor.
data BatchAttachObjectResponse = BatchAttachObjectResponse'
  { -- | The @ObjectIdentifier@ of the object that has been attached.
    BatchAttachObjectResponse -> Maybe Text
attachedObjectIdentifier :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchAttachObjectResponse -> BatchAttachObjectResponse -> Bool
(BatchAttachObjectResponse -> BatchAttachObjectResponse -> Bool)
-> (BatchAttachObjectResponse -> BatchAttachObjectResponse -> Bool)
-> Eq BatchAttachObjectResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAttachObjectResponse -> BatchAttachObjectResponse -> Bool
$c/= :: BatchAttachObjectResponse -> BatchAttachObjectResponse -> Bool
== :: BatchAttachObjectResponse -> BatchAttachObjectResponse -> Bool
$c== :: BatchAttachObjectResponse -> BatchAttachObjectResponse -> Bool
Prelude.Eq, ReadPrec [BatchAttachObjectResponse]
ReadPrec BatchAttachObjectResponse
Int -> ReadS BatchAttachObjectResponse
ReadS [BatchAttachObjectResponse]
(Int -> ReadS BatchAttachObjectResponse)
-> ReadS [BatchAttachObjectResponse]
-> ReadPrec BatchAttachObjectResponse
-> ReadPrec [BatchAttachObjectResponse]
-> Read BatchAttachObjectResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchAttachObjectResponse]
$creadListPrec :: ReadPrec [BatchAttachObjectResponse]
readPrec :: ReadPrec BatchAttachObjectResponse
$creadPrec :: ReadPrec BatchAttachObjectResponse
readList :: ReadS [BatchAttachObjectResponse]
$creadList :: ReadS [BatchAttachObjectResponse]
readsPrec :: Int -> ReadS BatchAttachObjectResponse
$creadsPrec :: Int -> ReadS BatchAttachObjectResponse
Prelude.Read, Int -> BatchAttachObjectResponse -> ShowS
[BatchAttachObjectResponse] -> ShowS
BatchAttachObjectResponse -> String
(Int -> BatchAttachObjectResponse -> ShowS)
-> (BatchAttachObjectResponse -> String)
-> ([BatchAttachObjectResponse] -> ShowS)
-> Show BatchAttachObjectResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAttachObjectResponse] -> ShowS
$cshowList :: [BatchAttachObjectResponse] -> ShowS
show :: BatchAttachObjectResponse -> String
$cshow :: BatchAttachObjectResponse -> String
showsPrec :: Int -> BatchAttachObjectResponse -> ShowS
$cshowsPrec :: Int -> BatchAttachObjectResponse -> ShowS
Prelude.Show, (forall x.
 BatchAttachObjectResponse -> Rep BatchAttachObjectResponse x)
-> (forall x.
    Rep BatchAttachObjectResponse x -> BatchAttachObjectResponse)
-> Generic BatchAttachObjectResponse
forall x.
Rep BatchAttachObjectResponse x -> BatchAttachObjectResponse
forall x.
BatchAttachObjectResponse -> Rep BatchAttachObjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchAttachObjectResponse x -> BatchAttachObjectResponse
$cfrom :: forall x.
BatchAttachObjectResponse -> Rep BatchAttachObjectResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchAttachObjectResponse' 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', 'batchAttachObjectResponse_attachedObjectIdentifier' - The @ObjectIdentifier@ of the object that has been attached.
newBatchAttachObjectResponse ::
  BatchAttachObjectResponse
newBatchAttachObjectResponse :: BatchAttachObjectResponse
newBatchAttachObjectResponse =
  BatchAttachObjectResponse' :: Maybe Text -> BatchAttachObjectResponse
BatchAttachObjectResponse'
    { $sel:attachedObjectIdentifier:BatchAttachObjectResponse' :: Maybe Text
attachedObjectIdentifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The @ObjectIdentifier@ of the object that has been attached.
batchAttachObjectResponse_attachedObjectIdentifier :: Lens.Lens' BatchAttachObjectResponse (Prelude.Maybe Prelude.Text)
batchAttachObjectResponse_attachedObjectIdentifier :: (Maybe Text -> f (Maybe Text))
-> BatchAttachObjectResponse -> f BatchAttachObjectResponse
batchAttachObjectResponse_attachedObjectIdentifier = (BatchAttachObjectResponse -> Maybe Text)
-> (BatchAttachObjectResponse
    -> Maybe Text -> BatchAttachObjectResponse)
-> Lens
     BatchAttachObjectResponse
     BatchAttachObjectResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachObjectResponse' {Maybe Text
attachedObjectIdentifier :: Maybe Text
$sel:attachedObjectIdentifier:BatchAttachObjectResponse' :: BatchAttachObjectResponse -> Maybe Text
attachedObjectIdentifier} -> Maybe Text
attachedObjectIdentifier) (\s :: BatchAttachObjectResponse
s@BatchAttachObjectResponse' {} Maybe Text
a -> BatchAttachObjectResponse
s {$sel:attachedObjectIdentifier:BatchAttachObjectResponse' :: Maybe Text
attachedObjectIdentifier = Maybe Text
a} :: BatchAttachObjectResponse)

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

instance Prelude.NFData BatchAttachObjectResponse