o
    ɶd                    @   s   d dl mZ d dlmZ d dlmZ d dlmZmZ d dlm	Z	 d dl
mZmZ d dlmZ d dlmZmZmZ d	d
lmZ edZG dd deZdS )    )absolute_import)requests)six)retrycircuit_breaker)
BaseClient)get_config_value_or_defaultvalidate_config)Signer)Sentinel#get_signer_from_authentication_typeAUTHENTICATION_TYPE_FIELD_NAME   )usage_api_type_mappingZMissingc                   @   s   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% Zd&d' Zd(d) Zd*S )+UsageapiClienta  
    Use the Usage API to view your Oracle Cloud usage and costs. The API allows you to request data that meets the specified filter criteria, and to group that data by the dimension of your choosing. The Usage API is used by the Cost Analysis tool in the Console. Also see [Using the Usage API](/Content/Billing/Concepts/costanalysisoverview.htm#cost_analysis_using_the_api) for more information.
    c              
   K   s  t ||dd d|v r|d }n"t|v rt|}nt|d |d |d |dt|d|dd	}d
|dddi |dd|dtj|dd}d|v rY|d|d< |ddu retj|d< d|v rp|d|d< t	d||t
fi || _|d| _|d| _dS )a  
        Creates a new service client

        :param dict config:
            Configuration keys and values as per `SDK and Tool Configuration <https://docs.cloud.oracle.com/Content/API/Concepts/sdkconfig.htm>`__.
            The :py:meth:`~oci.config.from_file` method can be used to load configuration from a file. Alternatively, a ``dict`` can be passed. You can validate_config
            the dict using :py:meth:`~oci.config.validate_config`

        :param str service_endpoint: (optional)
            The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is
            not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit
            need to specify a service endpoint.

        :param timeout: (optional)
            The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided
            as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If
            a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout.
        :type timeout: float or tuple(float, float)

        :param signer: (optional)
            The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.Signer` based on the values
            provided in the config parameter.

            One use case for this parameter is for `Instance Principals authentication <https://docs.cloud.oracle.com/Content/Identity/Tasks/callingservicesfrominstances.htm>`__
            by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument
        :type signer: :py:class:`~oci.signer.AbstractBaseSigner`

        :param obj retry_strategy: (optional)
            A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default.
            Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation.
            Any value provided at the operation level will override whatever is specified at the client level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY`
            is also available. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

        :param obj circuit_breaker_strategy: (optional)
            A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level).
            This client uses :py:data:`~oci.circuit_breaker.DEFAULT_CIRCUIT_BREAKER_STRATEGY` as default if no circuit breaker strategy is provided.
            The specifics of circuit breaker strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/circuit_breakers.html>`__.

        :param function circuit_breaker_callback: (optional)
            Callback function to receive any exceptions triggerred by the circuit breaker.

        :param bool client_level_realm_specific_endpoint_template_enabled: (optional)
            A boolean flag to indicate whether or not this client should be created with realm specific endpoint template enabled or disable. By default, this will be set as None.

        :param allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this client should allow control characters in the response object. By default, the client will not
            allow control characters to be in the response object.
        signer)r   tenancyuserfingerprintZkey_filepass_phraseZkey_content)r   r   r   Zprivate_key_file_locationr   Zprivate_key_contentTservice_endpointz	/20200107z1https://usageapi.{region}.oci.{secondLevelDomain}skip_deserializationFcircuit_breaker_strategy5client_level_realm_specific_endpoint_template_enabled)Zregional_clientr   	base_pathZservice_endpoint_templateZ#service_endpoint_template_per_realmr   r   r   timeoutNallow_control_charsZusageapiretry_strategycircuit_breaker_callback)r	   getr   r   r
   r   r   ZGLOBAL_CIRCUIT_BREAKER_STRATEGYZ DEFAULT_CIRCUIT_BREAKER_STRATEGYr   r   base_clientr   r   )selfconfigkwargsr   Zbase_client_init_kwargs r$   Ausr/lib/python3.10/site-packages/oci/usage_api/usageapi_client.py__init__   s>   3





zUsageapiClient.__init__c                      g }d}d}d}d}g d  fddt |D }|r#td|d	d	|d
t|dtd}	dd t |	D }	| jj|d| j	d}
|
rvt
|
tjsb| j|	 | j|	 |
| j |
j| jj|||	|d|d|||d
S | jj|||	|d|d|||d	S )a  
        Returns the created custom table.


        :param oci.usage_api.models.CreateCustomTableDetails create_custom_table_details: (required)
            New custom table details.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str opc_retry_token: (optional)
            A token that uniquely identifies a request so it can be retried in case of a timeout or
            server error, without risk of executing that same action again. Retry tokens expire after 24
            hours, but can be invalidated before then due to conflicting operations. For example, if a resource
            has been deleted and purged from the system, then a retry of the original creation request
            might be rejected.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.CustomTable`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/create_custom_table.py.html>`__ to see an example of how to use create_custom_table API.
        /customTablesPOSTcreate_custom_tablezRhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/CustomTable/CreateCustomTabler   r   opc_request_idopc_retry_tokenc                       g | ]}| vr|qS r$   r$   .0_keyZexpected_kwargsr$   r%   
<listcomp>       z6UsageapiClient.create_custom_table.<locals>.<listcomp>z,create_custom_table got unknown kwargs: {!r}application/jsonr,   r-   acceptcontent-typeopc-request-idzopc-retry-tokenc                 S   &   i | ]\}}|t ur|d ur||qS Nmissingr0   kvr$   r$   r%   
<dictcomp>      & z6UsageapiClient.create_custom_table.<locals>.<dictcomp>r   Zoperation_retry_strategyZclient_retry_strategyCustomTabler   	resource_pathmethodheader_paramsbodyresponse_typer   operation_nameapi_reference_linkrequired_argumentsr   iterkeys
ValueErrorformatr   r=   	iteritemsr    get_preferred_retry_strategyr   
isinstancer   NoneRetryStrategyZadd_opc_retry_token_if_neededadd_opc_client_retries_headeradd_circuit_breaker_callbackr   make_retrying_callcall_api)r!   Zcreate_custom_table_detailsr#   rM   rF   rG   rK   rL   extra_kwargsrH   r   r$   r2   r%   r*   r   b   &

z"UsageapiClient.create_custom_tablec                    r'   )a  
        Returns the created query.


        :param oci.usage_api.models.CreateQueryDetails create_query_details: (required)
            New query details. Up to ten saved queries.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str opc_retry_token: (optional)
            A token that uniquely identifies a request so it can be retried in case of a timeout or
            server error, without risk of executing that same action again. Retry tokens expire after 24
            hours, but can be invalidated before then due to conflicting operations. For example, if a resource
            has been deleted and purged from the system, then a retry of the original creation request
            might be rejected.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.Query`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/create_query.py.html>`__ to see an example of how to use create_query API.
        /queriesr)   create_queryzFhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Query/CreateQueryr+   c                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z/UsageapiClient.create_query.<locals>.<listcomp>z%create_query got unknown kwargs: {!r}r5   r,   r-   r6   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   z/UsageapiClient.create_query.<locals>.<dictcomp>r   rC   Queryr   rE   rN   )r!   Zcreate_query_detailsr#   rM   rF   rG   rK   rL   rZ   rH   r   r$   r2   r%   r]      r[   zUsageapiClient.create_queryc                    r'   )a  
        Returns the created schedule.


        :param oci.usage_api.models.CreateScheduleDetails create_schedule_details: (required)
            New schedule details.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str opc_retry_token: (optional)
            A token that uniquely identifies a request so it can be retried in case of a timeout or
            server error, without risk of executing that same action again. Retry tokens expire after 24
            hours, but can be invalidated before then due to conflicting operations. For example, if a resource
            has been deleted and purged from the system, then a retry of the original creation request
            might be rejected.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.Schedule`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/create_schedule.py.html>`__ to see an example of how to use create_schedule API.
        
/schedulesr)   create_schedulezLhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Schedule/CreateScheduler+   c                    r.   r$   r$   r/   r2   r$   r%   r3   g  r4   z2UsageapiClient.create_schedule.<locals>.<listcomp>z(create_schedule got unknown kwargs: {!r}r5   r,   r-   r6   c                 S   r:   r;   r<   r>   r$   r$   r%   rA   r  rB   z2UsageapiClient.create_schedule.<locals>.<dictcomp>r   rC   Scheduler   rE   rN   )r!   Zcreate_schedule_detailsr#   rM   rF   rG   rK   rL   rZ   rH   r   r$   r2   r%   r`   4  r[   zUsageapiClient.create_schedulec                    d  dg}d}d}d}d}g d  fddt |D }|r$td	|d|i}	d
d t |	D }	t |	D ]\}
}|du sMt|t jrTt| dkrTtd|
q7dd|	dt
|	dt
d}dd t |D }| jj|	d| jd}|rt|tjs| j| || j |j| jj|||	||	d|||d	S | jj|||	||	d|||dS )aJ  
        Delete a saved custom table by the OCID.


        :param str custom_table_id: (required)
            The custom table unique OCID.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str if_match: (optional)
            For optimistic concurrency control. In the PUT or DELETE call
            for a resource, set the `if-match` parameter to the value of the
            etag from a previous GET or POST response for that resource.
            The resource will be updated or deleted, only if the etag you
            provide matches the resource's current etag value.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type None
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/delete_custom_table.py.html>`__ to see an example of how to use delete_custom_table API.
        customTableId/customTables/{customTableId}DELETEdelete_custom_tablezRhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/CustomTable/DeleteCustomTabler   r   r,   if_matchc                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z6UsageapiClient.delete_custom_table.<locals>.<listcomp>z,delete_custom_table got unknown kwargs: {!r}c                 S      i | ]\}}|t ur||qS r$   r<   r>   r$   r$   r%   rA         z6UsageapiClient.delete_custom_table.<locals>.<dictcomp>Nr   7Parameter {} cannot be None, whitespace or empty stringr5   r,   rh   r7   r8   r9   zif-matchc                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   r   rC   r   rF   rG   path_paramsrH   r   rK   rL   rM   r   rO   rP   rQ   rR   rT   Zstring_typeslenstripr   r=   r    rS   r   r   rU   rV   rW   r   rX   rY   r!   custom_table_idr#   rM   rF   rG   rK   rL   rZ   rn   r?   r@   rH   r   r$   r2   r%   rf     j   &$

z"UsageapiClient.delete_custom_tablec                    rb   )a'  
        Delete a saved query by the OCID.


        :param str query_id: (required)
            The query unique OCID.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str if_match: (optional)
            For optimistic concurrency control. In the PUT or DELETE call
            for a resource, set the `if-match` parameter to the value of the
            etag from a previous GET or POST response for that resource.
            The resource will be updated or deleted, only if the etag you
            provide matches the resource's current etag value.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type None
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/delete_query.py.html>`__ to see an example of how to use delete_query API.
        queryId/queries/{queryId}re   delete_queryzFhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Query/DeleteQueryrg   c                    r.   r$   r$   r/   r2   r$   r%   r3   0  r4   z/UsageapiClient.delete_query.<locals>.<listcomp>z%delete_query got unknown kwargs: {!r}c                 S   ri   r$   r<   r>   r$   r$   r%   rA   9  rj   z/UsageapiClient.delete_query.<locals>.<dictcomp>Nr   rk   r5   r,   rh   rl   c                 S   r:   r;   r<   r>   r$   r$   r%   rA   E  rB   r   rC   r   rm   ro   r!   query_idr#   rM   rF   rG   rK   rL   rZ   rn   r?   r@   rH   r   r$   r2   r%   rw     rt   zUsageapiClient.delete_queryc                    rb   )a>  
        Delete a saved scheduled report by the OCID.


        :param str schedule_id: (required)
            The schedule unique OCID.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str if_match: (optional)
            For optimistic concurrency control. In the PUT or DELETE call
            for a resource, set the `if-match` parameter to the value of the
            etag from a previous GET or POST response for that resource.
            The resource will be updated or deleted, only if the etag you
            provide matches the resource's current etag value.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type None
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/delete_schedule.py.html>`__ to see an example of how to use delete_schedule API.
        
scheduleId/schedules/{scheduleId}re   delete_schedulezLhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Schedule/DeleteSchedulerg   c                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z2UsageapiClient.delete_schedule.<locals>.<listcomp>z(delete_schedule got unknown kwargs: {!r}c                 S   ri   r$   r<   r>   r$   r$   r%   rA     rj   z2UsageapiClient.delete_schedule.<locals>.<dictcomp>Nr   rk   r5   r,   rh   rl   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   r   rC   r   rm   ro   r!   schedule_idr#   rM   rF   rG   rK   rL   rZ   rn   r?   r@   rH   r   r$   r2   r%   r|   e  rt   zUsageapiClient.delete_schedulec                    ^  dg}d}d}d}d}g d  fddt |D }|r$td	|d|i}	d
d t |	D }	t |	D ]\}
}|du sMt|t jrTt| dkrTtd|
q7dd|	dt
d}dd t |D }| jj|	d| jd}|rt|tjs| j| || j |j| jj|||	|d|	d|||d
S | jj|||	|d|	d|||d	S )a  
        Returns the saved custom table.


        :param str custom_table_id: (required)
            The custom table unique OCID.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.CustomTable`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/get_custom_table.py.html>`__ to see an example of how to use get_custom_table API.
        rc   rd   GETget_custom_tablezOhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/CustomTable/GetCustomTabler   r   r,   c                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z3UsageapiClient.get_custom_table.<locals>.<listcomp>z)get_custom_table got unknown kwargs: {!r}c                 S   ri   r$   r<   r>   r$   r$   r%   rA     rj   z3UsageapiClient.get_custom_table.<locals>.<dictcomp>Nr   rk   r5   r,   r7   r8   r9   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   r   rC   rD   r   	rF   rG   rn   rH   rJ   r   rK   rL   rM   ro   rr   r$   r2   r%   r     l   $
zUsageapiClient.get_custom_tablec                    r   )a  
        Returns the saved query.


        :param str query_id: (required)
            The query unique OCID.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.Query`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/get_query.py.html>`__ to see an example of how to use get_query API.
        ru   rv   r   	get_queryzChttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Query/GetQueryr   c                    r.   r$   r$   r/   r2   r$   r%   r3   Y  r4   z,UsageapiClient.get_query.<locals>.<listcomp>z"get_query got unknown kwargs: {!r}c                 S   ri   r$   r<   r>   r$   r$   r%   rA   b  rj   z,UsageapiClient.get_query.<locals>.<dictcomp>Nr   rk   r5   r,   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA   m  rB   r   rC   r^   r   r   ro   rx   r$   r2   r%   r   .  r   zUsageapiClient.get_queryc                    r   )a  
        Returns the saved schedule.


        :param str schedule_id: (required)
            The schedule unique OCID.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.Schedule`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/get_schedule.py.html>`__ to see an example of how to use get_schedule API.
        rz   r{   r   get_schedulezIhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Schedule/GetScheduler   c                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z/UsageapiClient.get_schedule.<locals>.<listcomp>z%get_schedule got unknown kwargs: {!r}c                 S   ri   r$   r<   r>   r$   r$   r%   rA     rj   z/UsageapiClient.get_schedule.<locals>.<dictcomp>Nr   rk   r5   r,   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   r   rC   ra   r   r   ro   r}   r$   r2   r%   r     r   zUsageapiClient.get_schedulec                    r   )a  
        Returns the saved schedule run.


        :param str scheduled_run_id: (required)
            The scheduledRun unique OCID.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.ScheduledRun`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/get_scheduled_run.py.html>`__ to see an example of how to use get_scheduled_run API.
        ZscheduledRunIdz/scheduledRuns/{scheduledRunId}r   get_scheduled_runzQhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/ScheduledRun/GetScheduledRunr   c                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z4UsageapiClient.get_scheduled_run.<locals>.<listcomp>z*get_scheduled_run got unknown kwargs: {!r}c                 S   ri   r$   r<   r>   r$   r$   r%   rA   $  rj   z4UsageapiClient.get_scheduled_run.<locals>.<dictcomp>Nr   rk   r5   r,   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA   /  rB   r   rC   ZScheduledRunr   r   ro   )r!   Zscheduled_run_idr#   rM   rF   rG   rK   rL   rZ   rn   r?   r@   rH   r   r$   r2   r%   r     r   z UsageapiClient.get_scheduled_runc                    s  ddg}d}d}d}d}g d  fdd	t |D }	|	r%td
|	d|v r9dg}
|d |
vr9td|
d|v rNddg}|d |vrNtd||dt|dt|||dt|dtd}dd t |D }dd|dtd}dd t |D }| jj|d| j	d}|rt
|tjs| j| || j |j| jj||||d|d|||d
S | jj||||d|d|||d	S ) a	  
        Returns the saved custom table list.


        :param str compartment_id: (required)
            The compartment ID in which to list resources.

        :param str saved_report_id: (required)
            The saved report ID in which to list resources.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param int limit: (optional)
            The maximumimum number of items to return.

        :param str page: (optional)
            The page token representing the page at which to start retrieving results.
            This is usually retrieved from a previous list call.

        :param str sort_by: (optional)
            The field to sort by. If not specified, the default is displayName.

            Allowed values are: "displayName"

        :param str sort_order: (optional)
            The sort order to use, whether 'asc' or 'desc'.

            Allowed values are: "ASC", "DESC"

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.CustomTableCollection`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/list_custom_tables.py.html>`__ to see an example of how to use list_custom_tables API.
        compartmentIdsavedReportIdr(   r   list_custom_tableszQhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/CustomTable/ListCustomTablesr   r   r,   limitpagesort_by
sort_orderc                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z5UsageapiClient.list_custom_tables.<locals>.<listcomp>z+list_custom_tables got unknown kwargs: {!r}r   displayName/Invalid value for `sort_by`, must be one of {0}r   ASCDESC2Invalid value for `sort_order`, must be one of {0}r   r   )r   r   r   r   sortBy	sortOrderc                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   z5UsageapiClient.list_custom_tables.<locals>.<dictcomp>r5   r,   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   r   rC   ZCustomTableCollectionr   	rF   rG   query_paramsrH   rJ   r   rK   rL   rM   r   rO   rP   rQ   r   r=   rR   r    rS   r   rT   r   rU   rV   rW   r   rX   rY   )r!   compartment_idZsaved_report_idr#   rM   rF   rG   rK   rL   rZ   sort_by_allowed_valuessort_order_allowed_valuesr   rH   r   r$   r2   r%   r   Q  s   3	




z!UsageapiClient.list_custom_tablesc                      dg}d}d}d}d}g d  fddt |D }|r$td	|d
|v r8dg}	|d
 |	vr8td|	d|v rMddg}
|d |
vrMtd|
|dt|dt||d
t|dtd}dd t |D }dd|dtd}dd t |D }| jj|d| j	d}|rt
|tjs| j| || j |j| jj||||d|d|||d
S | jj||||d|d|||d	S )a0	  
        Returns the saved query list.


        :param str compartment_id: (required)
            The compartment ID in which to list resources.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param int limit: (optional)
            The maximumimum number of items to return.

        :param str page: (optional)
            The page token representing the page at which to start retrieving results.
            This is usually retrieved from a previous list call.

        :param str sort_by: (optional)
            The field to sort by. If not specified, the default is displayName.

            Allowed values are: "displayName"

        :param str sort_order: (optional)
            The sort order to use, whether 'asc' or 'desc'.

            Allowed values are: "ASC", "DESC"

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.QueryCollection`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/list_queries.py.html>`__ to see an example of how to use list_queries API.
        r   r\   r   list_querieszFhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Query/ListQueriesr   c                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z/UsageapiClient.list_queries.<locals>.<listcomp>z%list_queries got unknown kwargs: {!r}r   r   r   r   r   r   r   r   r   )r   r   r   r   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA   2  rB   z/UsageapiClient.list_queries.<locals>.<dictcomp>r5   r,   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA   9  rB   r   rC   ZQueryCollectionr   r   r   r!   r   r#   rM   rF   rG   rK   rL   rZ   r   r   r   rH   r   r$   r2   r%   r        0	




zUsageapiClient.list_queriesc                    r   )a1	  
        Returns schedule history list.


        :param str schedule_id: (required)
            The unique ID of a schedule.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str page: (optional)
            The page token representing the page at which to start retrieving results.
            This is usually retrieved from a previous list call.

        :param int limit: (optional)
            The maximumimum number of items to return.

        :param str sort_by: (optional)
            The field to sort by. If not specified, the default is timeCreated.

            Allowed values are: "timeCreated"

        :param str sort_order: (optional)
            The sort order to use, whether 'asc' or 'desc'.

            Allowed values are: "ASC", "DESC"

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.ScheduledRunCollection`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/list_scheduled_runs.py.html>`__ to see an example of how to use list_scheduled_runs API.
        rz   z/scheduledRunsr   list_scheduled_runszShttps://docs.oracle.com/iaas/api/#/en/usage/20200107/ScheduledRun/ListScheduledRuns)r   r   r,   r   r   r   r   c                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z6UsageapiClient.list_scheduled_runs.<locals>.<listcomp>z,list_scheduled_runs got unknown kwargs: {!r}r   timeCreatedr   r   r   r   r   r   r   )r   r   rz   r   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   z6UsageapiClient.list_scheduled_runs.<locals>.<dictcomp>r5   r,   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   r   rC   ZScheduledRunCollectionr   r   r   )r!   r~   r#   rM   rF   rG   rK   rL   rZ   r   r   r   rH   r   r$   r2   r%   r   [  r   z"UsageapiClient.list_scheduled_runsc                    s  dg}d}d}d}d}g d  fddt |D }|r$td	|d
|v r9ddg}	|d
 |	vr9td|	d|v rNddg}
|d |
vrNtd|
||dt|dt|d
t|dt|dtd}dd t |D }dd|dtd}dd t |D }| jj|d| j	d}|rt
|tjs| j| || j |j| jj||||d|d|||d
S | jj||||d|d|||d	S ) a	  
        Returns the saved schedule list.


        :param str compartment_id: (required)
            The compartment ID in which to list resources.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str page: (optional)
            The page token representing the page at which to start retrieving results.
            This is usually retrieved from a previous list call.

        :param int limit: (optional)
            The maximumimum number of items to return.

        :param str sort_by: (optional)
            The field to sort by. If not specified, the default is timeCreated.

            Allowed values are: "name", "timeCreated"

        :param str sort_order: (optional)
            The sort order to use, whether 'asc' or 'desc'.

            Allowed values are: "ASC", "DESC"

        :param str name: (optional)
            Query parameter for filtering by name

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.ScheduleCollection`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/list_schedules.py.html>`__ to see an example of how to use list_schedules API.
        r   r_   r   list_scheduleszKhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Schedule/ListSchedules)r   r   r,   r   r   r   r   namec                    r.   r$   r$   r/   r2   r$   r%   r3   "  r4   z1UsageapiClient.list_schedules.<locals>.<listcomp>z'list_schedules got unknown kwargs: {!r}r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA   =  rB   z1UsageapiClient.list_schedules.<locals>.<dictcomp>r5   r,   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA   D  rB   r   rC   ZScheduleCollectionr   r   r   r   r$   r2   r%   r     s   3






zUsageapiClient.list_schedulesc                    s  dg}d}d}d}d}g d  fddt |D }|r$td	|d|i}	d
d t |	D }	dd|dtd}
dd t |
D }
| jj|d| j	d}|rzt
|tjsf| j|
 || j |j| jj|||	|
d|d|||d
S | jj|||	|
d|d|||d	S )a  
        Returns the configurations list for the UI drop-down list.


        :param str tenant_id: (required)
            tenant id

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.ConfigurationAggregation`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/request_summarized_configurations.py.html>`__ to see an example of how to use request_summarized_configurations API.
        ZtenantIdz/configurationr   !request_summarized_configurationszbhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Configuration/RequestSummarizedConfigurationsr   c                    r.   r$   r$   r/   r2   r$   r%   r3     r4   zDUsageapiClient.request_summarized_configurations.<locals>.<listcomp>z:request_summarized_configurations got unknown kwargs: {!r}c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   zDUsageapiClient.request_summarized_configurations.<locals>.<dictcomp>r5   r,   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   r   rC   ZConfigurationAggregationr   r   )r   rO   rP   rQ   rR   r   r=   r    rS   r   rT   r   rU   rV   rW   r   rX   rY   )r!   Z	tenant_idr#   rM   rF   rG   rK   rL   rZ   r   rH   r   r$   r2   r%   r   f  sd   
z0UsageapiClient.request_summarized_configurationsc                    s,  g }d}d}d}d}g d  fddt |D }|r#td||d	t|d
td}	dd t |	D }	dd|dtd}
dd t |
D }
| jj|d| j	d}|rt
|tjsn| j|
 || j |j| jj|||	|
|d|d|||dS | jj|||	|
|d|d|||d
S )aU  
        Returns usage for the given account.


        :param oci.usage_api.models.RequestSummarizedUsagesDetails request_summarized_usages_details: (required)
            getUsageRequest contains query inforamtion.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str page: (optional)
            The page token representing the page at which to start retrieving results.
            This is usually retrieved from a previous list call.

        :param int limit: (optional)
            The maximumimum number of items to return.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.UsageAggregation`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/request_summarized_usages.py.html>`__ to see an example of how to use request_summarized_usages API.
        z/usager)   request_summarized_usageszYhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/UsageSummary/RequestSummarizedUsages)r   r   r,   r   r   c                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z<UsageapiClient.request_summarized_usages.<locals>.<listcomp>z2request_summarized_usages got unknown kwargs: {!r}r   r   )r   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   z<UsageapiClient.request_summarized_usages.<locals>.<dictcomp>r5   r,   r   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   r   rC   ZUsageAggregationr   )
rF   rG   r   rH   rI   rJ   r   rK   rL   rM   r   )r!   Z!request_summarized_usages_detailsr#   rM   rF   rG   rK   rL   rZ   r   rH   r   r$   r2   r%   r     sj   &


z(UsageapiClient.request_summarized_usagesc                    l  dg}d}d}d}d}g d  fddt |D }	|	r$td	|	d|i}
d
d t |
D }
t |
D ]\}}|du sMt|t jrTt| dkrTtd|q7dd|	dt
|	dt
d}dd t |D }| jj|	d| jd}|rt|tjs| j| || j |j| jj|||
||d|	d|||dS | jj|||
||d|	d|||d
S )a	  
        Update a saved custom table by table id.


        :param oci.usage_api.models.UpdateCustomTableDetails update_custom_table_details: (required)
            The information to be updated.

        :param str custom_table_id: (required)
            The custom table unique OCID.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str if_match: (optional)
            For optimistic concurrency control. In the PUT or DELETE call
            for a resource, set the `if-match` parameter to the value of the
            etag from a previous GET or POST response for that resource.
            The resource will be updated or deleted, only if the etag you
            provide matches the resource's current etag value.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.CustomTable`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/update_custom_table.py.html>`__ to see an example of how to use update_custom_table API.
        rc   rd   PUTupdate_custom_tablezRhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/CustomTable/UpdateCustomTablerg   c                    r.   r$   r$   r/   r2   r$   r%   r3   `  r4   z6UsageapiClient.update_custom_table.<locals>.<listcomp>z,update_custom_table got unknown kwargs: {!r}c                 S   ri   r$   r<   r>   r$   r$   r%   rA   i  rj   z6UsageapiClient.update_custom_table.<locals>.<dictcomp>Nr   rk   r5   r,   rh   rl   c                 S   r:   r;   r<   r>   r$   r$   r%   rA   u  rB   r   rC   rD   r   
rF   rG   rn   rH   rI   rJ   r   rK   rL   rM   ro   )r!   Zupdate_custom_table_detailsrs   r#   rM   rF   rG   rK   rL   rZ   rn   r?   r@   rH   r   r$   r2   r%   r   *  r   )$

z"UsageapiClient.update_custom_tablec                    r   )a  
        Update a saved query by the OCID.


        :param oci.usage_api.models.UpdateQueryDetails update_query_details: (required)
            The information to be updated.

        :param str query_id: (required)
            The query unique OCID.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str if_match: (optional)
            For optimistic concurrency control. In the PUT or DELETE call
            for a resource, set the `if-match` parameter to the value of the
            etag from a previous GET or POST response for that resource.
            The resource will be updated or deleted, only if the etag you
            provide matches the resource's current etag value.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.Query`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/update_query.py.html>`__ to see an example of how to use update_query API.
        ru   rv   r   update_queryzFhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Query/UpdateQueryrg   c                    r.   r$   r$   r/   r2   r$   r%   r3     r4   z/UsageapiClient.update_query.<locals>.<listcomp>z%update_query got unknown kwargs: {!r}c                 S   ri   r$   r<   r>   r$   r$   r%   rA     rj   z/UsageapiClient.update_query.<locals>.<dictcomp>Nr   rk   r5   r,   rh   rl   c                 S   r:   r;   r<   r>   r$   r$   r%   rA     rB   r   rC   r^   r   r   ro   )r!   Zupdate_query_detailsry   r#   rM   rF   rG   rK   rL   rZ   rn   r?   r@   rH   r   r$   r2   r%   r     r   zUsageapiClient.update_queryc                    r   )a  
        Update a saved schedule


        :param oci.usage_api.models.UpdateScheduleDetails update_schedule_details: (required)
            The information to be updated. Currently supports only tags

        :param str schedule_id: (required)
            The schedule unique OCID.

        :param str opc_request_id: (optional)
            Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
            particular request, please provide the request ID.

        :param str if_match: (optional)
            For optimistic concurrency control. In the PUT or DELETE call
            for a resource, set the `if-match` parameter to the value of the
            etag from a previous GET or POST response for that resource.
            The resource will be updated or deleted, only if the etag you
            provide matches the resource's current etag value.

        :param obj retry_strategy: (optional)
            A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

            This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it.
            The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.

            To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.

        :param bool allow_control_chars: (optional)
            allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object.
            By default, the response will not allow control characters in strings

        :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.usage_api.models.Schedule`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/usageapi/update_schedule.py.html>`__ to see an example of how to use update_schedule API.
        rz   r{   r   update_schedulezLhttps://docs.oracle.com/iaas/api/#/en/usage/20200107/Schedule/UpdateSchedulerg   c                    r.   r$   r$   r/   r2   r$   r%   r3   >  r4   z2UsageapiClient.update_schedule.<locals>.<listcomp>z(update_schedule got unknown kwargs: {!r}c                 S   ri   r$   r<   r>   r$   r$   r%   rA   G  rj   z2UsageapiClient.update_schedule.<locals>.<dictcomp>Nr   rk   r5   r,   rh   rl   c                 S   r:   r;   r<   r>   r$   r$   r%   rA   S  rB   r   rC   ra   r   r   ro   )r!   Zupdate_schedule_detailsr~   r#   rM   rF   rG   rK   rL   rZ   rn   r?   r@   rH   r   r$   r2   r%   r     r   zUsageapiClient.update_scheduleN)__name__
__module____qualname____doc__r&   r*   r]   r`   rf   rw   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r$   r$   r$   r%   r      s4    Xaaahhhaaaa    	\hoor   N)
__future__r   Zoci._vendorr   r   ocir   r   Zoci.base_clientr   Z
oci.configr   r	   Z
oci.signerr
   Zoci.utilr   r   r   Zmodelsr   r=   objectr   r$   r$   r$   r%   <module>   s   