
                         Z    S 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SS jrS rg)z$Shared resource arguments and flags.    )arg_parsers)conceptsc                  ,    [         R                  " SSS9$ )z=Returns the resource parameter attribute config for location.locationz&The Cloud location for the {resource}.name	help_textr    ResourceParameterAttributeConfig     0lib/googlecloudsdk/api_lib/vector_search/args.pyLocationAttributeConfigr      s    		2	28
 r   c                  ,    [         R                  " SSS9$ )z?Returns the resource parameter attribute config for collection.
collectionzThe name of the {resource}.r   r
   r   r   r   CollectionAttributeConfigr      s    		2	2-
 r   c            	      p    [         R                  " SSS[         R                  [        5       [	        5       S9$ )z*Returns the resource spec for data object.z7vectorsearch.projects.locations.collections.dataObjects
dataObjectF)resource_namedisable_auto_completers
projectsIdlocationsIdcollectionsId)r   ResourceSpec DEFAULT_PROJECT_ATTRIBUTE_CONFIGr   r   r   r   r   GetDataObjectResourceSpecr   %   s3    			? #::)+-/
 r   c                 .    U R                  SSSU S3S9  g)z%Adds --collection flag to the parser.z--collectionTzThe collection to z data objects from.requiredhelpNadd_argumentparser	help_verbs     r   AddCollectionFlagr&   1   s(    	{*=>  r   c                 &    U R                  SSSS9  g)z#Adds --location flag to the parser.z
--locationTzLocation of the collection.r   Nr!   )r$   s    r   AddLocationFlagr(   :   s    T(E  r   c                 ,    U R                  SSU S3S9  g)z&Adds --json-filter flag to the parser.z--json-filterz3A filter expression in JSON format to apply to the z&, e.g. '{"genre": {"$eq": "sci-fi"}}'.)r    Nr!   r#   s     r   AddJsonFilterFlagr*   A   s*    ?	{ K4 4  r   c                    U R                  S5      nUR                  S[        R                  " 5       SSS9  UR                  S[        R                  " 5       SSS9  UR                  S	[        R                  " 5       S
SS9  g)z'Adds output fields flags to the parser.zOutput fieldsz--output-data-fieldsDATA_OUTPUT_FIELDzQList of data fields to include in the output. Use `*` to include all data fields.)typemetavarr    z--output-vector-fieldsVECTOR_OUTPUT_FIELDzUList of vector fields to include in the output. Use `*` to include all vector fields.z--output-metadata-fieldsMETADATA_OUTPUT_FIELDzYList of metadata fields to include in the output. Use `*` to include all metadata fields.N)add_argument_groupr"   r   ArgList)r$   output_fields_groups     r   AddOutputFieldsFlagsr4   L   s    11/B"" ! #  "" #  #  ""  %" # r   c                 V    [        X5        [        U 5        U(       a  [        X5        gg)z)Adds flags for query data object command.N)r&   r(   r*   )r$   command_nameinclude_json_filters      r   AddDataObjectFlagsr8   l   s"    F)&f+ r   c                    UR                   R                  5       nU R                  (       a  U R                  Ul        U R                  (       a  U R                  Ul        U R                  (       a  U R                  Ul        U$ )z#Parses output fields from the args.)messages)GoogleCloudVectorsearchV1betaOutputFieldsoutput_data_fields
dataFieldsoutput_vector_fieldsvectorFieldsoutput_metadata_fieldsmetadataFields)argsclientoutput_fieldss      r   ParseOutputFieldsrE   t   s_    //KKM-	#66M	!%!:!:M	  #'#>#>M 	r   N)T)__doc__googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr   r   r   r   r&   r(   r*   r4   r8   rE   r   r   r   <module>rI      s>    + / 5	@,	r   