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

import Amazonka.CloudDirectory.Types.ObjectReference
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents the output of a DeleteObject operation.
--
-- /See:/ 'newBatchDeleteObject' smart constructor.
data BatchDeleteObject = BatchDeleteObject'
  { -- | The reference that identifies the object.
    BatchDeleteObject -> ObjectReference
objectReference :: ObjectReference
  }
  deriving (BatchDeleteObject -> BatchDeleteObject -> Bool
(BatchDeleteObject -> BatchDeleteObject -> Bool)
-> (BatchDeleteObject -> BatchDeleteObject -> Bool)
-> Eq BatchDeleteObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteObject -> BatchDeleteObject -> Bool
$c/= :: BatchDeleteObject -> BatchDeleteObject -> Bool
== :: BatchDeleteObject -> BatchDeleteObject -> Bool
$c== :: BatchDeleteObject -> BatchDeleteObject -> Bool
Prelude.Eq, ReadPrec [BatchDeleteObject]
ReadPrec BatchDeleteObject
Int -> ReadS BatchDeleteObject
ReadS [BatchDeleteObject]
(Int -> ReadS BatchDeleteObject)
-> ReadS [BatchDeleteObject]
-> ReadPrec BatchDeleteObject
-> ReadPrec [BatchDeleteObject]
-> Read BatchDeleteObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteObject]
$creadListPrec :: ReadPrec [BatchDeleteObject]
readPrec :: ReadPrec BatchDeleteObject
$creadPrec :: ReadPrec BatchDeleteObject
readList :: ReadS [BatchDeleteObject]
$creadList :: ReadS [BatchDeleteObject]
readsPrec :: Int -> ReadS BatchDeleteObject
$creadsPrec :: Int -> ReadS BatchDeleteObject
Prelude.Read, Int -> BatchDeleteObject -> ShowS
[BatchDeleteObject] -> ShowS
BatchDeleteObject -> String
(Int -> BatchDeleteObject -> ShowS)
-> (BatchDeleteObject -> String)
-> ([BatchDeleteObject] -> ShowS)
-> Show BatchDeleteObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteObject] -> ShowS
$cshowList :: [BatchDeleteObject] -> ShowS
show :: BatchDeleteObject -> String
$cshow :: BatchDeleteObject -> String
showsPrec :: Int -> BatchDeleteObject -> ShowS
$cshowsPrec :: Int -> BatchDeleteObject -> ShowS
Prelude.Show, (forall x. BatchDeleteObject -> Rep BatchDeleteObject x)
-> (forall x. Rep BatchDeleteObject x -> BatchDeleteObject)
-> Generic BatchDeleteObject
forall x. Rep BatchDeleteObject x -> BatchDeleteObject
forall x. BatchDeleteObject -> Rep BatchDeleteObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDeleteObject x -> BatchDeleteObject
$cfrom :: forall x. BatchDeleteObject -> Rep BatchDeleteObject x
Prelude.Generic)

-- |
-- Create a value of 'BatchDeleteObject' 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:
--
-- 'objectReference', 'batchDeleteObject_objectReference' - The reference that identifies the object.
newBatchDeleteObject ::
  -- | 'objectReference'
  ObjectReference ->
  BatchDeleteObject
newBatchDeleteObject :: ObjectReference -> BatchDeleteObject
newBatchDeleteObject ObjectReference
pObjectReference_ =
  BatchDeleteObject' :: ObjectReference -> BatchDeleteObject
BatchDeleteObject'
    { $sel:objectReference:BatchDeleteObject' :: ObjectReference
objectReference =
        ObjectReference
pObjectReference_
    }

-- | The reference that identifies the object.
batchDeleteObject_objectReference :: Lens.Lens' BatchDeleteObject ObjectReference
batchDeleteObject_objectReference :: (ObjectReference -> f ObjectReference)
-> BatchDeleteObject -> f BatchDeleteObject
batchDeleteObject_objectReference = (BatchDeleteObject -> ObjectReference)
-> (BatchDeleteObject -> ObjectReference -> BatchDeleteObject)
-> Lens
     BatchDeleteObject BatchDeleteObject ObjectReference ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteObject' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchDeleteObject' :: BatchDeleteObject -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchDeleteObject
s@BatchDeleteObject' {} ObjectReference
a -> BatchDeleteObject
s {$sel:objectReference:BatchDeleteObject' :: ObjectReference
objectReference = ObjectReference
a} :: BatchDeleteObject)

instance Prelude.Hashable BatchDeleteObject

instance Prelude.NFData BatchDeleteObject

instance Core.ToJSON BatchDeleteObject where
  toJSON :: BatchDeleteObject -> Value
toJSON BatchDeleteObject' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchDeleteObject' :: BatchDeleteObject -> ObjectReference
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ObjectReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
objectReference)
          ]
      )