client.imports.put_syncs

A method of the Imports endpoint.

put_syncs(id: int, sync_id: int, source: dict, destination: dict, *, advanced_options: dict = None) Response

Replace all attributes of this sync

API URL: PUT /imports/{id}/syncs/{sync_id}

import civis
client = civis.APIClient()
response = client.imports.put_syncs(...)
Parameters:
idint

The ID for the import.

sync_idint

The ID of the sync to fetch.

sourcedict
  • database_tabledict
    • schemastr

      The database schema name.

    • tablestr

      The database table name.

    • use_without_schemabool

      This attribute is no longer available; defaults to false but cannot be used.

  • file : dict

  • google_worksheetdict
    • spreadsheetstr

      The spreadsheet document name.

    • spreadsheet_idstr

      The spreadsheet document id.

    • worksheetstr

      The worksheet tab name.

    • worksheet_idint

      The worksheet tab id.

  • pathstr

    The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet

destinationdict
  • database_tabledict
    • schemastr

      The database schema name.

    • tablestr

      The database table name.

    • use_without_schemabool

      This attribute is no longer available; defaults to false but cannot be used.

  • google_worksheetdict
    • spreadsheetstr

      The spreadsheet document name.

    • spreadsheet_idstr

      The spreadsheet document id.

    • worksheetstr

      The worksheet tab name.

    • worksheet_idint

      The worksheet tab id.

  • pathstr

    The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

advanced_optionsdict, optional
  • max_errorsint

    For Google Doc and Auto Imports. The maximum number of errors that can occur without the job failing.

  • existing_table_rowsstr

    For Google Doc and Auto Imports. The behavior if a table with the requested name already exists. One of “fail”, “truncate”, “append”, or “drop”. Defaults to “fail”.

  • first_row_is_headerbool

    For Google Doc and Auto Imports. A boolean value indicating whether or not the first row is a header row.

  • diststylestr

    For Auto Imports. The diststyle to use for a Redshift table.

  • distkeystr

    For Auto Imports. The distkey to use for a Redshift table.

  • sortkey1str

    For Auto Imports. The first sortkey to use for a Redshift table.

  • sortkey2str

    For Auto Imports. The second sortkey to use for a Redshift table.

  • column_delimiterstr

    For Auto Imports. The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. If column_delimiter is null or omitted, it will be auto-detected.

  • column_overridesdict

    For Auto Imports. Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

  • escapedbool

    For Auto Imports. If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

  • identity_columnstr

    For DB Syncs. The column or columns to use as primary key for incremental syncs. Should be a unique identifier. If blank, primary key columns will be auto-detected. If more than one identity column is specified, an identity column must be specified for each table. We recommend the primary key be a sequential data type such as an integer, double, timestamp, date, or float. If using a primary key that is a string data type, we recommend having a last_modified_column to ensure all data is synced to the destination table.

  • last_modified_columnstr

    For DB Syncs. The column to use to detect recently modified data for incremental syncs. Defaults to “Auto-Detect”, which will use the first column it finds containing either “modif” or “update” in the name. When specified, only rows where last_modified_column in the source >= last_modified_column in the destination will be synced.

  • row_chunk_sizeint

    For DB Syncs. If specified, will split the sync into chunks of this size.

  • wipe_destination_tablebool

    For DB Syncs. If true, will perform a full table refresh.

  • truncate_long_linesbool

    For DB Syncs to Redshift. When true, truncates column data to fit the column specification.

  • invalid_char_replacementstr

    For DB Syncs to Redshift. If specified, will replace each invalid UTF-8 character with this character. Must be a single ASCII character.

  • verify_table_row_countsbool

    For DB Syncs. When true, an error will be raised if the destination table does not have the same number of rows as the source table after the sync.

  • partition_column_namestr

    This parameter is deprecated

  • partition_schema_namestr

    This parameter is deprecated

  • partition_table_namestr

    This parameter is deprecated

  • partition_table_partition_column_min_namestr

    This parameter is deprecated

  • partition_table_partition_column_max_namestr

    This parameter is deprecated

  • mysql_catalog_matches_schemabool

    This attribute is no longer available; defaults to true but cannot be used.

  • chunking_methodstr

    This parameter is deprecated

  • export_actionstr

    For Google Doc Exports. The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

  • sql_querystr

    For Google Doc Exports. The SQL query for the export.

  • contact_listsstr

    This parameter is deprecated

  • soql_querystr

    This parameter is deprecated

  • include_deleted_recordsbool

    This parameter is deprecated

Returns:
civis.Response
  • id : int

  • sourcecivis.Response
    • idint

      The ID of the table or file, if available.

    • database_tablecivis.Response
      • schemastr

        The database schema name.

      • tablestr

        The database table name.

      • use_without_schemabool

        This attribute is no longer available; defaults to false but cannot be used.

    • filecivis.Response
      • idint

        The file id.

      • namestr

        The file name.

    • google_worksheetcivis.Response
      • spreadsheetstr

        The spreadsheet document name.

      • spreadsheet_idstr

        The spreadsheet document id.

      • worksheetstr

        The worksheet tab name.

      • worksheet_idint

        The worksheet tab id.

    • pathstr

      The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet

  • destinationcivis.Response
    • database_tablecivis.Response
      • schemastr

        The database schema name.

      • tablestr

        The database table name.

      • use_without_schemabool

        This attribute is no longer available; defaults to false but cannot be used.

    • google_worksheetcivis.Response
      • spreadsheetstr

        The spreadsheet document name.

      • spreadsheet_idstr

        The spreadsheet document id.

      • worksheetstr

        The worksheet tab name.

      • worksheet_idint

        The worksheet tab id.

    • pathstr

      The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

  • advanced_optionscivis.Response
    • max_errorsint

      For Google Doc and Auto Imports. The maximum number of errors that can occur without the job failing.

    • existing_table_rowsstr

      For Google Doc and Auto Imports. The behavior if a table with the requested name already exists. One of “fail”, “truncate”, “append”, or “drop”. Defaults to “fail”.

    • first_row_is_headerbool

      For Google Doc and Auto Imports. A boolean value indicating whether or not the first row is a header row.

    • diststylestr

      For Auto Imports. The diststyle to use for a Redshift table.

    • distkeystr

      For Auto Imports. The distkey to use for a Redshift table.

    • sortkey1str

      For Auto Imports. The first sortkey to use for a Redshift table.

    • sortkey2str

      For Auto Imports. The second sortkey to use for a Redshift table.

    • column_delimiterstr

      For Auto Imports. The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. If column_delimiter is null or omitted, it will be auto-detected.

    • column_overridescivis.Response

      For Auto Imports. Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

    • escapedbool

      For Auto Imports. If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

    • identity_columnstr

      For DB Syncs. The column or columns to use as primary key for incremental syncs. Should be a unique identifier. If blank, primary key columns will be auto-detected. If more than one identity column is specified, an identity column must be specified for each table. We recommend the primary key be a sequential data type such as an integer, double, timestamp, date, or float. If using a primary key that is a string data type, we recommend having a last_modified_column to ensure all data is synced to the destination table.

    • last_modified_columnstr

      For DB Syncs. The column to use to detect recently modified data for incremental syncs. Defaults to “Auto-Detect”, which will use the first column it finds containing either “modif” or “update” in the name. When specified, only rows where last_modified_column in the source >= last_modified_column in the destination will be synced.

    • row_chunk_sizeint

      For DB Syncs. If specified, will split the sync into chunks of this size.

    • wipe_destination_tablebool

      For DB Syncs. If true, will perform a full table refresh.

    • truncate_long_linesbool

      For DB Syncs to Redshift. When true, truncates column data to fit the column specification.

    • invalid_char_replacementstr

      For DB Syncs to Redshift. If specified, will replace each invalid UTF-8 character with this character. Must be a single ASCII character.

    • verify_table_row_countsbool

      For DB Syncs. When true, an error will be raised if the destination table does not have the same number of rows as the source table after the sync.

    • partition_column_namestr

      This parameter is deprecated

    • partition_schema_namestr

      This parameter is deprecated

    • partition_table_namestr

      This parameter is deprecated

    • partition_table_partition_column_min_namestr

      This parameter is deprecated

    • partition_table_partition_column_max_namestr

      This parameter is deprecated

    • mysql_catalog_matches_schemabool

      This attribute is no longer available; defaults to true but cannot be used.

    • chunking_methodstr

      This parameter is deprecated

    • export_actionstr

      For Google Doc Exports. The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

    • sql_querystr

      For Google Doc Exports. The SQL query for the export.

    • contact_listsstr

      This parameter is deprecated

    • soql_querystr

      This parameter is deprecated

    • include_deleted_recordsbool

      This parameter is deprecated