
                         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
)zAAPI wrapper for `gcloud service-extensions wasm-plugin` commands.    )absolute_import)division)unicode_literals)util)waiter)	resourcesc                   P    \ rS rSrSrS r     S
S jr    SS jrS 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/service_extensions/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UUS9S9nU R                  R	                  U5      $ )zCalls the CreateWasmPlugin API.)descriptionlabels	logConfigmainVersionIdversions)parentwasmPluginId
wasmPlugin)r   8NetworkservicesProjectsLocationsWasmPluginsCreateRequest
WasmPluginr   Create)	r   namer'   r"   r#   
log_configmain_versionr&   requests	            r   CreateWasmPluginClient.CreateWasmPlugin+   sf     	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.)r%   r"   r#   r$   )r-   
updateMaskr)   )r   7NetworkservicesProjectsLocationsWasmPluginsPatchRequestr+   r   Patch)r   r-   r/   update_maskr"   r#   r.   r0   s           r   UpdateWasmPluginClient.UpdateWasmPluginE   sc     	MM"}}//*'$	 0  	N 		
  ##))'22r    c                     Uc  g U R                   R                  R                  U R                   R                  R                  R                  UU R                   R	                  UUUS9S9/S9$ )N)imageUripluginConfigDatapluginConfigUri)keyvalue)additionalProperties)r   r+   VersionsValueAdditionalPropertyWasmPluginVersionDetails)r   
version_idimageplugin_config_dataplugin_config_uris        r   %PrepareVersionDetailsForSingleVersion,Client.PrepareVersionDetailsForSingleVersion]   s{     ==##11MM$$22EEmm<<"%7$5 =  F 	
 2  r    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.WaitForOperationo   sj     $$66B 7 K ((  $"9"9F >> r    )r   r   r   r   r   )NNNNN)NNNN)__name__
__module____qualname____firstlineno____doc__r   r1   r8   rH   rT   __static_attributes__ r    r   r
   r
      s?     4< 30$r    r
   N)rZ   
__future__r   r   r   )googlecloudsdk.api_lib.service_extensionsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.corer   r
   r\   r    r   <module>ra      s)    H &  ' : . )o or    