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

import Amazonka.CloudDirectory.Types.BatchAddFacetToObject
import Amazonka.CloudDirectory.Types.BatchAttachObject
import Amazonka.CloudDirectory.Types.BatchAttachPolicy
import Amazonka.CloudDirectory.Types.BatchAttachToIndex
import Amazonka.CloudDirectory.Types.BatchAttachTypedLink
import Amazonka.CloudDirectory.Types.BatchCreateIndex
import Amazonka.CloudDirectory.Types.BatchCreateObject
import Amazonka.CloudDirectory.Types.BatchDeleteObject
import Amazonka.CloudDirectory.Types.BatchDetachFromIndex
import Amazonka.CloudDirectory.Types.BatchDetachObject
import Amazonka.CloudDirectory.Types.BatchDetachPolicy
import Amazonka.CloudDirectory.Types.BatchDetachTypedLink
import Amazonka.CloudDirectory.Types.BatchRemoveFacetFromObject
import Amazonka.CloudDirectory.Types.BatchUpdateLinkAttributes
import Amazonka.CloudDirectory.Types.BatchUpdateObjectAttributes
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents the output of a @BatchWrite@ operation.
--
-- /See:/ 'newBatchWriteOperation' smart constructor.
data BatchWriteOperation = BatchWriteOperation'
  { -- | Deletes an object in a Directory.
    BatchWriteOperation -> Maybe BatchDeleteObject
deleteObject :: Prelude.Maybe BatchDeleteObject,
    -- | Detaches the specified object from the specified index.
    BatchWriteOperation -> Maybe BatchDetachFromIndex
detachFromIndex :: Prelude.Maybe BatchDetachFromIndex,
    -- | A batch operation that removes a facet from an object.
    BatchWriteOperation -> Maybe BatchRemoveFacetFromObject
removeFacetFromObject :: Prelude.Maybe BatchRemoveFacetFromObject,
    -- | Attaches an object to a Directory.
    BatchWriteOperation -> Maybe BatchAttachObject
attachObject :: Prelude.Maybe BatchAttachObject,
    -- | Creates an object.
    BatchWriteOperation -> Maybe BatchCreateObject
createObject :: Prelude.Maybe BatchCreateObject,
    -- | Attaches a typed link to a specified source and target object. For more
    -- information, see
    -- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/directory_objects_links.html#directory_objects_links_typedlink Typed Links>.
    BatchWriteOperation -> Maybe BatchAttachTypedLink
attachTypedLink :: Prelude.Maybe BatchAttachTypedLink,
    -- | Detaches a policy from a Directory.
    BatchWriteOperation -> Maybe BatchDetachPolicy
detachPolicy :: Prelude.Maybe BatchDetachPolicy,
    -- | Creates an index object. See
    -- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/indexing_search.htm Indexing and search>
    -- for more information.
    BatchWriteOperation -> Maybe BatchCreateIndex
createIndex :: Prelude.Maybe BatchCreateIndex,
    -- | Detaches an object from a Directory.
    BatchWriteOperation -> Maybe BatchDetachObject
detachObject :: Prelude.Maybe BatchDetachObject,
    -- | A batch operation that adds a facet to an object.
    BatchWriteOperation -> Maybe BatchAddFacetToObject
addFacetToObject :: Prelude.Maybe BatchAddFacetToObject,
    -- | Detaches a typed link from a specified source and target object. For
    -- more information, see
    -- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/directory_objects_links.html#directory_objects_links_typedlink Typed Links>.
    BatchWriteOperation -> Maybe BatchDetachTypedLink
detachTypedLink :: Prelude.Maybe BatchDetachTypedLink,
    -- | Updates a given object\'s attributes.
    BatchWriteOperation -> Maybe BatchUpdateObjectAttributes
updateObjectAttributes :: Prelude.Maybe BatchUpdateObjectAttributes,
    -- | Attaches a policy object to a regular object. An object can have a
    -- limited number of attached policies.
    BatchWriteOperation -> Maybe BatchAttachPolicy
attachPolicy :: Prelude.Maybe BatchAttachPolicy,
    -- | Updates a given object\'s attributes.
    BatchWriteOperation -> Maybe BatchUpdateLinkAttributes
updateLinkAttributes :: Prelude.Maybe BatchUpdateLinkAttributes,
    -- | Attaches the specified object to the specified index.
    BatchWriteOperation -> Maybe BatchAttachToIndex
attachToIndex :: Prelude.Maybe BatchAttachToIndex
  }
  deriving (BatchWriteOperation -> BatchWriteOperation -> Bool
(BatchWriteOperation -> BatchWriteOperation -> Bool)
-> (BatchWriteOperation -> BatchWriteOperation -> Bool)
-> Eq BatchWriteOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchWriteOperation -> BatchWriteOperation -> Bool
$c/= :: BatchWriteOperation -> BatchWriteOperation -> Bool
== :: BatchWriteOperation -> BatchWriteOperation -> Bool
$c== :: BatchWriteOperation -> BatchWriteOperation -> Bool
Prelude.Eq, ReadPrec [BatchWriteOperation]
ReadPrec BatchWriteOperation
Int -> ReadS BatchWriteOperation
ReadS [BatchWriteOperation]
(Int -> ReadS BatchWriteOperation)
-> ReadS [BatchWriteOperation]
-> ReadPrec BatchWriteOperation
-> ReadPrec [BatchWriteOperation]
-> Read BatchWriteOperation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchWriteOperation]
$creadListPrec :: ReadPrec [BatchWriteOperation]
readPrec :: ReadPrec BatchWriteOperation
$creadPrec :: ReadPrec BatchWriteOperation
readList :: ReadS [BatchWriteOperation]
$creadList :: ReadS [BatchWriteOperation]
readsPrec :: Int -> ReadS BatchWriteOperation
$creadsPrec :: Int -> ReadS BatchWriteOperation
Prelude.Read, Int -> BatchWriteOperation -> ShowS
[BatchWriteOperation] -> ShowS
BatchWriteOperation -> String
(Int -> BatchWriteOperation -> ShowS)
-> (BatchWriteOperation -> String)
-> ([BatchWriteOperation] -> ShowS)
-> Show BatchWriteOperation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchWriteOperation] -> ShowS
$cshowList :: [BatchWriteOperation] -> ShowS
show :: BatchWriteOperation -> String
$cshow :: BatchWriteOperation -> String
showsPrec :: Int -> BatchWriteOperation -> ShowS
$cshowsPrec :: Int -> BatchWriteOperation -> ShowS
Prelude.Show, (forall x. BatchWriteOperation -> Rep BatchWriteOperation x)
-> (forall x. Rep BatchWriteOperation x -> BatchWriteOperation)
-> Generic BatchWriteOperation
forall x. Rep BatchWriteOperation x -> BatchWriteOperation
forall x. BatchWriteOperation -> Rep BatchWriteOperation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchWriteOperation x -> BatchWriteOperation
$cfrom :: forall x. BatchWriteOperation -> Rep BatchWriteOperation x
Prelude.Generic)

-- |
-- Create a value of 'BatchWriteOperation' 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:
--
-- 'deleteObject', 'batchWriteOperation_deleteObject' - Deletes an object in a Directory.
--
-- 'detachFromIndex', 'batchWriteOperation_detachFromIndex' - Detaches the specified object from the specified index.
--
-- 'removeFacetFromObject', 'batchWriteOperation_removeFacetFromObject' - A batch operation that removes a facet from an object.
--
-- 'attachObject', 'batchWriteOperation_attachObject' - Attaches an object to a Directory.
--
-- 'createObject', 'batchWriteOperation_createObject' - Creates an object.
--
-- 'attachTypedLink', 'batchWriteOperation_attachTypedLink' - Attaches a typed link to a specified source and target object. For more
-- information, see
-- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/directory_objects_links.html#directory_objects_links_typedlink Typed Links>.
--
-- 'detachPolicy', 'batchWriteOperation_detachPolicy' - Detaches a policy from a Directory.
--
-- 'createIndex', 'batchWriteOperation_createIndex' - Creates an index object. See
-- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/indexing_search.htm Indexing and search>
-- for more information.
--
-- 'detachObject', 'batchWriteOperation_detachObject' - Detaches an object from a Directory.
--
-- 'addFacetToObject', 'batchWriteOperation_addFacetToObject' - A batch operation that adds a facet to an object.
--
-- 'detachTypedLink', 'batchWriteOperation_detachTypedLink' - Detaches a typed link from a specified source and target object. For
-- more information, see
-- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/directory_objects_links.html#directory_objects_links_typedlink Typed Links>.
--
-- 'updateObjectAttributes', 'batchWriteOperation_updateObjectAttributes' - Updates a given object\'s attributes.
--
-- 'attachPolicy', 'batchWriteOperation_attachPolicy' - Attaches a policy object to a regular object. An object can have a
-- limited number of attached policies.
--
-- 'updateLinkAttributes', 'batchWriteOperation_updateLinkAttributes' - Updates a given object\'s attributes.
--
-- 'attachToIndex', 'batchWriteOperation_attachToIndex' - Attaches the specified object to the specified index.
newBatchWriteOperation ::
  BatchWriteOperation
newBatchWriteOperation :: BatchWriteOperation
newBatchWriteOperation =
  BatchWriteOperation' :: Maybe BatchDeleteObject
-> Maybe BatchDetachFromIndex
-> Maybe BatchRemoveFacetFromObject
-> Maybe BatchAttachObject
-> Maybe BatchCreateObject
-> Maybe BatchAttachTypedLink
-> Maybe BatchDetachPolicy
-> Maybe BatchCreateIndex
-> Maybe BatchDetachObject
-> Maybe BatchAddFacetToObject
-> Maybe BatchDetachTypedLink
-> Maybe BatchUpdateObjectAttributes
-> Maybe BatchAttachPolicy
-> Maybe BatchUpdateLinkAttributes
-> Maybe BatchAttachToIndex
-> BatchWriteOperation
BatchWriteOperation'
    { $sel:deleteObject:BatchWriteOperation' :: Maybe BatchDeleteObject
deleteObject =
        Maybe BatchDeleteObject
forall a. Maybe a
Prelude.Nothing,
      $sel:detachFromIndex:BatchWriteOperation' :: Maybe BatchDetachFromIndex
detachFromIndex = Maybe BatchDetachFromIndex
forall a. Maybe a
Prelude.Nothing,
      $sel:removeFacetFromObject:BatchWriteOperation' :: Maybe BatchRemoveFacetFromObject
removeFacetFromObject = Maybe BatchRemoveFacetFromObject
forall a. Maybe a
Prelude.Nothing,
      $sel:attachObject:BatchWriteOperation' :: Maybe BatchAttachObject
attachObject = Maybe BatchAttachObject
forall a. Maybe a
Prelude.Nothing,
      $sel:createObject:BatchWriteOperation' :: Maybe BatchCreateObject
createObject = Maybe BatchCreateObject
forall a. Maybe a
Prelude.Nothing,
      $sel:attachTypedLink:BatchWriteOperation' :: Maybe BatchAttachTypedLink
attachTypedLink = Maybe BatchAttachTypedLink
forall a. Maybe a
Prelude.Nothing,
      $sel:detachPolicy:BatchWriteOperation' :: Maybe BatchDetachPolicy
detachPolicy = Maybe BatchDetachPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:createIndex:BatchWriteOperation' :: Maybe BatchCreateIndex
createIndex = Maybe BatchCreateIndex
forall a. Maybe a
Prelude.Nothing,
      $sel:detachObject:BatchWriteOperation' :: Maybe BatchDetachObject
detachObject = Maybe BatchDetachObject
forall a. Maybe a
Prelude.Nothing,
      $sel:addFacetToObject:BatchWriteOperation' :: Maybe BatchAddFacetToObject
addFacetToObject = Maybe BatchAddFacetToObject
forall a. Maybe a
Prelude.Nothing,
      $sel:detachTypedLink:BatchWriteOperation' :: Maybe BatchDetachTypedLink
detachTypedLink = Maybe BatchDetachTypedLink
forall a. Maybe a
Prelude.Nothing,
      $sel:updateObjectAttributes:BatchWriteOperation' :: Maybe BatchUpdateObjectAttributes
updateObjectAttributes = Maybe BatchUpdateObjectAttributes
forall a. Maybe a
Prelude.Nothing,
      $sel:attachPolicy:BatchWriteOperation' :: Maybe BatchAttachPolicy
attachPolicy = Maybe BatchAttachPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:updateLinkAttributes:BatchWriteOperation' :: Maybe BatchUpdateLinkAttributes
updateLinkAttributes = Maybe BatchUpdateLinkAttributes
forall a. Maybe a
Prelude.Nothing,
      $sel:attachToIndex:BatchWriteOperation' :: Maybe BatchAttachToIndex
attachToIndex = Maybe BatchAttachToIndex
forall a. Maybe a
Prelude.Nothing
    }

-- | Deletes an object in a Directory.
batchWriteOperation_deleteObject :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchDeleteObject)
batchWriteOperation_deleteObject :: (Maybe BatchDeleteObject -> f (Maybe BatchDeleteObject))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_deleteObject = (BatchWriteOperation -> Maybe BatchDeleteObject)
-> (BatchWriteOperation
    -> Maybe BatchDeleteObject -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchDeleteObject)
     (Maybe BatchDeleteObject)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchDeleteObject
deleteObject :: Maybe BatchDeleteObject
$sel:deleteObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchDeleteObject
deleteObject} -> Maybe BatchDeleteObject
deleteObject) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchDeleteObject
a -> BatchWriteOperation
s {$sel:deleteObject:BatchWriteOperation' :: Maybe BatchDeleteObject
deleteObject = Maybe BatchDeleteObject
a} :: BatchWriteOperation)

-- | Detaches the specified object from the specified index.
batchWriteOperation_detachFromIndex :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchDetachFromIndex)
batchWriteOperation_detachFromIndex :: (Maybe BatchDetachFromIndex -> f (Maybe BatchDetachFromIndex))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_detachFromIndex = (BatchWriteOperation -> Maybe BatchDetachFromIndex)
-> (BatchWriteOperation
    -> Maybe BatchDetachFromIndex -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchDetachFromIndex)
     (Maybe BatchDetachFromIndex)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchDetachFromIndex
detachFromIndex :: Maybe BatchDetachFromIndex
$sel:detachFromIndex:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchDetachFromIndex
detachFromIndex} -> Maybe BatchDetachFromIndex
detachFromIndex) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchDetachFromIndex
a -> BatchWriteOperation
s {$sel:detachFromIndex:BatchWriteOperation' :: Maybe BatchDetachFromIndex
detachFromIndex = Maybe BatchDetachFromIndex
a} :: BatchWriteOperation)

-- | A batch operation that removes a facet from an object.
batchWriteOperation_removeFacetFromObject :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchRemoveFacetFromObject)
batchWriteOperation_removeFacetFromObject :: (Maybe BatchRemoveFacetFromObject
 -> f (Maybe BatchRemoveFacetFromObject))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_removeFacetFromObject = (BatchWriteOperation -> Maybe BatchRemoveFacetFromObject)
-> (BatchWriteOperation
    -> Maybe BatchRemoveFacetFromObject -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchRemoveFacetFromObject)
     (Maybe BatchRemoveFacetFromObject)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchRemoveFacetFromObject
removeFacetFromObject :: Maybe BatchRemoveFacetFromObject
$sel:removeFacetFromObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchRemoveFacetFromObject
removeFacetFromObject} -> Maybe BatchRemoveFacetFromObject
removeFacetFromObject) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchRemoveFacetFromObject
a -> BatchWriteOperation
s {$sel:removeFacetFromObject:BatchWriteOperation' :: Maybe BatchRemoveFacetFromObject
removeFacetFromObject = Maybe BatchRemoveFacetFromObject
a} :: BatchWriteOperation)

-- | Attaches an object to a Directory.
batchWriteOperation_attachObject :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchAttachObject)
batchWriteOperation_attachObject :: (Maybe BatchAttachObject -> f (Maybe BatchAttachObject))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_attachObject = (BatchWriteOperation -> Maybe BatchAttachObject)
-> (BatchWriteOperation
    -> Maybe BatchAttachObject -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchAttachObject)
     (Maybe BatchAttachObject)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchAttachObject
attachObject :: Maybe BatchAttachObject
$sel:attachObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchAttachObject
attachObject} -> Maybe BatchAttachObject
attachObject) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchAttachObject
a -> BatchWriteOperation
s {$sel:attachObject:BatchWriteOperation' :: Maybe BatchAttachObject
attachObject = Maybe BatchAttachObject
a} :: BatchWriteOperation)

-- | Creates an object.
batchWriteOperation_createObject :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchCreateObject)
batchWriteOperation_createObject :: (Maybe BatchCreateObject -> f (Maybe BatchCreateObject))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_createObject = (BatchWriteOperation -> Maybe BatchCreateObject)
-> (BatchWriteOperation
    -> Maybe BatchCreateObject -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchCreateObject)
     (Maybe BatchCreateObject)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchCreateObject
createObject :: Maybe BatchCreateObject
$sel:createObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchCreateObject
createObject} -> Maybe BatchCreateObject
createObject) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchCreateObject
a -> BatchWriteOperation
s {$sel:createObject:BatchWriteOperation' :: Maybe BatchCreateObject
createObject = Maybe BatchCreateObject
a} :: BatchWriteOperation)

-- | Attaches a typed link to a specified source and target object. For more
-- information, see
-- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/directory_objects_links.html#directory_objects_links_typedlink Typed Links>.
batchWriteOperation_attachTypedLink :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchAttachTypedLink)
batchWriteOperation_attachTypedLink :: (Maybe BatchAttachTypedLink -> f (Maybe BatchAttachTypedLink))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_attachTypedLink = (BatchWriteOperation -> Maybe BatchAttachTypedLink)
-> (BatchWriteOperation
    -> Maybe BatchAttachTypedLink -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchAttachTypedLink)
     (Maybe BatchAttachTypedLink)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchAttachTypedLink
attachTypedLink :: Maybe BatchAttachTypedLink
$sel:attachTypedLink:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchAttachTypedLink
attachTypedLink} -> Maybe BatchAttachTypedLink
attachTypedLink) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchAttachTypedLink
a -> BatchWriteOperation
s {$sel:attachTypedLink:BatchWriteOperation' :: Maybe BatchAttachTypedLink
attachTypedLink = Maybe BatchAttachTypedLink
a} :: BatchWriteOperation)

-- | Detaches a policy from a Directory.
batchWriteOperation_detachPolicy :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchDetachPolicy)
batchWriteOperation_detachPolicy :: (Maybe BatchDetachPolicy -> f (Maybe BatchDetachPolicy))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_detachPolicy = (BatchWriteOperation -> Maybe BatchDetachPolicy)
-> (BatchWriteOperation
    -> Maybe BatchDetachPolicy -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchDetachPolicy)
     (Maybe BatchDetachPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchDetachPolicy
detachPolicy :: Maybe BatchDetachPolicy
$sel:detachPolicy:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchDetachPolicy
detachPolicy} -> Maybe BatchDetachPolicy
detachPolicy) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchDetachPolicy
a -> BatchWriteOperation
s {$sel:detachPolicy:BatchWriteOperation' :: Maybe BatchDetachPolicy
detachPolicy = Maybe BatchDetachPolicy
a} :: BatchWriteOperation)

-- | Creates an index object. See
-- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/indexing_search.htm Indexing and search>
-- for more information.
batchWriteOperation_createIndex :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchCreateIndex)
batchWriteOperation_createIndex :: (Maybe BatchCreateIndex -> f (Maybe BatchCreateIndex))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_createIndex = (BatchWriteOperation -> Maybe BatchCreateIndex)
-> (BatchWriteOperation
    -> Maybe BatchCreateIndex -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchCreateIndex)
     (Maybe BatchCreateIndex)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchCreateIndex
createIndex :: Maybe BatchCreateIndex
$sel:createIndex:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchCreateIndex
createIndex} -> Maybe BatchCreateIndex
createIndex) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchCreateIndex
a -> BatchWriteOperation
s {$sel:createIndex:BatchWriteOperation' :: Maybe BatchCreateIndex
createIndex = Maybe BatchCreateIndex
a} :: BatchWriteOperation)

-- | Detaches an object from a Directory.
batchWriteOperation_detachObject :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchDetachObject)
batchWriteOperation_detachObject :: (Maybe BatchDetachObject -> f (Maybe BatchDetachObject))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_detachObject = (BatchWriteOperation -> Maybe BatchDetachObject)
-> (BatchWriteOperation
    -> Maybe BatchDetachObject -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchDetachObject)
     (Maybe BatchDetachObject)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchDetachObject
detachObject :: Maybe BatchDetachObject
$sel:detachObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchDetachObject
detachObject} -> Maybe BatchDetachObject
detachObject) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchDetachObject
a -> BatchWriteOperation
s {$sel:detachObject:BatchWriteOperation' :: Maybe BatchDetachObject
detachObject = Maybe BatchDetachObject
a} :: BatchWriteOperation)

-- | A batch operation that adds a facet to an object.
batchWriteOperation_addFacetToObject :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchAddFacetToObject)
batchWriteOperation_addFacetToObject :: (Maybe BatchAddFacetToObject -> f (Maybe BatchAddFacetToObject))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_addFacetToObject = (BatchWriteOperation -> Maybe BatchAddFacetToObject)
-> (BatchWriteOperation
    -> Maybe BatchAddFacetToObject -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchAddFacetToObject)
     (Maybe BatchAddFacetToObject)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchAddFacetToObject
addFacetToObject :: Maybe BatchAddFacetToObject
$sel:addFacetToObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchAddFacetToObject
addFacetToObject} -> Maybe BatchAddFacetToObject
addFacetToObject) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchAddFacetToObject
a -> BatchWriteOperation
s {$sel:addFacetToObject:BatchWriteOperation' :: Maybe BatchAddFacetToObject
addFacetToObject = Maybe BatchAddFacetToObject
a} :: BatchWriteOperation)

-- | Detaches a typed link from a specified source and target object. For
-- more information, see
-- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/directory_objects_links.html#directory_objects_links_typedlink Typed Links>.
batchWriteOperation_detachTypedLink :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchDetachTypedLink)
batchWriteOperation_detachTypedLink :: (Maybe BatchDetachTypedLink -> f (Maybe BatchDetachTypedLink))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_detachTypedLink = (BatchWriteOperation -> Maybe BatchDetachTypedLink)
-> (BatchWriteOperation
    -> Maybe BatchDetachTypedLink -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchDetachTypedLink)
     (Maybe BatchDetachTypedLink)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchDetachTypedLink
detachTypedLink :: Maybe BatchDetachTypedLink
$sel:detachTypedLink:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchDetachTypedLink
detachTypedLink} -> Maybe BatchDetachTypedLink
detachTypedLink) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchDetachTypedLink
a -> BatchWriteOperation
s {$sel:detachTypedLink:BatchWriteOperation' :: Maybe BatchDetachTypedLink
detachTypedLink = Maybe BatchDetachTypedLink
a} :: BatchWriteOperation)

-- | Updates a given object\'s attributes.
batchWriteOperation_updateObjectAttributes :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchUpdateObjectAttributes)
batchWriteOperation_updateObjectAttributes :: (Maybe BatchUpdateObjectAttributes
 -> f (Maybe BatchUpdateObjectAttributes))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_updateObjectAttributes = (BatchWriteOperation -> Maybe BatchUpdateObjectAttributes)
-> (BatchWriteOperation
    -> Maybe BatchUpdateObjectAttributes -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchUpdateObjectAttributes)
     (Maybe BatchUpdateObjectAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchUpdateObjectAttributes
updateObjectAttributes :: Maybe BatchUpdateObjectAttributes
$sel:updateObjectAttributes:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchUpdateObjectAttributes
updateObjectAttributes} -> Maybe BatchUpdateObjectAttributes
updateObjectAttributes) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchUpdateObjectAttributes
a -> BatchWriteOperation
s {$sel:updateObjectAttributes:BatchWriteOperation' :: Maybe BatchUpdateObjectAttributes
updateObjectAttributes = Maybe BatchUpdateObjectAttributes
a} :: BatchWriteOperation)

-- | Attaches a policy object to a regular object. An object can have a
-- limited number of attached policies.
batchWriteOperation_attachPolicy :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchAttachPolicy)
batchWriteOperation_attachPolicy :: (Maybe BatchAttachPolicy -> f (Maybe BatchAttachPolicy))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_attachPolicy = (BatchWriteOperation -> Maybe BatchAttachPolicy)
-> (BatchWriteOperation
    -> Maybe BatchAttachPolicy -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchAttachPolicy)
     (Maybe BatchAttachPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchAttachPolicy
attachPolicy :: Maybe BatchAttachPolicy
$sel:attachPolicy:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchAttachPolicy
attachPolicy} -> Maybe BatchAttachPolicy
attachPolicy) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchAttachPolicy
a -> BatchWriteOperation
s {$sel:attachPolicy:BatchWriteOperation' :: Maybe BatchAttachPolicy
attachPolicy = Maybe BatchAttachPolicy
a} :: BatchWriteOperation)

-- | Updates a given object\'s attributes.
batchWriteOperation_updateLinkAttributes :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchUpdateLinkAttributes)
batchWriteOperation_updateLinkAttributes :: (Maybe BatchUpdateLinkAttributes
 -> f (Maybe BatchUpdateLinkAttributes))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_updateLinkAttributes = (BatchWriteOperation -> Maybe BatchUpdateLinkAttributes)
-> (BatchWriteOperation
    -> Maybe BatchUpdateLinkAttributes -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchUpdateLinkAttributes)
     (Maybe BatchUpdateLinkAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchUpdateLinkAttributes
updateLinkAttributes :: Maybe BatchUpdateLinkAttributes
$sel:updateLinkAttributes:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchUpdateLinkAttributes
updateLinkAttributes} -> Maybe BatchUpdateLinkAttributes
updateLinkAttributes) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchUpdateLinkAttributes
a -> BatchWriteOperation
s {$sel:updateLinkAttributes:BatchWriteOperation' :: Maybe BatchUpdateLinkAttributes
updateLinkAttributes = Maybe BatchUpdateLinkAttributes
a} :: BatchWriteOperation)

-- | Attaches the specified object to the specified index.
batchWriteOperation_attachToIndex :: Lens.Lens' BatchWriteOperation (Prelude.Maybe BatchAttachToIndex)
batchWriteOperation_attachToIndex :: (Maybe BatchAttachToIndex -> f (Maybe BatchAttachToIndex))
-> BatchWriteOperation -> f BatchWriteOperation
batchWriteOperation_attachToIndex = (BatchWriteOperation -> Maybe BatchAttachToIndex)
-> (BatchWriteOperation
    -> Maybe BatchAttachToIndex -> BatchWriteOperation)
-> Lens
     BatchWriteOperation
     BatchWriteOperation
     (Maybe BatchAttachToIndex)
     (Maybe BatchAttachToIndex)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteOperation' {Maybe BatchAttachToIndex
attachToIndex :: Maybe BatchAttachToIndex
$sel:attachToIndex:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchAttachToIndex
attachToIndex} -> Maybe BatchAttachToIndex
attachToIndex) (\s :: BatchWriteOperation
s@BatchWriteOperation' {} Maybe BatchAttachToIndex
a -> BatchWriteOperation
s {$sel:attachToIndex:BatchWriteOperation' :: Maybe BatchAttachToIndex
attachToIndex = Maybe BatchAttachToIndex
a} :: BatchWriteOperation)

instance Prelude.Hashable BatchWriteOperation

instance Prelude.NFData BatchWriteOperation

instance Core.ToJSON BatchWriteOperation where
  toJSON :: BatchWriteOperation -> Value
toJSON BatchWriteOperation' {Maybe BatchDetachPolicy
Maybe BatchDetachObject
Maybe BatchDetachFromIndex
Maybe BatchDeleteObject
Maybe BatchCreateIndex
Maybe BatchAttachToIndex
Maybe BatchAttachPolicy
Maybe BatchAttachObject
Maybe BatchRemoveFacetFromObject
Maybe BatchCreateObject
Maybe BatchAddFacetToObject
Maybe BatchAttachTypedLink
Maybe BatchDetachTypedLink
Maybe BatchUpdateObjectAttributes
Maybe BatchUpdateLinkAttributes
attachToIndex :: Maybe BatchAttachToIndex
updateLinkAttributes :: Maybe BatchUpdateLinkAttributes
attachPolicy :: Maybe BatchAttachPolicy
updateObjectAttributes :: Maybe BatchUpdateObjectAttributes
detachTypedLink :: Maybe BatchDetachTypedLink
addFacetToObject :: Maybe BatchAddFacetToObject
detachObject :: Maybe BatchDetachObject
createIndex :: Maybe BatchCreateIndex
detachPolicy :: Maybe BatchDetachPolicy
attachTypedLink :: Maybe BatchAttachTypedLink
createObject :: Maybe BatchCreateObject
attachObject :: Maybe BatchAttachObject
removeFacetFromObject :: Maybe BatchRemoveFacetFromObject
detachFromIndex :: Maybe BatchDetachFromIndex
deleteObject :: Maybe BatchDeleteObject
$sel:attachToIndex:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchAttachToIndex
$sel:updateLinkAttributes:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchUpdateLinkAttributes
$sel:attachPolicy:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchAttachPolicy
$sel:updateObjectAttributes:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchUpdateObjectAttributes
$sel:detachTypedLink:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchDetachTypedLink
$sel:addFacetToObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchAddFacetToObject
$sel:detachObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchDetachObject
$sel:createIndex:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchCreateIndex
$sel:detachPolicy:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchDetachPolicy
$sel:attachTypedLink:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchAttachTypedLink
$sel:createObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchCreateObject
$sel:attachObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchAttachObject
$sel:removeFacetFromObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchRemoveFacetFromObject
$sel:detachFromIndex:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchDetachFromIndex
$sel:deleteObject:BatchWriteOperation' :: BatchWriteOperation -> Maybe BatchDeleteObject
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DeleteObject" Text -> BatchDeleteObject -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BatchDeleteObject -> Pair)
-> Maybe BatchDeleteObject -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchDeleteObject
deleteObject,
            (Text
"DetachFromIndex" Text -> BatchDetachFromIndex -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BatchDetachFromIndex -> Pair)
-> Maybe BatchDetachFromIndex -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchDetachFromIndex
detachFromIndex,
            (Text
"RemoveFacetFromObject" Text -> BatchRemoveFacetFromObject -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BatchRemoveFacetFromObject -> Pair)
-> Maybe BatchRemoveFacetFromObject -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchRemoveFacetFromObject
removeFacetFromObject,
            (Text
"AttachObject" Text -> BatchAttachObject -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BatchAttachObject -> Pair)
-> Maybe BatchAttachObject -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchAttachObject
attachObject,
            (Text
"CreateObject" Text -> BatchCreateObject -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BatchCreateObject -> Pair)
-> Maybe BatchCreateObject -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchCreateObject
createObject,
            (Text
"AttachTypedLink" Text -> BatchAttachTypedLink -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BatchAttachTypedLink -> Pair)
-> Maybe BatchAttachTypedLink -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchAttachTypedLink
attachTypedLink,
            (Text
"DetachPolicy" Text -> BatchDetachPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BatchDetachPolicy -> Pair)
-> Maybe BatchDetachPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchDetachPolicy
detachPolicy,
            (Text
"CreateIndex" Text -> BatchCreateIndex -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BatchCreateIndex -> Pair) -> Maybe BatchCreateIndex -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchCreateIndex
createIndex,
            (Text
"DetachObject" Text -> BatchDetachObject -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BatchDetachObject -> Pair)
-> Maybe BatchDetachObject -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchDetachObject
detachObject,
            (Text
"AddFacetToObject" Text -> BatchAddFacetToObject -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BatchAddFacetToObject -> Pair)
-> Maybe BatchAddFacetToObject -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchAddFacetToObject
addFacetToObject,
            (Text
"DetachTypedLink" Text -> BatchDetachTypedLink -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BatchDetachTypedLink -> Pair)
-> Maybe BatchDetachTypedLink -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchDetachTypedLink
detachTypedLink,
            (Text
"UpdateObjectAttributes" Text -> BatchUpdateObjectAttributes -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BatchUpdateObjectAttributes -> Pair)
-> Maybe BatchUpdateObjectAttributes -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchUpdateObjectAttributes
updateObjectAttributes,
            (Text
"AttachPolicy" Text -> BatchAttachPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BatchAttachPolicy -> Pair)
-> Maybe BatchAttachPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchAttachPolicy
attachPolicy,
            (Text
"UpdateLinkAttributes" Text -> BatchUpdateLinkAttributes -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BatchUpdateLinkAttributes -> Pair)
-> Maybe BatchUpdateLinkAttributes -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchUpdateLinkAttributes
updateLinkAttributes,
            (Text
"AttachToIndex" Text -> BatchAttachToIndex -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BatchAttachToIndex -> Pair)
-> Maybe BatchAttachToIndex -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchAttachToIndex
attachToIndex
          ]
      )