Class: Google::Apis::SqladminV1beta4::ImportContext

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/sqladmin_v1beta4/classes.rb,
generated/google/apis/sqladmin_v1beta4/representations.rb,
generated/google/apis/sqladmin_v1beta4/representations.rb

Overview

Database instance import context.

Defined Under Namespace

Classes: CsvImportOptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ ImportContext

Returns a new instance of ImportContext



1094
1095
1096
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 1094

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#csv_import_optionsGoogle::Apis::SqladminV1beta4::ImportContext::CsvImportOptions

Options for importing data as CSV. Importing CSV data using the Cloud SQL Admin API is not supported for PostgreSQL instances. Corresponds to the JSON property csvImportOptions



1057
1058
1059
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 1057

def csv_import_options
  @csv_import_options
end

#databaseString

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. If fileType is CSV, one database must be specified. Corresponds to the JSON property database

Returns:

  • (String)


1065
1066
1067
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 1065

def database
  @database
end

#file_typeString

The file type for the specified uri. SQL: The file contains SQL statements. CSV: The file contains CSV data. Importing CSV data using the Cloud SQL Admin API is not supported for PostgreSQL instances. Corresponds to the JSON property fileType

Returns:

  • (String)


1074
1075
1076
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 1074

def file_type
  @file_type
end

#import_userString

The PostgreSQL user for this import operation. Defaults to cloudsqlsuperuser. PostgreSQL instances only. Corresponds to the JSON property importUser

Returns:

  • (String)


1080
1081
1082
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 1080

def import_user
  @import_user
end

#kindString

This is always sql#importContext. Corresponds to the JSON property kind

Returns:

  • (String)


1085
1086
1087
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 1085

def kind
  @kind
end

#uriString

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. Corresponds to the JSON property uri

Returns:

  • (String)


1092
1093
1094
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 1092

def uri
  @uri
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1099
1100
1101
1102
1103
1104
1105
1106
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 1099

def update!(**args)
  @csv_import_options = args[:csv_import_options] if args.key?(:csv_import_options)
  @database = args[:database] if args.key?(:database)
  @file_type = args[:file_type] if args.key?(:file_type)
  @import_user = args[:import_user] if args.key?(:import_user)
  @kind = args[:kind] if args.key?(:kind)
  @uri = args[:uri] if args.key?(:uri)
end