o
    Á¿iR  ã                   @   s,   d dl mZmZmZ G dd„ deeeƒZdS )é    )ÚDeletableAPISubResourceÚListableAPISubResourceÚAddableAPISubResourcec                       sŒ   e Zd ZdZdZdZe‡ fdd„ƒZe‡ fdd„ƒZe‡ fdd	„ƒZ	e‡ fd
d„ƒZ
e‡ fdd„ƒZe‡ fdd„ƒZe‡ fdd„ƒZ‡  ZS )ÚAwsLogsIntegrationz(
    A wrapper around AWS Logs API.
    ÚintegrationÚawsc                    ó"   d| _ tt| ƒjdd| ji|¤ŽS )zx
        List all namespace rules available as options.

        >>> api.AwsLogsIntegration.list_log_services()
        úlogs/servicesÚidN© ©Ú_sub_resource_nameÚsuperr   Ú	get_itemsÚ_resource_id©ÚclsÚparams©Ú	__class__r   úS/home/ubuntu/.local/lib/python3.10/site-packages/datadog/api/aws_log_integration.pyÚlist_log_services   ó   z$AwsLogsIntegration.list_log_servicesc                    r   )aW  
        Attach the Lambda ARN of the Lambda created for the Datadog-AWS         log collection to your AWS account ID to enable log collection.

        >>> account_id = "<AWS_ACCOUNT_ID>"
        >>> lambda_arn = "<AWS_LAMBDA_ARN>"

        >>> api.AwsLogsIntegration.add_log_lambda_arn(account_id=account_id, lambda_arn=lambda_arn)
        Úlogsr
   Nr   ©r   r   r   Ú	add_itemsr   r   r   r   r   Úadd_log_lambda_arn   ó   z%AwsLogsIntegration.add_log_lambda_arnc                    r   )zû
        Enable Automatic Log collection for your AWS services.

        >>> account_id = "<AWS_ACCOUNT_ID>"
        >>> services = ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]

        >>> api.AwsLogsIntegration.save_services()
        r	   r
   Nr   r   r   r   r   r   Úsave_services'   s   
z AwsLogsIntegration.save_servicesc                    r   )aM  
        Delete a Datadog-AWS log collection configuration by removing the specific Lambda ARN         associated with a given AWS account.

        >>> account_id = "<AWS_ACCOUNT_ID>"
        >>> lambda_arn = "<AWS_LAMBDA_ARN>"

        >>> api.AwsLogsIntegration.delete_config(account_id=account_id, lambda_arn=lambda_arn)
        r   r
   Nr   )r   r   r   Údelete_itemsr   r   r   r   r   Údelete_config4   r   z AwsLogsIntegration.delete_configc                    r   )a  
        Check function to see if a lambda_arn exists within an account.         This sends a job on our side if it does not exist, then immediately returns         the status of that job. Subsequent requests will always repeat the above, so this endpoint         can be polled intermittently instead of blocking.

        Returns a status of 'created' when it's checking if the Lambda exists in the account.
        Returns a status of 'waiting' while checking.
        Returns a status of 'checked and ok' if the Lambda exists.
        Returns a status of 'error' if the Lambda does not exist.

        >>> account_id = "<AWS_ACCOUNT_ID>"
        >>> lambda_arn = "<AWS_LAMBDA_ARN>"

        >>> api.AwsLogsIntegration.check_lambda(account_id=account_id, lambda_arn=lambda_arn)
        zlogs/check_asyncr
   Nr   r   r   r   r   r   Úcheck_lambdaB   s   zAwsLogsIntegration.check_lambdac                    r   )aÎ  
        Test if permissions are present to add log-forwarding triggers for the         given services + AWS account. Input is the same as for save_services.
        Done async, so can be repeatedly polled in a non-blocking fashion until         the async request completes

        >>> account_id = "<AWS_ACCOUNT_ID>"
        >>> services = ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]

        >>> api.AwsLogsIntegration.check_services()
        zlogs/services_asyncr
   Nr   r   r   r   r   r   Úcheck_servicesW   s   z!AwsLogsIntegration.check_servicesc                    r   )z‹
        List all Datadog-AWS Logs integrations available in your Datadog organization.

        >>> api.AwsLogsIntegration.list()
        r   r
   Nr   r   r   r   r   r   Úlistg   r   zAwsLogsIntegration.list)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú_resource_namer   Úclassmethodr   r   r   r    r!   r"   r#   Ú__classcell__r   r   r   r   r      s$    	r   N)Údatadog.api.resourcesr   r   r   r   r   r   r   r   Ú<module>   s   