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


async def describe_all(
    hub,
    ctx,
    client_vpn_endpoint_id: str,
    filters: List = None,
    next_token: str = None,
    max_results: int = None,
    dry_run: bool = None,
) -> Dict:
    r"""
    **Autogenerated function**

    Describes active client connections and connections that have been terminated within the last 60 minutes for the specified Client VPN endpoint.

    Args:
        client_vpn_endpoint_id(str): The ID of the Client VPN endpoint.
        filters(List, optional): One or more filters. Filter names and values are case-sensitive.    connection-id - The ID of the connection.    username - For Active Directory client authentication, the user name of the client who established the client connection.  . Defaults to None.
        next_token(str, optional): The token to retrieve the next page of results. Defaults to None.
        max_results(int, optional): The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the nextToken value. Defaults to None.
        dry_run(bool, optional): Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. Defaults to None.

    Returns:
        Dict

    Examples:
        Call from code:

        .. code-block:: python

            await hub.exec.aws_auto.ec2.client_vpn.connection.describe_all(
                ctx, client_vpn_endpoint_id=value
            )

        Call from CLI:

        .. code-block:: bash

            $ idem exec aws_auto.ec2.client_vpn.connection.describe_all client_vpn_endpoint_id=value
    """
    return await hub.tool.aws.client.exec(
        ctx,
        service_name="ec2",
        operation="describe_client_vpn_connections",
        op_kwargs={
            "ClientVpnEndpointId": client_vpn_endpoint_id,
            "Filters": filters,
            "NextToken": next_token,
            "MaxResults": max_results,
            "DryRun": dry_run,
        },
    )


async def terminate(
    hub,
    ctx,
    client_vpn_endpoint_id: str,
    connection_id: str = None,
    username: str = None,
    dry_run: bool = None,
) -> Dict:
    r"""
    **Autogenerated function**

    Terminates active Client VPN endpoint connections. This action can be used to terminate a specific client connection, or up to five connections established by a specific user.

    Args:
        client_vpn_endpoint_id(str): The ID of the Client VPN endpoint to which the client is connected.
        connection_id(str, optional): The ID of the client connection to be terminated. Defaults to None.
        username(str, optional): The name of the user who initiated the connection. Use this option to terminate all active connections for the specified user. This option can only be used if the user has established up to five connections. Defaults to None.
        dry_run(bool, optional): Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. Defaults to None.

    Returns:
        Dict

    Examples:
        Call from code:

        .. code-block:: python

            await hub.exec.aws_auto.ec2.client_vpn.connection.terminate(
                ctx, client_vpn_endpoint_id=value
            )

        Call from CLI:

        .. code-block:: bash

            $ idem exec aws_auto.ec2.client_vpn.connection.terminate client_vpn_endpoint_id=value
    """
    return await hub.tool.aws.client.exec(
        ctx,
        service_name="ec2",
        operation="terminate_client_vpn_connections",
        op_kwargs={
            "ClientVpnEndpointId": client_vpn_endpoint_id,
            "ConnectionId": connection_id,
            "Username": username,
            "DryRun": dry_run,
        },
    )
