o
    i                     @   s2   d dl mZmZmZmZ G dd deeeeZdS )    )GetableAPIResourceCreateableAPIResourceDeletableAPIResourceUpdatableAPIResourcec                       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
  ZS )GcpIntegrationz/
    A wrapper around GCP integration API.
    integrationgcpc                       t t| jdd| ji|S )z
        List all Datadog-Gcp integrations available in your Datadog organization.

        >>> api.GcpIntegration.list()
        idN )superr   get_resource_idclsparams	__class__r   O/home/ubuntu/.local/lib/python3.10/site-packages/datadog/api/gcp_integration.pylist   s   zGcpIntegration.listc                    s   t t| j| j|dS )z
        Delete a given Datadog-GCP integration.

        >>> project_id="<GCP_CLIENT_ID>"
        >>> client_email="<GCP_CLIENT_EMAIL>"

        >>> api.GcpIntegration.delete(project_id=project_id, client_email=client_email)
        )r
   body)r   r   deleter   )r   r   r   r   r   r      s   
zGcpIntegration.deletec                    r	   )aL  
        Add a new GCP integration config.

        All of the following fields values are provided by the         JSON service account key file created in the GCP Console         for service accounts; Refer to the Datadog-Google Cloud         Platform integration installation instructions to see how         to generate one for your organization. For further references,         consult the Google Cloud service account documentation.

        >>> type="service_account"
        >>> project_id="<GCP_PROJECT_ID>"
        >>> private_key_id="<GCP_PRIVATE_KEY_ID>"
        >>> private_key="<GCP_PRIVATE_KEY>"
        >>> client_email="<GCP_CLIENT_EMAIL>"
        >>> client_id="<GCP_CLIENT_ID>"
        >>> auth_uri="<GCP_AUTH_URI"
        >>> token_uri="<GCP_TOKEN_URI>"
        >>> auth_provider_x509_cert_url="<GCP_AUTH_PROVIDER_X509_CERT_URL>"
        >>> client_x509_cert_url="<GCP_CLIENT_X509_CERT_URL>"
        >>> host_filters="<KEY>:<VALUE>,<KEY>:<VALUE>"

        >>> api.GcpIntegration.create(type=type, project_id=project_id,         private_key_id=private_key_id,private_key=private_key,         client_email=client_email, client_id=client_id,         auth_uri=auth_uri, token_uri=token_uri,         auth_provider_x509_cert_url=auth_provider_x509_cert_url,         client_x509_cert_url=client_x509_cert_url, host_filters=host_filters)
        r
   Nr   )r   r   creater   r   r   r   r   r   $   s   zGcpIntegration.createc                    s"   i }t t| jd| j|d|S )aH  
        Update an existing service account partially (one or multiple fields),         by supplying a new value for the field(s) to be updated.

        `project_id` and `client_email` are required, in order to identify the         right service account to update.         The unspecified fields will keep their original values.

        The only use case for updating this integration is to change         host filtering and automute settings. Otherwise, an entirely         new integration config is needed.

        >>> project_id="<GCP_PROJECT_ID>"
        >>> client_email="<GCP_CLIENT_EMAIL>"
        >>> host_filters="<NEW_HOST_FILTERS>"
        >>> automute=true #boolean

        >>> api.GcpIntegration.update(project_id=project_id,         client_email=client_email, host_filters=host_filters,         automute=automute)
        )r
   r   Nr   )r   r   updater   )r   r   r   r   r   r   r   E   s   zGcpIntegration.update)__name__
__module____qualname____doc___resource_namer   classmethodr   r   r   r   __classcell__r   r   r   r   r      s     r   N)datadog.api.resourcesr   r   r   r   r   r   r   r   r   <module>   s   