Ë
    €ÏÖ  ã                   óZ   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ	  G d„ de
«      Zy	)
z6Experiment client for Faultinjectiontesting Cloud SDK.é    )Úabsolute_import)Údivision)Úunicode_literals)Ú
list_pager)Úutilsc                   ó<   — e Zd ZdZd	d„Zd„ Zd„ Zd„ Zd„ Z	 	 d
d„Z	y)ÚExperimentsClientz0Client for faults in Faultinjection Testing API.Nc                 ó®   — |xs t        j                  «       | _        |xs t        j                  «       | _        | j                  j
                  | _        y )N)Úapi_lib_utilsÚGetClientInstanceÚclientÚGetMessagesModuleÚmessagesÚprojects_locations_experimentsÚ_experiments_client)Úselfr   r   s      ú9lib/googlecloudsdk/api_lib/fault_injection/experiments.pyÚ__init__zExperimentsClient.__init__   s>   € ØÒ=œM×;Ñ;Ó=€D„KØÒA¤× ?Ñ ?Ó A€D„MØ#Ÿ{™{×IÑI€DÕó    c                 óp   — | j                   j                  |¬«      }| j                  j                  |«      S )zµDescribe a Experiment in the Project/location.

    Args:
      experiment: str, the name for the experiment being described.

    Returns:
      Described Experiment Resource.
    ©Úname)r   Ú;FaultinjectiontestingProjectsLocationsExperimentsGetRequestr   ÚGet)r   Ú
experimentÚdescribe_reqs      r   ÚDescribezExperimentsClient.Describe!   s:   € ð —=‘=×\Ñ\Øð ]ó €Lð ×#Ñ#×'Ñ'¨Ó5Ð5r   c                 óp   — | j                   j                  |¬«      }| j                  j                  |«      S )z©Delete a Experiment in the Project/location.

    Args:
      experiment: str, the name for the Experiment being deleted

    Returns:
      Empty Response Message.
    r   )r   Ú>FaultinjectiontestingProjectsLocationsExperimentsDeleteRequestr   ÚDelete)r   r   Ú
delete_reqs      r   r    zExperimentsClient.Delete/   s:   € ð —‘×]Ñ]Øð ^ó €Jð ×#Ñ#×*Ñ*¨:Ó6Ð6r   c                 óf   — t        j                  |||«      }| j                  j                  |«      S )a	  Create a fault in the Project/location.

    Args:
      experiment: str, the name for the experiment being created
      experiment_config: file, the file which contains experiment config
      parent: parent for fault resource

    Returns:
      Experiment.
    )r   ÚParseCreateExperimentFromYamlr   ÚCreate)r   r   Úexperiment_configÚparentÚ
create_reqs        r   r$   zExperimentsClient.Create=   s5   € ô ×<Ñ<ØÐ% vó€Jð ×#Ñ#×*Ñ*¨:Ó6Ð6r   c                 ód   — t        j                  ||«      }| j                  j                  |«      S )zæUpdate a experiment in the Project/location.

    Args:
      experiment: str, the name for the experiment being created
      experiment_config: file, the file which contains experiment config

    Returns:
      Experiment.
    )r   ÚParseUpdateExperimentFromYamlr   ÚPatch)r   r   r%   Ú	patch_reqs       r   ÚUpdatezExperimentsClient.UpdateN   s3   € ô ×;Ñ;ØÐ%ó€Ið ×#Ñ#×)Ñ)¨)Ó4Ð4r   c                 ó„   — | j                   j                  |¬«      }t        j                  | j                  |d||d¬«      S )ag  List Experiments in the Projects/Location.

    Args:
      parent: str, projects/{projectId}/locations/{location}
      limit: int or None, the total number of results to return.
      page_size: int, the number of entries in each batch (affects requests
        made, but not the yielded results).

    Returns:
      Generator of matching Experiments.
    )r&   ÚexperimentsÚpageSize)ÚfieldÚ
batch_sizeÚlimitÚbatch_size_attribute)r   Ú<FaultinjectiontestingProjectsLocationsExperimentsListRequestr   ÚYieldFromListr   )r   r&   r2   Ú	page_sizeÚlist_reqs        r   ÚListzExperimentsClient.List^   sN   € ð" }‰}×YÑYØð Zó €Hô ×#Ñ#Ø× Ñ ØØØØØ'ôð r   )NN)Néd   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r    r$   r,   r8   © r   r   r	   r	      s,   „ Ù8óJò
6ò7ò7ò"5ð& Øô	r   r	   N)r=   Ú
__future__r   r   r   Úapitools.base.pyr   Ú&googlecloudsdk.api_lib.fault_injectionr   r   Úobjectr	   r>   r   r   Ú<module>rC      s'   ðñ =å &Ý Ý 'å 'Ý Iô`˜õ `r   