
                             S r SSK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	 rS
 rS rS rS rS rS rg)z.Common flags for service-extensions resources.    N)arg_parsers)concepts)util)	yaml_data)concept_parsers)presentation_specsc           
         [         R                  R                  S5      n[        R                  " [
        R                  " S[        R                  R                  UR                  5       US9USS9/5      R                  U 5        g )Nzservice_extensions.wasmPluginwasm_plugin)api_versionT)required)r   ResourceYAMLDataFromPathr   ConceptParserr   ResourcePresentationSpecr   ResourceSpecFromYamlGetDataAddToParser)parserr   messagewasm_plugin_datas       :lib/googlecloudsdk/command_lib/service_extensions/flags.pyAddWasmPluginResourcer      s~    //88% 

5
5##,,"**,) -  
 K    c                 $    U R                  SSS9  g )Nz--descriptionz-A human-readable description of the resource.helpadd_argumentr   s    r   AddDescriptionFlagr!   /   s    :  <r   c           
      |    U R                  SS[        R                  " U5      SS[        R                  " S5      S9  g )Nz--log-configappendF
LOG_CONFIGa          Logging options for the activity performed by this plugin.
        The following options can be set:
        * `enable`: whether to enable logging. If `log-config` flag is set,
          `enable` option is required.

        * `sample-rate`: configures the sampling rate of activity logs, where
          `1.0` means all logged activity is reported and `0.0` means no
          activity is reported. The default value is `1.0`, and the value of
          the field must be in range `0` to `1` (inclusive).

        * `min-log-level`: specifies the lowest level of the logs that
          should be exported to Cloud Logging. The default value is `INFO`.

        Example usage:
        `--log-config=enable=True,sample-rate=0.5,min-log-level=INFO
        --log_config=enable=False`
        )actiontyper   metavarr   )r   r   	LogConfigtextwrapdedent)r   r   s     r   AddLogConfigFlagr+   5   s>    >>+&??    r   c                 $    U R                  SUS9  g )Nz--main-versionr   r   )r   version_messages     r   AddVersionFlagr.   Q   s    &_=r   c                 L    U R                  S[        R                  " S5      S9  g )Nz--imagezt          URI of the container image containing the plugin's Wasm module,
          stored in the Artifact Registry.r   )r   r)   r*   r    s    r   AddImageFlagr0   U   s)    ?? . /  r   c                     U R                  SSSS9nUR                  SSSS9  UR                  SS[        R                  " SS	9S
S9  UR                  SSSS9  g)z"Adds flags defining plugin config.TFzConfiguration for the plugin, provided at runtime by the
              `on_configure` function (Rust Proxy-Wasm SDK) or the
              `onConfigure` method (C++ Proxy-Wasm SDK).)mutexr   r   z--plugin-configz3Plugin runtime configuration in the textual format.)r   r   z--plugin-config-file)binaryzOPath to a local file containing the plugin runtime
              configuration.)r   r&   r   z--plugin-config-urizxURI of the container image containing the plugin's runtime
              configuration, stored in the Artifact Registry.N)	add_groupr   r   FileContents)r   plugin_config_groups     r   AddPluginConfigFlagr7   ^   s    ((< )  ""D # 
 ""##40 	 #  ""A # r   c                 f    U R                  SSS9n[        X!5        [        U5        [        U5        g )NF)r2   r   )r4   r.   r0   r7   )r   r-   wasm_plugin_version_groups      r   AddWasmPluginVersionArgsr:   {   s3    $..UU.K*<()/0r   )__doc__r)   googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr   -googlecloudsdk.command_lib.service_extensionsr   $googlecloudsdk.command_lib.util.apisr   (googlecloudsdk.command_lib.util.conceptsr   r   r   r!   r+   r.   r0   r7   r:    r   r   <module>rB      sD    5  / 5 > : D G&<8>:1r   