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


async def create(
    hub,
    ctx,
    context_name: str,
    source: Dict,
    context_type: str,
    description: str = None,
    properties: Dict = None,
    tags: List = None,
) -> Dict:
    r"""
    **Autogenerated function**

    Creates a context. A context is a lineage tracking entity that represents a logical grouping of other tracking or experiment entities. Some examples are an endpoint and a model package. For more information, see Amazon SageMaker ML Lineage Tracking.   CreateContext can only be invoked from within an SageMaker managed environment. This includes SageMaker training jobs, processing jobs, transform jobs, and SageMaker notebooks. A call to CreateContext from outside one of these environments results in an error.

    Args:
        context_name(str): The name of the context. Must be unique to your account in an Amazon Web Services Region.
        source(Dict): The source type, ID, and URI.
        context_type(str): The context type.
        description(str, optional): The description of the context. Defaults to None.
        properties(Dict, optional): A list of properties to add to the context. Defaults to None.
        tags(List, optional): A list of tags to apply to the context. Defaults to None.

    Returns:
        Dict

    Examples:
        Call from code:

        .. code-block:: python

            await hub.exec.aws_auto.sagemaker.context.create(
                ctx, context_name=value, source=value, context_type=value
            )

        Call from CLI:

        .. code-block:: bash

            $ idem exec aws_auto.sagemaker.context.create context_name=value, source=value, context_type=value
    """
    return await hub.tool.aws.client.exec(
        ctx,
        service_name="sagemaker",
        operation="create_context",
        op_kwargs={
            "ContextName": context_name,
            "Source": source,
            "ContextType": context_type,
            "Description": description,
            "Properties": properties,
            "Tags": tags,
        },
    )


async def delete(hub, ctx, context_name: str) -> Dict:
    r"""
    **Autogenerated function**

    Deletes an context.

    Args:
        context_name(str): The name of the context to delete.

    Returns:
        Dict

    Examples:
        Call from code:

        .. code-block:: python

            await hub.exec.aws_auto.sagemaker.context.delete(ctx, context_name=value)

        Call from CLI:

        .. code-block:: bash

            $ idem exec aws_auto.sagemaker.context.delete context_name=value
    """
    return await hub.tool.aws.client.exec(
        ctx,
        service_name="sagemaker",
        operation="delete_context",
        op_kwargs={"ContextName": context_name},
    )


async def describe(hub, ctx, context_name: str) -> Dict:
    r"""
    **Autogenerated function**

    Describes a context.

    Args:
        context_name(str): The name of the context to describe.

    Returns:
        Dict

    Examples:
        Call from code:

        .. code-block:: python

            await hub.exec.aws_auto.sagemaker.context.describe(ctx, context_name=value)

        Call from CLI:

        .. code-block:: bash

            $ idem exec aws_auto.sagemaker.context.describe context_name=value
    """
    return await hub.tool.aws.client.exec(
        ctx,
        service_name="sagemaker",
        operation="describe_context",
        op_kwargs={"ContextName": context_name},
    )


async def list_all(
    hub,
    ctx,
    source_uri: str = None,
    context_type: str = None,
    created_after: str = None,
    created_before: str = None,
    sort_by: str = None,
    sort_order: str = None,
    next_token: str = None,
    max_results: int = None,
) -> Dict:
    r"""
    **Autogenerated function**

    Lists the contexts in your account and their properties.

    Args:
        source_uri(str, optional): A filter that returns only contexts with the specified source URI. Defaults to None.
        context_type(str, optional): A filter that returns only contexts of the specified type. Defaults to None.
        created_after(str, optional): A filter that returns only contexts created on or after the specified time. Defaults to None.
        created_before(str, optional): A filter that returns only contexts created on or before the specified time. Defaults to None.
        sort_by(str, optional): The property used to sort results. The default value is CreationTime. Defaults to None.
        sort_order(str, optional): The sort order. The default value is Descending. Defaults to None.
        next_token(str, optional): If the previous call to ListContexts didn't return the full set of contexts, the call returns a token for getting the next set of contexts. Defaults to None.
        max_results(int, optional): The maximum number of contexts to return in the response. The default value is 10. Defaults to None.

    Returns:
        Dict

    Examples:
        Call from code:

        .. code-block:: python

            await hub.exec.aws_auto.sagemaker.context.list_all(ctx)

        Call from CLI:

        .. code-block:: bash

            $ idem exec aws_auto.sagemaker.context.list_all
    """
    return await hub.tool.aws.client.exec(
        ctx,
        service_name="sagemaker",
        operation="list_contexts",
        op_kwargs={
            "SourceUri": source_uri,
            "ContextType": context_type,
            "CreatedAfter": created_after,
            "CreatedBefore": created_before,
            "SortBy": sort_by,
            "SortOrder": sort_order,
            "NextToken": next_token,
            "MaxResults": max_results,
        },
    )


async def update(
    hub,
    ctx,
    context_name: str,
    description: str = None,
    properties: Dict = None,
    properties_to_remove: List = None,
) -> Dict:
    r"""
    **Autogenerated function**

    Updates a context.

    Args:
        context_name(str): The name of the context to update.
        description(str, optional): The new description for the context. Defaults to None.
        properties(Dict, optional): The new list of properties. Overwrites the current property list. Defaults to None.
        properties_to_remove(List, optional): A list of properties to remove. Defaults to None.

    Returns:
        Dict

    Examples:
        Call from code:

        .. code-block:: python

            await hub.exec.aws_auto.sagemaker.context.update(ctx, context_name=value)

        Call from CLI:

        .. code-block:: bash

            $ idem exec aws_auto.sagemaker.context.update context_name=value
    """
    return await hub.tool.aws.client.exec(
        ctx,
        service_name="sagemaker",
        operation="update_context",
        op_kwargs={
            "ContextName": context_name,
            "Description": description,
            "Properties": properties,
            "PropertiesToRemove": properties_to_remove,
        },
    )
