
                         d    S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
   " S S	5      rg
)z>API wrapper for `gcloud network-actions wasm-plugin` commands.    )absolute_import)division)unicode_literals)util)waiter)	resourcesc                   B    \ rS rSrSrS r S	S jr    S
S jrS rSr	g)Client   zsAPI client for WasmPlugin commands.

Attributes:
  messages: API messages class, The Networkservices API messages.
c                    [         R                  " U5      U l        U R                  R                  U l        U R                  R
                  U l        U R                  R                  U l        [        R                  " 5       U l        U R                  R                  S[         R                  R                  U5      5        g )Nnetworkservices)r   GetClientInstance_clientprojects_locations_wasmPlugins_wasm_plugin_clientprojects_locations_operations_operations_clientMESSAGES_MODULEmessagesr   Registry_resource_parserRegisterApiByNameAPI_VERSION_FOR_TRACKget)selfrelease_tracks     =lib/googlecloudsdk/api_lib/network_actions/wasm_plugin_api.py__init__Client.__init__!   s    ))-8DL#||JJD"llHHDLL00DM%..0D++45599-H    Nc           
          U R                   R                  UUU R                   R                  UUUS9S9nU R                  R	                  U5      $ )zCalls the CreateWasmPlugin API.)descriptionlabels	logConfig)parentwasmPluginId
wasmPlugin)r   8NetworkservicesProjectsLocationsWasmPluginsCreateRequest
WasmPluginr   Create)r   namer%   r"   r#   
log_configrequests          r   CreateWasmPluginClient.CreateWasmPlugin+   s`    
 	NN}}//'$ 0  	O 	
  ##**733r    c                     U R                   R                  UUU R                   R                  UUUUS9S9nU R                  R	                  U5      $ )zCalls the UpdateWasmPlugin API.)mainVersionIdr"   r#   r$   )r+   
updateMaskr'   )r   7NetworkservicesProjectsLocationsWasmPluginsPatchRequestr)   r   Patch)r   r+   main_versionupdate_maskr"   r#   r,   r-   s           r   UpdateWasmPluginClient.UpdateWasmPlugin<   sc     	MM"}}//*'$	 0  	N 		
  ##))'22r    c                     [         R                  R                  UR                  SS9n[        R
                  " U R                  U R                  5      n[        R                  " UUU5      $ )a  Waits for the opration to complete and returns the result of the operation.

Args:
  operation_ref: A Resource describing the Operation.
  message: The message to display to the user while they wait.

Returns:
  result of result_service.Get request for the provided operation.
z-networkservices.projects.locations.operations)
collection)	r   REGISTRYParseRelativeNamer+   r   CloudOperationPollerr   r   WaitFor)r   operation_refmessageop_resourcepollers        r   WaitForOperationClient.WaitForOperationT   sj     $$66B 7 K ((  $"9"9F >> r    )r   r   r   r   r   )NNN)NNNN)
__name__
__module____qualname____firstlineno____doc__r   r.   r7   rC   __static_attributes__ r    r   r
   r
      s0     EI4* 30r    r
   N)rI   
__future__r   r   r   &googlecloudsdk.api_lib.network_actionsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.corer   r
   rK   r    r   <module>rP      s)    E &  ' 7 . )T Tr    