blob: 1a142819f8ab661e0797f66792f4edb29135f88e [file] [log] [blame]
// Package sqladmin provides access to the Cloud SQL Admin API.
//
// See https://cloud.google.com/sql/docs/reference/latest
//
// Usage example:
//
// import "google.golang.org/api/sqladmin/v1beta3"
// ...
// sqladminService, err := sqladmin.New(oauthHttpClient)
package sqladmin // import "google.golang.org/api/sqladmin/v1beta3"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
context "golang.org/x/net/context"
ctxhttp "golang.org/x/net/context/ctxhttp"
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "sqladmin:v1beta3"
const apiName = "sqladmin"
const apiVersion = "v1beta3"
const basePath = "https://www.googleapis.com/sql/v1beta3/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// Manage your Google SQL Service instances
SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.BackupRuns = NewBackupRunsService(s)
s.Flags = NewFlagsService(s)
s.Instances = NewInstancesService(s)
s.Operations = NewOperationsService(s)
s.SslCerts = NewSslCertsService(s)
s.Tiers = NewTiersService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
BackupRuns *BackupRunsService
Flags *FlagsService
Instances *InstancesService
Operations *OperationsService
SslCerts *SslCertsService
Tiers *TiersService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewBackupRunsService(s *Service) *BackupRunsService {
rs := &BackupRunsService{s: s}
return rs
}
type BackupRunsService struct {
s *Service
}
func NewFlagsService(s *Service) *FlagsService {
rs := &FlagsService{s: s}
return rs
}
type FlagsService struct {
s *Service
}
func NewInstancesService(s *Service) *InstancesService {
rs := &InstancesService{s: s}
return rs
}
type InstancesService struct {
s *Service
}
func NewOperationsService(s *Service) *OperationsService {
rs := &OperationsService{s: s}
return rs
}
type OperationsService struct {
s *Service
}
func NewSslCertsService(s *Service) *SslCertsService {
rs := &SslCertsService{s: s}
return rs
}
type SslCertsService struct {
s *Service
}
func NewTiersService(s *Service) *TiersService {
rs := &TiersService{s: s}
return rs
}
type TiersService struct {
s *Service
}
// BackupConfiguration: Database instance backup configuration.
type BackupConfiguration struct {
// BinaryLogEnabled: Whether binary log is enabled. If backup
// configuration is disabled, binary log must be disabled as well.
BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"`
// Enabled: Whether this configuration is enabled.
Enabled bool `json:"enabled,omitempty"`
// Id: Identifier for this configuration. This gets generated
// automatically when a backup configuration is created.
Id string `json:"id,omitempty"`
// Kind: This is always sql#backupConfiguration.
Kind string `json:"kind,omitempty"`
// ReplicationLogArchivingEnabled: Whether replication log archiving is
// enabled. Replication log archiving is required for the point-in-time
// recovery (PITR) feature. PostgreSQL instances only.
ReplicationLogArchivingEnabled bool `json:"replicationLogArchivingEnabled,omitempty"`
// StartTime: Start time for the daily backup configuration in UTC
// timezone in the 24 hour format - HH:MM.
StartTime string `json:"startTime,omitempty"`
// ForceSendFields is a list of field names (e.g. "BinaryLogEnabled") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BinaryLogEnabled") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BackupConfiguration) MarshalJSON() ([]byte, error) {
type NoMethod BackupConfiguration
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackupRun: A database instance backup run resource.
type BackupRun struct {
// BackupConfiguration: Backup Configuration identifier.
BackupConfiguration string `json:"backupConfiguration,omitempty"`
// DueTime: The due time of this run in UTC timezone in RFC 3339 format,
// for example 2012-11-15T16:19:00.094Z.
DueTime string `json:"dueTime,omitempty"`
// EndTime: The time the backup operation completed in UTC timezone in
// RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
EndTime string `json:"endTime,omitempty"`
// EnqueuedTime: The time the run was enqueued in UTC timezone in RFC
// 3339 format, for example 2012-11-15T16:19:00.094Z.
EnqueuedTime string `json:"enqueuedTime,omitempty"`
// Error: Information about why the backup operation failed. This is
// only present if the run has the FAILED status.
Error *OperationError `json:"error,omitempty"`
// Instance: Name of the database instance.
Instance string `json:"instance,omitempty"`
// Kind: This is always sql#backupRun.
Kind string `json:"kind,omitempty"`
// StartTime: The time the backup operation actually started in UTC
// timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
StartTime string `json:"startTime,omitempty"`
// Status: The status of this run.
Status string `json:"status,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "BackupConfiguration")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BackupConfiguration") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BackupRun) MarshalJSON() ([]byte, error) {
type NoMethod BackupRun
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackupRunsListResponse: Backup run list results.
type BackupRunsListResponse struct {
// Items: A list of backup runs in reverse chronological order of the
// enqueued time.
Items []*BackupRun `json:"items,omitempty"`
// Kind: This is always sql#backupRunsList.
Kind string `json:"kind,omitempty"`
// NextPageToken: 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 `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) {
type NoMethod BackupRunsListResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BinLogCoordinates: Binary log coordinates.
type BinLogCoordinates struct {
// BinLogFileName: Name of the binary log file for a Cloud SQL instance.
BinLogFileName string `json:"binLogFileName,omitempty"`
// BinLogPosition: Position (offset) within the binary log file.
BinLogPosition int64 `json:"binLogPosition,omitempty,string"`
// Kind: This is always sql#binLogCoordinates.
Kind string `json:"kind,omitempty"`
// ForceSendFields is a list of field names (e.g. "BinLogFileName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BinLogFileName") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) {
type NoMethod BinLogCoordinates
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CloneContext: Database instance clone context.
type CloneContext struct {
// BinLogCoordinates: Binary log coordinates, if specified, indentify
// the position up to which the source instance should be cloned. If not
// specified, the source instance is cloned up to the most recent binary
// log coordinates.
BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"`
// DestinationInstanceName: Name of the Cloud SQL instance to be created
// as a clone.
DestinationInstanceName string `json:"destinationInstanceName,omitempty"`
// Kind: This is always sql#cloneContext.
Kind string `json:"kind,omitempty"`
// PitrTimestampMs: The epoch timestamp, in milliseconds, of the time to
// which a point-in-time recovery (PITR) is performed. PostgreSQL
// instances only. For MySQL instances, use the binLogCoordinates
// property.
PitrTimestampMs int64 `json:"pitrTimestampMs,omitempty,string"`
// SourceInstanceName: Name of the Cloud SQL instance to be cloned.
SourceInstanceName string `json:"sourceInstanceName,omitempty"`
// ForceSendFields is a list of field names (e.g. "BinLogCoordinates")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BinLogCoordinates") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CloneContext) MarshalJSON() ([]byte, error) {
type NoMethod CloneContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DatabaseFlags: MySQL flags for Cloud SQL instances.
type DatabaseFlags struct {
// Name: The name of the flag. These flags are passed at instance
// startup, so include both MySQL server options and MySQL system
// variables. Flags should be specified with underscores, not hyphens.
// For more information, see Configuring MySQL Flags in the Google Cloud
// SQL documentation, as well as the official MySQL documentation for
// server options and system variables.
Name string `json:"name,omitempty"`
// Value: The value of the flag. Booleans should be set to on for true
// and off for false. This field must be omitted if the flag doesn't
// take a value.
Value string `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DatabaseFlags) MarshalJSON() ([]byte, error) {
type NoMethod DatabaseFlags
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DatabaseInstance: A Cloud SQL instance resource.
type DatabaseInstance struct {
// ConnectionName: Connection name of the Cloud SQL instance used in
// connection strings.
ConnectionName string `json:"connectionName,omitempty"`
// CurrentDiskSize: The current disk usage of the instance in bytes.
CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"`
// DatabaseVersion: The database engine type and version. Can be
// MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_5. The databaseVersion
// cannot be changed after instance creation.
DatabaseVersion string `json:"databaseVersion,omitempty"`
// Etag: HTTP 1.1 Entity tag for the resource.
Etag string `json:"etag,omitempty"`
// Instance: Name of the Cloud SQL instance. This does not include the
// project ID.
Instance string `json:"instance,omitempty"`
// InstanceType: The instance type. This can be one of the
// following.
// CLOUD_SQL_INSTANCE: Regular Cloud SQL
// instance.
// READ_REPLICA_INSTANCE: Cloud SQL instance acting as a read-replica.
InstanceType string `json:"instanceType,omitempty"`
// IpAddresses: The assigned IP addresses for the instance.
IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
// Ipv6Address: The IPv6 address assigned to the instance.
Ipv6Address string `json:"ipv6Address,omitempty"`
// Kind: This is always sql#instance.
Kind string `json:"kind,omitempty"`
// MasterInstanceName: The name of the instance which will act as master
// in the replication setup.
MasterInstanceName string `json:"masterInstanceName,omitempty"`
// MaxDiskSize: The maximum disk size of the instance in bytes.
MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"`
// Project: The project ID of the project containing the Cloud SQL
// instance. The Google apps domain is prefixed if applicable.
Project string `json:"project,omitempty"`
// Region: The geographical region. Can be us-central, asia-east1 or
// europe-west1. Defaults to us-central. The region can not be changed
// after instance creation.
Region string `json:"region,omitempty"`
// ReplicaNames: The replicas of the instance.
ReplicaNames []string `json:"replicaNames,omitempty"`
// ServerCaCert: SSL configuration.
ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
// ServiceAccountEmailAddress: The service account email address
// assigned to the instance.
ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"`
// Settings: The user settings.
Settings *Settings `json:"settings,omitempty"`
// State: 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.
// UNKNOWN_STATE: The state of the instance is unknown.
State string `json:"state,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ConnectionName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ConnectionName") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *DatabaseInstance) MarshalJSON() ([]byte, error) {
type NoMethod DatabaseInstance
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ExportContext: Database instance export context.
type ExportContext struct {
// Database: Databases (for example, guestbook) from which the export is
// made. If unspecified, all databases are exported.
Database []string `json:"database,omitempty"`
// Kind: This is always sql#exportContext.
Kind string `json:"kind,omitempty"`
// Table: Tables to export, or that were exported, from the specified
// database. If you specify tables, specify one and only one database.
Table []string `json:"table,omitempty"`
// Uri: The path to the file in Google Cloud Storage where the export
// will be stored, or where it was already stored. The URI is in the
// form gs://bucketName/fileName. If the file already exists, the
// operation fails. If the filename ends with .gz, the contents are
// compressed.
Uri string `json:"uri,omitempty"`
// ForceSendFields is a list of field names (e.g. "Database") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Database") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ExportContext) MarshalJSON() ([]byte, error) {
type NoMethod ExportContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Flag: A Google Cloud SQL service flag resource.
type Flag struct {
// AllowedStringValues: For STRING flags, a list of strings that the
// value can be set to.
AllowedStringValues []string `json:"allowedStringValues,omitempty"`
// AppliesTo: The database version this flag applies to. Currently this
// can only be [MYSQL_5_5].
AppliesTo []string `json:"appliesTo,omitempty"`
// Kind: This is always sql#flag.
Kind string `json:"kind,omitempty"`
// MaxValue: For INTEGER flags, the maximum allowed value.
MaxValue int64 `json:"maxValue,omitempty,string"`
// MinValue: For INTEGER flags, the minimum allowed value.
MinValue int64 `json:"minValue,omitempty,string"`
// Name: This is the name of the flag. Flag names always use
// underscores, not hyphens, e.g. max_allowed_packet
Name string `json:"name,omitempty"`
// Type: 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 `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "AllowedStringValues")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AllowedStringValues") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Flag) MarshalJSON() ([]byte, error) {
type NoMethod Flag
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// FlagsListResponse: Flags list response.
type FlagsListResponse struct {
// Items: List of flags.
Items []*Flag `json:"items,omitempty"`
// Kind: This is always sql#flagsList.
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *FlagsListResponse) MarshalJSON() ([]byte, error) {
type NoMethod FlagsListResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ImportContext: Database instance import context.
type ImportContext struct {
// Database: The database (for example, guestbook) to which the import
// is made. If not set, it is assumed that the database is specified in
// the file to be imported.
Database string `json:"database,omitempty"`
// Kind: This is always sql#importContext.
Kind string `json:"kind,omitempty"`
// Uri: A path to the MySQL dump file in Google Cloud Storage from which
// the import is made. The URI is in the form gs://bucketName/fileName.
// Compressed gzip files (.gz) are also supported.
Uri []string `json:"uri,omitempty"`
// ForceSendFields is a list of field names (e.g. "Database") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Database") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ImportContext) MarshalJSON() ([]byte, error) {
type NoMethod ImportContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstanceOperation: An Operations resource contains information about
// database instance operations such as create, delete, and restart.
// Operations resources are created in response to operations that were
// initiated; you never create them directly.
type InstanceOperation struct {
// EndTime: The time this operation finished in UTC timezone in RFC 3339
// format, for example 2012-11-15T16:19:00.094Z.
EndTime string `json:"endTime,omitempty"`
// EnqueuedTime: The time this operation was enqueued in UTC timezone in
// RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
EnqueuedTime string `json:"enqueuedTime,omitempty"`
// Error: The error(s) encountered by this operation. Only set if the
// operation results in an error.
Error []*OperationError `json:"error,omitempty"`
// ExportContext: The context for export operation, if applicable.
ExportContext *ExportContext `json:"exportContext,omitempty"`
// ImportContext: The context for import operation, if applicable.
ImportContext *ImportContext `json:"importContext,omitempty"`
// Instance: Name of the database instance.
Instance string `json:"instance,omitempty"`
// Kind: This is always sql#instanceOperation.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// OperationType: The type of the operation. Valid values are CREATE,
// DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME,
// RESTORE_VOLUME.
OperationType string `json:"operationType,omitempty"`
// StartTime: The time this operation actually started in UTC timezone
// in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
StartTime string `json:"startTime,omitempty"`
// State: The state of an operation. Valid values are PENDING, RUNNING,
// DONE, UNKNOWN.
State string `json:"state,omitempty"`
// UserEmailAddress: The email address of the user who initiated this
// operation.
UserEmailAddress string `json:"userEmailAddress,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "EndTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "EndTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstanceOperation) MarshalJSON() ([]byte, error) {
type NoMethod InstanceOperation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstanceSetRootPasswordRequest: Database instance set root password
// request.
type InstanceSetRootPasswordRequest struct {
// SetRootPasswordContext: Set Root Password Context.
SetRootPasswordContext *SetRootPasswordContext `json:"setRootPasswordContext,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "SetRootPasswordContext") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "SetRootPasswordContext")
// to include in API requests with the JSON null value. By default,
// fields with empty values are omitted from API requests. However, any
// field with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *InstanceSetRootPasswordRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstanceSetRootPasswordRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesCloneRequest: Database instance clone request.
type InstancesCloneRequest struct {
// CloneContext: Contains details about the clone operation.
CloneContext *CloneContext `json:"cloneContext,omitempty"`
// ForceSendFields is a list of field names (e.g. "CloneContext") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CloneContext") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesCloneRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesCloneResponse: Database instance clone response.
type InstancesCloneResponse struct {
// Kind: This is always sql#instancesClone.
Kind string `json:"kind,omitempty"`
// Operation: An unique identifier for the operation associated with the
// cloned instance. You can use this identifier to retrieve the
// Operations resource, which has information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesCloneResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesCloneResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesDeleteResponse: Database instance delete response.
type InstancesDeleteResponse struct {
// Kind: This is always sql#instancesDelete.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesDeleteResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesDeleteResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesExportRequest: Database instance export request.
type InstancesExportRequest struct {
// ExportContext: Contains details about the export operation.
ExportContext *ExportContext `json:"exportContext,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExportContext") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ExportContext") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesExportRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesExportResponse: Database instance export response.
type InstancesExportResponse struct {
// Kind: This is always sql#instancesExport.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesExportResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesExportResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesImportRequest: Database instance import request.
type InstancesImportRequest struct {
// ImportContext: Contains details about the import operation.
ImportContext *ImportContext `json:"importContext,omitempty"`
// ForceSendFields is a list of field names (e.g. "ImportContext") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ImportContext") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) {
type NoMethod InstancesImportRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesImportResponse: Database instance import response.
type InstancesImportResponse struct {
// Kind: This is always sql#instancesImport.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesImportResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesImportResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesInsertResponse: Database instance insert response.
type InstancesInsertResponse struct {
// Kind: This is always sql#instancesInsert.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesInsertResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesInsertResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesListResponse: Database instances list response.
type InstancesListResponse struct {
// Items: List of database instance resources.
Items []*DatabaseInstance `json:"items,omitempty"`
// Kind: This is always sql#instancesList.
Kind string `json:"kind,omitempty"`
// NextPageToken: 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 `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesListResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesListResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesPromoteReplicaResponse: Database promote read replica
// response.
type InstancesPromoteReplicaResponse struct {
// Kind: This is always sql#instancesPromoteReplica.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesPromoteReplicaResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesPromoteReplicaResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesResetSslConfigResponse: Database instance resetSslConfig
// response.
type InstancesResetSslConfigResponse struct {
// Kind: This is always sql#instancesResetSslConfig.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation. All ssl client certificates will be
// deleted and a new server certificate will be created. Does not take
// effect until the next instance restart.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesResetSslConfigResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesResetSslConfigResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesRestartResponse: Database instance restart response.
type InstancesRestartResponse struct {
// Kind: This is always sql#instancesRestart.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesRestartResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesRestartResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesRestoreBackupResponse: Database instance restore backup
// response.
type InstancesRestoreBackupResponse struct {
// Kind: This is always sql#instancesRestoreBackup.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesRestoreBackupResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesRestoreBackupResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesSetRootPasswordResponse: Database instance set root password
// response.
type InstancesSetRootPasswordResponse struct {
// Kind: This is always sql#instancesSetRootPassword.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesSetRootPasswordResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesSetRootPasswordResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstancesUpdateResponse: Database instance update response.
type InstancesUpdateResponse struct {
// Kind: This is always sql#instancesUpdate.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *InstancesUpdateResponse) MarshalJSON() ([]byte, error) {
type NoMethod InstancesUpdateResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// IpConfiguration: IP Management configuration.
type IpConfiguration struct {
// AuthorizedNetworks: The list of external networks that are allowed to
// connect to the instance using the IP. In CIDR notation, also known as
// 'slash' notation (e.g. 192.168.100.0/24).
AuthorizedNetworks []string `json:"authorizedNetworks,omitempty"`
// Enabled: Whether the instance should be assigned an IP address or
// not.
Enabled bool `json:"enabled,omitempty"`
// Kind: This is always sql#ipConfiguration.
Kind string `json:"kind,omitempty"`
// RequireSsl: Whether SSL connections over IP should be enforced or
// not.
RequireSsl bool `json:"requireSsl,omitempty"`
// ForceSendFields is a list of field names (e.g. "AuthorizedNetworks")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AuthorizedNetworks") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *IpConfiguration) MarshalJSON() ([]byte, error) {
type NoMethod IpConfiguration
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// IpMapping: Database instance IP Mapping.
type IpMapping struct {
// IpAddress: The IP address assigned.
IpAddress string `json:"ipAddress,omitempty"`
// TimeToRetire: 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 `json:"timeToRetire,omitempty"`
// ForceSendFields is a list of field names (e.g. "IpAddress") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "IpAddress") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *IpMapping) MarshalJSON() ([]byte, error) {
type NoMethod IpMapping
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LocationPreference: Preferred location. This specifies where a Cloud
// SQL instance should preferably be 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.
type LocationPreference struct {
// FollowGaeApplication: The App Engine application to follow, it must
// be in the same region as the Cloud SQL instance.
FollowGaeApplication string `json:"followGaeApplication,omitempty"`
// Kind: This is always sql#locationPreference.
Kind string `json:"kind,omitempty"`
// Zone: The preferred Compute Engine zone (e.g. us-centra1-a,
// us-central1-b, etc.).
Zone string `json:"zone,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "FollowGaeApplication") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "FollowGaeApplication") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *LocationPreference) MarshalJSON() ([]byte, error) {
type NoMethod LocationPreference
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// OperationError: Database instance operation error.
type OperationError struct {
// Code: Identifies the specific error that occurred.
Code string `json:"code,omitempty"`
// Kind: This is always sql#operationError.
Kind string `json:"kind,omitempty"`
// ForceSendFields is a list of field names (e.g. "Code") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Code") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *OperationError) MarshalJSON() ([]byte, error) {
type NoMethod OperationError
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// OperationsListResponse: Database instance list operations response.
type OperationsListResponse struct {
// Items: List of operation resources.
Items []*InstanceOperation `json:"items,omitempty"`
// Kind: This is always sql#operationsList.
Kind string `json:"kind,omitempty"`
// NextPageToken: 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 `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *OperationsListResponse) MarshalJSON() ([]byte, error) {
type NoMethod OperationsListResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SetRootPasswordContext: Database instance set root password context.
type SetRootPasswordContext struct {
// Kind: This is always sql#setRootUserContext.
Kind string `json:"kind,omitempty"`
// Password: The password for the root user.
Password string `json:"password,omitempty"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SetRootPasswordContext) MarshalJSON() ([]byte, error) {
type NoMethod SetRootPasswordContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Settings: Database instance settings.
type Settings struct {
// ActivationPolicy: The activation policy for this instance. This
// specifies when the instance should be activated and is applicable
// only when the instance state is RUNNABLE. This can be one of the
// following.
// ALWAYS: The instance should always be active.
// NEVER: The instance should never be activated.
// ON_DEMAND: The instance is activated upon receiving requests.
ActivationPolicy string `json:"activationPolicy,omitempty"`
// AuthorizedGaeApplications: The App Engine app IDs that can access
// this instance.
AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"`
// BackupConfiguration: The daily backup configuration for the instance.
BackupConfiguration []*BackupConfiguration `json:"backupConfiguration,omitempty"`
// DatabaseFlags: The database flags passed to the instance at startup.
DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"`
// DatabaseReplicationEnabled: Configuration specific to read replica
// instance. Indicates whether replication is enabled or not.
DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"`
// IpConfiguration: The settings for IP Management. This allows to
// enable or disable the instance IP and manage which external networks
// can connect to the instance.
IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"`
// Kind: This is always sql#settings.
Kind string `json:"kind,omitempty"`
// LocationPreference: The location preference settings. This allows the
// instance to be located as near as possible to either an App Engine
// app or GCE zone for better performance.
LocationPreference *LocationPreference `json:"locationPreference,omitempty"`
// PricingPlan: The pricing plan for this instance. This can be either
// PER_USE or PACKAGE.
PricingPlan string `json:"pricingPlan,omitempty"`
// ReplicationType: The type of replication this instance uses. This can
// be either ASYNCHRONOUS or SYNCHRONOUS.
ReplicationType string `json:"replicationType,omitempty"`
// SettingsVersion: 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 int64 `json:"settingsVersion,omitempty,string"`
// Tier: The tier of service for this instance, for example D1, D2. For
// more information, see pricing.
Tier string `json:"tier,omitempty"`
// ForceSendFields is a list of field names (e.g. "ActivationPolicy") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ActivationPolicy") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Settings) MarshalJSON() ([]byte, error) {
type NoMethod Settings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SslCert: SslCerts Resource
type SslCert struct {
// Cert: PEM representation.
Cert string `json:"cert,omitempty"`
// CertSerialNumber: Serial number, as extracted from the certificate.
CertSerialNumber string `json:"certSerialNumber,omitempty"`
// CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+.
CommonName string `json:"commonName,omitempty"`
// CreateTime: Time when the certificate was created.
CreateTime string `json:"createTime,omitempty"`
// ExpirationTime: Time when the certificate expires.
ExpirationTime string `json:"expirationTime,omitempty"`
// Instance: Name of the database instance.
Instance string `json:"instance,omitempty"`
// Kind: This is always sql#sslCert.
Kind string `json:"kind,omitempty"`
// Sha1Fingerprint: Sha1 Fingerprint.
Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Cert") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Cert") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SslCert) MarshalJSON() ([]byte, error) {
type NoMethod SslCert
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SslCertDetail: SslCertDetail.
type SslCertDetail struct {
// CertInfo: The public information about the cert.
CertInfo *SslCert `json:"certInfo,omitempty"`
// CertPrivateKey: The private key for the client cert, in pem format.
// Keep private in order to protect your security.
CertPrivateKey string `json:"certPrivateKey,omitempty"`
// ForceSendFields is a list of field names (e.g. "CertInfo") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CertInfo") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SslCertDetail) MarshalJSON() ([]byte, error) {
type NoMethod SslCertDetail
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SslCertsDeleteResponse: SslCert delete response.
type SslCertsDeleteResponse struct {
// Kind: This is always sql#sslCertsDelete.
Kind string `json:"kind,omitempty"`
// Operation: An identifier that uniquely identifies the operation. You
// can use this identifier to retrieve the Operations resource that has
// information about the operation.
Operation string `json:"operation,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SslCertsDeleteResponse) MarshalJSON() ([]byte, error) {
type NoMethod SslCertsDeleteResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SslCertsInsertRequest: SslCerts insert request.
type SslCertsInsertRequest struct {
// CommonName: User supplied name. Must be a distinct name from the
// other certificates for this instance. New certificates will not be
// usable until the instance is restarted.
CommonName string `json:"commonName,omitempty"`
// ForceSendFields is a list of field names (e.g. "CommonName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CommonName") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) {
type NoMethod SslCertsInsertRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SslCertsInsertResponse: SslCert insert response.
type SslCertsInsertResponse struct {
// ClientCert: The new client certificate and private key. The new
// certificate will not work until the instance is restarted.
ClientCert *SslCertDetail `json:"clientCert,omitempty"`
// Kind: This is always sql#sslCertsInsert.
Kind string `json:"kind,omitempty"`
// ServerCaCert: 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 *SslCert `json:"serverCaCert,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ClientCert") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ClientCert") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) {
type NoMethod SslCertsInsertResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SslCertsListResponse: SslCerts list response.
type SslCertsListResponse struct {
// Items: List of client certificates for the instance.
Items []*SslCert `json:"items,omitempty"`
// Kind: This is always sql#sslCertsList.
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) {
type NoMethod SslCertsListResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Tier: A Google Cloud SQL service tier resource.
type Tier struct {
// DiskQuota: The maximum disk size of this tier in bytes.
DiskQuota int64 `json:"DiskQuota,omitempty,string"`
// RAM: The maximum RAM usage of this tier in bytes.
RAM int64 `json:"RAM,omitempty,string"`
// Kind: This is always sql#tier.
Kind string `json:"kind,omitempty"`
// Region: The applicable regions for this tier.
Region []string `json:"region,omitempty"`
// Tier: An identifier for the service tier, for example D1, D2 etc. For
// related information, see Pricing.
Tier string `json:"tier,omitempty"`
// ForceSendFields is a list of field names (e.g. "DiskQuota") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DiskQuota") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Tier) MarshalJSON() ([]byte, error) {
type NoMethod Tier
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TiersListResponse: Tiers list response.
type TiersListResponse struct {
// Items: List of tiers.
Items []*Tier `json:"items,omitempty"`
// Kind: This is always sql#tiersList.
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TiersListResponse) MarshalJSON() ([]byte, error) {
type NoMethod TiersListResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "sql.backupRuns.get":
type BackupRunsGetCall struct {
s *Service
project string
instance string
backupConfiguration string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Retrieves information about a specified backup run for a Cloud
// SQL instance.
func (r *BackupRunsService) Get(project string, instance string, backupConfiguration string, dueTime string) *BackupRunsGetCall {
c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.backupConfiguration = backupConfiguration
c.urlParams_.Set("dueTime", dueTime)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *BackupRunsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
"backupConfiguration": c.backupConfiguration,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.backupRuns.get" call.
// Exactly one of *BackupRun or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *BackupRun.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &BackupRun{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves information about a specified backup run for a Cloud SQL instance.",
// "httpMethod": "GET",
// "id": "sql.backupRuns.get",
// "parameterOrder": [
// "project",
// "instance",
// "backupConfiguration",
// "dueTime"
// ],
// "parameters": {
// "backupConfiguration": {
// "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "dueTime": {
// "description": "The start time of the four-hour backup window. The backup can occur any time in the window. The time is in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}",
// "response": {
// "$ref": "BackupRun"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.backupRuns.list":
type BackupRunsListCall struct {
s *Service
project string
instance string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists all backup runs associated with a Cloud SQL instance.
func (r *BackupRunsService) List(project string, instance string, backupConfiguration string) *BackupRunsListCall {
c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.urlParams_.Set("backupConfiguration", backupConfiguration)
return c
}
// MaxResults sets the optional parameter "maxResults": Maximum number
// of backup runs per response.
func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall {
c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
return c
}
// PageToken sets the optional parameter "pageToken": A
// previously-returned page token representing part of the larger set of
// results to view.
func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *BackupRunsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.backupRuns.list" call.
// Exactly one of *BackupRunsListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *BackupRunsListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &BackupRunsListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all backup runs associated with a Cloud SQL instance.",
// "httpMethod": "GET",
// "id": "sql.backupRuns.list",
// "parameterOrder": [
// "project",
// "instance",
// "backupConfiguration"
// ],
// "parameters": {
// "backupConfiguration": {
// "description": "Identifier for the backup configuration. This gets generated automatically when a backup configuration is created.",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "maxResults": {
// "description": "Maximum number of backup runs per response.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A previously-returned page token representing part of the larger set of results to view.",
// "location": "query",
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/backupRuns",
// "response": {
// "$ref": "BackupRunsListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "sql.flags.list":
type FlagsListCall struct {
s *Service
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists all database flags that can be set for Google Cloud SQL
// instances.
func (r *FlagsService) List() *FlagsListCall {
c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *FlagsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "flags")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.flags.list" call.
// Exactly one of *FlagsListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *FlagsListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &FlagsListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all database flags that can be set for Google Cloud SQL instances.",
// "httpMethod": "GET",
// "id": "sql.flags.list",
// "path": "flags",
// "response": {
// "$ref": "FlagsListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.clone":
type InstancesCloneCall struct {
s *Service
project string
instancesclonerequest *InstancesCloneRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Clone: Creates a Cloud SQL instance as a clone of a source instance.
func (r *InstancesService) Clone(project string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall {
c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instancesclonerequest = instancesclonerequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesCloneCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/clone")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.clone" call.
// Exactly one of *InstancesCloneResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *InstancesCloneResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*InstancesCloneResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesCloneResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a Cloud SQL instance as a clone of a source instance.",
// "httpMethod": "POST",
// "id": "sql.instances.clone",
// "parameterOrder": [
// "project"
// ],
// "parameters": {
// "project": {
// "description": "Project ID of the source as well as the clone Cloud SQL instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/clone",
// "request": {
// "$ref": "InstancesCloneRequest"
// },
// "response": {
// "$ref": "InstancesCloneResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.delete":
type InstancesDeleteCall struct {
s *Service
project string
instance string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes a Cloud SQL instance.
func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall {
c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.delete" call.
// Exactly one of *InstancesDeleteResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *InstancesDeleteResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*InstancesDeleteResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesDeleteResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes a Cloud SQL instance.",
// "httpMethod": "DELETE",
// "id": "sql.instances.delete",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance to be deleted.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}",
// "response": {
// "$ref": "InstancesDeleteResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.export":
type InstancesExportCall struct {
s *Service
project string
instance string
instancesexportrequest *InstancesExportRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Export: Exports data from a Cloud SQL instance to a Google Cloud
// Storage bucket as a MySQL dump file.
func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall {
c := &InstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.instancesexportrequest = instancesexportrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesExportCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/export")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.export" call.
// Exactly one of *InstancesExportResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *InstancesExportResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*InstancesExportResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesExportResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a MySQL dump file.",
// "httpMethod": "POST",
// "id": "sql.instances.export",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance to be exported.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/export",
// "request": {
// "$ref": "InstancesExportRequest"
// },
// "response": {
// "$ref": "InstancesExportResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "sql.instances.get":
type InstancesGetCall struct {
s *Service
project string
instance string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Retrieves information about a Cloud SQL instance.
func (r *InstancesService) Get(project string, instance string) *InstancesGetCall {
c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.get" call.
// Exactly one of *DatabaseInstance or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *DatabaseInstance.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &DatabaseInstance{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves information about a Cloud SQL instance.",
// "httpMethod": "GET",
// "id": "sql.instances.get",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Database instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}",
// "response": {
// "$ref": "DatabaseInstance"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.import":
type InstancesImportCall struct {
s *Service
project string
instance string
instancesimportrequest *InstancesImportRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Import: Imports data into a Cloud SQL instance from a MySQL dump file
// stored in a Google Cloud Storage bucket.
func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall {
c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.instancesimportrequest = instancesimportrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesImportCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/import")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.import" call.
// Exactly one of *InstancesImportResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *InstancesImportResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*InstancesImportResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesImportResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Imports data into a Cloud SQL instance from a MySQL dump file stored in a Google Cloud Storage bucket.",
// "httpMethod": "POST",
// "id": "sql.instances.import",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/import",
// "request": {
// "$ref": "InstancesImportRequest"
// },
// "response": {
// "$ref": "InstancesImportResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "sql.instances.insert":
type InstancesInsertCall struct {
s *Service
project string
databaseinstance *DatabaseInstance
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Insert: Creates a new Cloud SQL instance.
func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall {
c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.databaseinstance = databaseinstance
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesInsertCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.insert" call.
// Exactly one of *InstancesInsertResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *InstancesInsertResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*InstancesInsertResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesInsertResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a new Cloud SQL instance.",
// "httpMethod": "POST",
// "id": "sql.instances.insert",
// "parameterOrder": [
// "project"
// ],
// "parameters": {
// "project": {
// "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances",
// "request": {
// "$ref": "DatabaseInstance"
// },
// "response": {
// "$ref": "InstancesInsertResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.list":
type InstancesListCall struct {
s *Service
project string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists instances for a given project, in alphabetical order by
// instance name.
func (r *InstancesService) List(project string) *InstancesListCall {
c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
return c
}
// MaxResults sets the optional parameter "maxResults": The maximum
// number of results to return per response.
func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
return c
}
// PageToken sets the optional parameter "pageToken": A
// previously-returned page token representing part of the larger set of
// results to view.
func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.list" call.
// Exactly one of *InstancesListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *InstancesListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists instances for a given project, in alphabetical order by instance name.",
// "httpMethod": "GET",
// "id": "sql.instances.list",
// "parameterOrder": [
// "project"
// ],
// "parameters": {
// "maxResults": {
// "description": "The maximum number of results to return per response.",
// "format": "uint32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A previously-returned page token representing part of the larger set of results to view.",
// "location": "query",
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project for which to list Cloud SQL instances.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances",
// "response": {
// "$ref": "InstancesListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "sql.instances.patch":
type InstancesPatchCall struct {
s *Service
project string
instance string
databaseinstance *DatabaseInstance
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates the settings of a Cloud SQL instance. This method
// supports patch semantics.
func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall {
c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.databaseinstance = databaseinstance
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("PATCH", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.patch" call.
// Exactly one of *InstancesUpdateResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *InstancesUpdateResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*InstancesUpdateResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesUpdateResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates the settings of a Cloud SQL instance. This method supports patch semantics.",
// "httpMethod": "PATCH",
// "id": "sql.instances.patch",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}",
// "request": {
// "$ref": "DatabaseInstance"
// },
// "response": {
// "$ref": "InstancesUpdateResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.promoteReplica":
type InstancesPromoteReplicaCall struct {
s *Service
project string
instance string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// PromoteReplica: Promotes the read replica instance to be a
// stand-alone Cloud SQL instance.
func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall {
c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesPromoteReplicaCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/promoteReplica")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.promoteReplica" call.
// Exactly one of *InstancesPromoteReplicaResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *InstancesPromoteReplicaResponse.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*InstancesPromoteReplicaResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesPromoteReplicaResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance.",
// "httpMethod": "POST",
// "id": "sql.instances.promoteReplica",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL read replica instance name.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "ID of the project that contains the read replica.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/promoteReplica",
// "response": {
// "$ref": "InstancesPromoteReplicaResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.resetSslConfig":
type InstancesResetSslConfigCall struct {
s *Service
project string
instance string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// ResetSslConfig: Deletes all client certificates and generates a new
// server SSL certificate for a Cloud SQL instance.
func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall {
c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesResetSslConfigCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/resetSslConfig")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.resetSslConfig" call.
// Exactly one of *InstancesResetSslConfigResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *InstancesResetSslConfigResponse.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*InstancesResetSslConfigResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesResetSslConfigResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes all client certificates and generates a new server SSL certificate for a Cloud SQL instance.",
// "httpMethod": "POST",
// "id": "sql.instances.resetSslConfig",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/resetSslConfig",
// "response": {
// "$ref": "InstancesResetSslConfigResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.restart":
type InstancesRestartCall struct {
s *Service
project string
instance string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Restart: Restarts a Cloud SQL instance.
func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall {
c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesRestartCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restart")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.restart" call.
// Exactly one of *InstancesRestartResponse or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *InstancesRestartResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*InstancesRestartResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesRestartResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Restarts a Cloud SQL instance.",
// "httpMethod": "POST",
// "id": "sql.instances.restart",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance to be restarted.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/restart",
// "response": {
// "$ref": "InstancesRestartResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.restoreBackup":
type InstancesRestoreBackupCall struct {
s *Service
project string
instance string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// RestoreBackup: Restores a backup of a Cloud SQL instance.
func (r *InstancesService) RestoreBackup(project string, instance string, backupConfigurationid string, dueTime string) *InstancesRestoreBackupCall {
c := &InstancesRestoreBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.urlParams_.Set("backupConfiguration", backupConfigurationid)
c.urlParams_.Set("dueTime", dueTime)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesRestoreBackupCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restoreBackup")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.restoreBackup" call.
// Exactly one of *InstancesRestoreBackupResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *InstancesRestoreBackupResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*InstancesRestoreBackupResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesRestoreBackupResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Restores a backup of a Cloud SQL instance.",
// "httpMethod": "POST",
// "id": "sql.instances.restoreBackup",
// "parameterOrder": [
// "project",
// "instance",
// "backupConfiguration",
// "dueTime"
// ],
// "parameters": {
// "backupConfiguration": {
// "description": "The identifier of the backup configuration. This gets generated automatically when a backup configuration is created.",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "dueTime": {
// "description": "The start time of the four-hour backup window. The backup can occur any time in the window. The time is in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/restoreBackup",
// "response": {
// "$ref": "InstancesRestoreBackupResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.setRootPassword":
type InstancesSetRootPasswordCall struct {
s *Service
project string
instance string
instancesetrootpasswordrequest *InstanceSetRootPasswordRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// SetRootPassword: Sets the password for the root user of the specified
// Cloud SQL instance.
func (r *InstancesService) SetRootPassword(project string, instance string, instancesetrootpasswordrequest *InstanceSetRootPasswordRequest) *InstancesSetRootPasswordCall {
c := &InstancesSetRootPasswordCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.instancesetrootpasswordrequest = instancesetrootpasswordrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesSetRootPasswordCall) Fields(s ...googleapi.Field) *InstancesSetRootPasswordCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesSetRootPasswordCall) Context(ctx context.Context) *InstancesSetRootPasswordCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesSetRootPasswordCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesSetRootPasswordCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesetrootpasswordrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/setRootPassword")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.setRootPassword" call.
// Exactly one of *InstancesSetRootPasswordResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *InstancesSetRootPasswordResponse.ServerResponse.Header or (if
// a response was returned at all) in error.(*googleapi.Error).Header.
// Use googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesSetRootPasswordCall) Do(opts ...googleapi.CallOption) (*InstancesSetRootPasswordResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesSetRootPasswordResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Sets the password for the root user of the specified Cloud SQL instance.",
// "httpMethod": "POST",
// "id": "sql.instances.setRootPassword",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/setRootPassword",
// "request": {
// "$ref": "InstanceSetRootPasswordRequest"
// },
// "response": {
// "$ref": "InstancesSetRootPasswordResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.instances.update":
type InstancesUpdateCall struct {
s *Service
project string
instance string
databaseinstance *DatabaseInstance
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Update: Updates the settings of a Cloud SQL instance.
func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall {
c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.databaseinstance = databaseinstance
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *InstancesUpdateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("PUT", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.instances.update" call.
// Exactly one of *InstancesUpdateResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *InstancesUpdateResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*InstancesUpdateResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstancesUpdateResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates the settings of a Cloud SQL instance.",
// "etagRequired": true,
// "httpMethod": "PUT",
// "id": "sql.instances.update",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}",
// "request": {
// "$ref": "DatabaseInstance"
// },
// "response": {
// "$ref": "InstancesUpdateResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.operations.get":
type OperationsGetCall struct {
s *Service
project string
instance string
operation string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Retrieves information about a specific operation that was
// performed on a Cloud SQL instance.
func (r *OperationsService) Get(project string, instance string, operation string) *OperationsGetCall {
c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.operation = operation
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OperationsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations/{operation}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
"operation": c.operation,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.operations.get" call.
// Exactly one of *InstanceOperation or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *InstanceOperation.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*InstanceOperation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstanceOperation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves information about a specific operation that was performed on a Cloud SQL instance.",
// "httpMethod": "GET",
// "id": "sql.operations.get",
// "parameterOrder": [
// "project",
// "instance",
// "operation"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "operation": {
// "description": "Instance operation ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/operations/{operation}",
// "response": {
// "$ref": "InstanceOperation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.operations.list":
type OperationsListCall struct {
s *Service
project string
instance string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists all operations that have been performed on a Cloud SQL
// instance.
func (r *OperationsService) List(project string, instance string) *OperationsListCall {
c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
return c
}
// MaxResults sets the optional parameter "maxResults": Maximum number
// of operations per response.
func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall {
c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
return c
}
// PageToken sets the optional parameter "pageToken": A
// previously-returned page token representing part of the larger set of
// results to view.
func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OperationsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.operations.list" call.
// Exactly one of *OperationsListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *OperationsListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &OperationsListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all operations that have been performed on a Cloud SQL instance.",
// "httpMethod": "GET",
// "id": "sql.operations.list",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "maxResults": {
// "description": "Maximum number of operations per response.",
// "format": "uint32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A previously-returned page token representing part of the larger set of results to view.",
// "location": "query",
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/operations",
// "response": {
// "$ref": "OperationsListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "sql.sslCerts.delete":
type SslCertsDeleteCall struct {
s *Service
project string
instance string
sha1Fingerprint string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes an SSL certificate from a Cloud SQL instance.
func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall {
c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.sha1Fingerprint = sha1Fingerprint
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *SslCertsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
"sha1Fingerprint": c.sha1Fingerprint,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.sslCerts.delete" call.
// Exactly one of *SslCertsDeleteResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *SslCertsDeleteResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*SslCertsDeleteResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SslCertsDeleteResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes an SSL certificate from a Cloud SQL instance.",
// "httpMethod": "DELETE",
// "id": "sql.sslCerts.delete",
// "parameterOrder": [
// "project",
// "instance",
// "sha1Fingerprint"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance to be deleted.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "sha1Fingerprint": {
// "description": "Sha1 FingerPrint.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
// "response": {
// "$ref": "SslCertsDeleteResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.sslCerts.get":
type SslCertsGetCall struct {
s *Service
project string
instance string
sha1Fingerprint string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Retrieves an SSL certificate as specified by its SHA-1
// fingerprint.
func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall {
c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.sha1Fingerprint = sha1Fingerprint
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *SslCertsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
"sha1Fingerprint": c.sha1Fingerprint,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.sslCerts.get" call.
// Exactly one of *SslCert or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *SslCert.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SslCert{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves an SSL certificate as specified by its SHA-1 fingerprint.",
// "httpMethod": "GET",
// "id": "sql.sslCerts.get",
// "parameterOrder": [
// "project",
// "instance",
// "sha1Fingerprint"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project that contains the instance.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "sha1Fingerprint": {
// "description": "Sha1 FingerPrint.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
// "response": {
// "$ref": "SslCert"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.sslCerts.insert":
type SslCertsInsertCall struct {
s *Service
project string
instance string
sslcertsinsertrequest *SslCertsInsertRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Insert: Creates an SSL certificate and returns the certificate, the
// associated private key, and the server certificate authority.
func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall {
c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
c.sslcertsinsertrequest = sslcertsinsertrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *SslCertsInsertCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.sslCerts.insert" call.
// Exactly one of *SslCertsInsertResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *SslCertsInsertResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SslCertsInsertResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates an SSL certificate and returns the certificate, the associated private key, and the server certificate authority.",
// "httpMethod": "POST",
// "id": "sql.sslCerts.insert",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/sslCerts",
// "request": {
// "$ref": "SslCertsInsertRequest"
// },
// "response": {
// "$ref": "SslCertsInsertResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.sslCerts.list":
type SslCertsListCall struct {
s *Service
project string
instance string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists all of the current SSL certificates defined for a Cloud
// SQL instance.
func (r *SslCertsService) List(project string, instance string) *SslCertsListCall {
c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
c.instance = instance
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *SslCertsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"instance": c.instance,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.sslCerts.list" call.
// Exactly one of *SslCertsListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *SslCertsListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &SslCertsListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all of the current SSL certificates defined for a Cloud SQL instance.",
// "httpMethod": "GET",
// "id": "sql.sslCerts.list",
// "parameterOrder": [
// "project",
// "instance"
// ],
// "parameters": {
// "instance": {
// "description": "Cloud SQL instance ID. This does not include the project ID.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Project ID of the project for which to list Cloud SQL instances.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/instances/{instance}/sslCerts",
// "response": {
// "$ref": "SslCertsListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}
// method id "sql.tiers.list":
type TiersListCall struct {
s *Service
project string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists service tiers that can be used to create Google Cloud SQL
// instances.
func (r *TiersService) List(project string) *TiersListCall {
c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *TiersListCall) Context(ctx context.Context) *TiersListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *TiersListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TiersListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/tiers")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "sql.tiers.list" call.
// Exactly one of *TiersListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *TiersListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &TiersListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists service tiers that can be used to create Google Cloud SQL instances.",
// "httpMethod": "GET",
// "id": "sql.tiers.list",
// "parameterOrder": [
// "project"
// ],
// "parameters": {
// "project": {
// "description": "Project ID of the project for which to list tiers.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "projects/{project}/tiers",
// "response": {
// "$ref": "TiersListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/sqlservice.admin"
// ]
// }
}