#[non_exhaustive]pub struct ImportContext {
pub uri: String,
pub database: String,
pub kind: String,
pub file_type: SqlFileType,
pub csv_import_options: Option<SqlCsvImportOptions>,
pub import_user: String,
pub bak_import_options: Option<SqlBakImportOptions>,
pub sql_import_options: Option<SqlImportOptions>,
pub tde_import_options: Option<SqlTdeImportOptions>,
/* private fields */
}Expand description
Database instance import context.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.uri: StringPath 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: StringThe 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: StringThis is always sql#importContext.
file_type: SqlFileTypeThe file type for the specified uri.`SQL: The file contains SQL statements. \CSV`: The file contains CSV data.
csv_import_options: Option<SqlCsvImportOptions>Options for importing data as CSV.
import_user: StringThe PostgreSQL user for this import operation. PostgreSQL instances only.
bak_import_options: Option<SqlBakImportOptions>Import parameters specific to SQL Server .BAK files
sql_import_options: Option<SqlImportOptions>Optional. Options for importing data from SQL statements.
tde_import_options: Option<SqlTdeImportOptions>Optional. Import parameters specific to SQL Server TDE certificates
Implementations§
Source§impl ImportContext
impl ImportContext
pub fn new() -> Self
Sourcepub fn set_database<T: Into<String>>(self, v: T) -> Self
pub fn set_database<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_file_type<T: Into<SqlFileType>>(self, v: T) -> Self
pub fn set_file_type<T: Into<SqlFileType>>(self, v: T) -> Self
Sourcepub fn set_csv_import_options<T>(self, v: T) -> Selfwhere
T: Into<SqlCsvImportOptions>,
pub fn set_csv_import_options<T>(self, v: T) -> Selfwhere
T: Into<SqlCsvImportOptions>,
Sets the value of csv_import_options.
§Example
use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
let x = ImportContext::new().set_csv_import_options(SqlCsvImportOptions::default()/* use setters */);Sourcepub fn set_or_clear_csv_import_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<SqlCsvImportOptions>,
pub fn set_or_clear_csv_import_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<SqlCsvImportOptions>,
Sets or clears the value of csv_import_options.
§Example
use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
let x = ImportContext::new().set_or_clear_csv_import_options(Some(SqlCsvImportOptions::default()/* use setters */));
let x = ImportContext::new().set_or_clear_csv_import_options(None::<SqlCsvImportOptions>);Sourcepub fn set_import_user<T: Into<String>>(self, v: T) -> Self
pub fn set_import_user<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_bak_import_options<T>(self, v: T) -> Selfwhere
T: Into<SqlBakImportOptions>,
pub fn set_bak_import_options<T>(self, v: T) -> Selfwhere
T: Into<SqlBakImportOptions>,
Sets the value of bak_import_options.
§Example
use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
let x = ImportContext::new().set_bak_import_options(SqlBakImportOptions::default()/* use setters */);Sourcepub fn set_or_clear_bak_import_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<SqlBakImportOptions>,
pub fn set_or_clear_bak_import_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<SqlBakImportOptions>,
Sets or clears the value of bak_import_options.
§Example
use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
let x = ImportContext::new().set_or_clear_bak_import_options(Some(SqlBakImportOptions::default()/* use setters */));
let x = ImportContext::new().set_or_clear_bak_import_options(None::<SqlBakImportOptions>);Sourcepub fn set_sql_import_options<T>(self, v: T) -> Selfwhere
T: Into<SqlImportOptions>,
pub fn set_sql_import_options<T>(self, v: T) -> Selfwhere
T: Into<SqlImportOptions>,
Sets the value of sql_import_options.
§Example
use google_cloud_sql_v1::model::import_context::SqlImportOptions;
let x = ImportContext::new().set_sql_import_options(SqlImportOptions::default()/* use setters */);Sourcepub fn set_or_clear_sql_import_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<SqlImportOptions>,
pub fn set_or_clear_sql_import_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<SqlImportOptions>,
Sets or clears the value of sql_import_options.
§Example
use google_cloud_sql_v1::model::import_context::SqlImportOptions;
let x = ImportContext::new().set_or_clear_sql_import_options(Some(SqlImportOptions::default()/* use setters */));
let x = ImportContext::new().set_or_clear_sql_import_options(None::<SqlImportOptions>);Sourcepub fn set_tde_import_options<T>(self, v: T) -> Selfwhere
T: Into<SqlTdeImportOptions>,
pub fn set_tde_import_options<T>(self, v: T) -> Selfwhere
T: Into<SqlTdeImportOptions>,
Sets the value of tde_import_options.
§Example
use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
let x = ImportContext::new().set_tde_import_options(SqlTdeImportOptions::default()/* use setters */);Sourcepub fn set_or_clear_tde_import_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<SqlTdeImportOptions>,
pub fn set_or_clear_tde_import_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<SqlTdeImportOptions>,
Sets or clears the value of tde_import_options.
§Example
use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
let x = ImportContext::new().set_or_clear_tde_import_options(Some(SqlTdeImportOptions::default()/* use setters */));
let x = ImportContext::new().set_or_clear_tde_import_options(None::<SqlTdeImportOptions>);Trait Implementations§
Source§impl Clone for ImportContext
impl Clone for ImportContext
Source§fn clone(&self) -> ImportContext
fn clone(&self) -> ImportContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more