
    b                        S 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SrSrSrSrSrSrS"S jrS#S jrS$S jrS%S jrS rS&S jrS"S jrS#S jrS$S jrS%S jr  S'S jrS r S r! S(S jr"S(S jr#S r$S(S  jr%g!))z.Shared resource flags for Datastream commands.    )base)concepts)concept_parsers)presentation_specsa    Path to a YAML (or JSON) file containing the configuration for MySQL Source Config.

  The JSON file is formatted as follows, with snake_case field naming:

  ```
    {
      "allowlist": {},
      "rejectlist":  {
        "mysql_databases": [
            {
              "database_name":"sample_database",
              "mysql_tables": [
                {
                  "table_name": "sample_table",
                  "mysql_columns": [
                    {
                      "column_name": "sample_column",
                    }
                   ]
                }
              ]
            }
          ]
        }
    }
  ```
a{    Path to a YAML (or JSON) file containing the configuration for MySQL Source Config.

  The JSON file is formatted as follows, with camelCase field naming:

  ```
    {
      "includeObjects": {},
      "excludeObjects":  {
        "mysqlDatabases": [
            {
              "database":"sample_database",
              "mysqlTables": [
                {
                  "table": "sample_table",
                  "mysqlColumns": [
                    {
                      "column": "sample_column",
                    }
                   ]
                }
              ]
            }
          ]
        }
    }
  ```
aS    Path to a YAML (or JSON) file containing the configuration for Oracle Source Config.

  The JSON file is formatted as follows, with snake_case field naming:

  ```
    {
      "allowlist": {},
      "rejectlist": {
        "oracle_schemas": [
          {
            "schema_name": "SAMPLE",
            "oracle_tables": [
              {
                "table_name": "SAMPLE_TABLE",
                "oracle_columns": [
                  {
                    "column_name": "COL",
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  ```
aI    Path to a YAML (or JSON) file containing the configuration for Oracle Source Config.

  The JSON file is formatted as follows, with camelCase field naming:

  ```
    {
      "includeObjects": {},
      "excludeObjects": {
        "oracleSchemas": [
          {
            "schema": "SAMPLE",
            "oracleTables": [
              {
                "table": "SAMPLE_TABLE",
                "oracleColumns": [
                  {
                    "column": "COL",
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  ```
a    Path to a YAML (or JSON) file containing the configuration for PostgreSQL Source Config.

  The JSON file is formatted as follows, with camelCase field naming:

  ```
    {
      "includeObjects": {},
      "excludeObjects": {
        "postgresqlSchemas": [
          {
            "schema": "SAMPLE",
            "postgresqlTables": [
              {
                "table": "SAMPLE_TABLE",
                "postgresqlColumns": [
                  {
                    "column": "COL",
                  }
                ]
              }
            ]
          }
        ]
      },
      "replicationSlot": "SAMPLE_REPLICATION_SLOT",
      "publication": "SAMPLE_PUBLICATION"
    }
  ```
a  
  Path to a YAML (or JSON) file containing the configuration for SQL Server Source Config.

  The JSON file is formatted as follows, with camelCase field naming:

  ```
    {
      "includeObjects": {},
      "excludeObjects": {
        "schemas": [
          {
            "schema": "SAMPLE",
            "tables": [
              {
                "table": "SAMPLE_TABLE",
                "columns": [
                  {
                    "column": "COL",
                  }
                ]
              }
            ]
          }
        ]
      },
      "maxConcurrentCdcTasks": 2,
      "maxConcurrentBackfillTasks": 10,
      "transactionLogs": {}  # Or changeTables
    }
  ```
a  
  Path to a YAML (or JSON) file containing the configuration for Salesforce Source Config.

  The JSON file is formatted as follows, with camelCase field naming:

  ```
    {
      "pollingInterval": "3000s",
      "includeObjects": {},
      "excludeObjects": {
        "objects": [
          {
            "objectName": "SAMPLE",
            "fields": [
              {
                "fieldName": "SAMPLE_FIELD",
              }
            ]
          }
        ]
      }
    }
  ```
a0  
  Path to a YAML (or JSON) file containing the configuration for Spanner Source Config.

  The JSON file is formatted as follows, with camelCase field naming:

  ```
    "changeStreamName": "SAMPLE_CHANGE_STREAM_NAME",
    {
      "includeObjects": {},
      "excludeObjects": {
        "schemas": [
          {
            "schema": "SAMPLE",
            "tables": [
              {
                "table": "SAMPLE_TABLE",
                "columns": [
                  {
                    "column": "COL",
                  }
                ]
              }
            ]
          }
        ]
      },
      "maxConcurrentCdcTasks": 1000,
      "maxConcurrentBackfillTasks": 10,
      "backfillDataBoostEnabled": false,
      "fgacRole": "SAMPLE_FGAC_ROLE",
      "spannerRpcPriority": "MEDIUM"
    }
  ```
a  
  Path to a YAML (or JSON) file containing the configuration for Spanner Source Config.

  The JSON file is formatted as follows, with camelCase field naming:

  ```
    {
      "includeObjects": {},
      "excludeObjects": {
        "schemas": [
          {
            "schema": "SAMPLE",
            "tables": [
              {
                "table": "SAMPLE_TABLE",
                "columns": [
                  {
                    "column": "COL",
                  }
                ]
              }
            ]
          }
        ]
      },
      "maxConcurrentCdcTasks": 1000,
      "maxConcurrentBackfillTasks": 10,
      "backfillDataBoostEnabled": false,
      "fgacRole": "SAMPLE_FGAC_ROLE",
      "spannerRpcPriority": "MEDIUM"
    }
  ```
aT    Path to a YAML (or JSON) file containing the configuration for MongoDB Source Config.

  The JSON file is formatted as follows, with snake_case field naming:

  ```
    {
      "includeObjects": {},
      "excludeObjects": {
        "databases": [
          {
            "database": "sampleDb",
            "collections": [
              {
                "collection": "sampleCollection",
                "fields": [
                  {
                    "field": "SAMPLE_FIELD",
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  ```
c                 4    [         R                  " U SSS0SS9$ )Nz)The connection profile of the {resource}.	fieldMasknameidr	   	help_textcompletion_request_paramscompletion_id_fieldr    ResourceParameterAttributeConfigr	   s    :lib/googlecloudsdk/command_lib/datastream/resource_args.py ConnectionProfileAttributeConfigr     &    		2	2;!,f 5	
       c                 4    [         R                  " U SSS0SS9$ )Nz)The private connection of the {resource}.r   r	   r
   r   r   r   s    r    PrivateConnectionAttributeConfigr     r   r   c                 4    [         R                  " U SSS0SS9$ )NzThe stream of the {resource}.r   r	   r
   r   r   r   s    r   StreamAttributeConfigr     s&    		2	2/!,f 5	
   r   c                 4    [         R                  " U SSS0SS9$ )NzThe route of the {resource}.r   r	   r
   r   r   r   s    r   RouteAttributeConfigr     s&    		2	2.!,f 5	
   r   c                  ,    [         R                  " SSS9$ )Nlocationz&The Cloud location for the {resource}.r	   r   r    r   r   LocationAttributeConfigr      s    		2	2!I
K Kr   c                 ^    [         R                  " SU [        5       [         R                  SS9$ )Nzdatastream.projects.locationsT)resource_namelocationsId
projectsIddisable_auto_completers)r   ResourceSpecr     DEFAULT_PROJECT_ATTRIBUTE_CONFIGr"   s    r   GetLocationResourceSpecr)     s-    			%!)+::"
$ $r   c           	      n    [         R                  " SU [        U S9[        5       [         R                  SS9$ )Nz0datastream.projects.locations.connectionProfilesr   T)r"   connectionProfilesIdr#   r$   r%   )r   r&   r   r    r'   r(   s    r    GetConnectionProfileResourceSpecr,     5    			8!;O)+::"
$ $r   c           	      n    [         R                  " SU [        U S9[        5       [         R                  SS9$ )Nz0datastream.projects.locations.privateConnectionsr   T)r"   privateConnectionsIdr#   r$   r%   )r   r&   r   r    r'   r(   s    r    GetPrivateConnectionResourceSpecr0     r-   r   c           	      n    [         R                  " SU [        U S9[        5       [         R                  SS9$ )Nz%datastream.projects.locations.streamsr   T)r"   	streamsIdr#   r$   r%   )r   r&   r   r    r'   r(   s    r   GetStreamResourceSpecr3     s5    			-!%=9)+::"
$ $r   c           
          [         R                  " SU [        U S9[        S5      [	        5       [         R
                  SS9$ )Nz7datastream.projects.locations.privateConnections.routesr   private-connectionT)r"   routesIdr/   r#   r$   r%   )r   r&   r   r   r    r'   r(   s    r   GetRouteResourceSpecr7     s@    			?!#7;
 )+::"
$ $r   c           	         U(       a  SnOSnU R                  SS9nUR                  SSSS9  U[        R                  R                  :X  a  UR                  S	SS
S9  UR                  5       nUR                  SSUS9  UR                  SSUS9  UR                  SS[
        SS9  UR                  USS9nUR                  SSS9  UR                  SSS9  Sn	U[        R                  R                  :X  a  Sn	[        R                  " U[        5       SR                  U5      SS9[        R                  " SU	-  [        5       SS S!0US"9/n
[        R                  " U
S#U	-  S$/0S%9R                  U 5        g&)'a  Add a resource argument for a Datastream connection profile.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  release_track: Some arguments are added based on the command release
      track.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
  required: bool, if True, means that a flag is required.
connection_profilez--connection-profileT)mutexz--static-ip-connectivity
store_truezuse static ip connectivity)actionhelpz--no-connectivityzno connectivityz--forward-ssh-hostnamezHostname for the SSH tunnel.)r=   requiredz--forward-ssh-usernamezUsername for the SSH tunnel.z--forward-ssh-portz-Port for the SSH tunnel, default value is 22.   )r=   typedefaultr>   r:   z--forward-ssh-passwordz"          SSH password.
          r=   z--forward-ssh-private-keyzSSH private key..r5   zprivate-connection-namezThe connection profile {}.r>   --%sz&Resource ID of the private connection.r    flag_name_overridesgroup--%s.location
--locationcommand_level_fallthroughsN)	add_groupadd_argumentr   ReleaseTrackBETAintr   ResourcePresentationSpecr,   formatr0   r   ConceptParserAddToParser)parserverbrelease_track
positionalr>   r	   connectivity_parserforward_ssh_parserpassword_groupprivate_connection_flag_nameresource_specss              r   AddConnectionProfileResourceArgr`     s     D!D((t(4"" + # -
 d'',,,$$L7L % N +446!!- "  !!- "  !!>	 " 
 &///N. &   !(;  = "6d'',,,#<  11

*
,
&
-
-d
3	
 11
/
/
*
,
2)2.#%. 
8
8<."	 
V	r   c                     U R                  SSS9nUR                  SSS9  [        R                  " S[	        5       SSS	0US
9/n[
        R                  " USS/0S9R                  U 5        g)z{Add a resource argument for a Datastream connection profile discover command.

Args:
  parser: the parser for the command.
T)r:   r>   z --connection-profile-object-filezPath to a YAML (or JSON) file containing the configuration
      for a connection profile object. If you pass - as the value of the
      flag the file content will be read from stdin.rC   z--connection-profile-namez&Resource ID of the connection profile.r   rF   rG   z"--connection-profile-name.locationrK   rL   N)rN   rO   r   rS   r,   r   rU   rV   )rW   connection_profile_parserr_   s      r   'AddConnectionProfileDiscoverResourceArgrc   @  s     %..TD.I(((8 )  11
%
*
,
2)2.)+. 
."	 
V	r   c                  \    S n [         R                  " SSU " 5       [         R                  S9$ )z:Constructs and returns the Resource specification for VPC.c                  ,    [         R                  " SSS9$ )Nvpcz8fully qualified name of the VPC Datastream will peer to.r   r   r   r   r   VpcAttributeConfig.GetVpcResourceSpec.<locals>.VpcAttributeConfig`  s    44P r   zcompute.networksrf   )r"   networkproject)r   r&   r'   )rg   s    r   GetVpcResourceSpecrk   ]  s1     
		 "77	
9 9r   c                     U(       a  SnOSn[         R                  " U[        5       SR                  U5      SS9/n[        R
                  " U5      R                  U 5        g)a  Add a resource argument for a Datastream private connection.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
private_connectionz--private-connectionzThe private connection {}.TrD   N)r   rS   r0   rT   r   rU   rV   rW   rX   rZ   r	   r_   s        r   AddPrivateConnectionResourceArgro   m  s_     D!D 11

*
,
&
-
-d
3	. !k&)r   c                 f   U R                  US9nUR                  USS9nUR                  SU[        R                  R                  :X  a  [
        O[        S9  UR                  SU[        R                  R                  :X  a  [        O[        S9  UR                  SUS:X  a  [        O[        S9  UR                  S	US:X  a  [        O[        S9  UR                  S
US:X  a  [        O[        S9  UR                  SUS:X  a  [        O[         S9  UR                  S["        S9  U R                  US9nUR                  USS9nUR                  SSS9  UR                  SSS9  SnSn	U[        R                  R                  :X  a  SnSn	[$        R&                  " S[)        5       SR+                  U5      SS9[$        R&                  " SU-  [-        5       SUSS0US9[$        R&                  " SU	-  [-        5       SUSS0US9/n
[.        R0                  " U
SU-  S/SU	-  S/0S9R3                  U 5        g )!ac  Add resource arguments for creating/updating a stream.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  release_track: base.ReleaseTrack, some arguments are added based on the
      command release track.
  required: bool, if True, means that a flag is required.
rD   TrB   z--oracle-source-configrC   z--mysql-source-configz--postgresql-source-configupdatez--sqlserver-source-configz--salesforce-source-configz--spanner-source-configz--mongodb-source-configz--gcs-destination-configaC        Path to a YAML (or JSON) file containing the configuration for Google Cloud Storage Destination Config.

      The JSON file is formatted as follows:

      ```
       {
       "path": "some/path",
       "fileRotationMb":5,
       "fileRotationInterval":"15s",
       "avroFileFormat": {}
       }
      ```
        z--bigquery-destination-configa        Path to a YAML (or JSON) file containing the configuration for Google BigQuery Destination Config.

      The YAML (or JSON) file should be formatted as follows:

      BigQuery configuration with source hierarchy datasets and merge mode (merge mode is by default):

      ```
      {
        "sourceHierarchyDatasets": {
          "datasetTemplate": {
            "location": "us-central1",
            "datasetIdPrefix": "my_prefix",
            "kmsKeyName": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}"
          }
        },
        "merge": {}
        "dataFreshness": "3600s"
      }
      ```

      BigQuery configuration with source hierarchy datasets and append only mode:
      ```
      {
        "sourceHierarchyDatasets": {
          "datasetTemplate": {
            "location": "us-central1",
            "datasetIdPrefix": "my_prefix",
            "kmsKeyName": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}"
          }
        },
        "appendOnly": {}
      }
      ```

      BigQuery configuration with single target dataset and merge mode:

      ```
      {
        "singleTargetDataset": {
          "datasetId": "projectId:my_dataset"
        },
        "merge": {}
        "dataFreshness": "3600s"
      }
      ```

      BigQuery configuration with Big Lake table configuration:
      ```
      {
        "singleTargetDataset": {
          "datasetId": "projectId:datasetId"
        },
        "appendOnly": {},
        "blmtConfig": {
          "bucket": "bucketName",
          "tableFormat": "ICEBERG",
          "fileFormat": "PARQUET",
          "connectionName": "projectId.region.connectionName",
          "rootPath": "/root"
        }
      }
      ```
      sourcedestinationzsource-namezdestination-namestreamzThe stream to {}.rE   z-Resource ID of the source connection profile.r   rF   )r>   rH   rI   z2Resource ID of the destination connection profile.rJ   rK   rL   N)rN   rO   r   rP   rQ   $_ORACLE_SOURCE_CONFIG_HELP_TEXT_BETA_ORACLE_SOURCE_CONFIG_HELP_TEXT#_MYSQL_SOURCE_CONFIG_HELP_TEXT_BETA_MYSQL_SOURCE_CONFIG_HELP_TEXT*_POSTGRESQL_UPDATE_SOURCE_CONFIG_HELP_TEXT*_POSTGRESQL_CREATE_SOURCE_CONFIG_HELP_TEXT)_SQLSERVER_UPDATE_SOURCE_CONFIG_HELP_TEXT)_SQLSERVER_CREATE_SOURCE_CONFIG_HELP_TEXT*_SALESFORCE_UPDATE_SOURCE_CONFIG_HELP_TEXT*_SALESFORCE_CREATE_SOURCE_CONFIG_HELP_TEXT'_SPANNER_UPDATE_SOURCE_CONFIG_HELP_TEXT'_SPANNER_CREATE_SOURCE_CONFIG_HELP_TEXT _MONGODB_SOURCE_CONFIG_HELP_TEXTr   rS   r3   rT   r,   r   rU   rV   )rW   rX   rY   r>   source_parsersource_config_parser_groupdestination_parserdestination_config_parser_groupsource_fielddestination_fieldr_   s              r   AddStreamResourceArgr     s    ""H"5-,66t  7  %))3@					4 /%D * F ))2?					3 .%C * E ))"		 65	 *  ))!		 54	 *  ))"		 65	 *  ))		 32	 *  ))+ * 
 ''':$6$@$@t %A %%!!..  / " "..%?
 / BH ,#d'',,, L* 11


!

$
$T
*	
 11
<

*
,
9)2. 11
$
$
*
,
>)2."$.* 
L
(<.
-
-~"	
 
V	r   c                     [         R                  " S[        5       SSS9/n[        R                  " USS/0S9R                  U 5        g)	zeAdd a resource argument for a Datastream stream object.

Args:
  parser: the parser for the command.
z--streamzThe stream to list objects for.TrD   z--stream.locationrK   rL   N)r   rS   r3   r   rU   rV   )rW   r_   s     r   AddStreamObjectResourceArgr   5  sS     11


!
+	. 
~"	 
V	r   c                     U(       a  SnOSn[         R                  " U[        5       SR                  U5      SS9/n[        R
                  " U5      R                  U 5        g)zAdd a resource argument for a Datastream route.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to create'.
  positional: bool, if True, means that the resource is a positional rather
    than a flag.
routez--routezThe route {}.TrD   N)r   rS   r7   rT   r   rU   rV   rn   s        r   AddRouteResourceArgr   I  s_     DD 11


 

 
 
&	. !k&)r   N)r9   )rm   )rt   )r   )r   )TT)T)&__doc__googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr   (googlecloudsdk.command_lib.util.conceptsr   r   rw   rx   ru   rv   rz   ry   r|   r{   r~   r}   r   r   r   r   r   r   r   r    r)   r,   r0   r3   r7   r`   rc   rk   ro   r   r   r   r   r   r   <module>r      s    5 ) 5 D G' #8" 8( $8# 8. *>. *>- )@- )@. *2. *2!+ 'F + 'D$  <    K
$$$$	$ 04-1	K\:9$ 04*6jZ(*r   