
    g                     6    S r SSKJr  SSKJr   " S S\5      rg)z6Experiment client for Faultinjectiontesting Cloud SDK.    )
list_pager)utilsc                   H    \ rS rSrSrSS jrS rS rS rS r	  SS	 jr
S
rg)ExperimentsClient   z0Client for faults in Faultinjection Testing API.Nc                     U=(       d    [         R                  " 5       U l        U=(       d    [         R                  " 5       U l        U R                  R
                  U l        g )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__ExperimentsClient.__init__   s>    =M;;=DKA ? ? ADM#{{IID    c                 j    U R                   R                  US9nU R                  R                  U5      $ )zDescribe 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   DescribeExperimentsClient.Describe   s:     ==\\ ] L ##''55r   c                 j    U R                   R                  US9nU R                  R                  U5      $ )zDelete 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    ExperimentsClient.Delete,   s:     ]] ^ J ##**:66r   c                 f    [         R                  " XU5      nU R                  R                  U5      $ )zCreate 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%   ExperimentsClient.Create:   s2     <<vJ ##**:66r   c                 d    [         R                  " X5      nU R                  R                  U5      $ )zUpdate 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   UpdateExperimentsClient.UpdateK   s0     ;;I ##)))44r   c           	      z    U R                   R                  US9n[        R                  " U R                  USUUSS9$ )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'   r5   	page_sizelist_reqs        r   ListExperimentsClient.List[   sN    " }}YY Z H ##  ' r   )r   r   r   )NN)Nd   )__name__
__module____qualname____firstlineno____doc__r   r   r    r%   r.   r;   __static_attributes__ r   r   r   r      s,    8J
677"5& 	r   r   N)rB   apitools.base.pyr   &googlecloudsdk.api_lib.fault_injectionr   r	   objectr   rD   r   r   <module>rH      s     = ( I` `r   