"""
Autogenerated module using `pop-create-idem <https://gitlab.com/saltstack/pop/pop-create-idem>`__
"""
from typing import Dict
from typing import List


async def batch(hub, ctx, directory_arn: str, operations: List) -> Dict:
    r"""
    **Autogenerated function**

    Performs all the write operations in a batch. Either all the operations succeed or none.

    Args:
        directory_arn(str): The Amazon Resource Name (ARN) that is associated with the Directory. For more information, see arns.
        operations(List): A list of operations that are part of the batch.

    Returns:
        Dict

    Examples:
        Call from code:

        .. code-block:: python

            await hub.exec.aws_auto.clouddirectory.write.batch(
                ctx, directory_arn=value, operations=value
            )

        Call from CLI:

        .. code-block:: bash

            $ idem exec aws_auto.clouddirectory.write.batch directory_arn=value, operations=value
    """
    return await hub.tool.aws.client.exec(
        ctx,
        service_name="clouddirectory",
        operation="batch_write",
        op_kwargs={"DirectoryArn": directory_arn, "Operations": operations},
    )
