
    [                     (   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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#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.    )absolute_import)division)unicode_literals)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",
              }
            ]
          }
        ]
      }
    }
  ```
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   X  &    		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   h  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   p  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#   x  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    GetPrivateConnectionResourceSpecr3     r0   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   GetStreamResourceSpecr6     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%   routesIdr2   r&   r'   r(   )r   r)   r   r   r#   r*   r+   s    r   GetRouteResourceSpecr:     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rA   r=   z--forward-ssh-passwordz"          SSH password.
          r@   z--forward-ssh-private-keyzSSH private key..r8   zprivate-connection-namezThe connection profile {}.rA   --%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/   formatr3   r   ConceptParserAddToParser)parserverbrelease_track
positionalrA   r   connectivity_parserforward_ssh_parserpassword_groupprivate_connection_flag_nameresource_specss              r   AddConnectionProfileResourceArgrc     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=   rA   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.rF   z--connection-profile-namez&Resource ID of the connection profile.r    rI   rJ   z"--connection-profile-name.locationrN   rO   N)rQ   rR   r	   rV   r/   r   rX   rY   )rZ   connection_profile_parserrb   s      r   'AddConnectionProfileDiscoverResourceArgrf     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.networksri   )r%   networkproject)r   r)   r*   )rj   s    r   GetVpcResourceSpecrn     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 {}.TrG   N)r	   rV   r3   rW   r   rX   rY   rZ   r[   r]   r   rb   s        r   AddPrivateConnectionResourceArgrr   +  s_     D!D 11

*
,
&
-
-d
3	. !k&)r   c                 &   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[        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
[*        R,                  " U
SU-  S/SU	-  S/0S9R/                  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.
rG   TrE   z--oracle-source-configrF   z--mysql-source-configz--postgresql-source-configupdatez--sqlserver-source-configz--salesforce-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 {}.rH   z-Resource ID of the source connection profile.r    rI   )rA   rK   rL   z2Resource ID of the destination connection profile.rM   rN   rO   N)rQ   rR   r   rS   rT   $_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 _MONGODB_SOURCE_CONFIG_HELP_TEXTr	   rV   r6   rW   r/   r   rX   rY   )rZ   r[   r\   rA   source_parsersource_config_parser_groupdestination_parserdestination_config_parser_groupsource_fielddestination_fieldrb   s              r   AddStreamResourceArgr   F  s    ""H"5-,66t  7  %))3@					4 /%D * F ))2?					3 .%C * E ))"		 65	 *  ))!		 54	 *  ))"		 65	 *  ))+ * 
 ''':$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.TrG   z--stream.locationrN   rO   N)r	   rV   r6   r   rX   rY   )rZ   rb   s     r   AddStreamObjectResourceArgr     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 {}.TrG   N)r	   rV   r:   rW   r   rX   rY   rq   s        r   AddRouteResourceArgr     s_     DD 11


 

 
 
&	. !k&)r   N)r<   )rp   )rw   )r   )r    )TT)T)(__doc__
__future__r   r   r   googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr   (googlecloudsdk.command_lib.util.conceptsr   r	   rz   r{   rx   ry   r}   r|   r   r~   r   r   r   r   r   r   r   r#   r,   r/   r3   r6   r:   rc   rf   rn   rr   r   r   r   r"   r   r   <module>r      s    5 &  ' ( 5 D G' #8" 8( $8# 8. *>. *>- )@- )@. *2. *2$  <    K
$$$$	$ 04-1	K\:9$ 04*6dN(*r   