a Of@s(ddlZddlmZGdddeZdS)N)WAIT_RESOURCE_NOT_FOUNDc@sHeZdZdZddZgiifddZgiifddZgiifdd Zd S) #OdapackageClientCompositeOperationsa This class provides a wrapper around :py:class:`~oci.oda.OdapackageClient` and offers convenience methods for operations that would otherwise need to be chained together. For example, instead of performing an action on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource to enter a given state, you can call a single method in this class to accomplish the same functionality cKs ||_dS)z Creates a new OdapackageClientCompositeOperations object :param OdapackageClient client: The service client which will be wrapped by this object N)client)selfrkwargsr/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/oci/oda/odapackage_client_composite_operations.py__init__sz,OdapackageClientCompositeOperations.__init__c s|jj||fi|}|s|Sdd|D|jd}z4tj|j|j|fdfddi|}|} | WSty} ztjj|g| dWYd} ~ n d} ~ 00dS) af Calls :py:func:`~oci.oda.OdapackageClient.create_imported_package` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param oci.oda.models.CreateImportedPackageDetails create_imported_package_details: (required) Parameter values required to import the package. :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdapackageClient.create_imported_package` :param dict waiter_kwargs: A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait cSsg|] }|qSrlower.0wrrr 3zbOdapackageClientCompositeOperations.create_imported_package_and_wait_for_state..opc-work-request-idevaluate_responsecs t|jdot|jdvSNstatusgetattrdatar rlowered_wait_for_statesrr:rz`OdapackageClientCompositeOperations.create_imported_package_and_wait_for_state..partial_resultscauseN) rcreate_imported_packageheadersoci wait_untilget_work_request Exception exceptionsCompositeOperationError) rcreate_imported_package_detailsoda_instance_idwait_for_statesoperation_kwargs waiter_kwargsoperation_resultwait_for_resource_id waiter_resultresult_to_returnerrr*create_imported_package_and_wait_for_states$   zNOdapackageClientCompositeOperations.create_imported_package_and_wait_for_statec sd}z|jj||fi|}WnFtjjyd}z*|jdkrLtWYd}~S|WYd}~n d}~00|sn|Sdd|D|jd}z4tj|j|j |fdfddi|} | } | WSt y}ztjj |g|d WYd}~n d}~00dS) a% Calls :py:func:`~oci.oda.OdapackageClient.delete_imported_package` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param str package_id: (required) Unique Digital Assistant package identifier. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdapackageClient.delete_imported_package` :param dict waiter_kwargs: A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait NicSsg|] }|qSrr r rrrrdrzbOdapackageClientCompositeOperations.delete_imported_package_and_wait_for_state..rrcs t|jdot|jdvSrrrrrrrkrz`OdapackageClientCompositeOperations.delete_imported_package_and_wait_for_state..r) rdelete_imported_packager"r& ServiceErrorrrr!r#r$r%r') rr) package_idr*r+r,r-r1r.r/r0rrr*delete_imported_package_and_wait_for_stateCs0    zNOdapackageClientCompositeOperations.delete_imported_package_and_wait_for_statec s|jj|||fi|}|s |Sdd|D|jd}z4tj|j|j|fdfddi|} | } | WSty} ztjj|g| dWYd} ~ n d} ~ 00dS) a Calls :py:func:`~oci.oda.OdapackageClient.update_imported_package` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param oci.oda.models.UpdateImportedPackageDetails update_imported_package_details: (required) Parameter values required to import the package, with updated values. :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param str package_id: (required) Unique Digital Assistant package identifier. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdapackageClient.update_imported_package` :param dict waiter_kwargs: A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds`` as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait cSsg|] }|qSrr r rrrrrzbOdapackageClientCompositeOperations.update_imported_package_and_wait_for_state..rrcs t|jdot|jdvSrrrrrrrrz`OdapackageClientCompositeOperations.update_imported_package_and_wait_for_state..rN) rupdate_imported_packager!r"r#r$r%r&r') rupdate_imported_package_detailsr)r5r*r+r,r-r.r/r0r1rrr*update_imported_package_and_wait_for_statets$   zNOdapackageClientCompositeOperations.update_imported_package_and_wait_for_stateN)__name__ __module__ __qualname____doc__r r2r6r9rrrrr s  )1r)r"oci.utilrobjectrrrrrs