From e85236f83082546593cce859baf93ea92eb7214f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 5 Oct 2020 13:15:11 -0700 Subject: [PATCH] feat(sqladmin)!: update the API BREAKING CHANGE: This release has breaking changes. #### sqladmin:v1beta4 The following keys were deleted: - schemas.DatabaseInstance.properties.suspensionReason.enumDescriptions - schemas.Flag.properties.appliesTo.enumDescriptions The following keys were added: - resources.projects.resources.instances.methods.startExternalSync.parameters.syncMode.enumDescriptions - resources.projects.resources.instances.methods.verifyExternalSyncSettings.parameters.syncMode.enumDescriptions - schemas.BackupRun.properties.backupKind.description - schemas.BackupRun.properties.backupKind.enum - schemas.BackupRun.properties.backupKind.enumDescriptions - schemas.BackupRun.properties.backupKind.type - schemas.DatabaseInstance.properties.suspensionReason.items.enumDescriptions - schemas.DenyMaintenancePeriod.description - schemas.DenyMaintenancePeriod.id - schemas.DenyMaintenancePeriod.properties.endDate.description - schemas.DenyMaintenancePeriod.properties.endDate.type - schemas.DenyMaintenancePeriod.properties.startDate.description - schemas.DenyMaintenancePeriod.properties.startDate.type - schemas.DenyMaintenancePeriod.properties.time.description - schemas.DenyMaintenancePeriod.properties.time.type - schemas.DenyMaintenancePeriod.type - schemas.Flag.properties.appliesTo.items.enumDescriptions - schemas.Settings.properties.activeDirectoryConfig.$ref - schemas.Settings.properties.activeDirectoryConfig.description - schemas.Settings.properties.collation.description - schemas.Settings.properties.collation.type - schemas.Settings.properties.denyMaintenancePeriods.description - schemas.Settings.properties.denyMaintenancePeriods.items.$ref - schemas.Settings.properties.denyMaintenancePeriods.type - schemas.SqlActiveDirectoryConfig.description - schemas.SqlActiveDirectoryConfig.id - schemas.SqlActiveDirectoryConfig.properties.domain.description - schemas.SqlActiveDirectoryConfig.properties.domain.type - schemas.SqlActiveDirectoryConfig.properties.kind.description - schemas.SqlActiveDirectoryConfig.properties.kind.type - schemas.SqlActiveDirectoryConfig.type - schemas.User.properties.type.description - schemas.User.properties.type.enum - schemas.User.properties.type.enumDescriptions - schemas.User.properties.type.type The following keys were changed: - id - name - resources.backupRuns.methods.delete.parameters.id.description - resources.backupRuns.methods.insert.description - resources.backupRuns.methods.list.description - resources.backupRuns.methods.list.parameters.pageToken.description - resources.databases.methods.get.description - resources.databases.methods.insert.description - resources.databases.methods.patch.description - resources.databases.methods.update.description - resources.flags.methods.list.parameters.databaseVersion.description - resources.instances.methods.addServerCa.description - resources.instances.methods.clone.description - resources.instances.methods.clone.parameters.instance.description - resources.instances.methods.demoteMaster.description - resources.instances.methods.export.description - resources.instances.methods.failover.description - resources.instances.methods.import.description - resources.instances.methods.insert.parameters.project.description - resources.instances.methods.list.parameters.filter.description - resources.instances.methods.list.parameters.pageToken.description - resources.instances.methods.listServerCas.description - resources.instances.methods.patch.description - resources.instances.methods.promoteReplica.description - resources.instances.methods.resetSslConfig.description - resources.instances.methods.restoreBackup.description - resources.instances.methods.rotateServerCa.description - resources.instances.methods.update.description - resources.operations.methods.list.description - resources.operations.methods.list.parameters.pageToken.description - resources.projects.resources.instances.methods.startExternalSync.description - resources.projects.resources.instances.methods.startExternalSync.parameters.project.description - resources.projects.resources.instances.methods.verifyExternalSyncSettings.description - resources.sslCerts.methods.createEphemeral.description - resources.sslCerts.methods.delete.description - resources.sslCerts.methods.get.description - resources.sslCerts.methods.insert.description - resources.tiers.methods.list.description - schemas.AclEntry.properties.expirationTime.description - schemas.AclEntry.properties.kind.description - schemas.AclEntry.properties.value.description - schemas.ApiWarning.properties.code.enumDescriptions - schemas.BackupConfiguration.properties.binaryLogEnabled.description - schemas.BackupConfiguration.properties.kind.description - schemas.BackupConfiguration.properties.startTime.description - schemas.BackupRun.properties.diskEncryptionConfiguration.description - schemas.BackupRun.properties.diskEncryptionStatus.description - schemas.BackupRun.properties.endTime.description - schemas.BackupRun.properties.enqueuedTime.description - schemas.BackupRun.properties.error.description - schemas.BackupRun.properties.id.description - schemas.BackupRun.properties.kind.description - schemas.BackupRun.properties.startTime.description - schemas.BackupRun.properties.status.enumDescriptions - schemas.BackupRun.properties.windowStartTime.description - schemas.BackupRunsListResponse.properties.kind.description - schemas.BackupRunsListResponse.properties.nextPageToken.description - schemas.BinLogCoordinates.properties.kind.description - schemas.CloneContext.properties.binLogCoordinates.description - schemas.CloneContext.properties.kind.description - schemas.Database.properties.charset.description - schemas.Database.properties.collation.description - schemas.Database.properties.etag.description - schemas.Database.properties.kind.description - schemas.Database.properties.name.description - schemas.Database.properties.project.description - schemas.DatabaseFlags.properties.name.description - schemas.DatabaseFlags.properties.value.description - schemas.DatabaseInstance.description - schemas.DatabaseInstance.properties.backendType.description - schemas.DatabaseInstance.properties.currentDiskSize.description - schemas.DatabaseInstance.properties.databaseVersion.description - schemas.DatabaseInstance.properties.diskEncryptionConfiguration.description - schemas.DatabaseInstance.properties.diskEncryptionStatus.description - schemas.DatabaseInstance.properties.etag.description - schemas.DatabaseInstance.properties.failoverReplica.description - schemas.DatabaseInstance.properties.failoverReplica.properties.available.description - schemas.DatabaseInstance.properties.failoverReplica.properties.name.description - schemas.DatabaseInstance.properties.gceZone.description - schemas.DatabaseInstance.properties.instanceType.description - schemas.DatabaseInstance.properties.instanceType.enumDescriptions - schemas.DatabaseInstance.properties.ipv6Address.description - schemas.DatabaseInstance.properties.kind.description - schemas.DatabaseInstance.properties.masterInstanceName.description - schemas.DatabaseInstance.properties.project.description - schemas.DatabaseInstance.properties.region.description - schemas.DatabaseInstance.properties.serviceAccountEmailAddress.description - schemas.DatabaseInstance.properties.state.description - schemas.DatabasesListResponse.properties.kind.description - schemas.DemoteMasterConfiguration.description - schemas.DemoteMasterConfiguration.properties.kind.description - schemas.DemoteMasterConfiguration.properties.mysqlReplicaConfiguration.description - schemas.DemoteMasterContext.description - schemas.DemoteMasterContext.properties.kind.description - schemas.DemoteMasterContext.properties.masterInstanceName.description - schemas.DemoteMasterContext.properties.replicaConfiguration.description - schemas.DemoteMasterContext.properties.verifyGtidConsistency.description - schemas.DemoteMasterMySqlReplicaConfiguration.properties.clientCertificate.description - schemas.DemoteMasterMySqlReplicaConfiguration.properties.clientKey.description - schemas.DemoteMasterMySqlReplicaConfiguration.properties.kind.description - schemas.DiskEncryptionConfiguration.properties.kind.description - schemas.DiskEncryptionStatus.properties.kind.description - schemas.ExportContext.properties.databases.description - schemas.ExportContext.properties.fileType.description - schemas.ExportContext.properties.kind.description - schemas.ExportContext.properties.sqlExportOptions.properties.mysqlExportOptions.properties.masterData.description - schemas.ExportContext.properties.sqlExportOptions.properties.tables.description - schemas.ExportContext.properties.uri.description - schemas.FailoverContext.properties.kind.description - schemas.FailoverContext.properties.settingsVersion.description - schemas.Flag.properties.allowedIntValues.description - schemas.Flag.properties.allowedStringValues.description - schemas.Flag.properties.appliesTo.description - schemas.Flag.properties.kind.description - schemas.Flag.properties.maxValue.description - schemas.Flag.properties.minValue.description - schemas.Flag.properties.name.description - schemas.Flag.properties.requiresRestart.description - schemas.Flag.properties.type.description - schemas.Flag.properties.type.enumDescriptions - schemas.FlagsListResponse.properties.kind.description - schemas.ImportContext.properties.bakImportOptions.properties.encryptionOptions.properties.certPath.description - schemas.ImportContext.properties.bakImportOptions.properties.encryptionOptions.properties.pvkPath.description - schemas.ImportContext.properties.csvImportOptions.properties.columns.description - schemas.ImportContext.properties.database.description - schemas.ImportContext.properties.fileType.description - schemas.ImportContext.properties.kind.description - schemas.ImportContext.properties.uri.description - schemas.InstancesDemoteMasterRequest.description - schemas.InstancesListResponse.properties.kind.description - schemas.InstancesListResponse.properties.nextPageToken.description - schemas.InstancesListServerCasResponse.properties.kind.description - schemas.IpConfiguration.properties.authorizedNetworks.description - schemas.IpConfiguration.properties.ipv4Enabled.description - schemas.IpConfiguration.properties.privateNetwork.description - schemas.IpConfiguration.properties.requireSsl.description - schemas.IpMapping.properties.timeToRetire.description - schemas.IpMapping.properties.type.description - schemas.IpMapping.properties.type.enumDescriptions - schemas.LocationPreference.description - schemas.LocationPreference.properties.followGaeApplication.description - schemas.LocationPreference.properties.kind.description - schemas.LocationPreference.properties.zone.description - schemas.MaintenanceWindow.description - schemas.MaintenanceWindow.properties.kind.description - schemas.MaintenanceWindow.properties.updateTrack.description - schemas.MaintenanceWindow.properties.updateTrack.enumDescriptions - schemas.MySqlReplicaConfiguration.properties.clientCertificate.description - schemas.MySqlReplicaConfiguration.properties.clientKey.description - schemas.MySqlReplicaConfiguration.properties.dumpFilePath.description - schemas.MySqlReplicaConfiguration.properties.kind.description - schemas.MySqlReplicaConfiguration.properties.verifyServerCertificate.description - schemas.OnPremisesConfiguration.properties.clientCertificate.description - schemas.OnPremisesConfiguration.properties.clientKey.description - schemas.OnPremisesConfiguration.properties.kind.description - schemas.Operation.description - schemas.Operation.properties.endTime.description - schemas.Operation.properties.error.description - schemas.Operation.properties.insertTime.description - schemas.Operation.properties.kind.description - schemas.Operation.properties.name.description - schemas.Operation.properties.operationType.description - schemas.Operation.properties.operationType.enumDescriptions - schemas.Operation.properties.startTime.description - schemas.Operation.properties.status.description - schemas.OperationError.properties.kind.description - schemas.OperationErrors.properties.kind.description - schemas.OperationsListResponse.properties.kind.description - schemas.OperationsListResponse.properties.nextPageToken.description - schemas.ReplicaConfiguration.description - schemas.ReplicaConfiguration.properties.failoverTarget.description - schemas.ReplicaConfiguration.properties.kind.description - schemas.ReplicaConfiguration.properties.mysqlReplicaConfiguration.description - schemas.Reschedule.properties.rescheduleType.enumDescriptions - schemas.Reschedule.properties.scheduleTime.description - schemas.RestoreBackupContext.description - schemas.RestoreBackupContext.properties.kind.description - schemas.RotateServerCaContext.properties.kind.description - schemas.RotateServerCaContext.properties.nextVersion.description - schemas.Settings.properties.activationPolicy.description - schemas.Settings.properties.activationPolicy.enumDescriptions - schemas.Settings.properties.authorizedGaeApplications.description - schemas.Settings.properties.availabilityType.description - schemas.Settings.properties.crashSafeReplicationEnabled.description - schemas.Settings.properties.dataDiskSizeGb.description - schemas.Settings.properties.dataDiskType.description - schemas.Settings.properties.dataDiskType.enumDescriptions - schemas.Settings.properties.databaseReplicationEnabled.description - schemas.Settings.properties.ipConfiguration.description - schemas.Settings.properties.kind.description - schemas.Settings.properties.locationPreference.description - schemas.Settings.properties.maintenanceWindow.description - schemas.Settings.properties.pricingPlan.description - schemas.Settings.properties.replicationType.description - schemas.Settings.properties.replicationType.enumDescriptions - schemas.Settings.properties.settingsVersion.description - schemas.Settings.properties.storageAutoResize.description - schemas.Settings.properties.storageAutoResizeLimit.description - schemas.Settings.properties.tier.description - schemas.Settings.properties.userLabels.description - schemas.SqlExternalSyncSettingError.description - schemas.SqlExternalSyncSettingError.properties.kind.description - schemas.SqlExternalSyncSettingError.properties.type.enum - schemas.SqlExternalSyncSettingError.properties.type.enumDescriptions - schemas.SqlInstancesVerifyExternalSyncSettingsResponse.properties.kind.description - schemas.SslCert.properties.commonName.description - schemas.SslCert.properties.createTime.description - schemas.SslCert.properties.expirationTime.description - schemas.SslCert.properties.kind.description - schemas.SslCertDetail.properties.certPrivateKey.description - schemas.SslCertsInsertRequest.properties.commonName.description - schemas.SslCertsInsertResponse.properties.clientCert.description - schemas.SslCertsInsertResponse.properties.kind.description - schemas.SslCertsInsertResponse.properties.serverCaCert.description - schemas.SslCertsListResponse.properties.kind.description - schemas.Tier.properties.kind.description - schemas.Tier.properties.tier.description - schemas.TiersListResponse.properties.kind.description - schemas.TruncateLogContext.properties.kind.description - schemas.TruncateLogContext.properties.logType.description - schemas.User.properties.etag.description - schemas.User.properties.host.description - schemas.User.properties.instance.description - schemas.User.properties.kind.description - schemas.User.properties.name.description - schemas.User.properties.project.description - schemas.UsersListResponse.properties.kind.description - schemas.UsersListResponse.properties.nextPageToken.description --- discovery/sqladmin-v1beta4.json | 633 +- src/apis/sqladmin/README.md | 47 + src/apis/sqladmin/index.ts | 35 + src/apis/sqladmin/package.json | 43 + src/apis/sqladmin/tsconfig.json | 10 + src/apis/sqladmin/v1beta4.ts | 9719 +++++++++++++++++++++++++++ src/apis/sqladmin/webpack.config.js | 70 + 7 files changed, 10295 insertions(+), 262 deletions(-) create mode 100644 src/apis/sqladmin/README.md create mode 100644 src/apis/sqladmin/index.ts create mode 100644 src/apis/sqladmin/package.json create mode 100644 src/apis/sqladmin/tsconfig.json create mode 100644 src/apis/sqladmin/v1beta4.ts create mode 100644 src/apis/sqladmin/webpack.config.js diff --git a/discovery/sqladmin-v1beta4.json b/discovery/sqladmin-v1beta4.json index ee0805a8630..3e124bf7f5a 100644 --- a/discovery/sqladmin-v1beta4.json +++ b/discovery/sqladmin-v1beta4.json @@ -22,10 +22,10 @@ "x16": "http://www.google.com/images/icons/product/search-16.gif", "x32": "http://www.google.com/images/icons/product/search-32.gif" }, - "id": "sql:v1beta4", + "id": "sqladmin:v1beta4", "kind": "discovery#restDescription", "mtlsRootUrl": "https://sqladmin.mtls.googleapis.com/", - "name": "sql", + "name": "sqladmin", "ownerDomain": "google.com", "ownerName": "Google", "parameters": { @@ -121,7 +121,7 @@ ], "parameters": { "id": { - "description": "The ID of the Backup Run to delete. To find a Backup Run ID, use the list\nmethod.", + "description": "The ID of the Backup Run to delete. To find a Backup Run ID, use the list method.", "format": "int64", "location": "path", "required": true, @@ -190,7 +190,7 @@ ] }, "insert": { - "description": "Creates a new backup run on demand. This method is applicable only to\nSecond Generation instances.", + "description": "Creates a new backup run on demand. This method is applicable only to Second Generation instances.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", "httpMethod": "POST", "id": "sql.backupRuns.insert", @@ -225,7 +225,7 @@ ] }, "list": { - "description": "Lists all backup runs associated with a given instance and configuration in\nthe reverse chronological order of the backup initiation time.", + "description": "Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", "httpMethod": "GET", "id": "sql.backupRuns.list", @@ -247,7 +247,7 @@ "type": "integer" }, "pageToken": { - "description": "A previously-returned page token representing part of the larger set of\nresults to view.", + "description": "A previously-returned page token representing part of the larger set of results to view.", "location": "query", "type": "string" }, @@ -311,7 +311,7 @@ ] }, "get": { - "description": "Retrieves a resource containing information about a database inside a Cloud\nSQL instance.", + "description": "Retrieves a resource containing information about a database inside a Cloud SQL instance.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", "httpMethod": "GET", "id": "sql.databases.get", @@ -350,7 +350,7 @@ ] }, "insert": { - "description": "Inserts a resource containing information about a database inside a Cloud\nSQL instance.", + "description": "Inserts a resource containing information about a database inside a Cloud SQL instance.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases", "httpMethod": "POST", "id": "sql.databases.insert", @@ -417,7 +417,7 @@ ] }, "patch": { - "description": "Partially updates a resource containing information about a database inside\na Cloud SQL instance. This method supports patch semantics.", + "description": "Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", "httpMethod": "PATCH", "id": "sql.databases.patch", @@ -459,7 +459,7 @@ ] }, "update": { - "description": "Updates a resource containing information about a database inside a Cloud\nSQL instance.", + "description": "Updates a resource containing information about a database inside a Cloud SQL instance.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", "httpMethod": "PUT", "id": "sql.databases.update", @@ -512,7 +512,7 @@ "parameterOrder": [], "parameters": { "databaseVersion": { - "description": "Database type and version you want to retrieve flags for. By default, this\nmethod returns flags for all database types and versions.", + "description": "Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions.", "location": "query", "type": "string" } @@ -531,7 +531,7 @@ "instances": { "methods": { "addServerCa": { - "description": "Add a new trusted Certificate Authority (CA) version for the specified\ninstance. Required to prepare for a certificate rotation. If a CA version\nwas previously added but never used in a certificate rotation, this\noperation replaces that version. There cannot be more than one CA version\nwaiting to be rotated in.", + "description": "Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa", "httpMethod": "POST", "id": "sql.instances.addServerCa", @@ -563,7 +563,7 @@ ] }, "clone": { - "description": "Creates a Cloud SQL instance as a clone of the source instance. Using this\noperation might cause your instance to restart.", + "description": "Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/clone", "httpMethod": "POST", "id": "sql.instances.clone", @@ -573,7 +573,7 @@ ], "parameters": { "instance": { - "description": "The ID of the Cloud SQL instance to be cloned (source). This does not\ninclude the project ID.", + "description": "The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.", "location": "path", "required": true, "type": "string" @@ -630,7 +630,7 @@ ] }, "demoteMaster": { - "description": "Demotes the stand-alone instance to be a Cloud SQL read replica for an\nexternal database server.", + "description": "Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster", "httpMethod": "POST", "id": "sql.instances.demoteMaster", @@ -665,7 +665,7 @@ ] }, "export": { - "description": "Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL\ndump or CSV file.", + "description": "Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/export", "httpMethod": "POST", "id": "sql.instances.export", @@ -699,7 +699,7 @@ ] }, "failover": { - "description": "Failover the instance to its failover replica instance. Using this\noperation might cause your instance to restart.", + "description": "Failover the instance to its failover replica instance. Using this operation might cause your instance to restart.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/failover", "httpMethod": "POST", "id": "sql.instances.failover", @@ -766,7 +766,7 @@ ] }, "import": { - "description": "Imports data into a Cloud SQL instance from a SQL dump or CSV file in\nCloud Storage.", + "description": "Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/import", "httpMethod": "POST", "id": "sql.instances.import", @@ -809,7 +809,7 @@ ], "parameters": { "project": { - "description": "Project ID of the project to which the newly created Cloud SQL instances\nshould belong.", + "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", "location": "path", "required": true, "type": "string" @@ -837,7 +837,7 @@ ], "parameters": { "filter": { - "description": "A filter expression that filters resources listed in the response.\nThe expression is in the form of field:value. For example,\n'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per\ntheir JSON representation, such as 'settings.userLabels.auto_start:true'.\n\nMultiple filter queries are space-separated. For example.\n'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each\nexpression is an AND expression. However, you can include AND and OR\nexpressions explicitly.", + "description": "A filter expression that filters resources listed in the response. The expression is in the form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON representation, such as 'settings.userLabels.auto_start:true'. Multiple filter queries are space-separated. For example. 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly.", "location": "query", "type": "string" }, @@ -848,7 +848,7 @@ "type": "integer" }, "pageToken": { - "description": "A previously-returned page token representing part of the larger set of\nresults to view.", + "description": "A previously-returned page token representing part of the larger set of results to view.", "location": "query", "type": "string" }, @@ -869,7 +869,7 @@ ] }, "listServerCas": { - "description": "Lists all of the trusted Certificate Authorities (CAs) for the specified\ninstance. There can be up to three CAs listed: the CA that was used to sign\nthe certificate that is currently in use, a CA that has been added but not\nyet used to sign a certificate, and a CA used to sign a certificate that\nhas previously rotated out.", + "description": "Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas", "httpMethod": "GET", "id": "sql.instances.listServerCas", @@ -901,7 +901,7 @@ ] }, "patch": { - "description": "Updates settings of a Cloud SQL instance.\nThis method supports patch semantics.", + "description": "Updates settings of a Cloud SQL instance. This method supports patch semantics.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", "httpMethod": "PATCH", "id": "sql.instances.patch", @@ -936,7 +936,7 @@ ] }, "promoteReplica": { - "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance.\nUsing this operation might cause your instance to restart.", + "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica", "httpMethod": "POST", "id": "sql.instances.promoteReplica", @@ -968,7 +968,7 @@ ] }, "resetSslConfig": { - "description": "Deletes all client certificates and generates a new server SSL certificate\nfor the instance.", + "description": "Deletes all client certificates and generates a new server SSL certificate for the instance.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig", "httpMethod": "POST", "id": "sql.instances.resetSslConfig", @@ -1032,7 +1032,7 @@ ] }, "restoreBackup": { - "description": "Restores a backup of a Cloud SQL instance. Using this operation might cause\nyour instance to restart.", + "description": "Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup", "httpMethod": "POST", "id": "sql.instances.restoreBackup", @@ -1067,7 +1067,7 @@ ] }, "rotateServerCa": { - "description": "Rotates the server certificate to one signed by the Certificate Authority\n(CA) version previously added with the addServerCA method.", + "description": "Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa", "httpMethod": "POST", "id": "sql.instances.rotateServerCa", @@ -1201,7 +1201,7 @@ ] }, "update": { - "description": "Updates settings of a Cloud SQL instance. Using this operation might cause\nyour instance to restart.", + "description": "Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", "httpMethod": "PUT", "id": "sql.instances.update", @@ -1272,7 +1272,7 @@ ] }, "list": { - "description": "Lists all instance operations that have been performed on the given Cloud\nSQL instance in the reverse chronological order of the start time.", + "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.", "flatPath": "sql/v1beta4/projects/{project}/operations", "httpMethod": "GET", "id": "sql.operations.list", @@ -1292,7 +1292,7 @@ "type": "integer" }, "pageToken": { - "description": "A previously-returned page token representing part of the larger set of\nresults to view.", + "description": "A previously-returned page token representing part of the larger set of results to view.", "location": "query", "type": "string" }, @@ -1354,7 +1354,7 @@ ] }, "startExternalSync": { - "description": "Start External master migration.", + "description": "Start External primary instance migration.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync", "httpMethod": "POST", "id": "sql.projects.instances.startExternalSync", @@ -1370,7 +1370,7 @@ "type": "string" }, "project": { - "description": "ID of the project that contains the first generation instance.", + "description": "ID of the project that contains the instance.", "location": "path", "required": true, "type": "string" @@ -1382,6 +1382,11 @@ "ONLINE", "OFFLINE" ], + "enumDescriptions": [ + "Unknown external sync mode, will be defaulted to ONLINE mode", + "Online external sync will set up replication after initial data external sync", + "Offline external sync only dumps and loads a one-time snapshot of the primary instance's data" + ], "location": "query", "type": "string" } @@ -1396,7 +1401,7 @@ ] }, "verifyExternalSyncSettings": { - "description": "Verify External master external sync settings.", + "description": "Verify External primary instance external sync settings.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings", "httpMethod": "POST", "id": "sql.projects.instances.verifyExternalSyncSettings", @@ -1424,6 +1429,11 @@ "ONLINE", "OFFLINE" ], + "enumDescriptions": [ + "Unknown external sync mode, will be defaulted to ONLINE mode", + "Online external sync will set up replication after initial data external sync", + "Offline external sync only dumps and loads a one-time snapshot of the primary instance's data" + ], "location": "query", "type": "string" }, @@ -1449,7 +1459,7 @@ "sslCerts": { "methods": { "createEphemeral": { - "description": "Generates a short-lived X509 certificate containing the provided public key\nand signed by a private key specific to the target instance. Users may use\nthe certificate to authenticate as themselves when connecting to the\ndatabase.", + "description": "Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral", "httpMethod": "POST", "id": "sql.sslCerts.createEphemeral", @@ -1484,7 +1494,7 @@ ] }, "delete": { - "description": "Deletes the SSL certificate. For First Generation instances, the\ncertificate remains valid until the instance is restarted.", + "description": "Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", "httpMethod": "DELETE", "id": "sql.sslCerts.delete", @@ -1523,7 +1533,7 @@ ] }, "get": { - "description": "Retrieves a particular SSL certificate. Does not include the private key\n(required for usage). The private key must be saved from the response to\ninitial creation.", + "description": "Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", "httpMethod": "GET", "id": "sql.sslCerts.get", @@ -1562,7 +1572,7 @@ ] }, "insert": { - "description": "Creates an SSL certificate and returns it along with the private key and\nserver certificate authority. The new certificate will not be usable until\nthe instance is restarted.", + "description": "Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.", "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", "httpMethod": "POST", "id": "sql.sslCerts.insert", @@ -1633,7 +1643,7 @@ "tiers": { "methods": { "list": { - "description": "Lists all available machine types (tiers) for Cloud SQL, for example,\ndb-n1-standard-1. For related information, see Pricing.", + "description": "Lists all available machine types (tiers) for Cloud SQL, for example, db-n1-standard-1. For related information, see Pricing.", "flatPath": "sql/v1beta4/projects/{project}/tiers", "httpMethod": "GET", "id": "sql.tiers.list", @@ -1818,7 +1828,7 @@ } } }, - "revision": "20200518", + "revision": "20200919", "rootUrl": "https://sqladmin.googleapis.com/", "schemas": { "AclEntry": { @@ -1826,12 +1836,12 @@ "id": "AclEntry", "properties": { "expirationTime": { - "description": "The time when this access control entry expires in RFC 3339 format, for example\n2012-11-15T16:19:00.094Z.", + "description": "The time when this access control entry expires in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.", "format": "google-datetime", "type": "string" }, "kind": { - "description": "This is always sql#aclEntry.", + "description": "This is always *sql#aclEntry*.", "type": "string" }, "name": { @@ -1839,7 +1849,7 @@ "type": "string" }, "value": { - "description": "The whitelisted value for the access control list.", + "description": "The allowlisted value for the access control list.", "type": "string" } }, @@ -1857,7 +1867,7 @@ ], "enumDescriptions": [ "An unknown or unset warning type from Cloud SQL API.", - "Warning when one or more regions are not reachable. The returned result\nset may be incomplete." + "Warning when one or more regions are not reachable. The returned result set may be incomplete." ], "type": "string" }, @@ -1873,7 +1883,7 @@ "id": "BackupConfiguration", "properties": { "binaryLogEnabled": { - "description": "(MySQL only) Whether binary log is enabled. If backup configuration is\ndisabled, binarylog must be disabled as well.", + "description": "(MySQL only) Whether binary log is enabled. If backup configuration is disabled, binarylog must be disabled as well.", "type": "boolean" }, "enabled": { @@ -1881,7 +1891,7 @@ "type": "boolean" }, "kind": { - "description": "This is always sql#backupConfiguration.", + "description": "This is always *sql#backupConfiguration*.", "type": "string" }, "location": { @@ -1897,7 +1907,7 @@ "type": "boolean" }, "startTime": { - "description": "Start time for the daily backup configuration in UTC timezone in the 24\nhour format - HH:MM.", + "description": "Start time for the daily backup configuration in UTC timezone in the 24 hour format - *HH:MM*.", "type": "string" } }, @@ -1907,34 +1917,48 @@ "description": "A BackupRun resource.", "id": "BackupRun", "properties": { + "backupKind": { + "description": "Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.", + "enum": [ + "SQL_BACKUP_KIND_UNSPECIFIED", + "SNAPSHOT", + "PHYSICAL" + ], + "enumDescriptions": [ + "This is an unknown BackupKind.", + "The snapshot based backups", + "Physical backups" + ], + "type": "string" + }, "description": { "description": "The description of this run, only applicable to on-demand backups.", "type": "string" }, "diskEncryptionConfiguration": { "$ref": "DiskEncryptionConfiguration", - "description": "Encryption configuration specific to a backup.\nApplies only to Second Generation instances." + "description": "Encryption configuration specific to a backup. Applies only to Second Generation instances." }, "diskEncryptionStatus": { "$ref": "DiskEncryptionStatus", - "description": "Encryption status specific to a backup.\nApplies only to Second Generation instances." + "description": "Encryption status specific to a backup. Applies only to Second Generation instances." }, "endTime": { - "description": "The time the backup operation completed in UTC timezone in RFC 3339 format, for example\n2012-11-15T16:19:00.094Z.", + "description": "The time the backup operation completed in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.", "format": "google-datetime", "type": "string" }, "enqueuedTime": { - "description": "The time the run was enqueued in UTC timezone in RFC 3339 format, for example\n2012-11-15T16:19:00.094Z.", + "description": "The time the run was enqueued in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.", "format": "google-datetime", "type": "string" }, "error": { "$ref": "OperationError", - "description": "Information about why the backup operation failed. This is only present if\nthe run has the FAILED status." + "description": "Information about why the backup operation failed. This is only present if the run has the FAILED status." }, "id": { - "description": "The identifier for this backup run. Unique only for a specific Cloud SQL\ninstance.", + "description": "The identifier for this backup run. Unique only for a specific Cloud SQL instance.", "format": "int64", "type": "string" }, @@ -1943,7 +1967,7 @@ "type": "string" }, "kind": { - "description": "This is always sql#backupRun.", + "description": "This is always *sql#backupRun*.", "type": "string" }, "location": { @@ -1955,7 +1979,7 @@ "type": "string" }, "startTime": { - "description": "The time the backup operation actually started in UTC timezone in RFC 3339 format, for example\n2012-11-15T16:19:00.094Z.", + "description": "The time the backup operation actually started in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.", "format": "google-datetime", "type": "string" }, @@ -1976,11 +2000,11 @@ "enumDescriptions": [ "The status of the run is unknown.", "The backup operation was enqueued.", - "The backup is overdue across a given backup window. Indicates a\nproblem. Example: Long-running operation in progress during\nthe whole window.", + "The backup is overdue across a given backup window. Indicates a problem. Example: Long-running operation in progress during the whole window.", "The backup is in progress.", "The backup failed.", "The backup was successful.", - "The backup was skipped (without problems) for a given backup\nwindow. Example: Instance was idle.", + "The backup was skipped (without problems) for a given backup window. Example: Instance was idle.", "The backup is about to be deleted.", "The backup deletion failed.", "The backup has been deleted." @@ -2002,7 +2026,7 @@ "type": "string" }, "windowStartTime": { - "description": "The start time of the backup window during which this the backup was\nattempted in RFC 3339\nformat, for example 2012-11-15T16:19:00.094Z.", + "description": "The start time of the backup window during which this the backup was attempted in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.", "format": "google-datetime", "type": "string" } @@ -2021,11 +2045,11 @@ "type": "array" }, "kind": { - "description": "This is always sql#backupRunsList.", + "description": "This is always *sql#backupRunsList*.", "type": "string" }, "nextPageToken": { - "description": "The continuation token, used to page through large result sets. Provide\nthis value in a subsequent request to return the next page of results.", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.", "type": "string" } }, @@ -2045,7 +2069,7 @@ "type": "string" }, "kind": { - "description": "This is always sql#binLogCoordinates.", + "description": "This is always *sql#binLogCoordinates*.", "type": "string" } }, @@ -2057,14 +2081,14 @@ "properties": { "binLogCoordinates": { "$ref": "BinLogCoordinates", - "description": "Binary log coordinates, if specified, identify the position up to which the\nsource instance should be cloned. If not specified, the source instance is\ncloned up to the most recent binary log coordinates." + "description": "Binary log coordinates, if specified, identify the position up to which the source instance is cloned. If not specified, the source instance is cloned up to the most recent binary log coordinates." }, "destinationInstanceName": { "description": "Name of the Cloud SQL instance to be created as a clone.", "type": "string" }, "kind": { - "description": "This is always sql#cloneContext.", + "description": "This is always *sql#cloneContext*.", "type": "string" }, "pitrTimestampMs": { @@ -2085,15 +2109,15 @@ "id": "Database", "properties": { "charset": { - "description": "The MySQL charset value.", + "description": "The Cloud SQL charset value.", "type": "string" }, "collation": { - "description": "The MySQL collation value.", + "description": "The Cloud SQL collation value.", "type": "string" }, "etag": { - "description": "This field is deprecated and will be removed from a future version of the\nAPI.", + "description": "This field is deprecated and will be removed from a future version of the API.", "type": "string" }, "instance": { @@ -2101,15 +2125,15 @@ "type": "string" }, "kind": { - "description": "This is always sql#database.", + "description": "This is always *sql#database*.", "type": "string" }, "name": { - "description": "The name of the database in the Cloud SQL instance. This does not include\nthe project ID or instance name.", + "description": "The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.", "type": "string" }, "project": { - "description": "The project ID of the project containing the Cloud SQL database. The Google\napps domain is prefixed if applicable.", + "description": "The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.", "type": "string" }, "selfLink": { @@ -2127,22 +2151,22 @@ "id": "DatabaseFlags", "properties": { "name": { - "description": "The name of the flag. These flags are passed at instance startup, so\ninclude both server options and system variables for MySQL. Flags should be\nspecified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud\nSQL documentation.", + "description": "The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags are specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation.", "type": "string" }, "value": { - "description": "The value of the flag. Booleans should be set to on for true\nand off for false. This field must be omitted if the flag\ndoesn't take a value.", + "description": "The value of the flag. Booleans are set to *on* for true and *off* for false. This field must be omitted if the flag doesn't take a value.", "type": "string" } }, "type": "object" }, "DatabaseInstance": { - "description": "A Cloud SQL instance resource.", + "description": "A Cloud SQL instance resource. Next field: 36", "id": "DatabaseInstance", "properties": { "backendType": { - "description": "FIRST_GEN: First Generation instance. MySQL only. SECOND_GEN: Second Generation instance or PostgreSQL\ninstance.
EXTERNAL: A database server that is not\nmanaged by Google.
This property is read-only; use the\ntier property in the settings object to determine\nthe database type and Second or First Generation.", + "description": " *SECOND_GEN*: Cloud SQL database instance. *EXTERNAL*: A database server that is not managed by Google. This property is read-only; use the *tier* property in the *settings* object to determine the database type.", "enum": [ "SQL_BACKEND_TYPE_UNSPECIFIED", "FIRST_GEN", @@ -2162,12 +2186,12 @@ "type": "string" }, "currentDiskSize": { - "description": "The current disk usage of the instance in bytes. This property has been\ndeprecated. Users should use the\n\"cloudsql.googleapis.com/database/disk/bytes_used\" metric in Cloud\nMonitoring API instead. Please see this\nannouncement for details.", + "description": "The current disk usage of the instance in bytes. This property has been deprecated. Use the \"cloudsql.googleapis.com/database/disk/bytes_used\" metric in Cloud Monitoring API instead. Please see this announcement for details.", "format": "int64", "type": "string" }, "databaseVersion": { - "description": "The database engine type and version. The databaseVersion\nfield can not be changed after instance creation. MySQL Second Generation\ninstances: MYSQL_5_7 (default) or MYSQL_5_6.\nPostgreSQL instances: POSTGRES_9_6 (default) or\nPOSTGRES_11 Beta MySQL First Generation\ninstances: MYSQL_5_6 (default) or MYSQL_5_5", + "description": "The database engine type and version. The *databaseVersion* field cannot be changed after instance creation. MySQL instances: *MYSQL_8_0*, *MYSQL_5_7* (default), or *MYSQL_5_6*. PostgreSQL instances: *POSTGRES_9_6*, *POSTGRES_10*, *POSTGRES_11* or *POSTGRES_12* (default). SQL Server instances: *SQLSERVER_2017_STANDARD* (default), *SQLSERVER_2017_ENTERPRISE*, *SQLSERVER_2017_EXPRESS*, or *SQLSERVER_2017_WEB*.", "enum": [ "SQL_DATABASE_VERSION_UNSPECIFIED", "MYSQL_5_1", @@ -2204,36 +2228,36 @@ }, "diskEncryptionConfiguration": { "$ref": "DiskEncryptionConfiguration", - "description": "Disk encryption configuration specific to an instance.\nApplies only to Second Generation instances." + "description": "Disk encryption configuration specific to an instance. Applies only to Second Generation instances." }, "diskEncryptionStatus": { "$ref": "DiskEncryptionStatus", - "description": "Disk encryption status specific to an instance.\nApplies only to Second Generation instances." + "description": "Disk encryption status specific to an instance. Applies only to Second Generation instances." }, "etag": { - "description": "This field is deprecated and will be removed from a future version of the\nAPI. Use the settings.settingsVersion field instead.", + "description": "This field is deprecated and will be removed from a future version of the API. Use the *settings.settingsVersion* field instead.", "type": "string" }, "failoverReplica": { - "description": "The name and status of the failover replica. This property is applicable\nonly to Second Generation instances.", + "description": "The name and status of the failover replica. This property is applicable only to Second Generation instances.", "properties": { "available": { - "description": "The availability status of the failover replica. A false status indicates\nthat the failover replica is out of sync. The master can only failover to\nthe failover replica when the status is true.", + "description": "The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The primary instance can only failover to the failover replica when the status is true.", "type": "boolean" }, "name": { - "description": "The name of the failover replica. If specified at instance creation, a\nfailover replica is created for the instance. The name\ndoesn't include the project ID. This property is applicable only to\nSecond Generation instances.", + "description": "The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances.", "type": "string" } }, "type": "object" }, "gceZone": { - "description": "The Compute Engine zone that the instance is currently serving from. This\nvalue could be different from the zone that was specified when the instance\nwas created if the instance has failed over to its secondary zone.", + "description": "The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone.", "type": "string" }, "instanceType": { - "description": "The instance type. This can be one of the following.\n
CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not\nreplicating from a master.
ON_PREMISES_INSTANCE: An\ninstance running on the\ncustomer's premises.
READ_REPLICA_INSTANCE: A Cloud SQL\ninstance configured as a read-replica.", + "description": "The instance type. This can be one of the following. *CLOUD_SQL_INSTANCE*: A Cloud SQL instance that is not replicating from a primary instance. *ON_PREMISES_INSTANCE*: An instance running on the customer's premises. *READ_REPLICA_INSTANCE*: A Cloud SQL instance configured as a read-replica.", "enum": [ "SQL_INSTANCE_TYPE_UNSPECIFIED", "CLOUD_SQL_INSTANCE", @@ -2243,7 +2267,7 @@ "enumDescriptions": [ "This is an unknown Cloud SQL instance type.", "A regular Cloud SQL instance.", - "An instance running on the customer's premises that is not managed by\nCloud SQL.", + "An instance running on the customer's premises that is not managed by Cloud SQL.", "A Cloud SQL instance acting as a read-replica." ], "type": "string" @@ -2256,15 +2280,15 @@ "type": "array" }, "ipv6Address": { - "description": "The IPv6 address assigned to the instance. This property is applicable only\nto First Generation instances.", + "description": "The IPv6 address assigned to the instance. (Deprecated) This property was applicable only to First Generation instances.", "type": "string" }, "kind": { - "description": "This is always sql#instance.", + "description": "This is always *sql#instance*.", "type": "string" }, "masterInstanceName": { - "description": "The name of the instance which will act as master in the replication setup.", + "description": "The name of the instance which will act as primary in the replication setup.", "type": "string" }, "maxDiskSize": { @@ -2281,11 +2305,11 @@ "description": "Configuration specific to on-premises instances." }, "project": { - "description": "The project ID of the project containing the Cloud SQL instance. The Google\napps domain is prefixed if applicable.", + "description": "The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.", "type": "string" }, "region": { - "description": "The geographical region. Can be us-central\n(FIRST_GEN instances only), us-central1\n(SECOND_GEN instances only), asia-east1 or\neurope-west1. Defaults to us-central or\nus-central1 depending on the instance type (First Generation\nor Second Generation). The region can not be changed after instance\ncreation.", + "description": "The geographical region. Can be *us-central* (*FIRST_GEN* instances only) *us-central1* (*SECOND_GEN* instances only) *asia-east1* or *europe-west1*. Defaults to *us-central* or *us-central1* depending on the instance type. The region cannot be changed after instance creation.", "type": "string" }, "replicaConfiguration": { @@ -2316,7 +2340,7 @@ "description": "SSL configuration." }, "serviceAccountEmailAddress": { - "description": "The service account email address assigned to the instance. This property\nis applicable only to Second Generation instances.", + "description": "The service account email address assigned to the instance. This property is applicable only to Second Generation instances.", "type": "string" }, "settings": { @@ -2324,7 +2348,7 @@ "description": "The user settings." }, "state": { - "description": "The current serving state of the Cloud SQL instance. This can be one of the\nfollowing.
RUNNABLE: The instance is running, or is ready\nto run when accessed.
SUSPENDED: The instance is not\navailable, for example due to problems with billing.\n
PENDING_CREATE: The instance is being created.\n
MAINTENANCE: The instance is down for maintenance.\n
FAILED: The instance creation failed.\n
UNKNOWN_STATE: The state of the instance is unknown.", + "description": "The current serving state of the Cloud SQL instance. This can be one of the following. *RUNNABLE*: The instance is running, or is ready to run when accessed. *SUSPENDED*: The instance is not available, for example due to problems with billing. *PENDING_CREATE*: The instance is being created. *MAINTENANCE*: The instance is down for maintenance. *FAILED*: The instance creation failed. *UNKNOWN_STATE*: The state of the instance is unknown.", "enum": [ "SQL_INSTANCE_STATE_UNSPECIFIED", "RUNNABLE", @@ -2347,13 +2371,6 @@ }, "suspensionReason": { "description": "If the instance state is SUSPENDED, the reason for the suspension.", - "enumDescriptions": [ - "This is an unknown suspension reason.", - "The instance is suspended due to billing issues (e.g., GCP account issue)", - "The instance is suspended due to illegal content (e.g., child pornography,\ncopyrighted material, etc.).", - "The instance is causing operational issues (e.g., causing the database\nto crash).", - "The KMS key used by the instance is either revoked or denied access to" - ], "items": { "enum": [ "SQL_SUSPENSION_REASON_UNSPECIFIED", @@ -2362,6 +2379,13 @@ "OPERATIONAL_ISSUE", "KMS_KEY_ISSUE" ], + "enumDescriptions": [ + "This is an unknown suspension reason.", + "The instance is suspended due to billing issues (for example:, GCP account issue)", + "The instance is suspended due to illegal content (for example:, child pornography, copyrighted material, etc.).", + "The instance is causing operational issues (for example:, causing the database to crash).", + "The KMS key used by the instance is either revoked or denied access to" + ], "type": "string" }, "type": "array" @@ -2381,45 +2405,45 @@ "type": "array" }, "kind": { - "description": "This is always sql#databasesList.", + "description": "This is always *sql#databasesList*.", "type": "string" } }, "type": "object" }, "DemoteMasterConfiguration": { - "description": "Read-replica configuration for connecting to the on-premises master.", + "description": "Read-replica configuration for connecting to the on-premises primary instance.", "id": "DemoteMasterConfiguration", "properties": { "kind": { - "description": "This is always sql#demoteMasterConfiguration.", + "description": "This is always *sql#demoteMasterConfiguration*.", "type": "string" }, "mysqlReplicaConfiguration": { "$ref": "DemoteMasterMySqlReplicaConfiguration", - "description": "MySQL specific configuration when replicating from a MySQL on-premises\nmaster. Replication configuration information such as the username,\npassword, certificates, and keys are not stored in the instance metadata.\nThe configuration information is used only to set up the replication\nconnection and is stored by MySQL in a file named master.info\nin the data directory." + "description": "MySQL specific configuration when replicating from a MySQL on-premises primary instance. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named *master.info* in the data directory." } }, "type": "object" }, "DemoteMasterContext": { - "description": "Database instance demote master context.", + "description": "Database instance demote primary instance context.", "id": "DemoteMasterContext", "properties": { "kind": { - "description": "This is always sql#demoteMasterContext.", + "description": "This is always *sql#demoteMasterContext*.", "type": "string" }, "masterInstanceName": { - "description": "The name of the instance which will act as on-premises master in the\nreplication setup.", + "description": "The name of the instance which will act as on-premises primary instance in the replication setup.", "type": "string" }, "replicaConfiguration": { "$ref": "DemoteMasterConfiguration", - "description": "Configuration specific to read-replicas replicating from the on-premises\nmaster." + "description": "Configuration specific to read-replicas replicating from the on-premises primary instance." }, "verifyGtidConsistency": { - "description": "Verify GTID consistency for demote operation. Default value:\nTrue. Second Generation instances only. Setting this flag to\nfalse enables you to bypass GTID consistency check between on-premises\nmaster and Cloud SQL instance during the demotion operation but also\nexposes you to the risk of future replication failures. Change the value\nonly if you know the reason for the GTID divergence and are confident that\ndoing so will not cause any replication issues.", + "description": "Verify GTID consistency for demote operation. Default value: *True*. Second Generation instances only. Setting this flag to false enables you to bypass GTID consistency check between on-premises primary instance and Cloud SQL instance during the demotion operation but also exposes you to the risk of future replication failures. Change the value only if you know the reason for the GTID divergence and are confident that doing so will not cause any replication issues.", "type": "boolean" } }, @@ -2434,15 +2458,15 @@ "type": "string" }, "clientCertificate": { - "description": "PEM representation of the slave's x509 certificate.", + "description": "PEM representation of the replica's x509 certificate.", "type": "string" }, "clientKey": { - "description": "PEM representation of the slave's private key. The corresponsing public key\nis encoded in the client's certificate. The format of the slave's private\nkey can be either PKCS #1 or PKCS #8.", + "description": "PEM representation of the replica's private key. The corresponsing public key is encoded in the client's certificate. The format of the replica's private key can be either PKCS #1 or PKCS #8.", "type": "string" }, "kind": { - "description": "This is always sql#demoteMasterMysqlReplicaConfiguration.", + "description": "This is always *sql#demoteMasterMysqlReplicaConfiguration*.", "type": "string" }, "password": { @@ -2456,12 +2480,31 @@ }, "type": "object" }, + "DenyMaintenancePeriod": { + "description": "Deny Maintenance Periods. This specifies a date range during when all CSA rollout will be denied.", + "id": "DenyMaintenancePeriod", + "properties": { + "endDate": { + "description": "\"deny maintenance period\" end date. If the year of the end date is empty, the year of the start date also must be empty. In this case, it means the deny maintenance period recurs every year. The date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01", + "type": "string" + }, + "startDate": { + "description": "\"deny maintenance period\" start date. If the year of the start date is empty, the year of the end date also must be empty. In this case, it means the deny maintenance period recurs every year. The date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01", + "type": "string" + }, + "time": { + "description": "Time in UTC when the \"deny maintenance period\" starts on start_date and ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00", + "type": "string" + } + }, + "type": "object" + }, "DiskEncryptionConfiguration": { "description": "Disk encryption configuration for an instance.", "id": "DiskEncryptionConfiguration", "properties": { "kind": { - "description": "This is always sql#diskEncryptionConfiguration.", + "description": "This is always *sql#diskEncryptionConfiguration*.", "type": "string" }, "kmsKeyName": { @@ -2476,7 +2519,7 @@ "id": "DiskEncryptionStatus", "properties": { "kind": { - "description": "This is always sql#diskEncryptionStatus.", + "description": "This is always *sql#diskEncryptionStatus*.", "type": "string" }, "kmsKeyVersionName": { @@ -2501,14 +2544,14 @@ "type": "object" }, "databases": { - "description": "Databases to be exported.
MySQL instances: If\nfileType is SQL and no database is specified, all\ndatabases are exported, except for the mysql system database.\nIf fileType is CSV, you can specify one database,\neither by using this property or by using the\ncsvExportOptions.selectQuery property, which takes precedence\nover this property.
PostgreSQL instances: You must specify\none database to be exported. If fileType is CSV,\nthis database must match the one specified in the\ncsvExportOptions.selectQuery property.", + "description": "Databases to be exported. *MySQL instances:* If *fileType* is *SQL* and no database is specified, all databases are exported, except for the *mysql* system database. If *fileType* is *CSV*, you can specify one database, either by using this property or by using the *csvExportOptions.selectQuery* property, which takes precedence over this property. *PostgreSQL instances:* You must specify one database to be exported. If *fileType* is *CSV*, this database must match the one specified in the *csvExportOptions.selectQuery* property.", "items": { "type": "string" }, "type": "array" }, "fileType": { - "description": "The file type for the specified uri.
SQL: The file\ncontains SQL statements.
CSV: The file contains CSV data.", + "description": "The file type for the specified uri. *SQL*: The file contains SQL statements. *CSV*: The file contains CSV data.", "enum": [ "SQL_FILE_TYPE_UNSPECIFIED", "SQL", @@ -2524,7 +2567,7 @@ "type": "string" }, "kind": { - "description": "This is always sql#exportContext.", + "description": "This is always *sql#exportContext*.", "type": "string" }, "offload": { @@ -2538,7 +2581,7 @@ "description": "Options for exporting from MySQL.", "properties": { "masterData": { - "description": "Option to include SQL statement required to set up replication.\nIf set to 1, the dump file includes\n a CHANGE MASTER TO statement with the binary log coordinates.\nIf set to 2, the CHANGE MASTER TO statement is written as\n a SQL comment, and has no effect.\nAll other values are ignored.", + "description": "Option to include SQL statement required to set up replication. If set to *1*, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to *2*, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored.", "format": "int32", "type": "integer" } @@ -2550,7 +2593,7 @@ "type": "boolean" }, "tables": { - "description": "Tables to export, or that were exported, from the specified database. If\nyou specify tables, specify one and only one database. For PostgreSQL\ninstances, you can specify only one table.", + "description": "Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table.", "items": { "type": "string" }, @@ -2560,7 +2603,7 @@ "type": "object" }, "uri": { - "description": "The path to the file in Google Cloud Storage where the export will be\nstored. The URI is in the form gs:\n//bucketName/fileName. If the file already exists, the requests\n// succeeds, but the operation fails. If fileType is\n// SQL and the filename ends with .gz, the contents are\n// compressed.", + "description": "The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form *gs: //bucketName/fileName*. If the file already exists, the requests // succeeds, but the operation fails. If *fileType* is // *SQL* and the filename ends with .gz, the contents are // compressed.", "type": "string" } }, @@ -2571,11 +2614,11 @@ "id": "FailoverContext", "properties": { "kind": { - "description": "This is always sql#failoverContext.", + "description": "This is always *sql#failoverContext*.", "type": "string" }, "settingsVersion": { - "description": "The current settings version of this instance. Request will be rejected if\nthis version doesn't match the current settings version.", + "description": "The current settings version of this instance. Request will be rejected if this version doesn't match the current settings version.", "format": "int64", "type": "string" } @@ -2587,7 +2630,7 @@ "id": "Flag", "properties": { "allowedIntValues": { - "description": "Use this field if only certain integers are accepted. Can be combined\nwith min_value and max_value to add additional values.", + "description": "Use this field if only certain integers are accepted. Can be combined with min_value and max_value to add additional values.", "items": { "format": "int64", "type": "string" @@ -2595,30 +2638,14 @@ "type": "array" }, "allowedStringValues": { - "description": "For STRING flags, a list of strings that the value can be set\nto.", + "description": "For *STRING* flags, a list of strings that the value can be set to.", "items": { "type": "string" }, "type": "array" }, "appliesTo": { - "description": "The database version this flag applies to. Can be MYSQL_5_5,\nMYSQL_5_6, or MYSQL_5_7. MYSQL_5_7\nis applicable only to Second Generation instances.", - "enumDescriptions": [ - "This is an unknown database version.", - "The database version is MySQL 5.1.", - "The database version is MySQL 5.5.", - "The database version is MySQL 5.6.", - "The database version is MySQL 5.7.", - "The database version is PostgreSQL 9.6.", - "The database version is PostgreSQL 11.", - "The database version is SQL Server 2017 Standard.", - "The database version is SQL Server 2017 Enterprise.", - "The database version is SQL Server 2017 Express.", - "The database version is SQL Server 2017 Web.", - "The database version is PostgreSQL 10.", - "The database version is PostgreSQL 12.", - "The database version is MySQL 8." - ], + "description": "The database version this flag applies to. Can be *MYSQL_8_0*, *MYSQL_5_6*, or *MYSQL_5_7*.", "items": { "enum": [ "SQL_DATABASE_VERSION_UNSPECIFIED", @@ -2636,6 +2663,22 @@ "POSTGRES_12", "MYSQL_8_0" ], + "enumDescriptions": [ + "This is an unknown database version.", + "The database version is MySQL 5.1.", + "The database version is MySQL 5.5.", + "The database version is MySQL 5.6.", + "The database version is MySQL 5.7.", + "The database version is PostgreSQL 9.6.", + "The database version is PostgreSQL 11.", + "The database version is SQL Server 2017 Standard.", + "The database version is SQL Server 2017 Enterprise.", + "The database version is SQL Server 2017 Express.", + "The database version is SQL Server 2017 Web.", + "The database version is PostgreSQL 10.", + "The database version is PostgreSQL 12.", + "The database version is MySQL 8." + ], "type": "string" }, "type": "array" @@ -2645,29 +2688,29 @@ "type": "boolean" }, "kind": { - "description": "This is always sql#flag.", + "description": "This is always *sql#flag*.", "type": "string" }, "maxValue": { - "description": "For INTEGER flags, the maximum allowed value.", + "description": "For *INTEGER* flags, the maximum allowed value.", "format": "int64", "type": "string" }, "minValue": { - "description": "For INTEGER flags, the minimum allowed value.", + "description": "For *INTEGER* flags, the minimum allowed value.", "format": "int64", "type": "string" }, "name": { - "description": "This is the name of the flag. Flag names always use underscores, not\nhyphens, e.g. max_allowed_packet", + "description": "This is the name of the flag. Flag names always use underscores, not hyphens, for example: *max_allowed_packet*", "type": "string" }, "requiresRestart": { - "description": "Indicates whether changing this flag will trigger a database restart. Only\napplicable to Second Generation instances.", + "description": "Indicates whether changing this flag will trigger a database restart. Only applicable to Second Generation instances.", "type": "boolean" }, "type": { - "description": "The type of the flag. Flags are typed to being BOOLEAN,\nSTRING, INTEGER or NONE.\nNONE is used for flags which do not take a value, such as\nskip_grant_tables.", + "description": "The type of the flag. Flags are typed to being *BOOLEAN*, *STRING*, *INTEGER* or *NONE*. *NONE* is used for flags which do not take a value, such as *skip_grant_tables*.", "enum": [ "SQL_FLAG_TYPE_UNSPECIFIED", "BOOLEAN", @@ -2684,7 +2727,7 @@ "String type flag.", "Integer type flag.", "Flag type used for a server startup option.", - "Type introduced specically for MySQL TimeZone offset. Accept a string value\nwith the format [-12:59, 13:00].", + "Type introduced specically for MySQL TimeZone offset. Accept a string value with the format [-12:59, 13:00].", "Float type flag.", "Comma-separated list of the strings in a SqlFlagType enum." ], @@ -2705,7 +2748,7 @@ "type": "array" }, "kind": { - "description": "This is always sql#flagsList.", + "description": "This is always *sql#flagsList*.", "type": "string" } }, @@ -2721,7 +2764,7 @@ "encryptionOptions": { "properties": { "certPath": { - "description": "Path to the Certificate (.cer) in Cloud Storage, in the form\ngs://bucketName/fileName. The instance must have\nwrite permissions to the bucket and read access to the file.", + "description": "Path to the Certificate (.cer) in Cloud Storage, in the form *gs://bucketName/fileName*. The instance must have write permissions to the bucket and read access to the file.", "type": "string" }, "pvkPassword": { @@ -2729,7 +2772,7 @@ "type": "string" }, "pvkPath": { - "description": "Path to the Certificate Private Key (.pvk) in Cloud Storage, in the\nform gs://bucketName/fileName. The instance must have\nwrite permissions to the bucket and read access to the file.", + "description": "Path to the Certificate Private Key (.pvk) in Cloud Storage, in the form *gs://bucketName/fileName*. The instance must have write permissions to the bucket and read access to the file.", "type": "string" } }, @@ -2742,7 +2785,7 @@ "description": "Options for importing data as CSV.", "properties": { "columns": { - "description": "The columns to which CSV data is imported. If not specified, all columns\nof the database table are loaded with CSV data.", + "description": "The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.", "items": { "type": "string" }, @@ -2756,11 +2799,11 @@ "type": "object" }, "database": { - "description": "The target database for the import. If fileType is\nSQL, this field is required only if the import file does not\nspecify a database, and is overridden by any database specification in the\nimport file. If fileType is CSV, one database\nmust be specified.", + "description": "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.", "type": "string" }, "fileType": { - "description": "The file type for the specified uri.
SQL: The file\ncontains SQL statements.
CSV: The file contains CSV data.", + "description": "The file type for the specified uri. *SQL*: The file contains SQL statements. *CSV*: The file contains CSV data.", "enum": [ "SQL_FILE_TYPE_UNSPECIFIED", "SQL", @@ -2780,11 +2823,11 @@ "type": "string" }, "kind": { - "description": "This is always sql#importContext.", + "description": "This is always *sql#importContext*.", "type": "string" }, "uri": { - "description": "Path to the import file in Cloud Storage, in the form\ngs:\n//bucketName/fileName. Compressed gzip files (.gz) are supported\n// when fileType is SQL. The instance must have\n// write permissions to the bucket and read access to the file.", + "description": "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.", "type": "string" } }, @@ -2802,7 +2845,7 @@ "type": "object" }, "InstancesDemoteMasterRequest": { - "description": "Database demote master request.", + "description": "Database demote primary instance request.", "id": "InstancesDemoteMasterRequest", "properties": { "demoteMasterContext": { @@ -2857,11 +2900,11 @@ "type": "array" }, "kind": { - "description": "This is always sql#instancesList.", + "description": "This is always *sql#instancesList*.", "type": "string" }, "nextPageToken": { - "description": "The continuation token, used to page through large result sets. Provide\nthis value in a subsequent request to return the next page of results.", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.", "type": "string" }, "warnings": { @@ -2889,7 +2932,7 @@ "type": "array" }, "kind": { - "description": "This is always sql#instancesListServerCas.", + "description": "This is always *sql#instancesListServerCas*.", "type": "string" } }, @@ -2933,22 +2976,22 @@ "id": "IpConfiguration", "properties": { "authorizedNetworks": { - "description": "The list of external networks that are allowed to connect to the instance\nusing the IP. In CIDR\nnotation, also known as 'slash' notation (e.g.\n192.168.100.0/24).", + "description": "The list of external networks that are allowed to connect to the instance using the IP. In 'CIDR' notation, also known as 'slash' notation (for example: *192.168.100.0/24*).", "items": { "$ref": "AclEntry" }, "type": "array" }, "ipv4Enabled": { - "description": "Whether the instance should be assigned an IP address or not.", + "description": "Whether the instance is assigned a public IP address or not.", "type": "boolean" }, "privateNetwork": { - "description": "The resource link for the VPC network from which the Cloud SQL instance is\naccessible for private IP. For example,\n/projects/myProject/global/networks/default. This setting can\nbe updated, but it cannot be removed after it is set.", + "description": "The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, */projects/myProject/global/networks/default*. This setting can be updated, but it cannot be removed after it is set.", "type": "string" }, "requireSsl": { - "description": "Whether SSL connections over IP should be enforced or not.", + "description": "Whether SSL connections over IP are enforced or not.", "type": "boolean" } }, @@ -2963,12 +3006,12 @@ "type": "string" }, "timeToRetire": { - "description": "The due time for this IP to be retired in RFC 3339 format, for example\n2012-11-15T16:19:00.094Z. This field is only available when\nthe IP is scheduled to be retired.", + "description": "The due time for this IP to be retired in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. This field is only available when the IP is scheduled to be retired.", "format": "google-datetime", "type": "string" }, "type": { - "description": "The type of this IP address. A PRIMARY address is a public\naddress that can accept incoming connections. A PRIVATE\naddress is a private address that can accept incoming connections. An\nOUTGOING address is the source address of connections\noriginating from the instance, if supported.", + "description": "The type of this IP address. A *PRIMARY* address is a public address that can accept incoming connections. A *PRIVATE* address is a private address that can accept incoming connections. An *OUTGOING* address is the source address of connections originating from the instance, if supported.", "enum": [ "SQL_IP_ADDRESS_TYPE_UNSPECIFIED", "PRIMARY", @@ -2978,10 +3021,10 @@ ], "enumDescriptions": [ "This is an unknown IP address type.", - "IP address the customer is supposed to connect to. Usually this is the\nload balancer's IP address", - "Source IP address of the connection a read replica establishes to its\nexternal master. This IP address can be whitelisted by the customer\nin case it has a firewall that filters incoming connection to its\non premises master.", + "IP address the customer is supposed to connect to. Usually this is the load balancer's IP address", + "Source IP address of the connection a read replica establishes to its external primary instance. This IP address can be allowlisted by the customer in case it has a firewall that filters incoming connection to its on premises primary instance.", "Private IP used when using private IPs and network peering.", - "V1 IP of a migrated instance. We want the user to\ndecommission this IP as soon as the migration is complete.\nNote: V1 instances with V1 ip addresses will be counted as PRIMARY." + "V1 IP of a migrated instance. We want the user to decommission this IP as soon as the migration is complete. Note: V1 instances with V1 ip addresses will be counted as PRIMARY." ], "type": "string" } @@ -2989,26 +3032,26 @@ "type": "object" }, "LocationPreference": { - "description": "Preferred location. This specifies where a Cloud SQL instance should\npreferably be located, either in a specific Compute Engine zone, or\nco-located with an App Engine application. Note that if the preferred\nlocation is not available, the instance will be located as close as possible\nwithin the region. Only one location may be specified.", + "description": "Preferred location. This specifies where a Cloud SQL instance is located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified.", "id": "LocationPreference", "properties": { "followGaeApplication": { - "description": "The AppEngine application to follow, it must be in the same region as the\nCloud SQL instance.", + "description": "The App Engine application to follow, it must be in the same region as the Cloud SQL instance.", "type": "string" }, "kind": { - "description": "This is always sql#locationPreference.", + "description": "This is always *sql#locationPreference*.", "type": "string" }, "zone": { - "description": "The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b,\netc.).", + "description": "The preferred Compute Engine zone (for example: us-central1-a, us-central1-b, etc.).", "type": "string" } }, "type": "object" }, "MaintenanceWindow": { - "description": "Maintenance window. This specifies when a v2 Cloud SQL instance should\npreferably be restarted for system maintenance purposes.", + "description": "Maintenance window. This specifies when a Cloud SQL instance is restarted for system maintenance purposes.", "id": "MaintenanceWindow", "properties": { "day": { @@ -3022,11 +3065,11 @@ "type": "integer" }, "kind": { - "description": "This is always sql#maintenanceWindow.", + "description": "This is always *sql#maintenanceWindow*.", "type": "string" }, "updateTrack": { - "description": "Maintenance timing setting: canary (Earlier) or\nstable (Later).
\nLearn more.", + "description": "Maintenance timing setting: *canary* (Earlier) or *stable* (Later). Learn more.", "enum": [ "SQL_UPDATE_TRACK_UNSPECIFIED", "canary", @@ -3034,8 +3077,8 @@ ], "enumDescriptions": [ "This is an unknown maintenance timing preference.", - "For instance update that requires a restart, this update track indicates\nyour instance prefer to restart for new version early in maintenance\nwindow.", - "For instance update that requires a restart, this update track indicates\nyour instance prefer to let Cloud SQL choose the timing of restart (within\nits Maintenance window, if applicable)." + "For instance update that requires a restart, this update track indicates your instance prefer to restart for new version early in maintenance window.", + "For instance update that requires a restart, this update track indicates your instance prefer to let Cloud SQL choose the timing of restart (within its Maintenance window, if applicable)." ], "type": "string" } @@ -3051,11 +3094,11 @@ "type": "string" }, "clientCertificate": { - "description": "PEM representation of the slave's x509 certificate.", + "description": "PEM representation of the replica's x509 certificate.", "type": "string" }, "clientKey": { - "description": "PEM representation of the slave's private key. The corresponsing public key\nis encoded in the client's certificate.", + "description": "PEM representation of the replica's private key. The corresponsing public key is encoded in the client's certificate.", "type": "string" }, "connectRetryInterval": { @@ -3064,11 +3107,11 @@ "type": "integer" }, "dumpFilePath": { - "description": "Path to a SQL dump file in Google Cloud Storage from which the slave\ninstance is to be created. The URI is in the form gs:\n//bucketName/fileName. Compressed gzip files (.gz) are also supported.\n// Dumps should have the binlog co-ordinates from which replication should\n// begin. This can be accomplished by setting --master-data to 1 when using\n// mysqldump.", + "description": "Path to a SQL dump file in Google Cloud Storage from which the replica instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps have the binlog co-ordinates from which replication begins. This can be accomplished by setting --master-data to 1 when using mysqldump.", "type": "string" }, "kind": { - "description": "This is always sql#mysqlReplicaConfiguration.", + "description": "This is always *sql#mysqlReplicaConfiguration*.", "type": "string" }, "masterHeartbeatPeriod": { @@ -3089,7 +3132,7 @@ "type": "string" }, "verifyServerCertificate": { - "description": "Whether or not to check the master's Common Name value in the certificate\nthat it sends during the SSL handshake.", + "description": "Whether or not to check the primary instance's Common Name value in the certificate that it sends during the SSL handshake.", "type": "boolean" } }, @@ -3104,11 +3147,11 @@ "type": "string" }, "clientCertificate": { - "description": "PEM representation of the slave's x509 certificate.", + "description": "PEM representation of the replica's x509 certificate.", "type": "string" }, "clientKey": { - "description": "PEM representation of the slave's private key. The corresponsing public key\nis encoded in the client's certificate.", + "description": "PEM representation of the replica's private key. The corresponsing public key is encoded in the client's certificate.", "type": "string" }, "dumpFilePath": { @@ -3120,7 +3163,7 @@ "type": "string" }, "kind": { - "description": "This is always sql#onPremisesConfiguration.", + "description": "This is always *sql#onPremisesConfiguration*.", "type": "string" }, "password": { @@ -3135,17 +3178,17 @@ "type": "object" }, "Operation": { - "description": "An Operation resource. For successful operations that return an\nOperation resource, only the fields relevant to the operation are populated\nin the resource.", + "description": "An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.", "id": "Operation", "properties": { "endTime": { - "description": "The time this operation finished in UTC timezone in RFC 3339 format, for example\n2012-11-15T16:19:00.094Z.", + "description": "The time this operation finished in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.", "format": "google-datetime", "type": "string" }, "error": { "$ref": "OperationErrors", - "description": "If errors occurred during processing of this operation, this field will be\npopulated." + "description": "If errors occurred during processing of this operation, this field will be populated." }, "exportContext": { "$ref": "ExportContext", @@ -3156,20 +3199,20 @@ "description": "The context for import operation, if applicable." }, "insertTime": { - "description": "The time this operation was enqueued in UTC timezone in RFC 3339 format, for example\n2012-11-15T16:19:00.094Z.", + "description": "The time this operation was enqueued in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.", "format": "google-datetime", "type": "string" }, "kind": { - "description": "This is always sql#operation.", + "description": "This is always *sql#operation*.", "type": "string" }, "name": { - "description": "An identifier that uniquely identifies the operation. You can use this\nidentifier to retrieve the Operations resource that has information about\nthe operation.", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.", "type": "string" }, "operationType": { - "description": "The type of the operation. Valid values are CREATE,\nDELETE, UPDATE, RESTART,\nIMPORT, EXPORT, BACKUP_VOLUME,\nRESTORE_VOLUME, CREATE_USER,\nDELETE_USER, CREATE_DATABASE,\nDELETE_DATABASE .", + "description": "The type of the operation. Valid values are: *CREATE* *DELETE* *UPDATE* *RESTART* *IMPORT* *EXPORT* *BACKUP_VOLUME* *RESTORE_VOLUME* *CREATE_USER* *DELETE_USER* *CREATE_DATABASE* *DELETE_DATABASE*", "enum": [ "SQL_OPERATION_TYPE_UNSPECIFIED", "IMPORT", @@ -3210,7 +3253,7 @@ "enumDescriptions": [ "Unknown operation type.", "Imports data into a Cloud SQL instance.", - "Exports data from a Cloud SQL instance to a Cloud Storage\nbucket.", + "Exports data from a Cloud SQL instance to a Cloud Storage bucket.", "Creates a new Cloud SQL instance.", "Updates the settings of a Cloud SQL instance.", "Deletes a Cloud SQL instance.", @@ -3232,17 +3275,17 @@ "Creates a database in the Cloud SQL instance.", "Deletes a database in the Cloud SQL instance.", "Updates a database in the Cloud SQL instance.", - "Performs failover of an HA-enabled Cloud SQL\nfailover replica.", + "Performs failover of an HA-enabled Cloud SQL failover replica.", "Deletes the backup taken by a backup run.", "", "Truncates a general or slow log table in MySQL.", - "Demotes the stand-alone instance to be a Cloud SQL\nread replica for an external database server.", - "Indicates that the instance is currently in maintenance. Maintenance\ntypically causes the instance to be unavailable for 1-3 minutes.", + "Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.", + "Indicates that the instance is currently in maintenance. Maintenance typically causes the instance to be unavailable for 1-3 minutes.", "This field is deprecated, and will be removed in future version of API.", "", "Creates clone instance.", "Reschedule maintenance to another time.", - "Starts external sync of a Cloud SQL EM replica to an external master." + "Starts external sync of a Cloud SQL EM replica to an external primary instance." ], "type": "string" }, @@ -3251,12 +3294,12 @@ "type": "string" }, "startTime": { - "description": "The time this operation actually started in UTC timezone in RFC 3339 format, for example\n2012-11-15T16:19:00.094Z.", + "description": "The time this operation actually started in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.", "format": "google-datetime", "type": "string" }, "status": { - "description": "The status of an operation. Valid values are PENDING,\nRUNNING, DONE,\nSQL_OPERATION_STATUS_UNSPECIFIED.", + "description": "The status of an operation. Valid values are: *PENDING* *RUNNING* *DONE* *SQL_OPERATION_STATUS_UNSPECIFIED*", "enum": [ "SQL_OPERATION_STATUS_UNSPECIFIED", "PENDING", @@ -3298,7 +3341,7 @@ "type": "string" }, "kind": { - "description": "This is always sql#operationError.", + "description": "This is always *sql#operationError*.", "type": "string" }, "message": { @@ -3320,7 +3363,7 @@ "type": "array" }, "kind": { - "description": "This is always sql#operationErrors.", + "description": "This is always *sql#operationErrors*.", "type": "string" } }, @@ -3338,31 +3381,31 @@ "type": "array" }, "kind": { - "description": "This is always sql#operationsList.", + "description": "This is always *sql#operationsList*.", "type": "string" }, "nextPageToken": { - "description": "The continuation token, used to page through large result sets. Provide\nthis value in a subsequent request to return the next page of results.", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.", "type": "string" } }, "type": "object" }, "ReplicaConfiguration": { - "description": "Read-replica configuration for connecting to the master.", + "description": "Read-replica configuration for connecting to the primary instance.", "id": "ReplicaConfiguration", "properties": { "failoverTarget": { - "description": "Specifies if the replica is the failover target. If the field is set to\ntrue the replica will be designated as a failover replica. In\ncase the master instance fails, the replica instance will be promoted as\nthe new master instance.

Only one replica can be specified as failover\ntarget, and the replica has to be in different zone with the master\ninstance.", + "description": "Specifies if the replica is the failover target. If the field is set to *true* the replica will be designated as a failover replica. In case the primary instance fails, the replica instance will be promoted as the new primary instance. Only one replica can be specified as failover target, and the replica has to be in different zone with the primary instance.", "type": "boolean" }, "kind": { - "description": "This is always sql#replicaConfiguration.", + "description": "This is always *sql#replicaConfiguration*.", "type": "string" }, "mysqlReplicaConfiguration": { "$ref": "MySqlReplicaConfiguration", - "description": "MySQL specific configuration when replicating from a MySQL on-premises\nmaster. Replication configuration information such as the username,\npassword, certificates, and keys are not stored in the instance metadata.\nThe configuration information is used only to set up the replication\nconnection and is stored by MySQL in a file named master.info\nin the data directory." + "description": "MySQL specific configuration when replicating from a MySQL on-premises primary instance. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named *master.info* in the data directory." } }, "type": "object" @@ -3381,13 +3424,13 @@ "enumDescriptions": [ "", "If the user wants to schedule the maintenance to happen now.", - "If the user wants to use the existing maintenance policy to find the\nnext available window.", + "If the user wants to use the existing maintenance policy to find the next available window.", "If the user wants to reschedule the maintenance to a specific time." ], "type": "string" }, "scheduleTime": { - "description": "Optional. Timestamp when the maintenance shall be rescheduled to if\nreschedule_type=SPECIFIC_TIME, in RFC 3339 format, for\nexample 2012-11-15T16:19:00.094Z.", + "description": "Optional. Timestamp when the maintenance shall be rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.", "format": "google-datetime", "type": "string" } @@ -3395,7 +3438,7 @@ "type": "object" }, "RestoreBackupContext": { - "description": "Database instance restore from backup context.\nBackup context contains source instance id and project id.", + "description": "Database instance restore from backup context. Backup context contains source instance id and project id.", "id": "RestoreBackupContext", "properties": { "backupRunId": { @@ -3408,7 +3451,7 @@ "type": "string" }, "kind": { - "description": "This is always sql#restoreBackupContext.", + "description": "This is always *sql#restoreBackupContext*.", "type": "string" }, "project": { @@ -3423,11 +3466,11 @@ "id": "RotateServerCaContext", "properties": { "kind": { - "description": "This is always sql#rotateServerCaContext.", + "description": "This is always *sql#rotateServerCaContext*.", "type": "string" }, "nextVersion": { - "description": "The fingerprint of the next version to be rotated to. If left unspecified,\nwill be rotated to the most recently added server CA version.", + "description": "The fingerprint of the next version to be rotated to. If left unspecified, will be rotated to the most recently added server CA version.", "type": "string" } }, @@ -3438,7 +3481,7 @@ "id": "Settings", "properties": { "activationPolicy": { - "description": "The activation policy specifies when the instance is activated; it is\napplicable only when the instance state is RUNNABLE. Valid\nvalues:
ALWAYS: The instance is on, and remains so even in\nthe absence of connection requests.
NEVER: The instance is\noff; it is not activated, even if a connection request arrives.\n
ON_DEMAND: First Generation instances only. The instance\nresponds to incoming requests, and turns itself off when not in use.\nInstances with PER_USE pricing turn off after 15 minutes of\ninactivity. Instances with PER_PACKAGE pricing turn off after\n12 hours of inactivity.", + "description": "The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values: *ALWAYS*: The instance is on, and remains so even in the absence of connection requests. *NEVER*: The instance is off; it is not activated, even if a connection request arrives.", "enum": [ "SQL_ACTIVATION_POLICY_UNSPECIFIED", "ALWAYS", @@ -3448,20 +3491,24 @@ "enumDescriptions": [ "Unknown activation plan.", "The instance is always up and running.", - "The instance should never spin up.", - "The instance spins up upon receiving requests." + "The instance never starts.", + "The instance starts upon receiving requests." ], "type": "string" }, + "activeDirectoryConfig": { + "$ref": "SqlActiveDirectoryConfig", + "description": "Active Directory configuration, for now relevant only for SQL Server" + }, "authorizedGaeApplications": { - "description": "The App Engine app IDs that can access this instance. First Generation\ninstances only.", + "description": "The App Engine app IDs that can access this instance. (Deprecated) Applied to First Generation instances only.", "items": { "type": "string" }, "type": "array" }, "availabilityType": { - "description": "Availability type (PostgreSQL and MySQL instances only). Potential values:\n
ZONAL: The instance serves data from only one zone.\nOutages in that zone affect data accessibility.
REGIONAL:\nThe instance can serve data from more than one zone in a region (it is\nhighly available).
For more information, see Overview\nof the High Availability Configuration.", + "description": "Availability type. Potential values: *ZONAL*: The instance serves data from only one zone. Outages in that zone affect data accessibility. *REGIONAL*: The instance can serve data from more than one zone in a region (it is highly available). For more information, see Overview of the High Availability Configuration.", "enum": [ "SQL_AVAILABILITY_TYPE_UNSPECIFIED", "ZONAL", @@ -3478,17 +3525,21 @@ "$ref": "BackupConfiguration", "description": "The daily backup configuration for the instance." }, + "collation": { + "description": "The name of server Instance collation.", + "type": "string" + }, "crashSafeReplicationEnabled": { - "description": "Configuration specific to read replica instances. Indicates whether\ndatabase flags for crash-safe replication are enabled. This property is\nonly applicable to First Generation instances.", + "description": "Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property was only applicable to First Generation instances.", "type": "boolean" }, "dataDiskSizeGb": { - "description": "The size of data disk, in GB. The data disk size minimum is 10GB. Not used\nfor First Generation instances.", + "description": "The size of data disk, in GB. The data disk size minimum is 10GB.", "format": "int64", "type": "string" }, "dataDiskType": { - "description": "The type of data disk: PD_SSD (default) or\nPD_HDD. Not used for First Generation instances.", + "description": "The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances.", "enum": [ "SQL_DATA_DISK_TYPE_UNSPECIFIED", "PD_SSD", @@ -3499,7 +3550,7 @@ "This is an unknown data disk type.", "An SSD data disk.", "An HDD data disk.", - "This field is deprecated and will be removed from a future version of the\nAPI." + "This field is deprecated and will be removed from a future version of the API." ], "type": "string" }, @@ -3511,27 +3562,34 @@ "type": "array" }, "databaseReplicationEnabled": { - "description": "Configuration specific to read replica instances. Indicates whether\nreplication is enabled or not.", + "description": "Configuration specific to read replica instances. Indicates whether replication is enabled or not.", "type": "boolean" }, + "denyMaintenancePeriods": { + "description": "Deny maintenance periods", + "items": { + "$ref": "DenyMaintenancePeriod" + }, + "type": "array" + }, "ipConfiguration": { "$ref": "IpConfiguration", - "description": "The settings for IP Management. This allows to enable or disable the\ninstance IP and manage which external networks can connect to the instance.\nThe IPv4 address cannot be disabled for Second Generation instances." + "description": "The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances." }, "kind": { - "description": "This is always sql#settings.", + "description": "This is always *sql#settings*.", "type": "string" }, "locationPreference": { "$ref": "LocationPreference", - "description": "The location preference settings. This allows the instance to be located as\nnear as possible to either an App Engine app or Compute Engine zone for\nbetter performance. App Engine co-location is only applicable to First\nGeneration instances." + "description": "The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location was only applicable to First Generation instances." }, "maintenanceWindow": { "$ref": "MaintenanceWindow", - "description": "The maintenance window for this instance. This specifies when the instance\ncan be restarted for maintenance purposes. Not used for First Generation\ninstances." + "description": "The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes." }, "pricingPlan": { - "description": "The pricing plan for this instance. This can be either PER_USE\nor PACKAGE. Only PER_USE is supported for Second\nGeneration instances.", + "description": "The pricing plan for this instance. This can be either *PER_USE* or *PACKAGE*. Only *PER_USE* is supported for Second Generation instances.", "enum": [ "SQL_PRICING_PLAN_UNSPECIFIED", "PACKAGE", @@ -3545,7 +3603,7 @@ "type": "string" }, "replicationType": { - "description": "The type of replication this instance uses. This can be either\nASYNCHRONOUS or SYNCHRONOUS. This property is\nonly applicable to First Generation instances.", + "description": "The type of replication this instance uses. This can be either *ASYNCHRONOUS* or *SYNCHRONOUS*. (Deprecated_ This property was only applicable to First Generation instances.", "enum": [ "SQL_REPLICATION_TYPE_UNSPECIFIED", "SYNCHRONOUS", @@ -3553,41 +3611,56 @@ ], "enumDescriptions": [ "This is an unknown replication type for a Cloud SQL instance.", - "The synchronous replication mode for First Generation instances. It is the\ndefault value.", - "The asynchronous replication mode for First Generation instances. It\nprovides a slight performance gain, but if an outage occurs while this\noption is set to asynchronous, you can lose up to a few seconds of updates\nto your data." + "The synchronous replication mode for First Generation instances. It is the default value.", + "The asynchronous replication mode for First Generation instances. It provides a slight performance gain, but if an outage occurs while this option is set to asynchronous, you can lose up to a few seconds of updates to your data." ], "type": "string" }, "settingsVersion": { - "description": "The version of instance settings. This is a required field for update\nmethod to make sure concurrent updates are handled properly. During update,\nuse the most recent settingsVersion value for this instance and do not try\nto update this value.", + "description": "The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value.", "format": "int64", "type": "string" }, "storageAutoResize": { - "description": "Configuration to increase storage size automatically. The default value is\ntrue. Not used for First Generation instances.", + "description": "Configuration to increase storage size automatically. The default value is true.", "type": "boolean" }, "storageAutoResizeLimit": { - "description": "The maximum size to which storage capacity can be automatically increased.\nThe default value is 0, which specifies that there is no limit. Not used\nfor First Generation instances.", + "description": "The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit.", "format": "int64", "type": "string" }, "tier": { - "description": "The tier (or machine type) for this instance, for example\ndb-n1-standard-1 (MySQL instances) or\ndb-custom-1-3840 (PostgreSQL instances). For MySQL instances,\nthis property determines whether the instance is First or Second\nGeneration. For more information, see Instance Settings.", + "description": "The tier (or machine type) for this instance, for example *db-n1-standard-1* (MySQL instances) or *db-custom-1-3840* (PostgreSQL instances).", "type": "string" }, "userLabels": { "additionalProperties": { "type": "string" }, - "description": "User-provided labels, represented as a dictionary where each label is a\nsingle key value pair.", + "description": "User-provided labels, represented as a dictionary where each label is a single key value pair.", "type": "object" } }, "type": "object" }, + "SqlActiveDirectoryConfig": { + "description": "Active Directory configuration, for now relevant only for SQL Server", + "id": "SqlActiveDirectoryConfig", + "properties": { + "domain": { + "description": "Domain name", + "type": "string" + }, + "kind": { + "description": "This will be always sql#activeDirectoryConfig.", + "type": "string" + } + }, + "type": "object" + }, "SqlExternalSyncSettingError": { - "description": "External master migration setting error.", + "description": "External primary instance migration setting error.", "id": "SqlExternalSyncSettingError", "properties": { "detail": { @@ -3595,7 +3668,7 @@ "type": "string" }, "kind": { - "description": "This is always sql#migrationSettingError.", + "description": "This is always *sql#migrationSettingError*.", "type": "string" }, "type": { @@ -3609,7 +3682,18 @@ "INSUFFICIENT_PRIVILEGE", "UNSUPPORTED_MIGRATION_TYPE", "NO_PGLOGICAL_INSTALLED", - "PGLOGICAL_NODE_ALREADY_EXISTS" + "PGLOGICAL_NODE_ALREADY_EXISTS", + "INVALID_WAL_LEVEL", + "INVALID_SHARED_PRELOAD_LIBRARY", + "INSUFFICIENT_MAX_REPLICATION_SLOTS", + "INSUFFICIENT_MAX_WAL_SENDERS", + "INSUFFICIENT_MAX_WORKER_PROCESSES", + "UNSUPPORTED_EXTENSIONS", + "INVALID_RDS_LOGICAL_REPLICATION", + "INVALID_LOGGING_SETUP", + "INVALID_DB_PARAM", + "UNSUPPORTED_GTID_MODE", + "SQLSERVER_AGENT_NOT_RUNNING" ], "enumDescriptions": [ "", @@ -3620,7 +3704,18 @@ "", "Unsupported migration type.", "No pglogical extension installed on databases, applicable for postgres.", - "pglogical node already exists on databases, applicable for postgres." + "pglogical node already exists on databases, applicable for postgres.", + "The value of parameter wal_level is not set to logical.", + "The value of parameter shared_preload_libraries does not include pglogical.", + "The value of parameter max_replication_slots is not sufficient.", + "The value of parameter max_wal_senders is not sufficient.", + "The value of parameter max_worker_processes is not sufficient.", + "Extensions installed are either not supported or having unsupported versions", + "The value of parameter rds.logical_replication is not set to 1.", + "The primary instance logging setup doesn't allow EM sync.", + "The primary instance database parameter setup doesn't allow EM sync.", + "The gtid_mode is not supported, applicable for MySQL.", + "SQL Server Agent is not running." ], "type": "string" } @@ -3650,7 +3745,7 @@ "type": "array" }, "kind": { - "description": "This is always sql#migrationSettingErrorList.", + "description": "This is always *sql#migrationSettingErrorList*.", "type": "string" } }, @@ -3722,16 +3817,16 @@ "type": "string" }, "commonName": { - "description": "User supplied name. Constrained to [a-zA-Z.-_ ]+.", + "description": "User supplied name. Constrained to [a-zA-Z.-_ ]+.", "type": "string" }, "createTime": { - "description": "The time when the certificate was created in RFC 3339 format, for example\n2012-11-15T16:19:00.094Z", + "description": "The time when the certificate was created in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*", "format": "google-datetime", "type": "string" }, "expirationTime": { - "description": "The time when the certificate expires in RFC 3339 format, for example\n2012-11-15T16:19:00.094Z.", + "description": "The time when the certificate expires in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.", "format": "google-datetime", "type": "string" }, @@ -3740,7 +3835,7 @@ "type": "string" }, "kind": { - "description": "This is always sql#sslCert.", + "description": "This is always *sql#sslCert*.", "type": "string" }, "selfLink": { @@ -3763,7 +3858,7 @@ "description": "The public information about the cert." }, "certPrivateKey": { - "description": "The private key for the client cert, in pem format. Keep private in order\nto protect your security.", + "description": "The private key for the client cert, in pem format. Keep private in order to protect your security.", "type": "string" } }, @@ -3785,7 +3880,7 @@ "id": "SslCertsInsertRequest", "properties": { "commonName": { - "description": "User supplied name. Must be a distinct name from the other certificates\nfor this instance.", + "description": "User supplied name. Must be a distinct name from the other certificates for this instance.", "type": "string" } }, @@ -3797,10 +3892,10 @@ "properties": { "clientCert": { "$ref": "SslCertDetail", - "description": "The new client certificate and private key. For First Generation\ninstances, the new certificate does not take effect until the instance is\nrestarted." + "description": "The new client certificate and private key." }, "kind": { - "description": "This is always sql#sslCertsInsert.", + "description": "This is always *sql#sslCertsInsert*.", "type": "string" }, "operation": { @@ -3809,7 +3904,7 @@ }, "serverCaCert": { "$ref": "SslCert", - "description": "The server Certificate Authority's certificate. If this is missing you can\nforce a new one to be generated by calling resetSslConfig method on\ninstances resource." + "description": "The server Certificate Authority's certificate. If this is missing you can force a new one to be generated by calling resetSslConfig method on instances resource." } }, "type": "object" @@ -3826,7 +3921,7 @@ "type": "array" }, "kind": { - "description": "This is always sql#sslCertsList.", + "description": "This is always *sql#sslCertsList*.", "type": "string" } }, @@ -3847,7 +3942,7 @@ "type": "string" }, "kind": { - "description": "This is always sql#tier.", + "description": "This is always *sql#tier*.", "type": "string" }, "region": { @@ -3858,7 +3953,7 @@ "type": "array" }, "tier": { - "description": "An identifier for the machine type, for example, db-n1-standard-1. For\nrelated information, see Pricing.", + "description": "An identifier for the machine type, for example, db-n1-standard-1. For related information, see Pricing.", "type": "string" } }, @@ -3876,7 +3971,7 @@ "type": "array" }, "kind": { - "description": "This is always sql#tiersList.", + "description": "This is always *sql#tiersList*.", "type": "string" } }, @@ -3887,11 +3982,11 @@ "id": "TruncateLogContext", "properties": { "kind": { - "description": "This is always sql#truncateLogContext.", + "description": "This is always *sql#truncateLogContext*.", "type": "string" }, "logType": { - "description": "The type of log to truncate. Valid values are\nMYSQL_GENERAL_TABLE and MYSQL_SLOW_TABLE.", + "description": "The type of log to truncate. Valid values are *MYSQL_GENERAL_TABLE* and *MYSQL_SLOW_TABLE*.", "type": "string" } }, @@ -3902,23 +3997,23 @@ "id": "User", "properties": { "etag": { - "description": "This field is deprecated and will be removed from a future version of the\nAPI.", + "description": "This field is deprecated and will be removed from a future version of the API.", "type": "string" }, "host": { - "description": "The host name from which the user can connect. For insert\noperations, host defaults to an empty string. For update\noperations, host is specified as part of the request URL. The host name\ncannot be updated after insertion.", + "description": "The host name from which the user can connect. For *insert* operations, host defaults to an empty string. For *update* operations, host is specified as part of the request URL. The host name cannot be updated after insertion.", "type": "string" }, "instance": { - "description": "The name of the Cloud SQL instance. This does not include the project ID.\nCan be omitted for update since it is already specified on the\nURL.", + "description": "The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for *update* since it is already specified on the URL.", "type": "string" }, "kind": { - "description": "This is always sql#user.", + "description": "This is always *sql#user*.", "type": "string" }, "name": { - "description": "The name of the user in the Cloud SQL instance. Can be omitted for\nupdate since it is already specified in the URL.", + "description": "The name of the user in the Cloud SQL instance. Can be omitted for *update* since it is already specified in the URL.", "type": "string" }, "password": { @@ -3926,11 +4021,25 @@ "type": "string" }, "project": { - "description": "The project ID of the project containing the Cloud SQL database. The Google\napps domain is prefixed if applicable. Can be omitted for\nupdate since it is already specified on the URL.", + "description": "The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for *update* since it is already specified on the URL.", "type": "string" }, "sqlserverUserDetails": { "$ref": "SqlServerUserDetails" + }, + "type": { + "description": "The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type.", + "enum": [ + "BUILT_IN", + "CLOUD_IAM_USER", + "CLOUD_IAM_SERVICE_ACCOUNT" + ], + "enumDescriptions": [ + "The database's built-in user type.", + "Cloud IAM user.", + "Cloud IAM service account." + ], + "type": "string" } }, "type": "object" @@ -3947,11 +4056,11 @@ "type": "array" }, "kind": { - "description": "This is always sql#usersList.", + "description": "This is always *sql#usersList*.", "type": "string" }, "nextPageToken": { - "description": "An identifier that uniquely identifies the operation. You can use this\nidentifier to retrieve the Operations resource that has information about\nthe operation.", + "description": "An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.", "type": "string" } }, diff --git a/src/apis/sqladmin/README.md b/src/apis/sqladmin/README.md new file mode 100644 index 00000000000..644cc7732f8 --- /dev/null +++ b/src/apis/sqladmin/README.md @@ -0,0 +1,47 @@ +Google Inc. logo + +# sqladmin + +> API for Cloud SQL database instance management + +## Installation + +```sh +$ npm install googleapis +``` + +## Usage +All documentation and usage information can be found on [GitHub](https://github.com/googleapis/google-api-nodejs-client). + +## Building a browser bundle + +This library can be used in a browser. To prepare a single file bundle, clone the +[repository](https://github.com/googleapis/google-api-nodejs-client) and run + +```sh +$ cd src/apis/sqladmin +$ npm install +$ npm run webpack +``` + +The generated bundle will be written to `dist/sqladmin.min.js`. Use it from your HTML file: + +```html + + +``` + +## License +This library is licensed under Apache 2.0. Full license text is available in [LICENSE](https://github.com/googleapis/google-api-nodejs-client/blob/master/LICENSE). + +## Contributing +We love contributions! Before submitting a Pull Request, it's always good to start with a new issue first. To learn more, see [CONTRIBUTING](https://github.com/google/google-api-nodejs-client/blob/master/.github/CONTRIBUTING.md). + +## Questions/problems? +* Ask your development related questions on [StackOverflow](http://stackoverflow.com/questions/tagged/google-api-nodejs-client). +* If you've found an bug/issue, please [file it on GitHub](https://github.com/googleapis/google-api-nodejs-client/issues). + + +*Crafted with ❤️ by the Google Node.js team* diff --git a/src/apis/sqladmin/index.ts b/src/apis/sqladmin/index.ts new file mode 100644 index 00000000000..f4690109476 --- /dev/null +++ b/src/apis/sqladmin/index.ts @@ -0,0 +1,35 @@ +// Copyright 2020 Google LLC +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*! THIS FILE IS AUTO-GENERATED */ + +import {AuthPlus, getAPI, GoogleConfigurable} from 'googleapis-common'; +import {sqladmin_v1beta4} from './v1beta4'; + +export const VERSIONS = { + v1beta4: sqladmin_v1beta4.Sqladmin, +}; + +export function sqladmin(version: 'v1beta4'): sqladmin_v1beta4.Sqladmin; +export function sqladmin( + options: sqladmin_v1beta4.Options +): sqladmin_v1beta4.Sqladmin; +export function sqladmin( + this: GoogleConfigurable, + versionOrOptions: 'v1beta4' | sqladmin_v1beta4.Options +) { + return getAPI('sqladmin', versionOrOptions, VERSIONS, this); +} + +const auth = new AuthPlus(); +export {auth}; diff --git a/src/apis/sqladmin/package.json b/src/apis/sqladmin/package.json new file mode 100644 index 00000000000..82135e83146 --- /dev/null +++ b/src/apis/sqladmin/package.json @@ -0,0 +1,43 @@ +{ + "name": "@google/sqladmin", + "version": "0.1.0", + "description": "sqladmin", + "main": "build/index.js", + "types": "build/index.d.ts", + "keywords": [ + "google" + ], + "author": "Google LLC", + "license": "Apache-2.0", + "homepage": "https://github.com/googleapis/google-api-nodejs-client", + "bugs": { + "url": "https://github.com/googleapis/google-api-nodejs-client/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-api-nodejs-client.git" + }, + "engines": { + "node": ">=10.0.0" + }, + "scripts": { + "fix": "gts fix", + "lint": "gts check", + "compile": "tsc -p .", + "prepare": "npm run compile", + "docs": "typedoc --out docs/", + "webpack": "webpack" + }, + "dependencies": { + "googleapis-common": "^4.4.0" + }, + "devDependencies": { + "gts": "^2.0.0", + "null-loader": "^4.0.0", + "ts-loader": "^8.0.0", + "typedoc": "^0.19.0", + "typescript": "~3.7.0", + "webpack": "^4.35.3", + "webpack-cli": "^3.3.5" + } +} diff --git a/src/apis/sqladmin/tsconfig.json b/src/apis/sqladmin/tsconfig.json new file mode 100644 index 00000000000..e0810904968 --- /dev/null +++ b/src/apis/sqladmin/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build" + }, + "include": [ + "*.ts", + ] +} diff --git a/src/apis/sqladmin/v1beta4.ts b/src/apis/sqladmin/v1beta4.ts new file mode 100644 index 00000000000..46ae039a56d --- /dev/null +++ b/src/apis/sqladmin/v1beta4.ts @@ -0,0 +1,9719 @@ +// Copyright 2020 Google LLC +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/class-name-casing */ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable no-irregular-whitespace */ + +import { + OAuth2Client, + JWT, + Compute, + UserRefreshClient, + GaxiosPromise, + GoogleConfigurable, + createAPIRequest, + MethodOptions, + StreamMethodOptions, + GlobalOptions, + GoogleAuth, + BodyResponseCallback, + APIRequestContext, +} from 'googleapis-common'; +import {Readable} from 'stream'; + +export namespace sqladmin_v1beta4 { + export interface Options extends GlobalOptions { + version: 'v1beta4'; + } + + interface StandardParameters { + /** + * Auth client or API Key for the request + */ + auth?: + | string + | OAuth2Client + | JWT + | Compute + | UserRefreshClient + | GoogleAuth; + + /** + * V1 error format. + */ + '$.xgafv'?: string; + /** + * OAuth access token. + */ + access_token?: string; + /** + * Data format for response. + */ + alt?: string; + /** + * JSONP + */ + callback?: string; + /** + * Selector specifying which fields to include in a partial response. + */ + fields?: string; + /** + * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + */ + key?: string; + /** + * OAuth 2.0 token for the current user. + */ + oauth_token?: string; + /** + * Returns response with indentations and line breaks. + */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + */ + quotaUser?: string; + /** + * Legacy upload protocol for media (e.g. "media", "multipart"). + */ + uploadType?: string; + /** + * Upload protocol for media (e.g. "raw", "multipart"). + */ + upload_protocol?: string; + } + + /** + * Cloud SQL Admin API + * + * API for Cloud SQL database instance management + * + * @example + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * @namespace sqladmin + * @type {Function} + * @version v1beta4 + * @variation v1beta4 + * @param {object=} options Options for Sqladmin + */ + export class Sqladmin { + context: APIRequestContext; + backupRuns: Resource$Backupruns; + databases: Resource$Databases; + flags: Resource$Flags; + instances: Resource$Instances; + operations: Resource$Operations; + projects: Resource$Projects; + sslCerts: Resource$Sslcerts; + tiers: Resource$Tiers; + users: Resource$Users; + + constructor(options: GlobalOptions, google?: GoogleConfigurable) { + this.context = { + _options: options || {}, + google, + }; + + this.backupRuns = new Resource$Backupruns(this.context); + this.databases = new Resource$Databases(this.context); + this.flags = new Resource$Flags(this.context); + this.instances = new Resource$Instances(this.context); + this.operations = new Resource$Operations(this.context); + this.projects = new Resource$Projects(this.context); + this.sslCerts = new Resource$Sslcerts(this.context); + this.tiers = new Resource$Tiers(this.context); + this.users = new Resource$Users(this.context); + } + } + + /** + * An entry for an Access Control list. + */ + export interface Schema$AclEntry { + /** + * The time when this access control entry expires in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. + */ + expirationTime?: string | null; + /** + * This is always *sql#aclEntry*. + */ + kind?: string | null; + /** + * Optional. A label to identify this entry. + */ + name?: string | null; + /** + * The allowlisted value for the access control list. + */ + value?: string | null; + } + /** + * An Admin API warning message. + */ + export interface Schema$ApiWarning { + /** + * Code to uniquely identify the warning type. + */ + code?: string | null; + /** + * The warning message. + */ + message?: string | null; + } + /** + * Database instance backup configuration. + */ + export interface Schema$BackupConfiguration { + /** + * (MySQL only) Whether binary log is enabled. If backup configuration is disabled, binarylog must be disabled as well. + */ + binaryLogEnabled?: boolean | null; + /** + * Whether this configuration is enabled. + */ + enabled?: boolean | null; + /** + * This is always *sql#backupConfiguration*. + */ + kind?: string | null; + /** + * Location of the backup + */ + location?: string | null; + /** + * Reserved for future use. + */ + pointInTimeRecoveryEnabled?: boolean | null; + /** + * Reserved for future use. + */ + replicationLogArchivingEnabled?: boolean | null; + /** + * Start time for the daily backup configuration in UTC timezone in the 24 hour format - *HH:MM*. + */ + startTime?: string | null; + } + /** + * A BackupRun resource. + */ + export interface Schema$BackupRun { + /** + * Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT. + */ + backupKind?: string | null; + /** + * The description of this run, only applicable to on-demand backups. + */ + description?: string | null; + /** + * Encryption configuration specific to a backup. Applies only to Second Generation instances. + */ + diskEncryptionConfiguration?: Schema$DiskEncryptionConfiguration; + /** + * Encryption status specific to a backup. Applies only to Second Generation instances. + */ + diskEncryptionStatus?: Schema$DiskEncryptionStatus; + /** + * The time the backup operation completed in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. + */ + endTime?: string | null; + /** + * The time the run was enqueued in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. + */ + enqueuedTime?: string | null; + /** + * Information about why the backup operation failed. This is only present if the run has the FAILED status. + */ + error?: Schema$OperationError; + /** + * The identifier for this backup run. Unique only for a specific Cloud SQL instance. + */ + id?: string | null; + /** + * Name of the database instance. + */ + instance?: string | null; + /** + * This is always *sql#backupRun*. + */ + kind?: string | null; + /** + * Location of the backups. + */ + location?: string | null; + /** + * The URI of this resource. + */ + selfLink?: string | null; + /** + * The time the backup operation actually started in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. + */ + startTime?: string | null; + /** + * The status of this run. + */ + status?: string | null; + /** + * The type of this run; can be either "AUTOMATED" or "ON_DEMAND". + */ + type?: string | null; + /** + * The start time of the backup window during which this the backup was attempted in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. + */ + windowStartTime?: string | null; + } + /** + * Backup run list results. + */ + export interface Schema$BackupRunsListResponse { + /** + * A list of backup runs in reverse chronological order of the enqueued time. + */ + items?: Schema$BackupRun[]; + /** + * This is always *sql#backupRunsList*. + */ + kind?: string | null; + /** + * The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + */ + nextPageToken?: string | null; + } + /** + * Binary log coordinates. + */ + export interface Schema$BinLogCoordinates { + /** + * Name of the binary log file for a Cloud SQL instance. + */ + binLogFileName?: string | null; + /** + * Position (offset) within the binary log file. + */ + binLogPosition?: string | null; + /** + * This is always *sql#binLogCoordinates*. + */ + kind?: string | null; + } + /** + * Database instance clone context. + */ + export interface Schema$CloneContext { + /** + * Binary log coordinates, if specified, identify the position up to which the source instance is cloned. If not specified, the source instance is cloned up to the most recent binary log coordinates. + */ + binLogCoordinates?: Schema$BinLogCoordinates; + /** + * Name of the Cloud SQL instance to be created as a clone. + */ + destinationInstanceName?: string | null; + /** + * This is always *sql#cloneContext*. + */ + kind?: string | null; + /** + * Reserved for future use. + */ + pitrTimestampMs?: string | null; + /** + * Reserved for future use. + */ + pointInTime?: string | null; + } + /** + * Represents a SQL database on the Cloud SQL instance. + */ + export interface Schema$Database { + /** + * The Cloud SQL charset value. + */ + charset?: string | null; + /** + * The Cloud SQL collation value. + */ + collation?: string | null; + /** + * This field is deprecated and will be removed from a future version of the API. + */ + etag?: string | null; + /** + * The name of the Cloud SQL instance. This does not include the project ID. + */ + instance?: string | null; + /** + * This is always *sql#database*. + */ + kind?: string | null; + /** + * The name of the database in the Cloud SQL instance. This does not include the project ID or instance name. + */ + name?: string | null; + /** + * The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. + */ + project?: string | null; + /** + * The URI of this resource. + */ + selfLink?: string | null; + sqlserverDatabaseDetails?: Schema$SqlServerDatabaseDetails; + } + /** + * Database flags for Cloud SQL instances. + */ + export interface Schema$DatabaseFlags { + /** + * The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags are specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation. + */ + name?: string | null; + /** + * The value of the flag. Booleans are set to *on* for true and *off* for false. This field must be omitted if the flag doesn't take a value. + */ + value?: string | null; + } + /** + * A Cloud SQL instance resource. Next field: 36 + */ + export interface Schema$DatabaseInstance { + /** + * *SECOND_GEN*: Cloud SQL database instance. *EXTERNAL*: A database server that is not managed by Google. This property is read-only; use the *tier* property in the *settings* object to determine the database type. + */ + backendType?: string | null; + /** + * Connection name of the Cloud SQL instance used in connection strings. + */ + connectionName?: string | null; + /** + * The current disk usage of the instance in bytes. This property has been deprecated. Use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details. + */ + currentDiskSize?: string | null; + /** + * The database engine type and version. The *databaseVersion* field cannot be changed after instance creation. MySQL instances: *MYSQL_8_0*, *MYSQL_5_7* (default), or *MYSQL_5_6*. PostgreSQL instances: *POSTGRES_9_6*, *POSTGRES_10*, *POSTGRES_11* or *POSTGRES_12* (default). SQL Server instances: *SQLSERVER_2017_STANDARD* (default), *SQLSERVER_2017_ENTERPRISE*, *SQLSERVER_2017_EXPRESS*, or *SQLSERVER_2017_WEB*. + */ + databaseVersion?: string | null; + /** + * Disk encryption configuration specific to an instance. Applies only to Second Generation instances. + */ + diskEncryptionConfiguration?: Schema$DiskEncryptionConfiguration; + /** + * Disk encryption status specific to an instance. Applies only to Second Generation instances. + */ + diskEncryptionStatus?: Schema$DiskEncryptionStatus; + /** + * This field is deprecated and will be removed from a future version of the API. Use the *settings.settingsVersion* field instead. + */ + etag?: string | null; + /** + * The name and status of the failover replica. This property is applicable only to Second Generation instances. + */ + failoverReplica?: {available?: boolean; name?: string} | null; + /** + * The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. + */ + gceZone?: string | null; + /** + * The instance type. This can be one of the following. *CLOUD_SQL_INSTANCE*: A Cloud SQL instance that is not replicating from a primary instance. *ON_PREMISES_INSTANCE*: An instance running on the customer's premises. *READ_REPLICA_INSTANCE*: A Cloud SQL instance configured as a read-replica. + */ + instanceType?: string | null; + /** + * The assigned IP addresses for the instance. + */ + ipAddresses?: Schema$IpMapping[]; + /** + * The IPv6 address assigned to the instance. (Deprecated) This property was applicable only to First Generation instances. + */ + ipv6Address?: string | null; + /** + * This is always *sql#instance*. + */ + kind?: string | null; + /** + * The name of the instance which will act as primary in the replication setup. + */ + masterInstanceName?: string | null; + /** + * The maximum disk size of the instance in bytes. + */ + maxDiskSize?: string | null; + /** + * Name of the Cloud SQL instance. This does not include the project ID. + */ + name?: string | null; + /** + * Configuration specific to on-premises instances. + */ + onPremisesConfiguration?: Schema$OnPremisesConfiguration; + /** + * The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable. + */ + project?: string | null; + /** + * The geographical region. Can be *us-central* (*FIRST_GEN* instances only) *us-central1* (*SECOND_GEN* instances only) *asia-east1* or *europe-west1*. Defaults to *us-central* or *us-central1* depending on the instance type. The region cannot be changed after instance creation. + */ + region?: string | null; + /** + * Configuration specific to failover replicas and read replicas. + */ + replicaConfiguration?: Schema$ReplicaConfiguration; + /** + * The replicas of the instance. + */ + replicaNames?: string[] | null; + /** + * Initial root password. Use only on creation. + */ + rootPassword?: string | null; + /** + * The start time of any upcoming scheduled maintenance for this instance. + */ + scheduledMaintenance?: Schema$SqlScheduledMaintenance; + /** + * The URI of this resource. + */ + selfLink?: string | null; + /** + * SSL configuration. + */ + serverCaCert?: Schema$SslCert; + /** + * The service account email address assigned to the instance. This property is applicable only to Second Generation instances. + */ + serviceAccountEmailAddress?: string | null; + /** + * The user settings. + */ + settings?: Schema$Settings; + /** + * The current serving state of the Cloud SQL instance. This can be one of the following. *RUNNABLE*: The instance is running, or is ready to run when accessed. *SUSPENDED*: The instance is not available, for example due to problems with billing. *PENDING_CREATE*: The instance is being created. *MAINTENANCE*: The instance is down for maintenance. *FAILED*: The instance creation failed. *UNKNOWN_STATE*: The state of the instance is unknown. + */ + state?: string | null; + /** + * If the instance state is SUSPENDED, the reason for the suspension. + */ + suspensionReason?: string[] | null; + } + /** + * Database list response. + */ + export interface Schema$DatabasesListResponse { + /** + * List of database resources in the instance. + */ + items?: Schema$Database[]; + /** + * This is always *sql#databasesList*. + */ + kind?: string | null; + } + /** + * Read-replica configuration for connecting to the on-premises primary instance. + */ + export interface Schema$DemoteMasterConfiguration { + /** + * This is always *sql#demoteMasterConfiguration*. + */ + kind?: string | null; + /** + * MySQL specific configuration when replicating from a MySQL on-premises primary instance. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named *master.info* in the data directory. + */ + mysqlReplicaConfiguration?: Schema$DemoteMasterMySqlReplicaConfiguration; + } + /** + * Database instance demote primary instance context. + */ + export interface Schema$DemoteMasterContext { + /** + * This is always *sql#demoteMasterContext*. + */ + kind?: string | null; + /** + * The name of the instance which will act as on-premises primary instance in the replication setup. + */ + masterInstanceName?: string | null; + /** + * Configuration specific to read-replicas replicating from the on-premises primary instance. + */ + replicaConfiguration?: Schema$DemoteMasterConfiguration; + /** + * Verify GTID consistency for demote operation. Default value: *True*. Second Generation instances only. Setting this flag to false enables you to bypass GTID consistency check between on-premises primary instance and Cloud SQL instance during the demotion operation but also exposes you to the risk of future replication failures. Change the value only if you know the reason for the GTID divergence and are confident that doing so will not cause any replication issues. + */ + verifyGtidConsistency?: boolean | null; + } + /** + * Read-replica configuration specific to MySQL databases. + */ + export interface Schema$DemoteMasterMySqlReplicaConfiguration { + /** + * PEM representation of the trusted CA's x509 certificate. + */ + caCertificate?: string | null; + /** + * PEM representation of the replica's x509 certificate. + */ + clientCertificate?: string | null; + /** + * PEM representation of the replica's private key. The corresponsing public key is encoded in the client's certificate. The format of the replica's private key can be either PKCS #1 or PKCS #8. + */ + clientKey?: string | null; + /** + * This is always *sql#demoteMasterMysqlReplicaConfiguration*. + */ + kind?: string | null; + /** + * The password for the replication connection. + */ + password?: string | null; + /** + * The username for the replication connection. + */ + username?: string | null; + } + /** + * Deny Maintenance Periods. This specifies a date range during when all CSA rollout will be denied. + */ + export interface Schema$DenyMaintenancePeriod { + /** + * "deny maintenance period" end date. If the year of the end date is empty, the year of the start date also must be empty. In this case, it means the deny maintenance period recurs every year. The date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01 + */ + endDate?: string | null; + /** + * "deny maintenance period" start date. If the year of the start date is empty, the year of the end date also must be empty. In this case, it means the deny maintenance period recurs every year. The date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01 + */ + startDate?: string | null; + /** + * Time in UTC when the "deny maintenance period" starts on start_date and ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00 + */ + time?: string | null; + } + /** + * Disk encryption configuration for an instance. + */ + export interface Schema$DiskEncryptionConfiguration { + /** + * This is always *sql#diskEncryptionConfiguration*. + */ + kind?: string | null; + /** + * Resource name of KMS key for disk encryption + */ + kmsKeyName?: string | null; + } + /** + * Disk encryption status for an instance. + */ + export interface Schema$DiskEncryptionStatus { + /** + * This is always *sql#diskEncryptionStatus*. + */ + kind?: string | null; + /** + * KMS key version used to encrypt the Cloud SQL instance resource + */ + kmsKeyVersionName?: string | null; + } + /** + * Database instance export context. + */ + export interface Schema$ExportContext { + /** + * Options for exporting data as CSV. + */ + csvExportOptions?: {selectQuery?: string} | null; + /** + * Databases to be exported. *MySQL instances:* If *fileType* is *SQL* and no database is specified, all databases are exported, except for the *mysql* system database. If *fileType* is *CSV*, you can specify one database, either by using this property or by using the *csvExportOptions.selectQuery* property, which takes precedence over this property. *PostgreSQL instances:* You must specify one database to be exported. If *fileType* is *CSV*, this database must match the one specified in the *csvExportOptions.selectQuery* property. + */ + databases?: string[] | null; + /** + * The file type for the specified uri. *SQL*: The file contains SQL statements. *CSV*: The file contains CSV data. + */ + fileType?: string | null; + /** + * This is always *sql#exportContext*. + */ + kind?: string | null; + /** + * Option for export offload. + */ + offload?: boolean | null; + /** + * Options for exporting data as SQL statements. + */ + sqlExportOptions?: { + mysqlExportOptions?: {masterData?: number}; + schemaOnly?: boolean; + tables?: string[]; + } | null; + /** + * The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form *gs: //bucketName/fileName*. If the file already exists, the requests // succeeds, but the operation fails. If *fileType* is // *SQL* and the filename ends with .gz, the contents are // compressed. + */ + uri?: string | null; + } + /** + * Database instance failover context. + */ + export interface Schema$FailoverContext { + /** + * This is always *sql#failoverContext*. + */ + kind?: string | null; + /** + * The current settings version of this instance. Request will be rejected if this version doesn't match the current settings version. + */ + settingsVersion?: string | null; + } + /** + * A flag resource. + */ + export interface Schema$Flag { + /** + * Use this field if only certain integers are accepted. Can be combined with min_value and max_value to add additional values. + */ + allowedIntValues?: string[] | null; + /** + * For *STRING* flags, a list of strings that the value can be set to. + */ + allowedStringValues?: string[] | null; + /** + * The database version this flag applies to. Can be *MYSQL_8_0*, *MYSQL_5_6*, or *MYSQL_5_7*. + */ + appliesTo?: string[] | null; + /** + * Whether or not the flag is considered in beta. + */ + inBeta?: boolean | null; + /** + * This is always *sql#flag*. + */ + kind?: string | null; + /** + * For *INTEGER* flags, the maximum allowed value. + */ + maxValue?: string | null; + /** + * For *INTEGER* flags, the minimum allowed value. + */ + minValue?: string | null; + /** + * This is the name of the flag. Flag names always use underscores, not hyphens, for example: *max_allowed_packet* + */ + name?: string | null; + /** + * Indicates whether changing this flag will trigger a database restart. Only applicable to Second Generation instances. + */ + requiresRestart?: boolean | null; + /** + * The type of the flag. Flags are typed to being *BOOLEAN*, *STRING*, *INTEGER* or *NONE*. *NONE* is used for flags which do not take a value, such as *skip_grant_tables*. + */ + type?: string | null; + } + /** + * Flags list response. + */ + export interface Schema$FlagsListResponse { + /** + * List of flags. + */ + items?: Schema$Flag[]; + /** + * This is always *sql#flagsList*. + */ + kind?: string | null; + } + /** + * Database instance import context. + */ + export interface Schema$ImportContext { + /** + * Import parameters specific to SQL Server .BAK files + */ + bakImportOptions?: { + encryptionOptions?: { + certPath?: string; + pvkPassword?: string; + pvkPath?: string; + }; + } | null; + /** + * Options for importing data as CSV. + */ + csvImportOptions?: {columns?: string[]; table?: string} | null; + /** + * 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. + */ + database?: string | null; + /** + * The file type for the specified uri. *SQL*: The file contains SQL statements. *CSV*: The file contains CSV data. + */ + fileType?: string | null; + /** + * The PostgreSQL user for this import operation. PostgreSQL instances only. + */ + importUser?: string | null; + /** + * This is always *sql#importContext*. + */ + kind?: string | null; + /** + * 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. + */ + uri?: string | null; + } + /** + * Database instance clone request. + */ + export interface Schema$InstancesCloneRequest { + /** + * Contains details about the clone operation. + */ + cloneContext?: Schema$CloneContext; + } + /** + * Database demote primary instance request. + */ + export interface Schema$InstancesDemoteMasterRequest { + /** + * Contains details about the demoteMaster operation. + */ + demoteMasterContext?: Schema$DemoteMasterContext; + } + /** + * Database instance export request. + */ + export interface Schema$InstancesExportRequest { + /** + * Contains details about the export operation. + */ + exportContext?: Schema$ExportContext; + } + /** + * Instance failover request. + */ + export interface Schema$InstancesFailoverRequest { + /** + * Failover Context. + */ + failoverContext?: Schema$FailoverContext; + } + /** + * Database instance import request. + */ + export interface Schema$InstancesImportRequest { + /** + * Contains details about the import operation. + */ + importContext?: Schema$ImportContext; + } + /** + * Database instances list response. + */ + export interface Schema$InstancesListResponse { + /** + * List of database instance resources. + */ + items?: Schema$DatabaseInstance[]; + /** + * This is always *sql#instancesList*. + */ + kind?: string | null; + /** + * The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + */ + nextPageToken?: string | null; + /** + * List of warnings that occurred while handling the request. + */ + warnings?: Schema$ApiWarning[]; + } + /** + * Instances ListServerCas response. + */ + export interface Schema$InstancesListServerCasResponse { + activeVersion?: string | null; + /** + * List of server CA certificates for the instance. + */ + certs?: Schema$SslCert[]; + /** + * This is always *sql#instancesListServerCas*. + */ + kind?: string | null; + } + /** + * Database instance restore backup request. + */ + export interface Schema$InstancesRestoreBackupRequest { + /** + * Parameters required to perform the restore backup operation. + */ + restoreBackupContext?: Schema$RestoreBackupContext; + } + /** + * Rotate Server CA request. + */ + export interface Schema$InstancesRotateServerCaRequest { + /** + * Contains details about the rotate server CA operation. + */ + rotateServerCaContext?: Schema$RotateServerCaContext; + } + /** + * Instance truncate log request. + */ + export interface Schema$InstancesTruncateLogRequest { + /** + * Contains details about the truncate log operation. + */ + truncateLogContext?: Schema$TruncateLogContext; + } + /** + * IP Management configuration. + */ + export interface Schema$IpConfiguration { + /** + * The list of external networks that are allowed to connect to the instance using the IP. In 'CIDR' notation, also known as 'slash' notation (for example: *192.168.100.0/24*). + */ + authorizedNetworks?: Schema$AclEntry[]; + /** + * Whether the instance is assigned a public IP address or not. + */ + ipv4Enabled?: boolean | null; + /** + * The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, x/projects/myProject/global/networks/default*. This setting can be updated, but it cannot be removed after it is set. + */ + privateNetwork?: string | null; + /** + * Whether SSL connections over IP are enforced or not. + */ + requireSsl?: boolean | null; + } + /** + * Database instance IP Mapping. + */ + export interface Schema$IpMapping { + /** + * The IP address assigned. + */ + ipAddress?: string | null; + /** + * The due time for this IP to be retired in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. This field is only available when the IP is scheduled to be retired. + */ + timeToRetire?: string | null; + /** + * The type of this IP address. A *PRIMARY* address is a public address that can accept incoming connections. A *PRIVATE* address is a private address that can accept incoming connections. An *OUTGOING* address is the source address of connections originating from the instance, if supported. + */ + type?: string | null; + } + /** + * Preferred location. This specifies where a Cloud SQL instance is located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. + */ + export interface Schema$LocationPreference { + /** + * The App Engine application to follow, it must be in the same region as the Cloud SQL instance. + */ + followGaeApplication?: string | null; + /** + * This is always *sql#locationPreference*. + */ + kind?: string | null; + /** + * The preferred Compute Engine zone (for example: us-central1-a, us-central1-b, etc.). + */ + zone?: string | null; + } + /** + * Maintenance window. This specifies when a Cloud SQL instance is restarted for system maintenance purposes. + */ + export interface Schema$MaintenanceWindow { + /** + * day of week (1-7), starting on Monday. + */ + day?: number | null; + /** + * hour of day - 0 to 23. + */ + hour?: number | null; + /** + * This is always *sql#maintenanceWindow*. + */ + kind?: string | null; + /** + * Maintenance timing setting: *canary* (Earlier) or *stable* (Later). Learn more. + */ + updateTrack?: string | null; + } + /** + * Read-replica configuration specific to MySQL databases. + */ + export interface Schema$MySqlReplicaConfiguration { + /** + * PEM representation of the trusted CA's x509 certificate. + */ + caCertificate?: string | null; + /** + * PEM representation of the replica's x509 certificate. + */ + clientCertificate?: string | null; + /** + * PEM representation of the replica's private key. The corresponsing public key is encoded in the client's certificate. + */ + clientKey?: string | null; + /** + * Seconds to wait between connect retries. MySQL's default is 60 seconds. + */ + connectRetryInterval?: number | null; + /** + * Path to a SQL dump file in Google Cloud Storage from which the replica instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps have the binlog co-ordinates from which replication begins. This can be accomplished by setting --master-data to 1 when using mysqldump. + */ + dumpFilePath?: string | null; + /** + * This is always *sql#mysqlReplicaConfiguration*. + */ + kind?: string | null; + /** + * Interval in milliseconds between replication heartbeats. + */ + masterHeartbeatPeriod?: string | null; + /** + * The password for the replication connection. + */ + password?: string | null; + /** + * A list of permissible ciphers to use for SSL encryption. + */ + sslCipher?: string | null; + /** + * The username for the replication connection. + */ + username?: string | null; + /** + * Whether or not to check the primary instance's Common Name value in the certificate that it sends during the SSL handshake. + */ + verifyServerCertificate?: boolean | null; + } + /** + * On-premises instance configuration. + */ + export interface Schema$OnPremisesConfiguration { + /** + * PEM representation of the trusted CA's x509 certificate. + */ + caCertificate?: string | null; + /** + * PEM representation of the replica's x509 certificate. + */ + clientCertificate?: string | null; + /** + * PEM representation of the replica's private key. The corresponsing public key is encoded in the client's certificate. + */ + clientKey?: string | null; + /** + * The dump file to create the Cloud SQL replica. + */ + dumpFilePath?: string | null; + /** + * The host and port of the on-premises instance in host:port format + */ + hostPort?: string | null; + /** + * This is always *sql#onPremisesConfiguration*. + */ + kind?: string | null; + /** + * The password for connecting to on-premises instance. + */ + password?: string | null; + /** + * The username for connecting to on-premises instance. + */ + username?: string | null; + } + /** + * An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. + */ + export interface Schema$Operation { + /** + * The time this operation finished in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. + */ + endTime?: string | null; + /** + * If errors occurred during processing of this operation, this field will be populated. + */ + error?: Schema$OperationErrors; + /** + * The context for export operation, if applicable. + */ + exportContext?: Schema$ExportContext; + /** + * The context for import operation, if applicable. + */ + importContext?: Schema$ImportContext; + /** + * The time this operation was enqueued in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. + */ + insertTime?: string | null; + /** + * This is always *sql#operation*. + */ + kind?: string | null; + /** + * An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. + */ + name?: string | null; + /** + * The type of the operation. Valid values are: *CREATE* *DELETE* *UPDATE* *RESTART* *IMPORT* *EXPORT* *BACKUP_VOLUME* *RESTORE_VOLUME* *CREATE_USER* *DELETE_USER* *CREATE_DATABASE* *DELETE_DATABASE* + */ + operationType?: string | null; + /** + * The URI of this resource. + */ + selfLink?: string | null; + /** + * The time this operation actually started in UTC timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. + */ + startTime?: string | null; + /** + * The status of an operation. Valid values are: *PENDING* *RUNNING* *DONE* *SQL_OPERATION_STATUS_UNSPECIFIED* + */ + status?: string | null; + /** + * Name of the database instance related to this operation. + */ + targetId?: string | null; + targetLink?: string | null; + /** + * The project ID of the target instance related to this operation. + */ + targetProject?: string | null; + /** + * The email address of the user who initiated this operation. + */ + user?: string | null; + } + /** + * Database instance operation error. + */ + export interface Schema$OperationError { + /** + * Identifies the specific error that occurred. + */ + code?: string | null; + /** + * This is always *sql#operationError*. + */ + kind?: string | null; + /** + * Additional information about the error encountered. + */ + message?: string | null; + } + /** + * Database instance operation errors list wrapper. + */ + export interface Schema$OperationErrors { + /** + * The list of errors encountered while processing this operation. + */ + errors?: Schema$OperationError[]; + /** + * This is always *sql#operationErrors*. + */ + kind?: string | null; + } + /** + * Database instance list operations response. + */ + export interface Schema$OperationsListResponse { + /** + * List of operation resources. + */ + items?: Schema$Operation[]; + /** + * This is always *sql#operationsList*. + */ + kind?: string | null; + /** + * The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + */ + nextPageToken?: string | null; + } + /** + * Read-replica configuration for connecting to the primary instance. + */ + export interface Schema$ReplicaConfiguration { + /** + * Specifies if the replica is the failover target. If the field is set to *true* the replica will be designated as a failover replica. In case the primary instance fails, the replica instance will be promoted as the new primary instance. Only one replica can be specified as failover target, and the replica has to be in different zone with the primary instance. + */ + failoverTarget?: boolean | null; + /** + * This is always *sql#replicaConfiguration*. + */ + kind?: string | null; + /** + * MySQL specific configuration when replicating from a MySQL on-premises primary instance. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named *master.info* in the data directory. + */ + mysqlReplicaConfiguration?: Schema$MySqlReplicaConfiguration; + } + export interface Schema$Reschedule { + /** + * Required. The type of the reschedule. + */ + rescheduleType?: string | null; + /** + * Optional. Timestamp when the maintenance shall be rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. + */ + scheduleTime?: string | null; + } + /** + * Database instance restore from backup context. Backup context contains source instance id and project id. + */ + export interface Schema$RestoreBackupContext { + /** + * The ID of the backup run to restore from. + */ + backupRunId?: string | null; + /** + * The ID of the instance that the backup was taken from. + */ + instanceId?: string | null; + /** + * This is always *sql#restoreBackupContext*. + */ + kind?: string | null; + /** + * The full project ID of the source instance. + */ + project?: string | null; + } + /** + * Instance rotate server CA context. + */ + export interface Schema$RotateServerCaContext { + /** + * This is always *sql#rotateServerCaContext*. + */ + kind?: string | null; + /** + * The fingerprint of the next version to be rotated to. If left unspecified, will be rotated to the most recently added server CA version. + */ + nextVersion?: string | null; + } + /** + * Database instance settings. + */ + export interface Schema$Settings { + /** + * The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values: *ALWAYS*: The instance is on, and remains so even in the absence of connection requests. *NEVER*: The instance is off; it is not activated, even if a connection request arrives. + */ + activationPolicy?: string | null; + /** + * Active Directory configuration, for now relevant only for SQL Server + */ + activeDirectoryConfig?: Schema$SqlActiveDirectoryConfig; + /** + * The App Engine app IDs that can access this instance. (Deprecated) Applied to First Generation instances only. + */ + authorizedGaeApplications?: string[] | null; + /** + * Availability type. Potential values: *ZONAL*: The instance serves data from only one zone. Outages in that zone affect data accessibility. *REGIONAL*: The instance can serve data from more than one zone in a region (it is highly available). For more information, see Overview of the High Availability Configuration. + */ + availabilityType?: string | null; + /** + * The daily backup configuration for the instance. + */ + backupConfiguration?: Schema$BackupConfiguration; + /** + * The name of server Instance collation. + */ + collation?: string | null; + /** + * Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property was only applicable to First Generation instances. + */ + crashSafeReplicationEnabled?: boolean | null; + /** + * The database flags passed to the instance at startup. + */ + databaseFlags?: Schema$DatabaseFlags[]; + /** + * Configuration specific to read replica instances. Indicates whether replication is enabled or not. + */ + databaseReplicationEnabled?: boolean | null; + /** + * The size of data disk, in GB. The data disk size minimum is 10GB. + */ + dataDiskSizeGb?: string | null; + /** + * The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances. + */ + dataDiskType?: string | null; + /** + * Deny maintenance periods + */ + denyMaintenancePeriods?: Schema$DenyMaintenancePeriod[]; + /** + * The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances. + */ + ipConfiguration?: Schema$IpConfiguration; + /** + * This is always *sql#settings*. + */ + kind?: string | null; + /** + * The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location was only applicable to First Generation instances. + */ + locationPreference?: Schema$LocationPreference; + /** + * The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. + */ + maintenanceWindow?: Schema$MaintenanceWindow; + /** + * The pricing plan for this instance. This can be either *PER_USE* or *PACKAGE*. Only *PER_USE* is supported for Second Generation instances. + */ + pricingPlan?: string | null; + /** + * The type of replication this instance uses. This can be either *ASYNCHRONOUS* or *SYNCHRONOUS*. (Deprecated_ This property was only applicable to First Generation instances. + */ + replicationType?: string | null; + /** + * The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value. + */ + settingsVersion?: string | null; + /** + * Configuration to increase storage size automatically. The default value is true. + */ + storageAutoResize?: boolean | null; + /** + * The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. + */ + storageAutoResizeLimit?: string | null; + /** + * The tier (or machine type) for this instance, for example *db-n1-standard-1* (MySQL instances) or *db-custom-1-3840* (PostgreSQL instances). + */ + tier?: string | null; + /** + * User-provided labels, represented as a dictionary where each label is a single key value pair. + */ + userLabels?: {[key: string]: string} | null; + } + /** + * Active Directory configuration, for now relevant only for SQL Server + */ + export interface Schema$SqlActiveDirectoryConfig { + /** + * Domain name + */ + domain?: string | null; + /** + * This will be always sql#activeDirectoryConfig. + */ + kind?: string | null; + } + /** + * External primary instance migration setting error. + */ + export interface Schema$SqlExternalSyncSettingError { + /** + * Additional information about the error encountered. + */ + detail?: string | null; + /** + * This is always *sql#migrationSettingError*. + */ + kind?: string | null; + /** + * Identifies the specific error that occurred. + */ + type?: string | null; + } + /** + * Reschedule options for maintenance windows. + */ + export interface Schema$SqlInstancesRescheduleMaintenanceRequestBody { + /** + * Required. The type of the reschedule the user wants. + */ + reschedule?: Schema$Reschedule; + } + /** + * Instance verify external sync settings response. + */ + export interface Schema$SqlInstancesVerifyExternalSyncSettingsResponse { + /** + * List of migration violations. + */ + errors?: Schema$SqlExternalSyncSettingError[]; + /** + * This is always *sql#migrationSettingErrorList*. + */ + kind?: string | null; + } + /** + * Any scheduled maintenancce for this instance. + */ + export interface Schema$SqlScheduledMaintenance { + canDefer?: boolean | null; + /** + * If the scheduled maintenance can be rescheduled. + */ + canReschedule?: boolean | null; + /** + * The start time of any upcoming scheduled maintenance for this instance. + */ + startTime?: string | null; + } + /** + * Represents a Sql Server database on the Cloud SQL instance. + */ + export interface Schema$SqlServerDatabaseDetails { + /** + * The version of SQL Server with which the database is to be made compatible + */ + compatibilityLevel?: number | null; + /** + * The recovery model of a SQL Server database + */ + recoveryModel?: string | null; + } + /** + * Represents a Sql Server user on the Cloud SQL instance. + */ + export interface Schema$SqlServerUserDetails { + /** + * If the user has been disabled + */ + disabled?: boolean | null; + /** + * The server roles for this user + */ + serverRoles?: string[] | null; + } + /** + * SslCerts Resource + */ + export interface Schema$SslCert { + /** + * PEM representation. + */ + cert?: string | null; + /** + * Serial number, as extracted from the certificate. + */ + certSerialNumber?: string | null; + /** + * User supplied name. Constrained to [a-zA-Z.-_ ]+. + */ + commonName?: string | null; + /** + * The time when the certificate was created in RFC 3339 format, for example *2012-11-15T16:19:00.094Z* + */ + createTime?: string | null; + /** + * The time when the certificate expires in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. + */ + expirationTime?: string | null; + /** + * Name of the database instance. + */ + instance?: string | null; + /** + * This is always *sql#sslCert*. + */ + kind?: string | null; + /** + * The URI of this resource. + */ + selfLink?: string | null; + /** + * Sha1 Fingerprint. + */ + sha1Fingerprint?: string | null; + } + /** + * SslCertDetail. + */ + export interface Schema$SslCertDetail { + /** + * The public information about the cert. + */ + certInfo?: Schema$SslCert; + /** + * The private key for the client cert, in pem format. Keep private in order to protect your security. + */ + certPrivateKey?: string | null; + } + /** + * SslCerts create ephemeral certificate request. + */ + export interface Schema$SslCertsCreateEphemeralRequest { + /** + * PEM encoded public key to include in the signed certificate. + */ + public_key?: string | null; + } + /** + * SslCerts insert request. + */ + export interface Schema$SslCertsInsertRequest { + /** + * User supplied name. Must be a distinct name from the other certificates for this instance. + */ + commonName?: string | null; + } + /** + * SslCert insert response. + */ + export interface Schema$SslCertsInsertResponse { + /** + * The new client certificate and private key. + */ + clientCert?: Schema$SslCertDetail; + /** + * This is always *sql#sslCertsInsert*. + */ + kind?: string | null; + /** + * The operation to track the ssl certs insert request. + */ + operation?: Schema$Operation; + /** + * The server Certificate Authority's certificate. If this is missing you can force a new one to be generated by calling resetSslConfig method on instances resource. + */ + serverCaCert?: Schema$SslCert; + } + /** + * SslCerts list response. + */ + export interface Schema$SslCertsListResponse { + /** + * List of client certificates for the instance. + */ + items?: Schema$SslCert[]; + /** + * This is always *sql#sslCertsList*. + */ + kind?: string | null; + } + /** + * A Google Cloud SQL service tier resource. + */ + export interface Schema$Tier { + /** + * The maximum disk size of this tier in bytes. + */ + DiskQuota?: string | null; + /** + * This is always *sql#tier*. + */ + kind?: string | null; + /** + * The maximum RAM usage of this tier in bytes. + */ + RAM?: string | null; + /** + * The applicable regions for this tier. + */ + region?: string[] | null; + /** + * An identifier for the machine type, for example, db-n1-standard-1. For related information, see Pricing. + */ + tier?: string | null; + } + /** + * Tiers list response. + */ + export interface Schema$TiersListResponse { + /** + * List of tiers. + */ + items?: Schema$Tier[]; + /** + * This is always *sql#tiersList*. + */ + kind?: string | null; + } + /** + * Database Instance truncate log context. + */ + export interface Schema$TruncateLogContext { + /** + * This is always *sql#truncateLogContext*. + */ + kind?: string | null; + /** + * The type of log to truncate. Valid values are *MYSQL_GENERAL_TABLE* and *MYSQL_SLOW_TABLE*. + */ + logType?: string | null; + } + /** + * A Cloud SQL user resource. + */ + export interface Schema$User { + /** + * This field is deprecated and will be removed from a future version of the API. + */ + etag?: string | null; + /** + * The host name from which the user can connect. For *insert* operations, host defaults to an empty string. For *update* operations, host is specified as part of the request URL. The host name cannot be updated after insertion. + */ + host?: string | null; + /** + * The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for *update* since it is already specified on the URL. + */ + instance?: string | null; + /** + * This is always *sql#user*. + */ + kind?: string | null; + /** + * The name of the user in the Cloud SQL instance. Can be omitted for *update* since it is already specified in the URL. + */ + name?: string | null; + /** + * The password for the user. + */ + password?: string | null; + /** + * The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for *update* since it is already specified on the URL. + */ + project?: string | null; + sqlserverUserDetails?: Schema$SqlServerUserDetails; + /** + * The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type. + */ + type?: string | null; + } + /** + * User list response. + */ + export interface Schema$UsersListResponse { + /** + * List of user resources in the instance. + */ + items?: Schema$User[]; + /** + * This is always *sql#usersList*. + */ + kind?: string | null; + /** + * An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. + */ + nextPageToken?: string | null; + } + + export class Resource$Backupruns { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * sql.backupRuns.delete + * @desc Deletes the backup taken by a backup run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.backupRuns.delete({ + * // The ID of the Backup Run to delete. To find a Backup Run ID, use the list method. + * id: 'placeholder-value', + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.backupRuns.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the Backup Run to delete. To find a Backup Run ID, use the list method. + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete( + params: Params$Resource$Backupruns$Delete, + options: StreamMethodOptions + ): GaxiosPromise; + delete( + params?: Params$Resource$Backupruns$Delete, + options?: MethodOptions + ): GaxiosPromise; + delete( + params: Params$Resource$Backupruns$Delete, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Backupruns$Delete, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Backupruns$Delete, + callback: BodyResponseCallback + ): void; + delete(callback: BodyResponseCallback): void; + delete( + paramsOrCallback?: + | Params$Resource$Backupruns$Delete + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Backupruns$Delete; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Backupruns$Delete; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE', + }, + options + ), + params, + requiredParams: ['project', 'instance', 'id'], + pathParams: ['id', 'instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.backupRuns.get + * @desc Retrieves a resource containing information about a backup run. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.backupRuns.get({ + * // The ID of this Backup Run. + * id: 'placeholder-value', + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backupKind": "my_backupKind", + * // "description": "my_description", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "endTime": "my_endTime", + * // "enqueuedTime": "my_enqueuedTime", + * // "error": {}, + * // "id": "my_id", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "location": "my_location", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "windowStartTime": "my_windowStartTime" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.backupRuns.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of this Backup Run. + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get( + params: Params$Resource$Backupruns$Get, + options: StreamMethodOptions + ): GaxiosPromise; + get( + params?: Params$Resource$Backupruns$Get, + options?: MethodOptions + ): GaxiosPromise; + get( + params: Params$Resource$Backupruns$Get, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Backupruns$Get, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Backupruns$Get, + callback: BodyResponseCallback + ): void; + get(callback: BodyResponseCallback): void; + get( + paramsOrCallback?: + | Params$Resource$Backupruns$Get + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Backupruns$Get; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Backupruns$Get; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project', 'instance', 'id'], + pathParams: ['id', 'instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.backupRuns.insert + * @desc Creates a new backup run on demand. This method is applicable only to Second Generation instances. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.backupRuns.insert({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backupKind": "my_backupKind", + * // "description": "my_description", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "endTime": "my_endTime", + * // "enqueuedTime": "my_enqueuedTime", + * // "error": {}, + * // "id": "my_id", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "location": "my_location", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "type": "my_type", + * // "windowStartTime": "my_windowStartTime" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.backupRuns.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().BackupRun} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert( + params: Params$Resource$Backupruns$Insert, + options: StreamMethodOptions + ): GaxiosPromise; + insert( + params?: Params$Resource$Backupruns$Insert, + options?: MethodOptions + ): GaxiosPromise; + insert( + params: Params$Resource$Backupruns$Insert, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + insert( + params: Params$Resource$Backupruns$Insert, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + insert( + params: Params$Resource$Backupruns$Insert, + callback: BodyResponseCallback + ): void; + insert(callback: BodyResponseCallback): void; + insert( + paramsOrCallback?: + | Params$Resource$Backupruns$Insert + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Backupruns$Insert; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Backupruns$Insert; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.backupRuns.list + * @desc Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.backupRuns.list({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Maximum number of backup runs per response. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of results to view. + * pageToken: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.backupRuns.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {integer=} params.maxResults Maximum number of backup runs per response. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list( + params: Params$Resource$Backupruns$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Backupruns$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Backupruns$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Backupruns$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Backupruns$List, + callback: BodyResponseCallback + ): void; + list(callback: BodyResponseCallback): void; + list( + paramsOrCallback?: + | Params$Resource$Backupruns$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Backupruns$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Backupruns$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Backupruns$Delete + extends StandardParameters { + /** + * The ID of the Backup Run to delete. To find a Backup Run ID, use the list method. + */ + id?: string; + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Backupruns$Get extends StandardParameters { + /** + * The ID of this Backup Run. + */ + id?: string; + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Backupruns$Insert + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$BackupRun; + } + export interface Params$Resource$Backupruns$List extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Maximum number of backup runs per response. + */ + maxResults?: number; + /** + * A previously-returned page token representing part of the larger set of results to view. + */ + pageToken?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + + export class Resource$Databases { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * sql.databases.delete + * @desc Deletes a database from a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.databases.delete({ + * // Name of the database to be deleted in the instance. + * database: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.databases.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Name of the database to be deleted in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete( + params: Params$Resource$Databases$Delete, + options: StreamMethodOptions + ): GaxiosPromise; + delete( + params?: Params$Resource$Databases$Delete, + options?: MethodOptions + ): GaxiosPromise; + delete( + params: Params$Resource$Databases$Delete, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Databases$Delete, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Databases$Delete, + callback: BodyResponseCallback + ): void; + delete(callback: BodyResponseCallback): void; + delete( + paramsOrCallback?: + | Params$Resource$Databases$Delete + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Databases$Delete; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Databases$Delete; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE', + }, + options + ), + params, + requiredParams: ['project', 'instance', 'database'], + pathParams: ['database', 'instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.databases.get + * @desc Retrieves a resource containing information about a database inside a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.databases.get({ + * // Name of the database in the instance. + * database: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "charset": "my_charset", + * // "collation": "my_collation", + * // "etag": "my_etag", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "project": "my_project", + * // "selfLink": "my_selfLink", + * // "sqlserverDatabaseDetails": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.databases.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Name of the database in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get( + params: Params$Resource$Databases$Get, + options: StreamMethodOptions + ): GaxiosPromise; + get( + params?: Params$Resource$Databases$Get, + options?: MethodOptions + ): GaxiosPromise; + get( + params: Params$Resource$Databases$Get, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Databases$Get, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Databases$Get, + callback: BodyResponseCallback + ): void; + get(callback: BodyResponseCallback): void; + get( + paramsOrCallback?: + | Params$Resource$Databases$Get + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Databases$Get; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Databases$Get; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project', 'instance', 'database'], + pathParams: ['database', 'instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.databases.insert + * @desc Inserts a resource containing information about a database inside a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.databases.insert({ + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "charset": "my_charset", + * // "collation": "my_collation", + * // "etag": "my_etag", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "project": "my_project", + * // "selfLink": "my_selfLink", + * // "sqlserverDatabaseDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.databases.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().Database} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert( + params: Params$Resource$Databases$Insert, + options: StreamMethodOptions + ): GaxiosPromise; + insert( + params?: Params$Resource$Databases$Insert, + options?: MethodOptions + ): GaxiosPromise; + insert( + params: Params$Resource$Databases$Insert, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + insert( + params: Params$Resource$Databases$Insert, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + insert( + params: Params$Resource$Databases$Insert, + callback: BodyResponseCallback + ): void; + insert(callback: BodyResponseCallback): void; + insert( + paramsOrCallback?: + | Params$Resource$Databases$Insert + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Databases$Insert; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Databases$Insert; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.databases.list + * @desc Lists databases in the specified Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.databases.list({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.databases.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list( + params: Params$Resource$Databases$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Databases$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Databases$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Databases$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Databases$List, + callback: BodyResponseCallback + ): void; + list(callback: BodyResponseCallback): void; + list( + paramsOrCallback?: + | Params$Resource$Databases$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Databases$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Databases$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.databases.patch + * @desc Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.databases.patch({ + * // Name of the database to be updated in the instance. + * database: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "charset": "my_charset", + * // "collation": "my_collation", + * // "etag": "my_etag", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "project": "my_project", + * // "selfLink": "my_selfLink", + * // "sqlserverDatabaseDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.databases.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Name of the database to be updated in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().Database} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch( + params: Params$Resource$Databases$Patch, + options: StreamMethodOptions + ): GaxiosPromise; + patch( + params?: Params$Resource$Databases$Patch, + options?: MethodOptions + ): GaxiosPromise; + patch( + params: Params$Resource$Databases$Patch, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + patch( + params: Params$Resource$Databases$Patch, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + patch( + params: Params$Resource$Databases$Patch, + callback: BodyResponseCallback + ): void; + patch(callback: BodyResponseCallback): void; + patch( + paramsOrCallback?: + | Params$Resource$Databases$Patch + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Databases$Patch; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Databases$Patch; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH', + }, + options + ), + params, + requiredParams: ['project', 'instance', 'database'], + pathParams: ['database', 'instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.databases.update + * @desc Updates a resource containing information about a database inside a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.databases.update({ + * // Name of the database to be updated in the instance. + * database: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "charset": "my_charset", + * // "collation": "my_collation", + * // "etag": "my_etag", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "project": "my_project", + * // "selfLink": "my_selfLink", + * // "sqlserverDatabaseDetails": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.databases.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Name of the database to be updated in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().Database} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update( + params: Params$Resource$Databases$Update, + options: StreamMethodOptions + ): GaxiosPromise; + update( + params?: Params$Resource$Databases$Update, + options?: MethodOptions + ): GaxiosPromise; + update( + params: Params$Resource$Databases$Update, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + update( + params: Params$Resource$Databases$Update, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + update( + params: Params$Resource$Databases$Update, + callback: BodyResponseCallback + ): void; + update(callback: BodyResponseCallback): void; + update( + paramsOrCallback?: + | Params$Resource$Databases$Update + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Databases$Update; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Databases$Update; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT', + }, + options + ), + params, + requiredParams: ['project', 'instance', 'database'], + pathParams: ['database', 'instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Databases$Delete extends StandardParameters { + /** + * Name of the database to be deleted in the instance. + */ + database?: string; + /** + * Database instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Databases$Get extends StandardParameters { + /** + * Name of the database in the instance. + */ + database?: string; + /** + * Database instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Databases$Insert extends StandardParameters { + /** + * Database instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$Database; + } + export interface Params$Resource$Databases$List extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Databases$Patch extends StandardParameters { + /** + * Name of the database to be updated in the instance. + */ + database?: string; + /** + * Database instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$Database; + } + export interface Params$Resource$Databases$Update extends StandardParameters { + /** + * Name of the database to be updated in the instance. + */ + database?: string; + /** + * Database instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$Database; + } + + export class Resource$Flags { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * sql.flags.list + * @desc List all available database flags for Cloud SQL instances. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.flags.list({ + * // Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions. + * databaseVersion: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.flags.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.databaseVersion Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list( + params: Params$Resource$Flags$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Flags$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Flags$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Flags$List, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Flags$List, + callback: BodyResponseCallback + ): void; + list(callback: BodyResponseCallback): void; + list( + paramsOrCallback?: + | Params$Resource$Flags$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Flags$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Flags$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta4/flags').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: [], + pathParams: [], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Flags$List extends StandardParameters { + /** + * Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions. + */ + databaseVersion?: string; + } + + export class Resource$Instances { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * sql.instances.addServerCa + * @desc Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.addServerCa({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.addServerCa + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addServerCa( + params: Params$Resource$Instances$Addserverca, + options: StreamMethodOptions + ): GaxiosPromise; + addServerCa( + params?: Params$Resource$Instances$Addserverca, + options?: MethodOptions + ): GaxiosPromise; + addServerCa( + params: Params$Resource$Instances$Addserverca, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + addServerCa( + params: Params$Resource$Instances$Addserverca, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + addServerCa( + params: Params$Resource$Instances$Addserverca, + callback: BodyResponseCallback + ): void; + addServerCa(callback: BodyResponseCallback): void; + addServerCa( + paramsOrCallback?: + | Params$Resource$Instances$Addserverca + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Addserverca; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Addserverca; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/addServerCa' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.clone + * @desc Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.clone({ + * // The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the source as well as the clone Cloud SQL instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "cloneContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.clone + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID. + * @param {string} params.project Project ID of the source as well as the clone Cloud SQL instance. + * @param {().InstancesCloneRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clone( + params: Params$Resource$Instances$Clone, + options: StreamMethodOptions + ): GaxiosPromise; + clone( + params?: Params$Resource$Instances$Clone, + options?: MethodOptions + ): GaxiosPromise; + clone( + params: Params$Resource$Instances$Clone, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + clone( + params: Params$Resource$Instances$Clone, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + clone( + params: Params$Resource$Instances$Clone, + callback: BodyResponseCallback + ): void; + clone(callback: BodyResponseCallback): void; + clone( + paramsOrCallback?: + | Params$Resource$Instances$Clone + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Instances$Clone; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Clone; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/clone' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.delete + * @desc Deletes a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.delete({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance to be deleted. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete( + params: Params$Resource$Instances$Delete, + options: StreamMethodOptions + ): GaxiosPromise; + delete( + params?: Params$Resource$Instances$Delete, + options?: MethodOptions + ): GaxiosPromise; + delete( + params: Params$Resource$Instances$Delete, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Instances$Delete, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Instances$Delete, + callback: BodyResponseCallback + ): void; + delete(callback: BodyResponseCallback): void; + delete( + paramsOrCallback?: + | Params$Resource$Instances$Delete + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Instances$Delete; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Delete; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + '/sql/v1beta4/projects/{project}/instances/{instance}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.demoteMaster + * @desc Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.demoteMaster({ + * // Cloud SQL instance name. + * instance: 'placeholder-value', + * // ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "demoteMasterContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.demoteMaster + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance name. + * @param {string} params.project ID of the project that contains the instance. + * @param {().InstancesDemoteMasterRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + demoteMaster( + params: Params$Resource$Instances$Demotemaster, + options: StreamMethodOptions + ): GaxiosPromise; + demoteMaster( + params?: Params$Resource$Instances$Demotemaster, + options?: MethodOptions + ): GaxiosPromise; + demoteMaster( + params: Params$Resource$Instances$Demotemaster, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + demoteMaster( + params: Params$Resource$Instances$Demotemaster, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + demoteMaster( + params: Params$Resource$Instances$Demotemaster, + callback: BodyResponseCallback + ): void; + demoteMaster(callback: BodyResponseCallback): void; + demoteMaster( + paramsOrCallback?: + | Params$Resource$Instances$Demotemaster + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Demotemaster; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Demotemaster; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.export + * @desc Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: ['https://www.googleapis.com/auth/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.export({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance to be exported. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "exportContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be exported. + * @param {().InstancesExportRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export( + params: Params$Resource$Instances$Export, + options: StreamMethodOptions + ): GaxiosPromise; + export( + params?: Params$Resource$Instances$Export, + options?: MethodOptions + ): GaxiosPromise; + export( + params: Params$Resource$Instances$Export, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + export( + params: Params$Resource$Instances$Export, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + export( + params: Params$Resource$Instances$Export, + callback: BodyResponseCallback + ): void; + export(callback: BodyResponseCallback): void; + export( + paramsOrCallback?: + | Params$Resource$Instances$Export + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Instances$Export; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Export; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/export' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.failover + * @desc Failover the instance to its failover replica instance. Using this operation might cause your instance to restart. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.failover({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // ID of the project that contains the read replica. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "failoverContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.failover + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project ID of the project that contains the read replica. + * @param {().InstancesFailoverRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + failover( + params: Params$Resource$Instances$Failover, + options: StreamMethodOptions + ): GaxiosPromise; + failover( + params?: Params$Resource$Instances$Failover, + options?: MethodOptions + ): GaxiosPromise; + failover( + params: Params$Resource$Instances$Failover, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + failover( + params: Params$Resource$Instances$Failover, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + failover( + params: Params$Resource$Instances$Failover, + callback: BodyResponseCallback + ): void; + failover(callback: BodyResponseCallback): void; + failover( + paramsOrCallback?: + | Params$Resource$Instances$Failover + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Failover; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Failover; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/failover' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.get + * @desc Retrieves a resource containing information about a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.get({ + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "backendType": "my_backendType", + * // "connectionName": "my_connectionName", + * // "currentDiskSize": "my_currentDiskSize", + * // "databaseVersion": "my_databaseVersion", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "etag": "my_etag", + * // "failoverReplica": {}, + * // "gceZone": "my_gceZone", + * // "instanceType": "my_instanceType", + * // "ipAddresses": [], + * // "ipv6Address": "my_ipv6Address", + * // "kind": "my_kind", + * // "masterInstanceName": "my_masterInstanceName", + * // "maxDiskSize": "my_maxDiskSize", + * // "name": "my_name", + * // "onPremisesConfiguration": {}, + * // "project": "my_project", + * // "region": "my_region", + * // "replicaConfiguration": {}, + * // "replicaNames": [], + * // "rootPassword": "my_rootPassword", + * // "scheduledMaintenance": {}, + * // "selfLink": "my_selfLink", + * // "serverCaCert": {}, + * // "serviceAccountEmailAddress": "my_serviceAccountEmailAddress", + * // "settings": {}, + * // "state": "my_state", + * // "suspensionReason": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get( + params: Params$Resource$Instances$Get, + options: StreamMethodOptions + ): GaxiosPromise; + get( + params?: Params$Resource$Instances$Get, + options?: MethodOptions + ): GaxiosPromise; + get( + params: Params$Resource$Instances$Get, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Instances$Get, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Instances$Get, + callback: BodyResponseCallback + ): void; + get(callback: BodyResponseCallback): void; + get( + paramsOrCallback?: + | Params$Resource$Instances$Get + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Instances$Get; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Get; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + '/sql/v1beta4/projects/{project}/instances/{instance}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.import + * @desc Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: ['https://www.googleapis.com/auth/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.import({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "importContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().InstancesImportRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + import( + params: Params$Resource$Instances$Import, + options: StreamMethodOptions + ): GaxiosPromise; + import( + params?: Params$Resource$Instances$Import, + options?: MethodOptions + ): GaxiosPromise; + import( + params: Params$Resource$Instances$Import, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + import( + params: Params$Resource$Instances$Import, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + import( + params: Params$Resource$Instances$Import, + callback: BodyResponseCallback + ): void; + import(callback: BodyResponseCallback): void; + import( + paramsOrCallback?: + | Params$Resource$Instances$Import + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Instances$Import; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Import; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/import' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.insert + * @desc Creates a new Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.insert({ + * // Project ID of the project to which the newly created Cloud SQL instances should belong. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backendType": "my_backendType", + * // "connectionName": "my_connectionName", + * // "currentDiskSize": "my_currentDiskSize", + * // "databaseVersion": "my_databaseVersion", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "etag": "my_etag", + * // "failoverReplica": {}, + * // "gceZone": "my_gceZone", + * // "instanceType": "my_instanceType", + * // "ipAddresses": [], + * // "ipv6Address": "my_ipv6Address", + * // "kind": "my_kind", + * // "masterInstanceName": "my_masterInstanceName", + * // "maxDiskSize": "my_maxDiskSize", + * // "name": "my_name", + * // "onPremisesConfiguration": {}, + * // "project": "my_project", + * // "region": "my_region", + * // "replicaConfiguration": {}, + * // "replicaNames": [], + * // "rootPassword": "my_rootPassword", + * // "scheduledMaintenance": {}, + * // "selfLink": "my_selfLink", + * // "serverCaCert": {}, + * // "serviceAccountEmailAddress": "my_serviceAccountEmailAddress", + * // "settings": {}, + * // "state": "my_state", + * // "suspensionReason": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID of the project to which the newly created Cloud SQL instances should belong. + * @param {().DatabaseInstance} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert( + params: Params$Resource$Instances$Insert, + options: StreamMethodOptions + ): GaxiosPromise; + insert( + params?: Params$Resource$Instances$Insert, + options?: MethodOptions + ): GaxiosPromise; + insert( + params: Params$Resource$Instances$Insert, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + insert( + params: Params$Resource$Instances$Insert, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + insert( + params: Params$Resource$Instances$Insert, + callback: BodyResponseCallback + ): void; + insert(callback: BodyResponseCallback): void; + insert( + paramsOrCallback?: + | Params$Resource$Instances$Insert + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Instances$Insert; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Insert; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + '/sql/v1beta4/projects/{project}/instances' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.list + * @desc Lists instances under a given project. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.list({ + * // A filter expression that filters resources listed in the response. The expression is in the form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON representation, such as 'settings.userLabels.auto_start:true'. Multiple filter queries are space-separated. For example. 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. + * filter: 'placeholder-value', + * // The maximum number of results to return per response. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of results to view. + * pageToken: 'placeholder-value', + * // Project ID of the project for which to list Cloud SQL instances. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken", + * // "warnings": [] + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression is in the form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON representation, such as 'settings.userLabels.auto_start:true'. Multiple filter queries are space-separated. For example. 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. + * @param {integer=} params.maxResults The maximum number of results to return per response. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list( + params: Params$Resource$Instances$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Instances$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Instances$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Instances$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Instances$List, + callback: BodyResponseCallback + ): void; + list(callback: BodyResponseCallback): void; + list( + paramsOrCallback?: + | Params$Resource$Instances$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Instances$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + '/sql/v1beta4/projects/{project}/instances' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.listServerCas + * @desc Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.listServerCas({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "activeVersion": "my_activeVersion", + * // "certs": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.listServerCas + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listServerCas( + params: Params$Resource$Instances$Listservercas, + options: StreamMethodOptions + ): GaxiosPromise; + listServerCas( + params?: Params$Resource$Instances$Listservercas, + options?: MethodOptions + ): GaxiosPromise; + listServerCas( + params: Params$Resource$Instances$Listservercas, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + listServerCas( + params: Params$Resource$Instances$Listservercas, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + listServerCas( + params: Params$Resource$Instances$Listservercas, + callback: BodyResponseCallback + ): void; + listServerCas( + callback: BodyResponseCallback + ): void; + listServerCas( + paramsOrCallback?: + | Params$Resource$Instances$Listservercas + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Listservercas; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Listservercas; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/listServerCas' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest( + parameters + ); + } + } + + /** + * sql.instances.patch + * @desc Updates settings of a Cloud SQL instance. This method supports patch semantics. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.patch({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backendType": "my_backendType", + * // "connectionName": "my_connectionName", + * // "currentDiskSize": "my_currentDiskSize", + * // "databaseVersion": "my_databaseVersion", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "etag": "my_etag", + * // "failoverReplica": {}, + * // "gceZone": "my_gceZone", + * // "instanceType": "my_instanceType", + * // "ipAddresses": [], + * // "ipv6Address": "my_ipv6Address", + * // "kind": "my_kind", + * // "masterInstanceName": "my_masterInstanceName", + * // "maxDiskSize": "my_maxDiskSize", + * // "name": "my_name", + * // "onPremisesConfiguration": {}, + * // "project": "my_project", + * // "region": "my_region", + * // "replicaConfiguration": {}, + * // "replicaNames": [], + * // "rootPassword": "my_rootPassword", + * // "scheduledMaintenance": {}, + * // "selfLink": "my_selfLink", + * // "serverCaCert": {}, + * // "serviceAccountEmailAddress": "my_serviceAccountEmailAddress", + * // "settings": {}, + * // "state": "my_state", + * // "suspensionReason": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().DatabaseInstance} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch( + params: Params$Resource$Instances$Patch, + options: StreamMethodOptions + ): GaxiosPromise; + patch( + params?: Params$Resource$Instances$Patch, + options?: MethodOptions + ): GaxiosPromise; + patch( + params: Params$Resource$Instances$Patch, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + patch( + params: Params$Resource$Instances$Patch, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + patch( + params: Params$Resource$Instances$Patch, + callback: BodyResponseCallback + ): void; + patch(callback: BodyResponseCallback): void; + patch( + paramsOrCallback?: + | Params$Resource$Instances$Patch + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Instances$Patch; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Patch; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + '/sql/v1beta4/projects/{project}/instances/{instance}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.promoteReplica + * @desc Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.promoteReplica({ + * // Cloud SQL read replica instance name. + * instance: 'placeholder-value', + * // ID of the project that contains the read replica. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.promoteReplica + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL read replica instance name. + * @param {string} params.project ID of the project that contains the read replica. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + promoteReplica( + params: Params$Resource$Instances$Promotereplica, + options: StreamMethodOptions + ): GaxiosPromise; + promoteReplica( + params?: Params$Resource$Instances$Promotereplica, + options?: MethodOptions + ): GaxiosPromise; + promoteReplica( + params: Params$Resource$Instances$Promotereplica, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + promoteReplica( + params: Params$Resource$Instances$Promotereplica, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + promoteReplica( + params: Params$Resource$Instances$Promotereplica, + callback: BodyResponseCallback + ): void; + promoteReplica(callback: BodyResponseCallback): void; + promoteReplica( + paramsOrCallback?: + | Params$Resource$Instances$Promotereplica + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Promotereplica; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Promotereplica; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.resetSslConfig + * @desc Deletes all client certificates and generates a new server SSL certificate for the instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.resetSslConfig({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.resetSslConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetSslConfig( + params: Params$Resource$Instances$Resetsslconfig, + options: StreamMethodOptions + ): GaxiosPromise; + resetSslConfig( + params?: Params$Resource$Instances$Resetsslconfig, + options?: MethodOptions + ): GaxiosPromise; + resetSslConfig( + params: Params$Resource$Instances$Resetsslconfig, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + resetSslConfig( + params: Params$Resource$Instances$Resetsslconfig, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + resetSslConfig( + params: Params$Resource$Instances$Resetsslconfig, + callback: BodyResponseCallback + ): void; + resetSslConfig(callback: BodyResponseCallback): void; + resetSslConfig( + paramsOrCallback?: + | Params$Resource$Instances$Resetsslconfig + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Resetsslconfig; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Resetsslconfig; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.restart + * @desc Restarts a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.restart({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance to be restarted. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.restart + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be restarted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + restart( + params: Params$Resource$Instances$Restart, + options: StreamMethodOptions + ): GaxiosPromise; + restart( + params?: Params$Resource$Instances$Restart, + options?: MethodOptions + ): GaxiosPromise; + restart( + params: Params$Resource$Instances$Restart, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + restart( + params: Params$Resource$Instances$Restart, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + restart( + params: Params$Resource$Instances$Restart, + callback: BodyResponseCallback + ): void; + restart(callback: BodyResponseCallback): void; + restart( + paramsOrCallback?: + | Params$Resource$Instances$Restart + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Restart; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Restart; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/restart' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.restoreBackup + * @desc Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.restoreBackup({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "restoreBackupContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.restoreBackup + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().InstancesRestoreBackupRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + restoreBackup( + params: Params$Resource$Instances$Restorebackup, + options: StreamMethodOptions + ): GaxiosPromise; + restoreBackup( + params?: Params$Resource$Instances$Restorebackup, + options?: MethodOptions + ): GaxiosPromise; + restoreBackup( + params: Params$Resource$Instances$Restorebackup, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + restoreBackup( + params: Params$Resource$Instances$Restorebackup, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + restoreBackup( + params: Params$Resource$Instances$Restorebackup, + callback: BodyResponseCallback + ): void; + restoreBackup(callback: BodyResponseCallback): void; + restoreBackup( + paramsOrCallback?: + | Params$Resource$Instances$Restorebackup + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Restorebackup; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Restorebackup; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.rotateServerCa + * @desc Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.rotateServerCa({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "rotateServerCaContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.rotateServerCa + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().InstancesRotateServerCaRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rotateServerCa( + params: Params$Resource$Instances$Rotateserverca, + options: StreamMethodOptions + ): GaxiosPromise; + rotateServerCa( + params?: Params$Resource$Instances$Rotateserverca, + options?: MethodOptions + ): GaxiosPromise; + rotateServerCa( + params: Params$Resource$Instances$Rotateserverca, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + rotateServerCa( + params: Params$Resource$Instances$Rotateserverca, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + rotateServerCa( + params: Params$Resource$Instances$Rotateserverca, + callback: BodyResponseCallback + ): void; + rotateServerCa(callback: BodyResponseCallback): void; + rotateServerCa( + paramsOrCallback?: + | Params$Resource$Instances$Rotateserverca + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Rotateserverca; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Rotateserverca; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.startReplica + * @desc Starts the replication in the read replica instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.startReplica({ + * // Cloud SQL read replica instance name. + * instance: 'placeholder-value', + * // ID of the project that contains the read replica. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.startReplica + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL read replica instance name. + * @param {string} params.project ID of the project that contains the read replica. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startReplica( + params: Params$Resource$Instances$Startreplica, + options: StreamMethodOptions + ): GaxiosPromise; + startReplica( + params?: Params$Resource$Instances$Startreplica, + options?: MethodOptions + ): GaxiosPromise; + startReplica( + params: Params$Resource$Instances$Startreplica, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + startReplica( + params: Params$Resource$Instances$Startreplica, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + startReplica( + params: Params$Resource$Instances$Startreplica, + callback: BodyResponseCallback + ): void; + startReplica(callback: BodyResponseCallback): void; + startReplica( + paramsOrCallback?: + | Params$Resource$Instances$Startreplica + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Startreplica; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Startreplica; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/startReplica' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.stopReplica + * @desc Stops the replication in the read replica instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.stopReplica({ + * // Cloud SQL read replica instance name. + * instance: 'placeholder-value', + * // ID of the project that contains the read replica. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.stopReplica + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL read replica instance name. + * @param {string} params.project ID of the project that contains the read replica. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stopReplica( + params: Params$Resource$Instances$Stopreplica, + options: StreamMethodOptions + ): GaxiosPromise; + stopReplica( + params?: Params$Resource$Instances$Stopreplica, + options?: MethodOptions + ): GaxiosPromise; + stopReplica( + params: Params$Resource$Instances$Stopreplica, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + stopReplica( + params: Params$Resource$Instances$Stopreplica, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + stopReplica( + params: Params$Resource$Instances$Stopreplica, + callback: BodyResponseCallback + ): void; + stopReplica(callback: BodyResponseCallback): void; + stopReplica( + paramsOrCallback?: + | Params$Resource$Instances$Stopreplica + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Stopreplica; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Stopreplica; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/stopReplica' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.truncateLog + * @desc Truncate MySQL general and slow query log tables + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.truncateLog({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the Cloud SQL project. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "truncateLogContext": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.truncateLog + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the Cloud SQL project. + * @param {().InstancesTruncateLogRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + truncateLog( + params: Params$Resource$Instances$Truncatelog, + options: StreamMethodOptions + ): GaxiosPromise; + truncateLog( + params?: Params$Resource$Instances$Truncatelog, + options?: MethodOptions + ): GaxiosPromise; + truncateLog( + params: Params$Resource$Instances$Truncatelog, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + truncateLog( + params: Params$Resource$Instances$Truncatelog, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + truncateLog( + params: Params$Resource$Instances$Truncatelog, + callback: BodyResponseCallback + ): void; + truncateLog(callback: BodyResponseCallback): void; + truncateLog( + paramsOrCallback?: + | Params$Resource$Instances$Truncatelog + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Instances$Truncatelog; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Truncatelog; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/truncateLog' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.instances.update + * @desc Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.instances.update({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "backendType": "my_backendType", + * // "connectionName": "my_connectionName", + * // "currentDiskSize": "my_currentDiskSize", + * // "databaseVersion": "my_databaseVersion", + * // "diskEncryptionConfiguration": {}, + * // "diskEncryptionStatus": {}, + * // "etag": "my_etag", + * // "failoverReplica": {}, + * // "gceZone": "my_gceZone", + * // "instanceType": "my_instanceType", + * // "ipAddresses": [], + * // "ipv6Address": "my_ipv6Address", + * // "kind": "my_kind", + * // "masterInstanceName": "my_masterInstanceName", + * // "maxDiskSize": "my_maxDiskSize", + * // "name": "my_name", + * // "onPremisesConfiguration": {}, + * // "project": "my_project", + * // "region": "my_region", + * // "replicaConfiguration": {}, + * // "replicaNames": [], + * // "rootPassword": "my_rootPassword", + * // "scheduledMaintenance": {}, + * // "selfLink": "my_selfLink", + * // "serverCaCert": {}, + * // "serviceAccountEmailAddress": "my_serviceAccountEmailAddress", + * // "settings": {}, + * // "state": "my_state", + * // "suspensionReason": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.instances.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().DatabaseInstance} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update( + params: Params$Resource$Instances$Update, + options: StreamMethodOptions + ): GaxiosPromise; + update( + params?: Params$Resource$Instances$Update, + options?: MethodOptions + ): GaxiosPromise; + update( + params: Params$Resource$Instances$Update, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + update( + params: Params$Resource$Instances$Update, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + update( + params: Params$Resource$Instances$Update, + callback: BodyResponseCallback + ): void; + update(callback: BodyResponseCallback): void; + update( + paramsOrCallback?: + | Params$Resource$Instances$Update + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Instances$Update; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Instances$Update; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + '/sql/v1beta4/projects/{project}/instances/{instance}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Instances$Addserverca + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Instances$Clone extends StandardParameters { + /** + * The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the source as well as the clone Cloud SQL instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$InstancesCloneRequest; + } + export interface Params$Resource$Instances$Delete extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance to be deleted. + */ + project?: string; + } + export interface Params$Resource$Instances$Demotemaster + extends StandardParameters { + /** + * Cloud SQL instance name. + */ + instance?: string; + /** + * ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$InstancesDemoteMasterRequest; + } + export interface Params$Resource$Instances$Export extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance to be exported. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$InstancesExportRequest; + } + export interface Params$Resource$Instances$Failover + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * ID of the project that contains the read replica. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$InstancesFailoverRequest; + } + export interface Params$Resource$Instances$Get extends StandardParameters { + /** + * Database instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Instances$Import extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$InstancesImportRequest; + } + export interface Params$Resource$Instances$Insert extends StandardParameters { + /** + * Project ID of the project to which the newly created Cloud SQL instances should belong. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$DatabaseInstance; + } + export interface Params$Resource$Instances$List extends StandardParameters { + /** + * A filter expression that filters resources listed in the response. The expression is in the form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON representation, such as 'settings.userLabels.auto_start:true'. Multiple filter queries are space-separated. For example. 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. + */ + filter?: string; + /** + * The maximum number of results to return per response. + */ + maxResults?: number; + /** + * A previously-returned page token representing part of the larger set of results to view. + */ + pageToken?: string; + /** + * Project ID of the project for which to list Cloud SQL instances. + */ + project?: string; + } + export interface Params$Resource$Instances$Listservercas + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Instances$Patch extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$DatabaseInstance; + } + export interface Params$Resource$Instances$Promotereplica + extends StandardParameters { + /** + * Cloud SQL read replica instance name. + */ + instance?: string; + /** + * ID of the project that contains the read replica. + */ + project?: string; + } + export interface Params$Resource$Instances$Resetsslconfig + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Instances$Restart + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance to be restarted. + */ + project?: string; + } + export interface Params$Resource$Instances$Restorebackup + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$InstancesRestoreBackupRequest; + } + export interface Params$Resource$Instances$Rotateserverca + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$InstancesRotateServerCaRequest; + } + export interface Params$Resource$Instances$Startreplica + extends StandardParameters { + /** + * Cloud SQL read replica instance name. + */ + instance?: string; + /** + * ID of the project that contains the read replica. + */ + project?: string; + } + export interface Params$Resource$Instances$Stopreplica + extends StandardParameters { + /** + * Cloud SQL read replica instance name. + */ + instance?: string; + /** + * ID of the project that contains the read replica. + */ + project?: string; + } + export interface Params$Resource$Instances$Truncatelog + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the Cloud SQL project. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$InstancesTruncateLogRequest; + } + export interface Params$Resource$Instances$Update extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$DatabaseInstance; + } + + export class Resource$Operations { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * sql.operations.get + * @desc Retrieves an instance operation that has been performed on an instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.operations.get({ + * // Instance operation ID. + * operation: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Instance operation ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get( + params: Params$Resource$Operations$Get, + options: StreamMethodOptions + ): GaxiosPromise; + get( + params?: Params$Resource$Operations$Get, + options?: MethodOptions + ): GaxiosPromise; + get( + params: Params$Resource$Operations$Get, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Operations$Get, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Operations$Get, + callback: BodyResponseCallback + ): void; + get(callback: BodyResponseCallback): void; + get( + paramsOrCallback?: + | Params$Resource$Operations$Get + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Operations$Get; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Operations$Get; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + '/sql/v1beta4/projects/{project}/operations/{operation}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.operations.list + * @desc Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.operations.list({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Maximum number of operations per response. + * maxResults: 'placeholder-value', + * // A previously-returned page token representing part of the larger set of results to view. + * pageToken: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {integer=} params.maxResults Maximum number of operations per response. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list( + params: Params$Resource$Operations$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Operations$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Operations$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Operations$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Operations$List, + callback: BodyResponseCallback + ): void; + list(callback: BodyResponseCallback): void; + list( + paramsOrCallback?: + | Params$Resource$Operations$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Operations$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Operations$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + '/sql/v1beta4/projects/{project}/operations' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Operations$Get extends StandardParameters { + /** + * Instance operation ID. + */ + operation?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Operations$List extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Maximum number of operations per response. + */ + maxResults?: number; + /** + * A previously-returned page token representing part of the larger set of results to view. + */ + pageToken?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + + export class Resource$Projects { + context: APIRequestContext; + instances: Resource$Projects$Instances; + constructor(context: APIRequestContext) { + this.context = context; + this.instances = new Resource$Projects$Instances(this.context); + } + } + + export class Resource$Projects$Instances { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * sql.projects.instances.rescheduleMaintenance + * @desc Reschedules the maintenance on the given instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.projects.instances.rescheduleMaintenance({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "reschedule": {} + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.projects.instances.rescheduleMaintenance + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project ID of the project that contains the instance. + * @param {().SqlInstancesRescheduleMaintenanceRequestBody} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rescheduleMaintenance( + params: Params$Resource$Projects$Instances$Reschedulemaintenance, + options: StreamMethodOptions + ): GaxiosPromise; + rescheduleMaintenance( + params?: Params$Resource$Projects$Instances$Reschedulemaintenance, + options?: MethodOptions + ): GaxiosPromise; + rescheduleMaintenance( + params: Params$Resource$Projects$Instances$Reschedulemaintenance, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + rescheduleMaintenance( + params: Params$Resource$Projects$Instances$Reschedulemaintenance, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + rescheduleMaintenance( + params: Params$Resource$Projects$Instances$Reschedulemaintenance, + callback: BodyResponseCallback + ): void; + rescheduleMaintenance( + callback: BodyResponseCallback + ): void; + rescheduleMaintenance( + paramsOrCallback?: + | Params$Resource$Projects$Instances$Reschedulemaintenance + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Instances$Reschedulemaintenance; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Instances$Reschedulemaintenance; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.projects.instances.startExternalSync + * @desc Start External primary instance migration. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.projects.instances.startExternalSync({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // ID of the project that contains the instance. + * project: 'placeholder-value', + * // External sync mode + * syncMode: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.projects.instances.startExternalSync + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project ID of the project that contains the instance. + * @param {string=} params.syncMode External sync mode + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startExternalSync( + params: Params$Resource$Projects$Instances$Startexternalsync, + options: StreamMethodOptions + ): GaxiosPromise; + startExternalSync( + params?: Params$Resource$Projects$Instances$Startexternalsync, + options?: MethodOptions + ): GaxiosPromise; + startExternalSync( + params: Params$Resource$Projects$Instances$Startexternalsync, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + startExternalSync( + params: Params$Resource$Projects$Instances$Startexternalsync, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + startExternalSync( + params: Params$Resource$Projects$Instances$Startexternalsync, + callback: BodyResponseCallback + ): void; + startExternalSync(callback: BodyResponseCallback): void; + startExternalSync( + paramsOrCallback?: + | Params$Resource$Projects$Instances$Startexternalsync + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Instances$Startexternalsync; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Instances$Startexternalsync; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.projects.instances.verifyExternalSyncSettings + * @desc Verify External primary instance external sync settings. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.projects.instances.verifyExternalSyncSettings({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * // External sync mode + * syncMode: 'placeholder-value', + * // Flag to enable verifying connection only + * verifyConnectionOnly: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "errors": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.projects.instances.verifyExternalSyncSettings + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {string=} params.syncMode External sync mode + * @param {boolean=} params.verifyConnectionOnly Flag to enable verifying connection only + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + verifyExternalSyncSettings( + params: Params$Resource$Projects$Instances$Verifyexternalsyncsettings, + options: StreamMethodOptions + ): GaxiosPromise; + verifyExternalSyncSettings( + params?: Params$Resource$Projects$Instances$Verifyexternalsyncsettings, + options?: MethodOptions + ): GaxiosPromise; + verifyExternalSyncSettings( + params: Params$Resource$Projects$Instances$Verifyexternalsyncsettings, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + verifyExternalSyncSettings( + params: Params$Resource$Projects$Instances$Verifyexternalsyncsettings, + options: + | MethodOptions + | BodyResponseCallback< + Schema$SqlInstancesVerifyExternalSyncSettingsResponse + >, + callback: BodyResponseCallback< + Schema$SqlInstancesVerifyExternalSyncSettingsResponse + > + ): void; + verifyExternalSyncSettings( + params: Params$Resource$Projects$Instances$Verifyexternalsyncsettings, + callback: BodyResponseCallback< + Schema$SqlInstancesVerifyExternalSyncSettingsResponse + > + ): void; + verifyExternalSyncSettings( + callback: BodyResponseCallback< + Schema$SqlInstancesVerifyExternalSyncSettingsResponse + > + ): void; + verifyExternalSyncSettings( + paramsOrCallback?: + | Params$Resource$Projects$Instances$Verifyexternalsyncsettings + | BodyResponseCallback< + Schema$SqlInstancesVerifyExternalSyncSettingsResponse + > + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback< + Schema$SqlInstancesVerifyExternalSyncSettingsResponse + > + | BodyResponseCallback, + callback?: + | BodyResponseCallback< + Schema$SqlInstancesVerifyExternalSyncSettingsResponse + > + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Instances$Verifyexternalsyncsettings; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Instances$Verifyexternalsyncsettings; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest< + Schema$SqlInstancesVerifyExternalSyncSettingsResponse + >(parameters); + } + } + } + + export interface Params$Resource$Projects$Instances$Reschedulemaintenance + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$SqlInstancesRescheduleMaintenanceRequestBody; + } + export interface Params$Resource$Projects$Instances$Startexternalsync + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * ID of the project that contains the instance. + */ + project?: string; + /** + * External sync mode + */ + syncMode?: string; + } + export interface Params$Resource$Projects$Instances$Verifyexternalsyncsettings + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + /** + * External sync mode + */ + syncMode?: string; + /** + * Flag to enable verifying connection only + */ + verifyConnectionOnly?: boolean; + } + + export class Resource$Sslcerts { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * sql.sslCerts.createEphemeral + * @desc Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.sslCerts.createEphemeral({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the Cloud SQL project. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "public_key": "my_public_key" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cert": "my_cert", + * // "certSerialNumber": "my_certSerialNumber", + * // "commonName": "my_commonName", + * // "createTime": "my_createTime", + * // "expirationTime": "my_expirationTime", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "sha1Fingerprint": "my_sha1Fingerprint" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.sslCerts.createEphemeral + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the Cloud SQL project. + * @param {().SslCertsCreateEphemeralRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createEphemeral( + params: Params$Resource$Sslcerts$Createephemeral, + options: StreamMethodOptions + ): GaxiosPromise; + createEphemeral( + params?: Params$Resource$Sslcerts$Createephemeral, + options?: MethodOptions + ): GaxiosPromise; + createEphemeral( + params: Params$Resource$Sslcerts$Createephemeral, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + createEphemeral( + params: Params$Resource$Sslcerts$Createephemeral, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + createEphemeral( + params: Params$Resource$Sslcerts$Createephemeral, + callback: BodyResponseCallback + ): void; + createEphemeral(callback: BodyResponseCallback): void; + createEphemeral( + paramsOrCallback?: + | Params$Resource$Sslcerts$Createephemeral + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Sslcerts$Createephemeral; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Sslcerts$Createephemeral; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.sslCerts.delete + * @desc Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.sslCerts.delete({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * // Sha1 FingerPrint. + * sha1Fingerprint: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.sslCerts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {string} params.sha1Fingerprint Sha1 FingerPrint. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete( + params: Params$Resource$Sslcerts$Delete, + options: StreamMethodOptions + ): GaxiosPromise; + delete( + params?: Params$Resource$Sslcerts$Delete, + options?: MethodOptions + ): GaxiosPromise; + delete( + params: Params$Resource$Sslcerts$Delete, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Sslcerts$Delete, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Sslcerts$Delete, + callback: BodyResponseCallback + ): void; + delete(callback: BodyResponseCallback): void; + delete( + paramsOrCallback?: + | Params$Resource$Sslcerts$Delete + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Sslcerts$Delete; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Sslcerts$Delete; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE', + }, + options + ), + params, + requiredParams: ['project', 'instance', 'sha1Fingerprint'], + pathParams: ['instance', 'project', 'sha1Fingerprint'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.sslCerts.get + * @desc Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.sslCerts.get({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * // Sha1 FingerPrint. + * sha1Fingerprint: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "cert": "my_cert", + * // "certSerialNumber": "my_certSerialNumber", + * // "commonName": "my_commonName", + * // "createTime": "my_createTime", + * // "expirationTime": "my_expirationTime", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "selfLink": "my_selfLink", + * // "sha1Fingerprint": "my_sha1Fingerprint" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.sslCerts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {string} params.sha1Fingerprint Sha1 FingerPrint. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get( + params: Params$Resource$Sslcerts$Get, + options: StreamMethodOptions + ): GaxiosPromise; + get( + params?: Params$Resource$Sslcerts$Get, + options?: MethodOptions + ): GaxiosPromise; + get( + params: Params$Resource$Sslcerts$Get, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Sslcerts$Get, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + get( + params: Params$Resource$Sslcerts$Get, + callback: BodyResponseCallback + ): void; + get(callback: BodyResponseCallback): void; + get( + paramsOrCallback?: + | Params$Resource$Sslcerts$Get + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Sslcerts$Get; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Sslcerts$Get; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project', 'instance', 'sha1Fingerprint'], + pathParams: ['instance', 'project', 'sha1Fingerprint'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.sslCerts.insert + * @desc Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.sslCerts.insert({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "commonName": "my_commonName" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "clientCert": {}, + * // "kind": "my_kind", + * // "operation": {}, + * // "serverCaCert": {} + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.sslCerts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().SslCertsInsertRequest} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert( + params: Params$Resource$Sslcerts$Insert, + options: StreamMethodOptions + ): GaxiosPromise; + insert( + params?: Params$Resource$Sslcerts$Insert, + options?: MethodOptions + ): GaxiosPromise; + insert( + params: Params$Resource$Sslcerts$Insert, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + insert( + params: Params$Resource$Sslcerts$Insert, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + insert( + params: Params$Resource$Sslcerts$Insert, + callback: BodyResponseCallback + ): void; + insert(callback: BodyResponseCallback): void; + insert( + paramsOrCallback?: + | Params$Resource$Sslcerts$Insert + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Sslcerts$Insert; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Sslcerts$Insert; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.sslCerts.list + * @desc Lists all of the current SSL certificates for the instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.sslCerts.list({ + * // Cloud SQL instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.sslCerts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list( + params: Params$Resource$Sslcerts$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Sslcerts$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Sslcerts$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Sslcerts$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Sslcerts$List, + callback: BodyResponseCallback + ): void; + list(callback: BodyResponseCallback): void; + list( + paramsOrCallback?: + | Params$Resource$Sslcerts$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Sslcerts$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Sslcerts$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Sslcerts$Createephemeral + extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the Cloud SQL project. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$SslCertsCreateEphemeralRequest; + } + export interface Params$Resource$Sslcerts$Delete extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + /** + * Sha1 FingerPrint. + */ + sha1Fingerprint?: string; + } + export interface Params$Resource$Sslcerts$Get extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + /** + * Sha1 FingerPrint. + */ + sha1Fingerprint?: string; + } + export interface Params$Resource$Sslcerts$Insert extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$SslCertsInsertRequest; + } + export interface Params$Resource$Sslcerts$List extends StandardParameters { + /** + * Cloud SQL instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + + export class Resource$Tiers { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * sql.tiers.list + * @desc Lists all available machine types (tiers) for Cloud SQL, for example, db-n1-standard-1. For related information, see Pricing. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.tiers.list({ + * // Project ID of the project for which to list tiers. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.tiers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID of the project for which to list tiers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list( + params: Params$Resource$Tiers$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Tiers$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Tiers$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Tiers$List, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Tiers$List, + callback: BodyResponseCallback + ): void; + list(callback: BodyResponseCallback): void; + list( + paramsOrCallback?: + | Params$Resource$Tiers$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Tiers$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Tiers$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta4/projects/{project}/tiers').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Tiers$List extends StandardParameters { + /** + * Project ID of the project for which to list tiers. + */ + project?: string; + } + + export class Resource$Users { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * sql.users.delete + * @desc Deletes a user from a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.users.delete({ + * // Host of the user in the instance. + * host: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Name of the user in the instance. + * name: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.users.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.host Host of the user in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string=} params.name Name of the user in the instance. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete( + params: Params$Resource$Users$Delete, + options: StreamMethodOptions + ): GaxiosPromise; + delete( + params?: Params$Resource$Users$Delete, + options?: MethodOptions + ): GaxiosPromise; + delete( + params: Params$Resource$Users$Delete, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Users$Delete, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + delete( + params: Params$Resource$Users$Delete, + callback: BodyResponseCallback + ): void; + delete(callback: BodyResponseCallback): void; + delete( + paramsOrCallback?: + | Params$Resource$Users$Delete + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Users$Delete; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Users$Delete; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/users' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.users.insert + * @desc Creates a new user in a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.users.insert({ + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "host": "my_host", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "password": "my_password", + * // "project": "my_project", + * // "sqlserverUserDetails": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.users.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().User} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert( + params: Params$Resource$Users$Insert, + options: StreamMethodOptions + ): GaxiosPromise; + insert( + params?: Params$Resource$Users$Insert, + options?: MethodOptions + ): GaxiosPromise; + insert( + params: Params$Resource$Users$Insert, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + insert( + params: Params$Resource$Users$Insert, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + insert( + params: Params$Resource$Users$Insert, + callback: BodyResponseCallback + ): void; + insert(callback: BodyResponseCallback): void; + insert( + paramsOrCallback?: + | Params$Resource$Users$Insert + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Users$Insert; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Users$Insert; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/users' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'POST', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.users.list + * @desc Lists users in the specified Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.users.list({ + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "items": [], + * // "kind": "my_kind", + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.users.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list( + params: Params$Resource$Users$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Users$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Users$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Users$List, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Users$List, + callback: BodyResponseCallback + ): void; + list(callback: BodyResponseCallback): void; + list( + paramsOrCallback?: + | Params$Resource$Users$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Users$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Users$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/users' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'GET', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * sql.users.update + * @desc Updates an existing user in a Cloud SQL instance. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/sqladmin.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: [ + * 'https://www.googleapis.com/auth/cloud-platform', + * 'https://www.googleapis.com/auth/sqlservice.admin', + * ], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await sql.users.update({ + * // Optional. Host of the user in the instance. + * host: 'placeholder-value', + * // Database instance ID. This does not include the project ID. + * instance: 'placeholder-value', + * // Name of the user in the instance. + * name: 'placeholder-value', + * // Project ID of the project that contains the instance. + * project: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "etag": "my_etag", + * // "host": "my_host", + * // "instance": "my_instance", + * // "kind": "my_kind", + * // "name": "my_name", + * // "password": "my_password", + * // "project": "my_project", + * // "sqlserverUserDetails": {}, + * // "type": "my_type" + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "endTime": "my_endTime", + * // "error": {}, + * // "exportContext": {}, + * // "importContext": {}, + * // "insertTime": "my_insertTime", + * // "kind": "my_kind", + * // "name": "my_name", + * // "operationType": "my_operationType", + * // "selfLink": "my_selfLink", + * // "startTime": "my_startTime", + * // "status": "my_status", + * // "targetId": "my_targetId", + * // "targetLink": "my_targetLink", + * // "targetProject": "my_targetProject", + * // "user": "my_user" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias sql.users.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.host Optional. Host of the user in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string=} params.name Name of the user in the instance. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().User} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update( + params: Params$Resource$Users$Update, + options: StreamMethodOptions + ): GaxiosPromise; + update( + params?: Params$Resource$Users$Update, + options?: MethodOptions + ): GaxiosPromise; + update( + params: Params$Resource$Users$Update, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + update( + params: Params$Resource$Users$Update, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + update( + params: Params$Resource$Users$Update, + callback: BodyResponseCallback + ): void; + update(callback: BodyResponseCallback): void; + update( + paramsOrCallback?: + | Params$Resource$Users$Update + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || {}) as Params$Resource$Users$Update; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Users$Update; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://sqladmin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: ( + rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/users' + ).replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT', + }, + options + ), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Users$Delete extends StandardParameters { + /** + * Host of the user in the instance. + */ + host?: string; + /** + * Database instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Name of the user in the instance. + */ + name?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Users$Insert extends StandardParameters { + /** + * Database instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$User; + } + export interface Params$Resource$Users$List extends StandardParameters { + /** + * Database instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + } + export interface Params$Resource$Users$Update extends StandardParameters { + /** + * Optional. Host of the user in the instance. + */ + host?: string; + /** + * Database instance ID. This does not include the project ID. + */ + instance?: string; + /** + * Name of the user in the instance. + */ + name?: string; + /** + * Project ID of the project that contains the instance. + */ + project?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$User; + } +} diff --git a/src/apis/sqladmin/webpack.config.js b/src/apis/sqladmin/webpack.config.js new file mode 100644 index 00000000000..5bfc00385a7 --- /dev/null +++ b/src/apis/sqladmin/webpack.config.js @@ -0,0 +1,70 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Use `npm run webpack` to produce Webpack bundle for this library. + +const path = require('path'); + +module.exports = { + entry: './index.ts', + resolve: { + extensions: ['.ts', '.js', '.json'], + }, + output: { + library: 'Sqladmin', + filename: 'sqladmin.min.js', + path: path.resolve(__dirname, 'dist'), + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + http2: 'empty', + }, + module: { + rules: [ + { + test: /node_modules[\\/]google-auth-library[\\/]src[\\/]crypto[\\/]node[\\/]crypto/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https-proxy-agent[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gcp-metadata[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]pkginfo[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]semver[\\/]/, + use: 'null-loader', + }, + { + test: /\.ts$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + ], + }, + mode: 'production', + plugins: [], +};