
                         f    d Z ddlmZ ddlmZ ddlmZ dZdZdZdZd	Z	d
Z
ddZd Zd Zd ZddZy)z6Flags and helpers for the Datastream related commands.    )absolute_import)division)unicode_literalsa    Path to a YAML (or JSON) file containing the MySQL data sources to avoid backfilling.

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

  ```
    {
      "mysqlDatabases": [
        {
          "database":"sample_database",
          "mysqlTables": [
            {
              "table": "sample_table",
              "mysqlColumns": [
                {
                  "column": "sample_column",
                }
                ]
            }
          ]
        }
      ]
    }
  ```
a    Path to a YAML (or JSON) file containing the Oracle data sources to avoid backfilling.

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

  ```
    {
      "oracleSchemas": [
        {
          "schema": "SAMPLE",
          "oracleTables": [
            {
              "table": "SAMPLE_TABLE",
              "oracleColumns": [
                {
                  "column": "COL",
                }
              ]
            }
          ]
        }
      ]
    }
  ```
a    Path to a YAML (or JSON) file containing the PostgreSQL data sources to avoid backfilling.

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

  ```
    {
      "postgresqlSchemas": [
        {
          "schema": "SAMPLE",
          "postgresqlTables": [
            {
              "table": "SAMPLE_TABLE",
              "postgresqlColumns": [
                {
                  "column": "COL",
                }
              ]
            }
          ]
        }
      ]
    }
  ```
a    Path to a YAML (or JSON) file containing the SQL Server data sources to avoid backfilling.

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

  ```
    {
      "schemas": [
        {
          "schema": "SAMPLE",
          "tables": [
            {
              "table": "SAMPLE_TABLE",
              "columns": [
                {
                  "column": "COL",
                }
              ]
            }
          ]
        }
      ]
    }
  ```
aF    Path to a YAML (or JSON) file containing the Salesforce data sources to avoid backfilling.

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

  ```
    {
      "objects": [
        {
          "objectName": "SAMPLE",
        },
        {
          "objectName": "SAMPLE2",
        }
      ]
    }
  ```
a     Path to a YAML (or JSON) file containing the MongoDB data sources to avoid backfilling.

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

  ```
    {
      "databases": [
        {
          "database":"sample_database",
          "collections": [
            {
              "collection": "sample_collection",
              "fields": [
                {
                  "field": "sample_field",
                }
              ]
            }
          ]
        }
      ]
    }
  ```
c                 0    d}| j                  d||       y)z/Adds a --display-name flag to the given parser.zFriendly name for the stream.z--display-name)helprequiredNadd_argument)parserr   	help_texts      :lib/googlecloudsdk/command_lib/datastream/streams/flags.pyAddDisplayNameFlagr      s    1)&YJ    c                 .    d}| j                  d|       y)z.Adds a --update-mask flag to the given parser.a  Used to specify the fields to be overwritten in the stream resource by the update.
  If the update mask is used, then a field will be overwritten only if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
  This is a comma-separated list of fully qualified names of fields, written as snake_case or camelCase. Example: "display_name, source_config.oracle_source_config".z--update-maskr   Nr	   r   r   s     r   AddUpdateMaskFlagr      s    i) 	oI6r   c                 .    d}| j                  d|       y)z(Adds a --state flag to the given parser.z3Stream state, can be set to: "RUNNING" or "PAUSED".z--stater   Nr	   r   s     r   AddStateFlagr      s    G)ii0r   c                     | j                  d      }|j                  dd|j                         z  dd       |j                  dd	|z  dd       y
)z;Adds a --validate-only or --force flag to the given parser.Tmutexz--validate-onlyzROnly validate the stream, but do not %s any resources.
      The default is false.
store_trueF)r   actiondefaultz--forcez$%s the stream without validating it.N)	add_groupr
   lower)r   verbvalidation_groups      r   AddValidationGroupr       sk    %%D%1!%.    5<	   r   c                    | j                  |d      }|j                  ddd       |j                         }|j                  ddd       |j                  d	      }|j                  d
t               |j                  dt               |j                  dt               |j                  dt
               |j                  dt               |j                  dt               y)zCAdds a --backfiill-all or --backfill-none flag to the given parser.T)r   r   z--backfill-nonezDo not automatically backfill any objects. This flag is equivalent
      to selecting the Manual backfill type in the Google Cloud console.r   )r   r   z--backfill-allzAutomatically backfill objects included in the stream source
      configuration. Specific objects can be excluded. This flag is equivalent
      to selecting the Automatic backfill type in the Google Cloud console.r   z--oracle-excluded-objectsr   z--mysql-excluded-objectsz--postgresql-excluded-objectsz--sqlserver-excluded-objectsz--salesforce-excluded-objectsz--mongodb-excluded-objectsN)r   r
   "_ORACLE_EXCLUDED_OBJECTS_HELP_TEXT!_MYSQL_EXCLUDED_OBJECTS_HELP_TEXT&_POSTGRESQL_EXCLUDED_OBJECTS_HELP_TEXT%_SQLSERVER_EXCLUDED_OBJECTS_HELP_TEXT&_SALESFORCE_EXCLUDED_OBJECTS_HELP_TEXT#_MONGODB_EXCLUDED_OBJECTS_HELP_TEXT)r   r   backfill_groupbackfill_all_groupbackfill_all_excluded_objectss        r   AddBackfillStrategyGroupr+      s   ##XT#B.L	  
 &//1!!O  "  #5">">T">"J,,!(J -   ,, 'H -   ,,%1 -   ,,$0 -   ,,%1 -   ,,". - r   N)T)__doc__
__future__r   r   r   r#   r"   r$   r%   r&   r'   r   r   r   r    r+    r   r   <module>r/      s]    = &  '% !4& "4* &4) %4* &&' #6K71 %r   