
    #                         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 rS rS rS rS rSS jrS rS rS rS rS rS rS rS rg)z@Flags and helpers for the conversion workspace related commands.    )arg_parsers)enumsc                 &    U R                  SSSS9  g)z+Adds a --no-async flag to the given parser.z
--no-async
store_truezAWaits for the operation in progress to complete before returning.actionhelpNadd_argumentparsers    Plib/googlecloudsdk/command_lib/database_migration/conversion_workspaces/flags.pyAddNoAsyncFlagr      s    N      c                 $    U R                  SSS9  g)z/Adds a --display-name flag to the given parser.z--display-namez        A user-friendly name for the conversion workspace. The display name can
        include letters, numbers, spaces, and hyphens, and must start with a letter.
        The maximum length allowed is 60 characters.
      r	   Nr
   r   s    r   AddDisplayNameFlagr      s    
  r   c                     U R                  SS[        R                  [        [        R                  5      SS9  U R                  SS[        R                  [        [        R                  5      SS9  g)z^Adds the --source-database-engine and --destination-database-engine flags to the given parser.z--source-database-enginezSource database engine type.T)r	   typechoicesrequiredz--destination-database-enginez!Destination database engine type.N)r   r   SourceDatabaseEnginelistDestinationDatabaseEnginer   s    r   AddDatabaseEngineFlagsr   *   sj     )%%5--.   	%.**5223  r   c                 l   U R                  SS[        R                  [        [        R                  5      [        R                  R                  R
                  S9  U R                  SS[        R                  [        [        R                  5      [        R                  R                  R
                  S9  g)zbAdds the --source-database-provider and --destination-database-provider flags to the given parser.z--source-database-providerzSource database provider.)r	   r   r   defaultz--destination-database-providerzDestination database provider.N)r   r   SourceDatabaseProviderr   UNSPECIFIEDvalueDestinationDatabaseProviderCLOUDSQLr   s    r   AddDatabaseProviderFlagsr#   =   s    "&''5//0**66<<   	'+,,5445//88>>  r   c                 H    U R                  SSSS9  U R                  SSSS9  g)z`Adds the --source-database-version and --destination-database-version flags to the given parser.z--source-database-versionz        Version number for the database engine.
        The version number must contain numbers and letters only.
        Example for Oracle 21c, version number will be 21c.
      unspecified)r	   r   z--destination-database-versionz        Version number for the database engine.
        The version number must contain numbers and letters only.
        Example for PostgreSQL 17.0, version number will be 17.0.
      Nr
   r   s    r   AddDatabaseVersionFlagr&   P   sD    !

    	&

   r   c                 N    U R                  SS[        R                  " 5       SS9  g)z2Adds a --global-settings flag to the given parser.z--global-settingsz	KEY=VALUEa          A generic list of settings for the workspace. The settings are database pair
        dependant and can indicate default behavior for the mapping rules engine or
        turn on or off specific features. An object containing a list of
        "key": "value" pairs.
      )metavarr   r	   N)r   r   ArgDictr   s    r   AddGlobalSettingsFlagr*   f   s,     
	  
r   c                 $    U R                  SSS9  g)z0Adds a --global-filter flag to the given parser.z--global-filterz        Filter the source entities based on [AIP-160](https://google.aip.dev/160) standard.
        This filter will be applied to all subsequent operations on the source entities,
        such as convert and describe-entities.
      r   Nr
   r   s    r   AddGlobalFilterFlagr,   u       
  r   c                 $    U R                  SSS9  g)z.Adds a --commit-name flag to the given parser.z--commit-namez        A user-friendly name for the conversion workspace commit. The commit name
        can include letters, numbers, spaces, and hyphens, and must start with a
        letter.
        r   Nr
   r   s    r   AddCommitNameFlagr/      s      r   c                 &    U R                  SSSS9  g)z.Adds a --auto-commit flag to the given parser.z--auto-commitr   z&Auto commits the conversion workspace.r   Nr
   r   s    r   AddAutoCommitFlagr1      s    3  r   c                 *    U R                  SSS/SS9  g)z0Adds the --file-format flag to the given parser.z--file-formatz&File format type to import rules from.ORA2PG)r	   r   r   Nr
   r   s    r   AddImportFileFormatFlagr4      s#    3j	  r   c                 N    U R                  SS[        R                  " SS9SSS9  g)	z/Adds a --config-files flag to the given parser.z--config-filesCONFIG_FILE   )
min_lengthz        A list of files to import rules from. Either provide a single file path or if
        multiple files are to be provided, each file should correspond to one schema.
        Provide file paths as a comma separated list.
      T)r(   r   r	   r   N)r   r   ArgListr   s    r   AddConfigFilesFlagr:      s3    !,

   
r   c                 $    U R                  SSS9  g)z)Adds a --filter flag to the given parser.z--filtera"          Filter the entities based on [AIP-160](https://google.aip.dev/160) standard.
        Example:
          to filter all tables whose name start with "Employee" and are present
          under schema "Company", use filter as
            "Company.Employee```*``` AND type=TABLE"
       r   Nr
   r   s    r   AddFilterFlagr<      s      	r   c                 .    U R                  SSSS/UUS9  g)z.Adds the --tree-type flag to the given parser.z--tree-typez Tree type for database entities.SOURCEDRAFT)r	   r   r   r   Nr
   )r   r   default_values      r   AddTreeTypeFlagrA      s)    -!  r   c                 &    U R                  SSSS9  g)z.Adds a --uncommitted flag to the given parser.z--uncommittedr   z        Whether to retrieve the latest committed version of the entities or the
        latest version.
        This field is ignored if a specific commit_id is specified.
      r   Nr
   r   s    r   AddUncommittedFlagrC      s     
  r   c                 $    U R                  SSS9  g)z,Adds a --commit-id flag to the given parser.z--commit-idzy        Request a specific commit id.
        If not specified, the entities from the latest commit are returned.
       r   Nr
   r   s    r   AddCommitIdFlagrE      s      r   c                 P    U R                  SSS9n[        U5        [        U5        g)zLAdds the source details to the given parser for application code conversion.T)r   mutexN)	add_groupAddSourceFolderFlagAddSourceFileFlag)r   source_details_groups     r   AddSourceDetailsFlagrL      s,      ))4t)D*+()r   c                 $    U R                  SSS9  g)z0Adds a --source-folder flag to the given parser.z--source-folderz        A folder path to the source code files which needs to be converted.
        If the target-path is not specified, the source file is backed up and
        the original file is overwritten with the converted code.
      r   Nr
   r   s    r   rI   rI      r-   r   c                 $    U R                  SSS9  g)z.Adds a --source-file flag to the given parser.z--source-filez        A file path to the source code which needs to be converted.
        If the target-path is not specified, the source file is backed up and
        the original file is overwritten with the converted code.
      r   Nr
   r   s    r   rJ   rJ      s    
  r   c                 $    U R                  SSS9  g)z.Adds a --target-path flag to the given parser.z--target-pathaB          Path where the converted code should be written.
        This can be a directory or a file name.
        In case it is a directory, the file name will be the same as the source file.
        If it is not provied, source file is backed up and the original file
        is overwritten with the converted code.
      r   Nr
   r   s    r   AddTargetPathFlagrP      s    
  	r   c                 &    U R                  SSSS9  g)z1Adds a --source-dialect flag to the given parser.z--source-dialectzHThe source dialect of the code to be converted. This can only be ORACLE.Tr	   r   Nr
   r   s    r   AddSourceDialectFlagrS     s"       r   c                 &    U R                  SSSS9  g)z1Adds a --target-dialect flag to the given parser.z--target-dialectzLThe target dialect of the code to be converted. This can only be POSTGRESQL.TrR   Nr
   r   s    r   AddTargetDialectFlagrU     s"       r   N)Tr?   )__doc__googlecloudsdk.callioper   Cgooglecloudsdk.command_lib.database_migration.conversion_workspacesr   r   r   r   r#   r&   r*   r,   r/   r1   r4   r:   r<   rA   rC   rE   rL   rI   rJ   rP   rS   rU    r   r   <module>rZ      sz    G / U	&&,		
*				r   