# Google Cloud Sql Admin V1 Client - Class ImportContext (1.9.0)

1.9.0 (latest) 1.8.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.1 1.2.6 1.1.0 1.0.0 0.19.0 0.18.0 0.17.1 0.16.1 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.1 0.3.1 0.2.12 Reference documentation and code samples for the Google Cloud Sql Admin V1 Client class ImportContext.

Database instance import context.

Generated from protobuf message `google.cloud.sql.v1.ImportContext`

## Namespace

Google \\ Cloud \\ Sql \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ uri` | `string` Path to the import file in Cloud Storage, in the form `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported when `fileType` is `SQL`. The instance must have write permissions to the bucket and read access to the file. |
| `↳ database` | `string` The target database for the import. If `fileType` is `SQL`, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. For entire instance parallel import operations, the database is overridden by the database name stored in subdirectory name. If `fileType` is `CSV`, one database must be specified. |
| `↳ kind` | `string` This is always `sql#importContext`. |
| `↳ file_type` | `int` The file type for the specified uri.\`SQL`: The file contains SQL statements. \`CSV\`: The file contains CSV data. |
| `↳ csv_import_options` | `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlCsvImportOptions` Options for importing data as CSV. |
| `↳ import_user` | `string` The PostgreSQL user for this import operation. PostgreSQL instances only. |
| `↳ bak_import_options` | `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlBakImportOptions` Import parameters specific to SQL Server .BAK files |
| `↳ sql_import_options` | `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlImportOptions` Optional. Options for importing data from SQL statements. |
| `↳ tde_import_options` | `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlTdeImportOptions` Optional. Import parameters specific to SQL Server TDE certificates |

### getUri

Path to the import file in Cloud Storage, in the form
`gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
when `fileType` is `SQL`. The instance must have
write permissions to the bucket and read access to the file.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setUri

Path to the import file in Cloud Storage, in the form
`gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
when `fileType` is `SQL`. The instance must have
write permissions to the bucket and read access to the file.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDatabase

The target database for the import. If `fileType` is `SQL`, this field
is required only if the import file does not specify a database, and is
overridden by any database specification in the import file. For entire
instance parallel import operations, the database is overridden by the
database name stored in subdirectory name. If
`fileType` is `CSV`, one database must be specified.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDatabase

The target database for the import. If `fileType` is `SQL`, this field
is required only if the import file does not specify a database, and is
overridden by any database specification in the import file. For entire
instance parallel import operations, the database is overridden by the
database name stored in subdirectory name. If
`fileType` is `CSV`, one database must be specified.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getKind

This is always `sql#importContext`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setKind

This is always `sql#importContext`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFileType

The file type for the specified uri.\`SQL`: The file
contains SQL statements. \`CSV\`: The file contains CSV data.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [SqlFileType](https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.SqlFileType). |

### setFileType

The file type for the specified uri.\`SQL`: The file
contains SQL statements. \`CSV\`: The file contains CSV data.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [SqlFileType](https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.SqlFileType). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCsvImportOptions

Options for importing data as CSV.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlCsvImportOptions|null` |   |

### hasCsvImportOptions

### clearCsvImportOptions

### setCsvImportOptions

Options for importing data as CSV.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlCsvImportOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getImportUser

The PostgreSQL user for this import operation. PostgreSQL instances only.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setImportUser

The PostgreSQL user for this import operation. PostgreSQL instances only.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBakImportOptions

Import parameters specific to SQL Server .BAK files

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlBakImportOptions|null` |   |

### hasBakImportOptions

### clearBakImportOptions

### setBakImportOptions

Import parameters specific to SQL Server .BAK files

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlBakImportOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSqlImportOptions

Optional. Options for importing data from SQL statements.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlImportOptions|null` |   |

### hasSqlImportOptions

### clearSqlImportOptions

### setSqlImportOptions

Optional. Options for importing data from SQL statements.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlImportOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTdeImportOptions

Optional. Import parameters specific to SQL Server TDE certificates

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlTdeImportOptions|null` |   |

### hasTdeImportOptions

### clearTdeImportOptions

### setTdeImportOptions

Optional. Import parameters specific to SQL Server TDE certificates

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext.SqlTdeImportOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |