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é   )Úopa_type_mappingZMissingc                   @   sp   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S )ÚOpaInstanceClienta1  
    Process Automation helps you to rapidly design, automate, and manage business processes in the cloud. With the Process Automation design-time (Designer) and the runtime (Workspace) environments, you can easily create, develop, manage, test, and monitor process applications and their components.
    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	/20210621z0https://process.{region}.oci.{secondLevelDomain}Úskip_deserializationFÚcircuit_breaker_strategyÚ5client_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opa_instanceÚ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$   ú?usr/lib/python3.10/site-packages/oci/opa/opa_instance_client.pyÚ__init__   s>   3

ú

ø

zOpaInstanceClient.__init__c                    ór  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}|du rtj}|r¨t|tjƒs•| j |¡ | | j¡ |j| jj|||	|| 	d¡|||d	S | jj|||	|| 	d¡|||dS )aš  
        Cancel work request with the given ID.


        :param str work_request_id: (required)
            The ID of the asynchronous request.

        :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 str opc_request_id: (optional)
            The client request ID for tracing.

        :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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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/opa/cancel_work_request.py.html>`__ to see an example of how to use cancel_work_request API.
        ÚworkRequestIdú/workRequests/{workRequestId}ÚDELETEÚcancel_work_requestzPhttps://docs.oracle.com/iaas/api/#/en/opa/20210621/WorkRequest/CancelWorkRequest©r   r   Úif_matchÚopc_request_idc                    ó   g | ]}|ˆ vr|‘qS r$   r$   ©Ú.0Ú_key©Zexpected_kwargsr$   r%   Ú
<listcomp>¤   ó    z9OpaInstanceClient.cancel_work_request.<locals>.<listcomp>z,cancel_work_request got unknown kwargs: {!r}c                 S   ó   i | ]\}}|t ur||“qS r$   ©Úmissing©r1   ÚkÚvr$   r$   r%   Ú
<dictcomp>­   ó    z9OpaInstanceClient.cancel_work_request.<locals>.<dictcomp>Nr   ú7Parameter {} cannot be None, whitespace or empty stringúapplication/jsonr-   r.   ©Úacceptúcontent-typezif-matchúopc-request-idc                 S   ó&   i | ]\}}|t ur|d ur||“qS ©Nr7   r9   r$   r$   r%   r<   ¹   ó   & r   ©Zoperation_retry_strategyZclient_retry_strategyr   ©Úresource_pathÚmethodÚpath_paramsÚheader_paramsr   Úoperation_nameÚapi_reference_linkÚrequired_arguments©r   ÚiterkeysÚ
ValueErrorÚformatÚ	iteritemsÚ
isinstanceZstring_typesÚlenÚstripr   r8   r    Úget_preferred_retry_strategyr   r   ÚDEFAULT_RETRY_STRATEGYÚNoneRetryStrategyÚadd_opc_client_retries_headerÚadd_circuit_breaker_callbackr   Úmake_retrying_callÚcall_api©r!   Úwork_request_idr#   rO   rI   rJ   rM   rN   Úextra_kwargsrK   r:   r;   rL   r   r$   r3   r%   r+   r   ón   %ÿÿ$€

üþ÷øz%OpaInstanceClient.cancel_work_requestc                    óv  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}|du rtj}|r©t|tjƒs•| j |¡ | | j¡ |j| jj|||
||| 	d¡|||d
S | jj|||
||| 	d¡|||d	S )a¸  
        Moves a OpaInstance resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource.


        :param str opa_instance_id: (required)
            unique OpaInstance identifier

        :param oci.opa.models.ChangeOpaInstanceCompartmentDetails change_opa_instance_compartment_details: (required)
            The information to be updated.

        :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 str opc_request_id: (optional)
            The client request ID for tracing.

        :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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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/opa/change_opa_instance_compartment.py.html>`__ to see an example of how to use change_opa_instance_compartment API.
        ÚopaInstanceIdz7/opaInstances/{opaInstanceId}/actions/changeCompartmentÚPOSTÚchange_opa_instance_compartmentz[https://docs.oracle.com/iaas/api/#/en/opa/20210621/OpaInstance/ChangeOpaInstanceCompartmentr,   c                    r/   r$   r$   r0   r3   r$   r%   r4     r5   zEOpaInstanceClient.change_opa_instance_compartment.<locals>.<listcomp>z8change_opa_instance_compartment got unknown kwargs: {!r}c                 S   r6   r$   r7   r9   r$   r$   r%   r<     r=   zEOpaInstanceClient.change_opa_instance_compartment.<locals>.<dictcomp>Nr   r>   r?   r-   r.   r@   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   %  rF   r   rG   r   ©	rI   rJ   rK   rL   Úbodyr   rM   rN   rO   rP   )r!   Úopa_instance_idZ'change_opa_instance_compartment_detailsr#   rO   rI   rJ   rM   rN   ra   rK   r:   r;   rL   r   r$   r3   r%   rf   Û   ór   (ÿÿ$€

üþö÷z1OpaInstanceClient.change_opa_instance_compartmentc                    s  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}
|
du rOt
j}
|
r|t|
t
jƒsi| j |	¡ | j |	¡ |
 | j¡ |
j| jj|||	|| d¡|||d	S | jj|||	|| d¡|||dS )a  
        Creates a new OpaInstance.


        :param oci.opa.models.CreateOpaInstanceDetails create_opa_instance_details: (required)
            Details for the new OpaInstance.

        :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 str opc_request_id: (optional)
            The client request ID for tracing.

        :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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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/opa/create_opa_instance.py.html>`__ to see an example of how to use create_opa_instance API.
        ú/opaInstancesre   Úcreate_opa_instancezPhttps://docs.oracle.com/iaas/api/#/en/opa/20210621/OpaInstance/CreateOpaInstance)r   r   Úopc_retry_tokenr.   c                    r/   r$   r$   r0   r3   r$   r%   r4   {  r5   z9OpaInstanceClient.create_opa_instance.<locals>.<listcomp>z,create_opa_instance got unknown kwargs: {!r}r?   rm   r.   )rA   rB   zopc-retry-tokenrC   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   †  rF   z9OpaInstanceClient.create_opa_instance.<locals>.<dictcomp>r   rG   Nr   )rI   rJ   rL   rh   r   rM   rN   rO   )r   rQ   rR   rS   r   r8   rT   r    rX   r   r   rY   rU   rZ   Zadd_opc_retry_token_if_neededr[   r\   r   r]   r^   )r!   Zcreate_opa_instance_detailsr#   rO   rI   rJ   rM   rN   ra   rL   r   r$   r3   r%   rl   I  sb   %ÿ

üþ÷øz%OpaInstanceClient.create_opa_instancec                    r'   )aš  
        Deletes a OpaInstance resource by identifier


        :param str opa_instance_id: (required)
            unique OpaInstance identifier

        :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 str opc_request_id: (optional)
            The client request ID for tracing.

        :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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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/opa/delete_opa_instance.py.html>`__ to see an example of how to use delete_opa_instance API.
        rd   ú/opaInstances/{opaInstanceId}r*   Údelete_opa_instancezPhttps://docs.oracle.com/iaas/api/#/en/opa/20210621/OpaInstance/DeleteOpaInstancer,   c                    r/   r$   r$   r0   r3   r$   r%   r4   Û  r5   z9OpaInstanceClient.delete_opa_instance.<locals>.<listcomp>z,delete_opa_instance got unknown kwargs: {!r}c                 S   r6   r$   r7   r9   r$   r$   r%   r<   ä  r=   z9OpaInstanceClient.delete_opa_instance.<locals>.<dictcomp>Nr   r>   r?   r-   r.   r@   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   ð  rF   r   rG   r   rH   rP   ©r!   ri   r#   rO   rI   rJ   rM   rN   ra   rK   r:   r;   rL   r   r$   r3   r%   ro   ©  rb   z%OpaInstanceClient.delete_opa_instancec                    ó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œ}dd„ t  |¡D ƒ}| jj| 	d¡| jd}|du r|tj}|r¤t|tjƒs| j |¡ | | j¡ |j| jj|||	|d| 	d¡|||d
S | jj|||	|d| 	d¡|||d	S )a  
        Gets a OpaInstance by identifier


        :param str opa_instance_id: (required)
            unique OpaInstance identifier

        :param str opc_request_id: (optional)
            The client request ID for tracing.

        :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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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.opa.models.OpaInstance`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/opa/get_opa_instance.py.html>`__ to see an example of how to use get_opa_instance API.
        rd   rn   ÚGETÚget_opa_instancezMhttps://docs.oracle.com/iaas/api/#/en/opa/20210621/OpaInstance/GetOpaInstance©r   r   r.   c                    r/   r$   r$   r0   r3   r$   r%   r4   <  r5   z6OpaInstanceClient.get_opa_instance.<locals>.<listcomp>z)get_opa_instance got unknown kwargs: {!r}c                 S   r6   r$   r7   r9   r$   r$   r%   r<   E  r=   z6OpaInstanceClient.get_opa_instance.<locals>.<dictcomp>Nr   r>   r?   r.   ©rA   rB   rC   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   P  rF   r   rG   ZOpaInstancer   ©	rI   rJ   rK   rL   Úresponse_typer   rM   rN   rO   rP   rp   r$   r3   r%   rs     óp   ÿÿ$€
ýþö÷z"OpaInstanceClient.get_opa_instancec                    rq   )a3  
        Gets the status of the work request with the given ID.


        :param str work_request_id: (required)
            The ID of the asynchronous request.

        :param str opc_request_id: (optional)
            The client request ID for tracing.

        :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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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.opa.models.WorkRequest`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/opa/get_work_request.py.html>`__ to see an example of how to use get_work_request API.
        r(   r)   rr   Úget_work_requestzMhttps://docs.oracle.com/iaas/api/#/en/opa/20210621/WorkRequest/GetWorkRequestrt   c                    r/   r$   r$   r0   r3   r$   r%   r4   ž  r5   z6OpaInstanceClient.get_work_request.<locals>.<listcomp>z)get_work_request got unknown kwargs: {!r}c                 S   r6   r$   r7   r9   r$   r$   r%   r<   §  r=   z6OpaInstanceClient.get_work_request.<locals>.<dictcomp>Nr   r>   r?   r.   ru   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   ²  rF   r   rG   ZWorkRequestr   rv   rP   r_   r$   r3   r%   ry   t  rx   z"OpaInstanceClient.get_work_requestc                    sð  g }d}d}d}d}g d¢‰ ‡ fdd„t  |¡D ƒ}|r#td |¡ƒ‚d	|v r8g d
¢}|d	 |vr8td |¡ƒ‚d|v rMddg}	|d |	vrMtd |	¡ƒ‚d|v rbddg}
|d |
vrbtd |
¡ƒ‚| dt¡| d	t¡| dt¡| 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!}|d"u r¾t
j}|ræt|t
jƒsÒ| j |¡ | | j¡ |j| jj||||d#| d$¡|||d%
S | jj||||d#| d$¡|||d%	S )&a¿
  
        Returns a list of OpaInstances.


        :param str compartment_id: (optional)
            The ID of the compartment in which to list resources.

        :param str lifecycle_state: (optional)
            A filter to return only resources their lifecycleState matches the given lifecycleState.

            Allowed values are: "CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"

        :param str display_name: (optional)
            A filter to return only resources that match the entire display name given.

        :param str id: (optional)
            unique OpaInstance identifier

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

        :param str page: (optional)
            A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.

        :param str sort_order: (optional)
            The sort order to use, either 'ASC' or 'DESC'.

            Allowed values are: "ASC", "DESC"

        :param str sort_by: (optional)
            The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.

            Allowed values are: "timeCreated", "displayName"

        :param str opc_request_id: (optional)
            The client request ID for tracing.

        :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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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.opa.models.OpaInstanceCollection`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/opa/list_opa_instances.py.html>`__ to see an example of how to use list_opa_instances API.
        rk   rr   Úlist_opa_instanceszYhttps://docs.oracle.com/iaas/api/#/en/opa/20210621/OpaInstanceCollection/ListOpaInstances)r   r   Úcompartment_idÚlifecycle_stateÚdisplay_nameÚidÚlimitÚpageÚ
sort_orderÚsort_byr.   c                    r/   r$   r$   r0   r3   r$   r%   r4   #  r5   z8OpaInstanceClient.list_opa_instances.<locals>.<listcomp>z+list_opa_instances got unknown kwargs: {!r}r|   )ZCREATINGZUPDATINGZACTIVEZDELETINGZDELETEDÚFAILEDz7Invalid value for `lifecycle_state`, must be one of {0}r   ÚASCÚDESCú2Invalid value for `sort_order`, must be one of {0}r‚   ZtimeCreatedÚdisplayNameú/Invalid value for `sort_by`, must be one of {0}r{   r}   r~   r   r€   )ÚcompartmentIdZlifecycleStater‡   r~   r   r€   Ú	sortOrderÚsortByc                 S   rD   rE   r7   r9   r$   r$   r%   r<   G  rF   z8OpaInstanceClient.list_opa_instances.<locals>.<dictcomp>r?   r.   ru   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   N  rF   r   rG   NZOpaInstanceCollectionr   ©	rI   rJ   Úquery_paramsrL   rw   r   rM   rN   rO   ©r   rQ   rR   rS   r   r8   rT   r    rX   r   r   rY   rU   rZ   r[   r\   r   r]   r^   )r!   r#   rO   rI   rJ   rM   rN   ra   Zlifecycle_state_allowed_valuesÚsort_order_allowed_valuesÚsort_by_allowed_valuesr   rL   r   r$   r3   r%   rz   Ö  sš   9ÿÿÿÿ







ø

ýþö÷z$OpaInstanceClient.list_opa_instancesc                    ó  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|v ridg}|d |vritd |¡ƒ‚d|v r~ddg}|d |vr~t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}|du rÆtj}|rït|tjƒsÚ| j |¡ | | j¡ |j| jj|||	||d | 	d!¡|||d"S | jj|||	||d | 	d!¡|||d"
S )#aÚ  
        Return a (paginated) list of errors for a given work request.


        :param str work_request_id: (required)
            The ID of the asynchronous request.

        :param str opc_request_id: (optional)
            The client request ID for tracing.

        :param str page: (optional)
            A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.

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

        :param str sort_by: (optional)
            The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending.

            Allowed values are: "timeAccepted"

        :param str sort_order: (optional)
            The sort order to use, either '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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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.opa.models.WorkRequestErrorCollection`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/opa/list_work_request_errors.py.html>`__ to see an example of how to use list_work_request_errors API.
        r(   z$/workRequests/{workRequestId}/errorsrr   Úlist_work_request_errorszYhttps://docs.oracle.com/iaas/api/#/en/opa/20210621/WorkRequestError/ListWorkRequestErrors©r   r   r.   r€   r   r‚   r   c                    r/   r$   r$   r0   r3   r$   r%   r4   °  r5   z>OpaInstanceClient.list_work_request_errors.<locals>.<listcomp>z1list_work_request_errors got unknown kwargs: {!r}c                 S   r6   r$   r7   r9   r$   r$   r%   r<   ¹  r=   z>OpaInstanceClient.list_work_request_errors.<locals>.<dictcomp>Nr   r>   r‚   ÚtimeAcceptedrˆ   r   r„   r…   r†   r€   r   ©r€   r   r‹   rŠ   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   Ó  rF   r?   r.   ru   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   Ú  rF   r   rG   ZWorkRequestErrorCollectionr   ©
rI   rJ   rK   r   rL   rw   r   rM   rN   rO   rP   ©r!   r`   r#   rO   rI   rJ   rM   rN   ra   rK   r:   r;   r   r   r   rL   r   r$   r3   r%   r’   r  ó˜   .	ÿÿ$€ÿÿ



ü
ýþõöz*OpaInstanceClient.list_work_request_errorsc                    r‘   )#a×  
        Return a (paginated) list of logs for a given work request.


        :param str work_request_id: (required)
            The ID of the asynchronous request.

        :param str opc_request_id: (optional)
            The client request ID for tracing.

        :param str page: (optional)
            A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.

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

        :param str sort_by: (optional)
            The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending.

            Allowed values are: "timeAccepted"

        :param str sort_order: (optional)
            The sort order to use, either '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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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.opa.models.WorkRequestLogEntryCollection`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/opa/list_work_request_logs.py.html>`__ to see an example of how to use list_work_request_logs API.
        r(   z"/workRequests/{workRequestId}/logsrr   Úlist_work_request_logszZhttps://docs.oracle.com/iaas/api/#/en/opa/20210621/WorkRequestLogEntry/ListWorkRequestLogsr“   c                    r/   r$   r$   r0   r3   r$   r%   r4   >  r5   z<OpaInstanceClient.list_work_request_logs.<locals>.<listcomp>z/list_work_request_logs got unknown kwargs: {!r}c                 S   r6   r$   r7   r9   r$   r$   r%   r<   G  r=   z<OpaInstanceClient.list_work_request_logs.<locals>.<dictcomp>Nr   r>   r‚   r”   rˆ   r   r„   r…   r†   r€   r   r•   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   a  rF   r?   r.   ru   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   h  rF   r   rG   ZWorkRequestLogEntryCollectionr   r–   rP   r—   r$   r3   r%   r™      r˜   z(OpaInstanceClient.list_work_request_logsc                    sî  g }d}d}d}d}g d¢‰ ‡ fdd„t  |¡D ƒ}|r#td |¡ƒ‚d	|v r8g d
¢}|d	 |vr8td |¡ƒ‚d|v rMddg}	|d |	vrMtd |	¡ƒ‚d|v radg}
|d |
vratd |
¡ƒ‚| dt¡| dt¡| d	t¡| 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 }|d!u r½t
j}|råt|t
jƒsÑ| j |¡ | | j¡ |j| jj||||d"| d#¡|||d$
S | jj||||d"| d#¡|||d$	S )%a¢
  
        Lists the work requests in a compartment.


        :param str compartment_id: (optional)
            The ID of the compartment in which to list resources.

        :param str work_request_id: (optional)
            The ID of the asynchronous work request.

        :param str status: (optional)
            A filter to return only resources their lifecycleState matches the given OperationStatus.

            Allowed values are: "ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"

        :param str resource_id: (optional)
            The ID of the resource affected by the work request.

        :param str opc_request_id: (optional)
            The client request ID for tracing.

        :param str page: (optional)
            A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.

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

        :param str sort_order: (optional)
            The sort order to use, either 'ASC' or 'DESC'.

            Allowed values are: "ASC", "DESC"

        :param str sort_by: (optional)
            The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending.

            Allowed values are: "timeAccepted"

        :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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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.opa.models.WorkRequestSummaryCollection`
        :rtype: :class:`~oci.response.Response`

        :example:
        Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/latest/opa/list_work_requests.py.html>`__ to see an example of how to use list_work_requests API.
        z/workRequestsrr   Úlist_work_requestszOhttps://docs.oracle.com/iaas/api/#/en/opa/20210621/WorkRequest/ListWorkRequests)r   r   r{   r`   ÚstatusÚresource_idr.   r€   r   r   r‚   c                    r/   r$   r$   r0   r3   r$   r%   r4   Û  r5   z8OpaInstanceClient.list_work_requests.<locals>.<listcomp>z+list_work_requests got unknown kwargs: {!r}r›   )ZACCEPTEDZIN_PROGRESSZWAITINGrƒ   Z	SUCCEEDEDZ	CANCELINGZCANCELEDz.Invalid value for `status`, must be one of {0}r   r„   r…   r†   r‚   r”   rˆ   r{   r`   rœ   r€   r   )r‰   r(   r›   Z
resourceIdr€   r   rŠ   r‹   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   ÿ  rF   z8OpaInstanceClient.list_work_requests.<locals>.<dictcomp>r?   r.   ru   c                 S   rD   rE   r7   r9   r$   r$   r%   r<     rF   r   rG   NZWorkRequestSummaryCollectionr   rŒ   rŽ   )r!   r#   rO   rI   rJ   rM   rN   ra   Zstatus_allowed_valuesr   r   r   rL   r   r$   r3   r%   rš   Ž  sš   9ÿÿÿÿ







ø

ýþö÷z$OpaInstanceClient.list_work_requestsc                    rc   )a  
        Updates the OpaInstance


        :param str opa_instance_id: (required)
            unique OpaInstance identifier

        :param oci.opa.models.UpdateOpaInstanceDetails update_opa_instance_details: (required)
            The information to be updated.

        :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 str opc_request_id: (optional)
            The client request ID for tracing.

        :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 uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided.
            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/opa/update_opa_instance.py.html>`__ to see an example of how to use update_opa_instance API.
        rd   rn   ZPUTÚupdate_opa_instancezPhttps://docs.oracle.com/iaas/api/#/en/opa/20210621/OpaInstance/UpdateOpaInstancer,   c                    r/   r$   r$   r0   r3   r$   r%   r4   _  r5   z9OpaInstanceClient.update_opa_instance.<locals>.<listcomp>z,update_opa_instance got unknown kwargs: {!r}c                 S   r6   r$   r7   r9   r$   r$   r%   r<   h  r=   z9OpaInstanceClient.update_opa_instance.<locals>.<dictcomp>Nr   r>   r?   r-   r.   r@   c                 S   rD   rE   r7   r9   r$   r$   r%   r<   t  rF   r   rG   r   rg   rP   )r!   ri   Zupdate_opa_instance_detailsr#   rO   rI   rJ   rM   rN   ra   rK   r:   r;   rL   r   r$   r3   r%   r   *  rj   z%OpaInstanceClient.update_opa_instanceN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r&   r+   rf   rl   ro   rs   ry   rz   r’   r™   rš   r   r$   r$   r$   r%   r      s$    Xin`ibb    r   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   r8   Úobjectr   r$   r$   r$   r%   Ú<module>   s   