1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Code generated file. DO NOT EDIT.
6
7// Package sqladmin provides access to the Cloud SQL Admin API.
8//
9// For product documentation, see: https://cloud.google.com/sql/docs/reference/latest
10//
11// Creating a client
12//
13// Usage example:
14//
15//   import "google.golang.org/api/sqladmin/v1beta4"
16//   ...
17//   ctx := context.Background()
18//   sqladminService, err := sqladmin.NewService(ctx)
19//
20// In this example, Google Application Default Credentials are used for authentication.
21//
22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
23//
24// Other authentication options
25//
26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
27//
28//   sqladminService, err := sqladmin.NewService(ctx, option.WithScopes(sqladmin.SqlserviceAdminScope))
29//
30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
31//
32//   sqladminService, err := sqladmin.NewService(ctx, option.WithAPIKey("AIza..."))
33//
34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
35//
36//   config := &oauth2.Config{...}
37//   // ...
38//   token, err := config.Exchange(ctx, ...)
39//   sqladminService, err := sqladmin.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
40//
41// See https://godoc.org/google.golang.org/api/option/ for details on options.
42package sqladmin // import "google.golang.org/api/sqladmin/v1beta4"
43
44import (
45	"bytes"
46	"context"
47	"encoding/json"
48	"errors"
49	"fmt"
50	"io"
51	"net/http"
52	"net/url"
53	"strconv"
54	"strings"
55
56	googleapi "google.golang.org/api/googleapi"
57	gensupport "google.golang.org/api/internal/gensupport"
58	option "google.golang.org/api/option"
59	htransport "google.golang.org/api/transport/http"
60)
61
62// Always reference these packages, just in case the auto-generated code
63// below doesn't.
64var _ = bytes.NewBuffer
65var _ = strconv.Itoa
66var _ = fmt.Sprintf
67var _ = json.NewDecoder
68var _ = io.Copy
69var _ = url.Parse
70var _ = gensupport.MarshalJSON
71var _ = googleapi.Version
72var _ = errors.New
73var _ = strings.Replace
74var _ = context.Canceled
75
76const apiId = "sqladmin:v1beta4"
77const apiName = "sqladmin"
78const apiVersion = "v1beta4"
79const basePath = "https://www.googleapis.com/sql/v1beta4/"
80
81// OAuth2 scopes used by this API.
82const (
83	// View and manage your data across Google Cloud Platform services
84	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
85
86	// Manage your Google SQL Service instances
87	SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin"
88)
89
90// NewService creates a new Service.
91func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
92	scopesOption := option.WithScopes(
93		"https://www.googleapis.com/auth/cloud-platform",
94		"https://www.googleapis.com/auth/sqlservice.admin",
95	)
96	// NOTE: prepend, so we don't override user-specified scopes.
97	opts = append([]option.ClientOption{scopesOption}, opts...)
98	client, endpoint, err := htransport.NewClient(ctx, opts...)
99	if err != nil {
100		return nil, err
101	}
102	s, err := New(client)
103	if err != nil {
104		return nil, err
105	}
106	if endpoint != "" {
107		s.BasePath = endpoint
108	}
109	return s, nil
110}
111
112// New creates a new Service. It uses the provided http.Client for requests.
113//
114// Deprecated: please use NewService instead.
115// To provide a custom HTTP client, use option.WithHTTPClient.
116// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
117func New(client *http.Client) (*Service, error) {
118	if client == nil {
119		return nil, errors.New("client is nil")
120	}
121	s := &Service{client: client, BasePath: basePath}
122	s.BackupRuns = NewBackupRunsService(s)
123	s.Databases = NewDatabasesService(s)
124	s.Flags = NewFlagsService(s)
125	s.Instances = NewInstancesService(s)
126	s.Operations = NewOperationsService(s)
127	s.SslCerts = NewSslCertsService(s)
128	s.Tiers = NewTiersService(s)
129	s.Users = NewUsersService(s)
130	return s, nil
131}
132
133type Service struct {
134	client    *http.Client
135	BasePath  string // API endpoint base URL
136	UserAgent string // optional additional User-Agent fragment
137
138	BackupRuns *BackupRunsService
139
140	Databases *DatabasesService
141
142	Flags *FlagsService
143
144	Instances *InstancesService
145
146	Operations *OperationsService
147
148	SslCerts *SslCertsService
149
150	Tiers *TiersService
151
152	Users *UsersService
153}
154
155func (s *Service) userAgent() string {
156	if s.UserAgent == "" {
157		return googleapi.UserAgent
158	}
159	return googleapi.UserAgent + " " + s.UserAgent
160}
161
162func NewBackupRunsService(s *Service) *BackupRunsService {
163	rs := &BackupRunsService{s: s}
164	return rs
165}
166
167type BackupRunsService struct {
168	s *Service
169}
170
171func NewDatabasesService(s *Service) *DatabasesService {
172	rs := &DatabasesService{s: s}
173	return rs
174}
175
176type DatabasesService struct {
177	s *Service
178}
179
180func NewFlagsService(s *Service) *FlagsService {
181	rs := &FlagsService{s: s}
182	return rs
183}
184
185type FlagsService struct {
186	s *Service
187}
188
189func NewInstancesService(s *Service) *InstancesService {
190	rs := &InstancesService{s: s}
191	return rs
192}
193
194type InstancesService struct {
195	s *Service
196}
197
198func NewOperationsService(s *Service) *OperationsService {
199	rs := &OperationsService{s: s}
200	return rs
201}
202
203type OperationsService struct {
204	s *Service
205}
206
207func NewSslCertsService(s *Service) *SslCertsService {
208	rs := &SslCertsService{s: s}
209	return rs
210}
211
212type SslCertsService struct {
213	s *Service
214}
215
216func NewTiersService(s *Service) *TiersService {
217	rs := &TiersService{s: s}
218	return rs
219}
220
221type TiersService struct {
222	s *Service
223}
224
225func NewUsersService(s *Service) *UsersService {
226	rs := &UsersService{s: s}
227	return rs
228}
229
230type UsersService struct {
231	s *Service
232}
233
234// AclEntry: An entry for an Access Control list.
235type AclEntry struct {
236	// ExpirationTime: The time when this access control entry expires in
237	// RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
238	ExpirationTime string `json:"expirationTime,omitempty"`
239
240	// Kind: This is always sql#aclEntry.
241	Kind string `json:"kind,omitempty"`
242
243	// Name: An optional label to identify this entry.
244	Name string `json:"name,omitempty"`
245
246	// Value: The whitelisted value for the access control list.
247	Value string `json:"value,omitempty"`
248
249	// ForceSendFields is a list of field names (e.g. "ExpirationTime") to
250	// unconditionally include in API requests. By default, fields with
251	// empty values are omitted from API requests. However, any non-pointer,
252	// non-interface field appearing in ForceSendFields will be sent to the
253	// server regardless of whether the field is empty or not. This may be
254	// used to include empty fields in Patch requests.
255	ForceSendFields []string `json:"-"`
256
257	// NullFields is a list of field names (e.g. "ExpirationTime") to
258	// include in API requests with the JSON null value. By default, fields
259	// with empty values are omitted from API requests. However, any field
260	// with an empty value appearing in NullFields will be sent to the
261	// server as null. It is an error if a field in this list has a
262	// non-empty value. This may be used to include null fields in Patch
263	// requests.
264	NullFields []string `json:"-"`
265}
266
267func (s *AclEntry) MarshalJSON() ([]byte, error) {
268	type NoMethod AclEntry
269	raw := NoMethod(*s)
270	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
271}
272
273// ApiWarning: An Admin API warning message.
274type ApiWarning struct {
275	// Code: Code to uniquely identify the warning type.
276	Code string `json:"code,omitempty"`
277
278	// Message: The warning message.
279	Message string `json:"message,omitempty"`
280
281	// ForceSendFields is a list of field names (e.g. "Code") to
282	// unconditionally include in API requests. By default, fields with
283	// empty values are omitted from API requests. However, any non-pointer,
284	// non-interface field appearing in ForceSendFields will be sent to the
285	// server regardless of whether the field is empty or not. This may be
286	// used to include empty fields in Patch requests.
287	ForceSendFields []string `json:"-"`
288
289	// NullFields is a list of field names (e.g. "Code") to include in API
290	// requests with the JSON null value. By default, fields with empty
291	// values are omitted from API requests. However, any field with an
292	// empty value appearing in NullFields will be sent to the server as
293	// null. It is an error if a field in this list has a non-empty value.
294	// This may be used to include null fields in Patch requests.
295	NullFields []string `json:"-"`
296}
297
298func (s *ApiWarning) MarshalJSON() ([]byte, error) {
299	type NoMethod ApiWarning
300	raw := NoMethod(*s)
301	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
302}
303
304// BackupConfiguration: Database instance backup configuration.
305type BackupConfiguration struct {
306	// BinaryLogEnabled: Whether binary log is enabled. If backup
307	// configuration is disabled, binary log must be disabled as well.
308	BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"`
309
310	// Enabled: Whether this configuration is enabled.
311	Enabled bool `json:"enabled,omitempty"`
312
313	// Kind: This is always sql#backupConfiguration.
314	Kind string `json:"kind,omitempty"`
315
316	// Location: The location of the backup.
317	Location string `json:"location,omitempty"`
318
319	// ReplicationLogArchivingEnabled: Reserved for future use.
320	ReplicationLogArchivingEnabled bool `json:"replicationLogArchivingEnabled,omitempty"`
321
322	// StartTime: Start time for the daily backup configuration in UTC
323	// timezone in the 24 hour format - HH:MM.
324	StartTime string `json:"startTime,omitempty"`
325
326	// ForceSendFields is a list of field names (e.g. "BinaryLogEnabled") to
327	// unconditionally include in API requests. By default, fields with
328	// empty values are omitted from API requests. However, any non-pointer,
329	// non-interface field appearing in ForceSendFields will be sent to the
330	// server regardless of whether the field is empty or not. This may be
331	// used to include empty fields in Patch requests.
332	ForceSendFields []string `json:"-"`
333
334	// NullFields is a list of field names (e.g. "BinaryLogEnabled") to
335	// include in API requests with the JSON null value. By default, fields
336	// with empty values are omitted from API requests. However, any field
337	// with an empty value appearing in NullFields will be sent to the
338	// server as null. It is an error if a field in this list has a
339	// non-empty value. This may be used to include null fields in Patch
340	// requests.
341	NullFields []string `json:"-"`
342}
343
344func (s *BackupConfiguration) MarshalJSON() ([]byte, error) {
345	type NoMethod BackupConfiguration
346	raw := NoMethod(*s)
347	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
348}
349
350// BackupRun: A BackupRun resource.
351type BackupRun struct {
352	// Description: The description of this run, only applicable to
353	// on-demand backups.
354	Description string `json:"description,omitempty"`
355
356	// DiskEncryptionConfiguration: Disk encryption configuration specific
357	// to a backup. Applies only to Second Generation instances.
358	DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"`
359
360	// DiskEncryptionStatus: Disk encryption status specific to a backup.
361	// Applies only to Second Generation instances.
362	DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"`
363
364	// EndTime: The time the backup operation completed in UTC timezone in
365	// RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
366	EndTime string `json:"endTime,omitempty"`
367
368	// EnqueuedTime: The time the run was enqueued in UTC timezone in RFC
369	// 3339 format, for example 2012-11-15T16:19:00.094Z.
370	EnqueuedTime string `json:"enqueuedTime,omitempty"`
371
372	// Error: Information about why the backup operation failed. This is
373	// only present if the run has the FAILED status.
374	Error *OperationError `json:"error,omitempty"`
375
376	// Id: The identifier for this backup run. Unique only for a specific
377	// Cloud SQL instance.
378	Id int64 `json:"id,omitempty,string"`
379
380	// Instance: Name of the database instance.
381	Instance string `json:"instance,omitempty"`
382
383	// Kind: This is always sql#backupRun.
384	Kind string `json:"kind,omitempty"`
385
386	// Location: The location of the backup.
387	Location string `json:"location,omitempty"`
388
389	// SelfLink: The URI of this resource.
390	SelfLink string `json:"selfLink,omitempty"`
391
392	// StartTime: The time the backup operation actually started in UTC
393	// timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
394	StartTime string `json:"startTime,omitempty"`
395
396	// Status: The status of this run.
397	Status string `json:"status,omitempty"`
398
399	// Type: The type of this run; can be either "AUTOMATED" or "ON_DEMAND".
400	Type string `json:"type,omitempty"`
401
402	// WindowStartTime: The start time of the backup window during which
403	// this the backup was attempted in RFC 3339 format, for example
404	// 2012-11-15T16:19:00.094Z.
405	WindowStartTime string `json:"windowStartTime,omitempty"`
406
407	// ServerResponse contains the HTTP response code and headers from the
408	// server.
409	googleapi.ServerResponse `json:"-"`
410
411	// ForceSendFields is a list of field names (e.g. "Description") to
412	// unconditionally include in API requests. By default, fields with
413	// empty values are omitted from API requests. However, any non-pointer,
414	// non-interface field appearing in ForceSendFields will be sent to the
415	// server regardless of whether the field is empty or not. This may be
416	// used to include empty fields in Patch requests.
417	ForceSendFields []string `json:"-"`
418
419	// NullFields is a list of field names (e.g. "Description") to include
420	// in API requests with the JSON null value. By default, fields with
421	// empty values are omitted from API requests. However, any field with
422	// an empty value appearing in NullFields will be sent to the server as
423	// null. It is an error if a field in this list has a non-empty value.
424	// This may be used to include null fields in Patch requests.
425	NullFields []string `json:"-"`
426}
427
428func (s *BackupRun) MarshalJSON() ([]byte, error) {
429	type NoMethod BackupRun
430	raw := NoMethod(*s)
431	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
432}
433
434// BackupRunsListResponse: Backup run list results.
435type BackupRunsListResponse struct {
436	// Items: A list of backup runs in reverse chronological order of the
437	// enqueued time.
438	Items []*BackupRun `json:"items,omitempty"`
439
440	// Kind: This is always sql#backupRunsList.
441	Kind string `json:"kind,omitempty"`
442
443	// NextPageToken: The continuation token, used to page through large
444	// result sets. Provide this value in a subsequent request to return the
445	// next page of results.
446	NextPageToken string `json:"nextPageToken,omitempty"`
447
448	// ServerResponse contains the HTTP response code and headers from the
449	// server.
450	googleapi.ServerResponse `json:"-"`
451
452	// ForceSendFields is a list of field names (e.g. "Items") to
453	// unconditionally include in API requests. By default, fields with
454	// empty values are omitted from API requests. However, any non-pointer,
455	// non-interface field appearing in ForceSendFields will be sent to the
456	// server regardless of whether the field is empty or not. This may be
457	// used to include empty fields in Patch requests.
458	ForceSendFields []string `json:"-"`
459
460	// NullFields is a list of field names (e.g. "Items") to include in API
461	// requests with the JSON null value. By default, fields with empty
462	// values are omitted from API requests. However, any field with an
463	// empty value appearing in NullFields will be sent to the server as
464	// null. It is an error if a field in this list has a non-empty value.
465	// This may be used to include null fields in Patch requests.
466	NullFields []string `json:"-"`
467}
468
469func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) {
470	type NoMethod BackupRunsListResponse
471	raw := NoMethod(*s)
472	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
473}
474
475// BinLogCoordinates: Binary log coordinates.
476type BinLogCoordinates struct {
477	// BinLogFileName: Name of the binary log file for a Cloud SQL instance.
478	BinLogFileName string `json:"binLogFileName,omitempty"`
479
480	// BinLogPosition: Position (offset) within the binary log file.
481	BinLogPosition int64 `json:"binLogPosition,omitempty,string"`
482
483	// Kind: This is always sql#binLogCoordinates.
484	Kind string `json:"kind,omitempty"`
485
486	// ForceSendFields is a list of field names (e.g. "BinLogFileName") to
487	// unconditionally include in API requests. By default, fields with
488	// empty values are omitted from API requests. However, any non-pointer,
489	// non-interface field appearing in ForceSendFields will be sent to the
490	// server regardless of whether the field is empty or not. This may be
491	// used to include empty fields in Patch requests.
492	ForceSendFields []string `json:"-"`
493
494	// NullFields is a list of field names (e.g. "BinLogFileName") to
495	// include in API requests with the JSON null value. By default, fields
496	// with empty values are omitted from API requests. However, any field
497	// with an empty value appearing in NullFields will be sent to the
498	// server as null. It is an error if a field in this list has a
499	// non-empty value. This may be used to include null fields in Patch
500	// requests.
501	NullFields []string `json:"-"`
502}
503
504func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) {
505	type NoMethod BinLogCoordinates
506	raw := NoMethod(*s)
507	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
508}
509
510// CloneContext: Database instance clone context.
511type CloneContext struct {
512	// BinLogCoordinates: Binary log coordinates, if specified, identify the
513	// position up to which the source instance should be cloned. If not
514	// specified, the source instance is cloned up to the most recent binary
515	// log coordinates.
516	BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"`
517
518	// DestinationInstanceName: Name of the Cloud SQL instance to be created
519	// as a clone.
520	DestinationInstanceName string `json:"destinationInstanceName,omitempty"`
521
522	// Kind: This is always sql#cloneContext.
523	Kind string `json:"kind,omitempty"`
524
525	// PitrTimestampMs: Reserved for future use.
526	PitrTimestampMs int64 `json:"pitrTimestampMs,omitempty,string"`
527
528	// ForceSendFields is a list of field names (e.g. "BinLogCoordinates")
529	// to unconditionally include in API requests. By default, fields with
530	// empty values are omitted from API requests. However, any non-pointer,
531	// non-interface field appearing in ForceSendFields will be sent to the
532	// server regardless of whether the field is empty or not. This may be
533	// used to include empty fields in Patch requests.
534	ForceSendFields []string `json:"-"`
535
536	// NullFields is a list of field names (e.g. "BinLogCoordinates") to
537	// include in API requests with the JSON null value. By default, fields
538	// with empty values are omitted from API requests. However, any field
539	// with an empty value appearing in NullFields will be sent to the
540	// server as null. It is an error if a field in this list has a
541	// non-empty value. This may be used to include null fields in Patch
542	// requests.
543	NullFields []string `json:"-"`
544}
545
546func (s *CloneContext) MarshalJSON() ([]byte, error) {
547	type NoMethod CloneContext
548	raw := NoMethod(*s)
549	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
550}
551
552// Database: Represents a SQL database on the Cloud SQL instance.
553type Database struct {
554	// Charset: The MySQL charset value.
555	Charset string `json:"charset,omitempty"`
556
557	// Collation: The MySQL collation value.
558	Collation string `json:"collation,omitempty"`
559
560	// Etag: This field is deprecated and will be removed from a future
561	// version of the API.
562	Etag string `json:"etag,omitempty"`
563
564	// Instance: The name of the Cloud SQL instance. This does not include
565	// the project ID.
566	Instance string `json:"instance,omitempty"`
567
568	// Kind: This is always sql#database.
569	Kind string `json:"kind,omitempty"`
570
571	// Name: The name of the database in the Cloud SQL instance. This does
572	// not include the project ID or instance name.
573	Name string `json:"name,omitempty"`
574
575	// Project: The project ID of the project containing the Cloud SQL
576	// database. The Google apps domain is prefixed if applicable.
577	Project string `json:"project,omitempty"`
578
579	// SelfLink: The URI of this resource.
580	SelfLink string `json:"selfLink,omitempty"`
581
582	// ServerResponse contains the HTTP response code and headers from the
583	// server.
584	googleapi.ServerResponse `json:"-"`
585
586	// ForceSendFields is a list of field names (e.g. "Charset") to
587	// unconditionally include in API requests. By default, fields with
588	// empty values are omitted from API requests. However, any non-pointer,
589	// non-interface field appearing in ForceSendFields will be sent to the
590	// server regardless of whether the field is empty or not. This may be
591	// used to include empty fields in Patch requests.
592	ForceSendFields []string `json:"-"`
593
594	// NullFields is a list of field names (e.g. "Charset") to include in
595	// API requests with the JSON null value. By default, fields with empty
596	// values are omitted from API requests. However, any field with an
597	// empty value appearing in NullFields will be sent to the server as
598	// null. It is an error if a field in this list has a non-empty value.
599	// This may be used to include null fields in Patch requests.
600	NullFields []string `json:"-"`
601}
602
603func (s *Database) MarshalJSON() ([]byte, error) {
604	type NoMethod Database
605	raw := NoMethod(*s)
606	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
607}
608
609// DatabaseFlags: Database flags for Cloud SQL instances.
610type DatabaseFlags struct {
611	// Name: The name of the flag. These flags are passed at instance
612	// startup, so include both server options and system variables for
613	// MySQL. Flags should be specified with underscores, not hyphens. For
614	// more information, see Configuring Database Flags in the Cloud SQL
615	// documentation.
616	Name string `json:"name,omitempty"`
617
618	// Value: The value of the flag. Booleans should be set to on for true
619	// and off for false. This field must be omitted if the flag doesn't
620	// take a value.
621	Value string `json:"value,omitempty"`
622
623	// ForceSendFields is a list of field names (e.g. "Name") to
624	// unconditionally include in API requests. By default, fields with
625	// empty values are omitted from API requests. However, any non-pointer,
626	// non-interface field appearing in ForceSendFields will be sent to the
627	// server regardless of whether the field is empty or not. This may be
628	// used to include empty fields in Patch requests.
629	ForceSendFields []string `json:"-"`
630
631	// NullFields is a list of field names (e.g. "Name") to include in API
632	// requests with the JSON null value. By default, fields with empty
633	// values are omitted from API requests. However, any field with an
634	// empty value appearing in NullFields will be sent to the server as
635	// null. It is an error if a field in this list has a non-empty value.
636	// This may be used to include null fields in Patch requests.
637	NullFields []string `json:"-"`
638}
639
640func (s *DatabaseFlags) MarshalJSON() ([]byte, error) {
641	type NoMethod DatabaseFlags
642	raw := NoMethod(*s)
643	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
644}
645
646// DatabaseInstance: A Cloud SQL instance resource.
647type DatabaseInstance struct {
648	// BackendType: FIRST_GEN: First Generation instance. MySQL
649	// only.
650	// SECOND_GEN: Second Generation instance or PostgreSQL
651	// instance.
652	// EXTERNAL: A database server that is not managed by Google.
653	// This property is read-only; use the tier property in the settings
654	// object to determine the database type and Second or First Generation.
655	BackendType string `json:"backendType,omitempty"`
656
657	// ConnectionName: Connection name of the Cloud SQL instance used in
658	// connection strings.
659	ConnectionName string `json:"connectionName,omitempty"`
660
661	// CurrentDiskSize: The current disk usage of the instance in bytes.
662	// This property has been deprecated. Users should use the
663	// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
664	// Monitoring API instead. Please see this announcement for details.
665	CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"`
666
667	// DatabaseVersion: The database engine type and version. The
668	// databaseVersion field can not be changed after instance creation.
669	// MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6.
670	// PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta.
671	// MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5
672	DatabaseVersion string `json:"databaseVersion,omitempty"`
673
674	// DiskEncryptionConfiguration: Disk encryption configuration specific
675	// to an instance. Applies only to Second Generation instances.
676	DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"`
677
678	// DiskEncryptionStatus: Disk encryption status specific to an instance.
679	// Applies only to Second Generation instances.
680	DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"`
681
682	// Etag: This field is deprecated and will be removed from a future
683	// version of the API. Use the settings.settingsVersion field instead.
684	Etag string `json:"etag,omitempty"`
685
686	// FailoverReplica: The name and status of the failover replica. This
687	// property is applicable only to Second Generation instances.
688	FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"`
689
690	// GceZone: The Compute Engine zone that the instance is currently
691	// serving from. This value could be different from the zone that was
692	// specified when the instance was created if the instance has failed
693	// over to its secondary zone.
694	GceZone string `json:"gceZone,omitempty"`
695
696	// InstanceType: The instance type. This can be one of the
697	// following.
698	// CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from
699	// a master.
700	// ON_PREMISES_INSTANCE: An instance running on the customer's
701	// premises.
702	// READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a
703	// read-replica.
704	InstanceType string `json:"instanceType,omitempty"`
705
706	// IpAddresses: The assigned IP addresses for the instance.
707	IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
708
709	// Ipv6Address: The IPv6 address assigned to the instance. This property
710	// is applicable only to First Generation instances.
711	Ipv6Address string `json:"ipv6Address,omitempty"`
712
713	// Kind: This is always sql#instance.
714	Kind string `json:"kind,omitempty"`
715
716	// MasterInstanceName: The name of the instance which will act as master
717	// in the replication setup.
718	MasterInstanceName string `json:"masterInstanceName,omitempty"`
719
720	// MaxDiskSize: The maximum disk size of the instance in bytes.
721	MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"`
722
723	// Name: Name of the Cloud SQL instance. This does not include the
724	// project ID.
725	Name string `json:"name,omitempty"`
726
727	// OnPremisesConfiguration: Configuration specific to on-premises
728	// instances.
729	OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"`
730
731	// Project: The project ID of the project containing the Cloud SQL
732	// instance. The Google apps domain is prefixed if applicable.
733	Project string `json:"project,omitempty"`
734
735	// Region: The geographical region. Can be us-central (FIRST_GEN
736	// instances only), us-central1 (SECOND_GEN instances only), asia-east1
737	// or europe-west1. Defaults to us-central or us-central1 depending on
738	// the instance type (First Generation or Second Generation). The region
739	// can not be changed after instance creation.
740	Region string `json:"region,omitempty"`
741
742	// ReplicaConfiguration: Configuration specific to failover replicas and
743	// read replicas.
744	ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"`
745
746	// ReplicaNames: The replicas of the instance.
747	ReplicaNames []string `json:"replicaNames,omitempty"`
748
749	// RootPassword: Initial root password. Use only on creation.
750	RootPassword string `json:"rootPassword,omitempty"`
751
752	// SelfLink: The URI of this resource.
753	SelfLink string `json:"selfLink,omitempty"`
754
755	// ServerCaCert: SSL configuration.
756	ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
757
758	// ServiceAccountEmailAddress: The service account email address
759	// assigned to the instance. This property is applicable only to Second
760	// Generation instances.
761	ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"`
762
763	// Settings: The user settings.
764	Settings *Settings `json:"settings,omitempty"`
765
766	// State: The current serving state of the Cloud SQL instance. This can
767	// be one of the following.
768	// RUNNABLE: The instance is running, or is ready to run when
769	// accessed.
770	// SUSPENDED: The instance is not available, for example due to problems
771	// with billing.
772	// PENDING_CREATE: The instance is being created.
773	// MAINTENANCE: The instance is down for maintenance.
774	// FAILED: The instance creation failed.
775	// UNKNOWN_STATE: The state of the instance is unknown.
776	State string `json:"state,omitempty"`
777
778	// SuspensionReason: If the instance state is SUSPENDED, the reason for
779	// the suspension.
780	SuspensionReason []string `json:"suspensionReason,omitempty"`
781
782	// ServerResponse contains the HTTP response code and headers from the
783	// server.
784	googleapi.ServerResponse `json:"-"`
785
786	// ForceSendFields is a list of field names (e.g. "BackendType") to
787	// unconditionally include in API requests. By default, fields with
788	// empty values are omitted from API requests. However, any non-pointer,
789	// non-interface field appearing in ForceSendFields will be sent to the
790	// server regardless of whether the field is empty or not. This may be
791	// used to include empty fields in Patch requests.
792	ForceSendFields []string `json:"-"`
793
794	// NullFields is a list of field names (e.g. "BackendType") to include
795	// in API requests with the JSON null value. By default, fields with
796	// empty values are omitted from API requests. However, any field with
797	// an empty value appearing in NullFields will be sent to the server as
798	// null. It is an error if a field in this list has a non-empty value.
799	// This may be used to include null fields in Patch requests.
800	NullFields []string `json:"-"`
801}
802
803func (s *DatabaseInstance) MarshalJSON() ([]byte, error) {
804	type NoMethod DatabaseInstance
805	raw := NoMethod(*s)
806	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
807}
808
809// DatabaseInstanceFailoverReplica: The name and status of the failover
810// replica. This property is applicable only to Second Generation
811// instances.
812type DatabaseInstanceFailoverReplica struct {
813	// Available: The availability status of the failover replica. A false
814	// status indicates that the failover replica is out of sync. The master
815	// can only failover to the falover replica when the status is true.
816	Available bool `json:"available,omitempty"`
817
818	// Name: The name of the failover replica. If specified at instance
819	// creation, a failover replica is created for the instance. The name
820	// doesn't include the project ID. This property is applicable only to
821	// Second Generation instances.
822	Name string `json:"name,omitempty"`
823
824	// ForceSendFields is a list of field names (e.g. "Available") to
825	// unconditionally include in API requests. By default, fields with
826	// empty values are omitted from API requests. However, any non-pointer,
827	// non-interface field appearing in ForceSendFields will be sent to the
828	// server regardless of whether the field is empty or not. This may be
829	// used to include empty fields in Patch requests.
830	ForceSendFields []string `json:"-"`
831
832	// NullFields is a list of field names (e.g. "Available") to include in
833	// API requests with the JSON null value. By default, fields with empty
834	// values are omitted from API requests. However, any field with an
835	// empty value appearing in NullFields will be sent to the server as
836	// null. It is an error if a field in this list has a non-empty value.
837	// This may be used to include null fields in Patch requests.
838	NullFields []string `json:"-"`
839}
840
841func (s *DatabaseInstanceFailoverReplica) MarshalJSON() ([]byte, error) {
842	type NoMethod DatabaseInstanceFailoverReplica
843	raw := NoMethod(*s)
844	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
845}
846
847// DatabasesListResponse: Database list response.
848type DatabasesListResponse struct {
849	// Items: List of database resources in the instance.
850	Items []*Database `json:"items,omitempty"`
851
852	// Kind: This is always sql#databasesList.
853	Kind string `json:"kind,omitempty"`
854
855	// ServerResponse contains the HTTP response code and headers from the
856	// server.
857	googleapi.ServerResponse `json:"-"`
858
859	// ForceSendFields is a list of field names (e.g. "Items") to
860	// unconditionally include in API requests. By default, fields with
861	// empty values are omitted from API requests. However, any non-pointer,
862	// non-interface field appearing in ForceSendFields will be sent to the
863	// server regardless of whether the field is empty or not. This may be
864	// used to include empty fields in Patch requests.
865	ForceSendFields []string `json:"-"`
866
867	// NullFields is a list of field names (e.g. "Items") to include in API
868	// requests with the JSON null value. By default, fields with empty
869	// values are omitted from API requests. However, any field with an
870	// empty value appearing in NullFields will be sent to the server as
871	// null. It is an error if a field in this list has a non-empty value.
872	// This may be used to include null fields in Patch requests.
873	NullFields []string `json:"-"`
874}
875
876func (s *DatabasesListResponse) MarshalJSON() ([]byte, error) {
877	type NoMethod DatabasesListResponse
878	raw := NoMethod(*s)
879	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
880}
881
882// DemoteMasterConfiguration: Read-replica configuration for connecting
883// to the on-premises master.
884type DemoteMasterConfiguration struct {
885	// Kind: This is always sql#demoteMasterConfiguration.
886	Kind string `json:"kind,omitempty"`
887
888	// MysqlReplicaConfiguration: MySQL specific configuration when
889	// replicating from a MySQL on-premises master. Replication
890	// configuration information such as the username, password,
891	// certificates, and keys are not stored in the instance metadata. The
892	// configuration information is used only to set up the replication
893	// connection and is stored by MySQL in a file named master.info in the
894	// data directory.
895	MysqlReplicaConfiguration *DemoteMasterMySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"`
896
897	// ForceSendFields is a list of field names (e.g. "Kind") to
898	// unconditionally include in API requests. By default, fields with
899	// empty values are omitted from API requests. However, any non-pointer,
900	// non-interface field appearing in ForceSendFields will be sent to the
901	// server regardless of whether the field is empty or not. This may be
902	// used to include empty fields in Patch requests.
903	ForceSendFields []string `json:"-"`
904
905	// NullFields is a list of field names (e.g. "Kind") to include in API
906	// requests with the JSON null value. By default, fields with empty
907	// values are omitted from API requests. However, any field with an
908	// empty value appearing in NullFields will be sent to the server as
909	// null. It is an error if a field in this list has a non-empty value.
910	// This may be used to include null fields in Patch requests.
911	NullFields []string `json:"-"`
912}
913
914func (s *DemoteMasterConfiguration) MarshalJSON() ([]byte, error) {
915	type NoMethod DemoteMasterConfiguration
916	raw := NoMethod(*s)
917	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
918}
919
920// DemoteMasterContext: Database instance demote master context.
921type DemoteMasterContext struct {
922	// Kind: This is always sql#demoteMasterContext.
923	Kind string `json:"kind,omitempty"`
924
925	// MasterInstanceName: The name of the instance which will act as
926	// on-premises master in the replication setup.
927	MasterInstanceName string `json:"masterInstanceName,omitempty"`
928
929	// ReplicaConfiguration: Configuration specific to read-replicas
930	// replicating from the on-premises master.
931	ReplicaConfiguration *DemoteMasterConfiguration `json:"replicaConfiguration,omitempty"`
932
933	// VerifyGtidConsistency: Verify GTID consistency for demote operation.
934	// Default value: True. Second Generation instances only. Setting this
935	// flag to false enables you to bypass GTID consistency check between
936	// on-premises master and Cloud SQL instance during the demotion
937	// operation but also exposes you to the risk of future replication
938	// failures. Change the value only if you know the reason for the GTID
939	// divergence and are confident that doing so will not cause any
940	// replication issues.
941	VerifyGtidConsistency bool `json:"verifyGtidConsistency,omitempty"`
942
943	// ForceSendFields is a list of field names (e.g. "Kind") to
944	// unconditionally include in API requests. By default, fields with
945	// empty values are omitted from API requests. However, any non-pointer,
946	// non-interface field appearing in ForceSendFields will be sent to the
947	// server regardless of whether the field is empty or not. This may be
948	// used to include empty fields in Patch requests.
949	ForceSendFields []string `json:"-"`
950
951	// NullFields is a list of field names (e.g. "Kind") to include in API
952	// requests with the JSON null value. By default, fields with empty
953	// values are omitted from API requests. However, any field with an
954	// empty value appearing in NullFields will be sent to the server as
955	// null. It is an error if a field in this list has a non-empty value.
956	// This may be used to include null fields in Patch requests.
957	NullFields []string `json:"-"`
958}
959
960func (s *DemoteMasterContext) MarshalJSON() ([]byte, error) {
961	type NoMethod DemoteMasterContext
962	raw := NoMethod(*s)
963	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
964}
965
966// DemoteMasterMySqlReplicaConfiguration: Read-replica configuration
967// specific to MySQL databases.
968type DemoteMasterMySqlReplicaConfiguration struct {
969	// CaCertificate: PEM representation of the trusted CA's x509
970	// certificate.
971	CaCertificate string `json:"caCertificate,omitempty"`
972
973	// ClientCertificate: PEM representation of the slave's x509
974	// certificate.
975	ClientCertificate string `json:"clientCertificate,omitempty"`
976
977	// ClientKey: PEM representation of the slave's private key. The
978	// corresponsing public key is encoded in the client's certificate. The
979	// format of the slave's private key can be either PKCS #1 or PKCS #8.
980	ClientKey string `json:"clientKey,omitempty"`
981
982	// Kind: This is always sql#demoteMasterMysqlReplicaConfiguration.
983	Kind string `json:"kind,omitempty"`
984
985	// Password: The password for the replication connection.
986	Password string `json:"password,omitempty"`
987
988	// Username: The username for the replication connection.
989	Username string `json:"username,omitempty"`
990
991	// ForceSendFields is a list of field names (e.g. "CaCertificate") to
992	// unconditionally include in API requests. By default, fields with
993	// empty values are omitted from API requests. However, any non-pointer,
994	// non-interface field appearing in ForceSendFields will be sent to the
995	// server regardless of whether the field is empty or not. This may be
996	// used to include empty fields in Patch requests.
997	ForceSendFields []string `json:"-"`
998
999	// NullFields is a list of field names (e.g. "CaCertificate") to include
1000	// in API requests with the JSON null value. By default, fields with
1001	// empty values are omitted from API requests. However, any field with
1002	// an empty value appearing in NullFields will be sent to the server as
1003	// null. It is an error if a field in this list has a non-empty value.
1004	// This may be used to include null fields in Patch requests.
1005	NullFields []string `json:"-"`
1006}
1007
1008func (s *DemoteMasterMySqlReplicaConfiguration) MarshalJSON() ([]byte, error) {
1009	type NoMethod DemoteMasterMySqlReplicaConfiguration
1010	raw := NoMethod(*s)
1011	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1012}
1013
1014// DiskEncryptionConfiguration: Disk encryption configuration.
1015type DiskEncryptionConfiguration struct {
1016	// Kind: This is always sql#diskEncryptionConfiguration.
1017	Kind string `json:"kind,omitempty"`
1018
1019	// KmsKeyName: KMS key resource name
1020	KmsKeyName string `json:"kmsKeyName,omitempty"`
1021
1022	// ForceSendFields is a list of field names (e.g. "Kind") to
1023	// unconditionally include in API requests. By default, fields with
1024	// empty values are omitted from API requests. However, any non-pointer,
1025	// non-interface field appearing in ForceSendFields will be sent to the
1026	// server regardless of whether the field is empty or not. This may be
1027	// used to include empty fields in Patch requests.
1028	ForceSendFields []string `json:"-"`
1029
1030	// NullFields is a list of field names (e.g. "Kind") to include in API
1031	// requests with the JSON null value. By default, fields with empty
1032	// values are omitted from API requests. However, any field with an
1033	// empty value appearing in NullFields will be sent to the server as
1034	// null. It is an error if a field in this list has a non-empty value.
1035	// This may be used to include null fields in Patch requests.
1036	NullFields []string `json:"-"`
1037}
1038
1039func (s *DiskEncryptionConfiguration) MarshalJSON() ([]byte, error) {
1040	type NoMethod DiskEncryptionConfiguration
1041	raw := NoMethod(*s)
1042	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1043}
1044
1045// DiskEncryptionStatus: Disk encryption status.
1046type DiskEncryptionStatus struct {
1047	// Kind: This is always sql#diskEncryptionStatus.
1048	Kind string `json:"kind,omitempty"`
1049
1050	// KmsKeyVersionName: KMS key version used to encrypt the Cloud SQL
1051	// instance disk
1052	KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"`
1053
1054	// ForceSendFields is a list of field names (e.g. "Kind") to
1055	// unconditionally include in API requests. By default, fields with
1056	// empty values are omitted from API requests. However, any non-pointer,
1057	// non-interface field appearing in ForceSendFields will be sent to the
1058	// server regardless of whether the field is empty or not. This may be
1059	// used to include empty fields in Patch requests.
1060	ForceSendFields []string `json:"-"`
1061
1062	// NullFields is a list of field names (e.g. "Kind") to include in API
1063	// requests with the JSON null value. By default, fields with empty
1064	// values are omitted from API requests. However, any field with an
1065	// empty value appearing in NullFields will be sent to the server as
1066	// null. It is an error if a field in this list has a non-empty value.
1067	// This may be used to include null fields in Patch requests.
1068	NullFields []string `json:"-"`
1069}
1070
1071func (s *DiskEncryptionStatus) MarshalJSON() ([]byte, error) {
1072	type NoMethod DiskEncryptionStatus
1073	raw := NoMethod(*s)
1074	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1075}
1076
1077// ExportContext: Database instance export context.
1078type ExportContext struct {
1079	// CsvExportOptions: Options for exporting data as CSV.
1080	CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"`
1081
1082	// Databases: Databases to be exported.
1083	// MySQL instances: If fileType is SQL and no database is specified, all
1084	// databases are exported, except for the mysql system database. If
1085	// fileType is CSV, you can specify one database, either by using this
1086	// property or by using the csvExportOptions.selectQuery property, which
1087	// takes precedence over this property.
1088	// PostgreSQL instances: Specify exactly one database to be exported. If
1089	// fileType is CSV, this database must match the database used in the
1090	// csvExportOptions.selectQuery property.
1091	Databases []string `json:"databases,omitempty"`
1092
1093	// FileType: The file type for the specified uri.
1094	// SQL: The file contains SQL statements.
1095	// CSV: The file contains CSV data.
1096	FileType string `json:"fileType,omitempty"`
1097
1098	// Kind: This is always sql#exportContext.
1099	Kind string `json:"kind,omitempty"`
1100
1101	// SqlExportOptions: Options for exporting data as SQL statements.
1102	SqlExportOptions *ExportContextSqlExportOptions `json:"sqlExportOptions,omitempty"`
1103
1104	// Uri: The path to the file in Google Cloud Storage where the export
1105	// will be stored. The URI is in the form gs://bucketName/fileName. If
1106	// the file already exists, the requests succeeds, but the operation
1107	// fails. If fileType is SQL and the filename ends with .gz, the
1108	// contents are compressed.
1109	Uri string `json:"uri,omitempty"`
1110
1111	// ForceSendFields is a list of field names (e.g. "CsvExportOptions") to
1112	// unconditionally include in API requests. By default, fields with
1113	// empty values are omitted from API requests. However, any non-pointer,
1114	// non-interface field appearing in ForceSendFields will be sent to the
1115	// server regardless of whether the field is empty or not. This may be
1116	// used to include empty fields in Patch requests.
1117	ForceSendFields []string `json:"-"`
1118
1119	// NullFields is a list of field names (e.g. "CsvExportOptions") to
1120	// include in API requests with the JSON null value. By default, fields
1121	// with empty values are omitted from API requests. However, any field
1122	// with an empty value appearing in NullFields will be sent to the
1123	// server as null. It is an error if a field in this list has a
1124	// non-empty value. This may be used to include null fields in Patch
1125	// requests.
1126	NullFields []string `json:"-"`
1127}
1128
1129func (s *ExportContext) MarshalJSON() ([]byte, error) {
1130	type NoMethod ExportContext
1131	raw := NoMethod(*s)
1132	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1133}
1134
1135// ExportContextCsvExportOptions: Options for exporting data as CSV.
1136type ExportContextCsvExportOptions struct {
1137	// SelectQuery: The select query used to extract the data.
1138	SelectQuery string `json:"selectQuery,omitempty"`
1139
1140	// ForceSendFields is a list of field names (e.g. "SelectQuery") to
1141	// unconditionally include in API requests. By default, fields with
1142	// empty values are omitted from API requests. However, any non-pointer,
1143	// non-interface field appearing in ForceSendFields will be sent to the
1144	// server regardless of whether the field is empty or not. This may be
1145	// used to include empty fields in Patch requests.
1146	ForceSendFields []string `json:"-"`
1147
1148	// NullFields is a list of field names (e.g. "SelectQuery") to include
1149	// in API requests with the JSON null value. By default, fields with
1150	// empty values are omitted from API requests. However, any field with
1151	// an empty value appearing in NullFields will be sent to the server as
1152	// null. It is an error if a field in this list has a non-empty value.
1153	// This may be used to include null fields in Patch requests.
1154	NullFields []string `json:"-"`
1155}
1156
1157func (s *ExportContextCsvExportOptions) MarshalJSON() ([]byte, error) {
1158	type NoMethod ExportContextCsvExportOptions
1159	raw := NoMethod(*s)
1160	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1161}
1162
1163// ExportContextSqlExportOptions: Options for exporting data as SQL
1164// statements.
1165type ExportContextSqlExportOptions struct {
1166	// MysqlExportOptions: Options for exporting from MySQL.
1167	MysqlExportOptions *ExportContextSqlExportOptionsMysqlExportOptions `json:"mysqlExportOptions,omitempty"`
1168
1169	// SchemaOnly: Export only schemas.
1170	SchemaOnly bool `json:"schemaOnly,omitempty"`
1171
1172	// Tables: Tables to export, or that were exported, from the specified
1173	// database. If you specify tables, specify one and only one database.
1174	// For PostgreSQL instances, you can specify only one table.
1175	Tables []string `json:"tables,omitempty"`
1176
1177	// ForceSendFields is a list of field names (e.g. "MysqlExportOptions")
1178	// to unconditionally include in API requests. By default, fields with
1179	// empty values are omitted from API requests. However, any non-pointer,
1180	// non-interface field appearing in ForceSendFields will be sent to the
1181	// server regardless of whether the field is empty or not. This may be
1182	// used to include empty fields in Patch requests.
1183	ForceSendFields []string `json:"-"`
1184
1185	// NullFields is a list of field names (e.g. "MysqlExportOptions") to
1186	// include in API requests with the JSON null value. By default, fields
1187	// with empty values are omitted from API requests. However, any field
1188	// with an empty value appearing in NullFields will be sent to the
1189	// server as null. It is an error if a field in this list has a
1190	// non-empty value. This may be used to include null fields in Patch
1191	// requests.
1192	NullFields []string `json:"-"`
1193}
1194
1195func (s *ExportContextSqlExportOptions) MarshalJSON() ([]byte, error) {
1196	type NoMethod ExportContextSqlExportOptions
1197	raw := NoMethod(*s)
1198	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1199}
1200
1201// ExportContextSqlExportOptionsMysqlExportOptions: Options for
1202// exporting from MySQL.
1203type ExportContextSqlExportOptionsMysqlExportOptions struct {
1204	// MasterData: Option to include SQL statement required to set up
1205	// replication. If set to 1, the dump file includes a CHANGE MASTER TO
1206	// statement with the binary log coordinates. If set to 2, the CHANGE
1207	// MASTER TO statement is written as a SQL comment, and has no effect.
1208	// All other values are ignored.
1209	MasterData int64 `json:"masterData,omitempty"`
1210
1211	// ForceSendFields is a list of field names (e.g. "MasterData") to
1212	// unconditionally include in API requests. By default, fields with
1213	// empty values are omitted from API requests. However, any non-pointer,
1214	// non-interface field appearing in ForceSendFields will be sent to the
1215	// server regardless of whether the field is empty or not. This may be
1216	// used to include empty fields in Patch requests.
1217	ForceSendFields []string `json:"-"`
1218
1219	// NullFields is a list of field names (e.g. "MasterData") to include in
1220	// API requests with the JSON null value. By default, fields with empty
1221	// values are omitted from API requests. However, any field with an
1222	// empty value appearing in NullFields will be sent to the server as
1223	// null. It is an error if a field in this list has a non-empty value.
1224	// This may be used to include null fields in Patch requests.
1225	NullFields []string `json:"-"`
1226}
1227
1228func (s *ExportContextSqlExportOptionsMysqlExportOptions) MarshalJSON() ([]byte, error) {
1229	type NoMethod ExportContextSqlExportOptionsMysqlExportOptions
1230	raw := NoMethod(*s)
1231	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1232}
1233
1234// FailoverContext: Database instance failover context.
1235type FailoverContext struct {
1236	// Kind: This is always sql#failoverContext.
1237	Kind string `json:"kind,omitempty"`
1238
1239	// SettingsVersion: The current settings version of this instance.
1240	// Request will be rejected if this version doesn't match the current
1241	// settings version.
1242	SettingsVersion int64 `json:"settingsVersion,omitempty,string"`
1243
1244	// ForceSendFields is a list of field names (e.g. "Kind") to
1245	// unconditionally include in API requests. By default, fields with
1246	// empty values are omitted from API requests. However, any non-pointer,
1247	// non-interface field appearing in ForceSendFields will be sent to the
1248	// server regardless of whether the field is empty or not. This may be
1249	// used to include empty fields in Patch requests.
1250	ForceSendFields []string `json:"-"`
1251
1252	// NullFields is a list of field names (e.g. "Kind") to include in API
1253	// requests with the JSON null value. By default, fields with empty
1254	// values are omitted from API requests. However, any field with an
1255	// empty value appearing in NullFields will be sent to the server as
1256	// null. It is an error if a field in this list has a non-empty value.
1257	// This may be used to include null fields in Patch requests.
1258	NullFields []string `json:"-"`
1259}
1260
1261func (s *FailoverContext) MarshalJSON() ([]byte, error) {
1262	type NoMethod FailoverContext
1263	raw := NoMethod(*s)
1264	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1265}
1266
1267// Flag: A flag resource.
1268type Flag struct {
1269	// AllowedStringValues: For STRING flags, a list of strings that the
1270	// value can be set to.
1271	AllowedStringValues []string `json:"allowedStringValues,omitempty"`
1272
1273	// AppliesTo: The database version this flag applies to. Can be
1274	// MYSQL_5_5, MYSQL_5_6, or MYSQL_5_7. MYSQL_5_7 is applicable only to
1275	// Second Generation instances.
1276	AppliesTo []string `json:"appliesTo,omitempty"`
1277
1278	// InBeta: True if the flag is only released in Beta.
1279	InBeta bool `json:"inBeta,omitempty"`
1280
1281	// Kind: This is always sql#flag.
1282	Kind string `json:"kind,omitempty"`
1283
1284	// MaxValue: For INTEGER flags, the maximum allowed value.
1285	MaxValue int64 `json:"maxValue,omitempty,string"`
1286
1287	// MinValue: For INTEGER flags, the minimum allowed value.
1288	MinValue int64 `json:"minValue,omitempty,string"`
1289
1290	// Name: This is the name of the flag. Flag names always use
1291	// underscores, not hyphens, e.g. max_allowed_packet
1292	Name string `json:"name,omitempty"`
1293
1294	// RequiresRestart: Indicates whether changing this flag will trigger a
1295	// database restart. Only applicable to Second Generation instances.
1296	RequiresRestart bool `json:"requiresRestart,omitempty"`
1297
1298	// Type: The type of the flag. Flags are typed to being BOOLEAN, STRING,
1299	// INTEGER or NONE. NONE is used for flags which do not take a value,
1300	// such as skip_grant_tables.
1301	Type string `json:"type,omitempty"`
1302
1303	// ForceSendFields is a list of field names (e.g. "AllowedStringValues")
1304	// to unconditionally include in API requests. By default, fields with
1305	// empty values are omitted from API requests. However, any non-pointer,
1306	// non-interface field appearing in ForceSendFields will be sent to the
1307	// server regardless of whether the field is empty or not. This may be
1308	// used to include empty fields in Patch requests.
1309	ForceSendFields []string `json:"-"`
1310
1311	// NullFields is a list of field names (e.g. "AllowedStringValues") to
1312	// include in API requests with the JSON null value. By default, fields
1313	// with empty values are omitted from API requests. However, any field
1314	// with an empty value appearing in NullFields will be sent to the
1315	// server as null. It is an error if a field in this list has a
1316	// non-empty value. This may be used to include null fields in Patch
1317	// requests.
1318	NullFields []string `json:"-"`
1319}
1320
1321func (s *Flag) MarshalJSON() ([]byte, error) {
1322	type NoMethod Flag
1323	raw := NoMethod(*s)
1324	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1325}
1326
1327// FlagsListResponse: Flags list response.
1328type FlagsListResponse struct {
1329	// Items: List of flags.
1330	Items []*Flag `json:"items,omitempty"`
1331
1332	// Kind: This is always sql#flagsList.
1333	Kind string `json:"kind,omitempty"`
1334
1335	// ServerResponse contains the HTTP response code and headers from the
1336	// server.
1337	googleapi.ServerResponse `json:"-"`
1338
1339	// ForceSendFields is a list of field names (e.g. "Items") to
1340	// unconditionally include in API requests. By default, fields with
1341	// empty values are omitted from API requests. However, any non-pointer,
1342	// non-interface field appearing in ForceSendFields will be sent to the
1343	// server regardless of whether the field is empty or not. This may be
1344	// used to include empty fields in Patch requests.
1345	ForceSendFields []string `json:"-"`
1346
1347	// NullFields is a list of field names (e.g. "Items") to include in API
1348	// requests with the JSON null value. By default, fields with empty
1349	// values are omitted from API requests. However, any field with an
1350	// empty value appearing in NullFields will be sent to the server as
1351	// null. It is an error if a field in this list has a non-empty value.
1352	// This may be used to include null fields in Patch requests.
1353	NullFields []string `json:"-"`
1354}
1355
1356func (s *FlagsListResponse) MarshalJSON() ([]byte, error) {
1357	type NoMethod FlagsListResponse
1358	raw := NoMethod(*s)
1359	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1360}
1361
1362// ImportContext: Database instance import context.
1363type ImportContext struct {
1364	// BakImportOptions: Import parameters specific to SQL Server .BAK files
1365	BakImportOptions *ImportContextBakImportOptions `json:"bakImportOptions,omitempty"`
1366
1367	// CsvImportOptions: Options for importing data as CSV.
1368	CsvImportOptions *ImportContextCsvImportOptions `json:"csvImportOptions,omitempty"`
1369
1370	// Database: The target database for the import. If fileType is SQL,
1371	// this field is required only if the import file does not specify a
1372	// database, and is overridden by any database specification in the
1373	// import file. If fileType is CSV, one database must be specified.
1374	Database string `json:"database,omitempty"`
1375
1376	// FileType: The file type for the specified uri.
1377	// SQL: The file contains SQL statements.
1378	// CSV: The file contains CSV data.
1379	FileType string `json:"fileType,omitempty"`
1380
1381	// ImportUser: The PostgreSQL user for this import operation. PostgreSQL
1382	// instances only.
1383	ImportUser string `json:"importUser,omitempty"`
1384
1385	// Kind: This is always sql#importContext.
1386	Kind string `json:"kind,omitempty"`
1387
1388	// Uri: Path to the import file in Cloud Storage, in the form
1389	// gs://bucketName/fileName. Compressed gzip files (.gz) are supported
1390	// when fileType is SQL. The instance must have write permissions to the
1391	// bucket and read access to the file.
1392	Uri string `json:"uri,omitempty"`
1393
1394	// ForceSendFields is a list of field names (e.g. "BakImportOptions") to
1395	// unconditionally include in API requests. By default, fields with
1396	// empty values are omitted from API requests. However, any non-pointer,
1397	// non-interface field appearing in ForceSendFields will be sent to the
1398	// server regardless of whether the field is empty or not. This may be
1399	// used to include empty fields in Patch requests.
1400	ForceSendFields []string `json:"-"`
1401
1402	// NullFields is a list of field names (e.g. "BakImportOptions") to
1403	// include in API requests with the JSON null value. By default, fields
1404	// with empty values are omitted from API requests. However, any field
1405	// with an empty value appearing in NullFields will be sent to the
1406	// server as null. It is an error if a field in this list has a
1407	// non-empty value. This may be used to include null fields in Patch
1408	// requests.
1409	NullFields []string `json:"-"`
1410}
1411
1412func (s *ImportContext) MarshalJSON() ([]byte, error) {
1413	type NoMethod ImportContext
1414	raw := NoMethod(*s)
1415	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1416}
1417
1418// ImportContextBakImportOptions: Import parameters specific to SQL
1419// Server .BAK files
1420type ImportContextBakImportOptions struct {
1421	EncryptionOptions *ImportContextBakImportOptionsEncryptionOptions `json:"encryptionOptions,omitempty"`
1422
1423	// ForceSendFields is a list of field names (e.g. "EncryptionOptions")
1424	// to unconditionally include in API requests. By default, fields with
1425	// empty values are omitted from API requests. However, any non-pointer,
1426	// non-interface field appearing in ForceSendFields will be sent to the
1427	// server regardless of whether the field is empty or not. This may be
1428	// used to include empty fields in Patch requests.
1429	ForceSendFields []string `json:"-"`
1430
1431	// NullFields is a list of field names (e.g. "EncryptionOptions") to
1432	// include in API requests with the JSON null value. By default, fields
1433	// with empty values are omitted from API requests. However, any field
1434	// with an empty value appearing in NullFields will be sent to the
1435	// server as null. It is an error if a field in this list has a
1436	// non-empty value. This may be used to include null fields in Patch
1437	// requests.
1438	NullFields []string `json:"-"`
1439}
1440
1441func (s *ImportContextBakImportOptions) MarshalJSON() ([]byte, error) {
1442	type NoMethod ImportContextBakImportOptions
1443	raw := NoMethod(*s)
1444	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1445}
1446
1447type ImportContextBakImportOptionsEncryptionOptions struct {
1448	// CertPath: Path to the Certificate (.cer) in Cloud Storage, in the
1449	// form gs://bucketName/fileName. The instance must have write
1450	// permissions to the bucket and read access to the file.
1451	CertPath string `json:"certPath,omitempty"`
1452
1453	// PvkPassword: Password that encrypts the private key
1454	PvkPassword string `json:"pvkPassword,omitempty"`
1455
1456	// PvkPath: Path to the Certificate Private Key (.pvk) in Cloud Storage,
1457	// in the form gs://bucketName/fileName. The instance must have write
1458	// permissions to the bucket and read access to the file.
1459	PvkPath string `json:"pvkPath,omitempty"`
1460
1461	// ForceSendFields is a list of field names (e.g. "CertPath") to
1462	// unconditionally include in API requests. By default, fields with
1463	// empty values are omitted from API requests. However, any non-pointer,
1464	// non-interface field appearing in ForceSendFields will be sent to the
1465	// server regardless of whether the field is empty or not. This may be
1466	// used to include empty fields in Patch requests.
1467	ForceSendFields []string `json:"-"`
1468
1469	// NullFields is a list of field names (e.g. "CertPath") to include in
1470	// API requests with the JSON null value. By default, fields with empty
1471	// values are omitted from API requests. However, any field with an
1472	// empty value appearing in NullFields will be sent to the server as
1473	// null. It is an error if a field in this list has a non-empty value.
1474	// This may be used to include null fields in Patch requests.
1475	NullFields []string `json:"-"`
1476}
1477
1478func (s *ImportContextBakImportOptionsEncryptionOptions) MarshalJSON() ([]byte, error) {
1479	type NoMethod ImportContextBakImportOptionsEncryptionOptions
1480	raw := NoMethod(*s)
1481	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1482}
1483
1484// ImportContextCsvImportOptions: Options for importing data as CSV.
1485type ImportContextCsvImportOptions struct {
1486	// Columns: The columns to which CSV data is imported. If not specified,
1487	// all columns of the database table are loaded with CSV data.
1488	Columns []string `json:"columns,omitempty"`
1489
1490	// Table: The table to which CSV data is imported.
1491	Table string `json:"table,omitempty"`
1492
1493	// ForceSendFields is a list of field names (e.g. "Columns") to
1494	// unconditionally include in API requests. By default, fields with
1495	// empty values are omitted from API requests. However, any non-pointer,
1496	// non-interface field appearing in ForceSendFields will be sent to the
1497	// server regardless of whether the field is empty or not. This may be
1498	// used to include empty fields in Patch requests.
1499	ForceSendFields []string `json:"-"`
1500
1501	// NullFields is a list of field names (e.g. "Columns") to include in
1502	// API requests with the JSON null value. By default, fields with empty
1503	// values are omitted from API requests. However, any field with an
1504	// empty value appearing in NullFields will be sent to the server as
1505	// null. It is an error if a field in this list has a non-empty value.
1506	// This may be used to include null fields in Patch requests.
1507	NullFields []string `json:"-"`
1508}
1509
1510func (s *ImportContextCsvImportOptions) MarshalJSON() ([]byte, error) {
1511	type NoMethod ImportContextCsvImportOptions
1512	raw := NoMethod(*s)
1513	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1514}
1515
1516// InstancesCloneRequest: Database instance clone request.
1517type InstancesCloneRequest struct {
1518	// CloneContext: Contains details about the clone operation.
1519	CloneContext *CloneContext `json:"cloneContext,omitempty"`
1520
1521	// ForceSendFields is a list of field names (e.g. "CloneContext") to
1522	// unconditionally include in API requests. By default, fields with
1523	// empty values are omitted from API requests. However, any non-pointer,
1524	// non-interface field appearing in ForceSendFields will be sent to the
1525	// server regardless of whether the field is empty or not. This may be
1526	// used to include empty fields in Patch requests.
1527	ForceSendFields []string `json:"-"`
1528
1529	// NullFields is a list of field names (e.g. "CloneContext") to include
1530	// in API requests with the JSON null value. By default, fields with
1531	// empty values are omitted from API requests. However, any field with
1532	// an empty value appearing in NullFields will be sent to the server as
1533	// null. It is an error if a field in this list has a non-empty value.
1534	// This may be used to include null fields in Patch requests.
1535	NullFields []string `json:"-"`
1536}
1537
1538func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) {
1539	type NoMethod InstancesCloneRequest
1540	raw := NoMethod(*s)
1541	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1542}
1543
1544// InstancesDemoteMasterRequest: Database demote master request.
1545type InstancesDemoteMasterRequest struct {
1546	// DemoteMasterContext: Contains details about the demoteMaster
1547	// operation.
1548	DemoteMasterContext *DemoteMasterContext `json:"demoteMasterContext,omitempty"`
1549
1550	// ForceSendFields is a list of field names (e.g. "DemoteMasterContext")
1551	// to unconditionally include in API requests. By default, fields with
1552	// empty values are omitted from API requests. However, any non-pointer,
1553	// non-interface field appearing in ForceSendFields will be sent to the
1554	// server regardless of whether the field is empty or not. This may be
1555	// used to include empty fields in Patch requests.
1556	ForceSendFields []string `json:"-"`
1557
1558	// NullFields is a list of field names (e.g. "DemoteMasterContext") to
1559	// include in API requests with the JSON null value. By default, fields
1560	// with empty values are omitted from API requests. However, any field
1561	// with an empty value appearing in NullFields will be sent to the
1562	// server as null. It is an error if a field in this list has a
1563	// non-empty value. This may be used to include null fields in Patch
1564	// requests.
1565	NullFields []string `json:"-"`
1566}
1567
1568func (s *InstancesDemoteMasterRequest) MarshalJSON() ([]byte, error) {
1569	type NoMethod InstancesDemoteMasterRequest
1570	raw := NoMethod(*s)
1571	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1572}
1573
1574// InstancesExportRequest: Database instance export request.
1575type InstancesExportRequest struct {
1576	// ExportContext: Contains details about the export operation.
1577	ExportContext *ExportContext `json:"exportContext,omitempty"`
1578
1579	// ForceSendFields is a list of field names (e.g. "ExportContext") to
1580	// unconditionally include in API requests. By default, fields with
1581	// empty values are omitted from API requests. However, any non-pointer,
1582	// non-interface field appearing in ForceSendFields will be sent to the
1583	// server regardless of whether the field is empty or not. This may be
1584	// used to include empty fields in Patch requests.
1585	ForceSendFields []string `json:"-"`
1586
1587	// NullFields is a list of field names (e.g. "ExportContext") to include
1588	// in API requests with the JSON null value. By default, fields with
1589	// empty values are omitted from API requests. However, any field with
1590	// an empty value appearing in NullFields will be sent to the server as
1591	// null. It is an error if a field in this list has a non-empty value.
1592	// This may be used to include null fields in Patch requests.
1593	NullFields []string `json:"-"`
1594}
1595
1596func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) {
1597	type NoMethod InstancesExportRequest
1598	raw := NoMethod(*s)
1599	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1600}
1601
1602// InstancesFailoverRequest: Instance failover request.
1603type InstancesFailoverRequest struct {
1604	// FailoverContext: Failover Context.
1605	FailoverContext *FailoverContext `json:"failoverContext,omitempty"`
1606
1607	// ForceSendFields is a list of field names (e.g. "FailoverContext") to
1608	// unconditionally include in API requests. By default, fields with
1609	// empty values are omitted from API requests. However, any non-pointer,
1610	// non-interface field appearing in ForceSendFields will be sent to the
1611	// server regardless of whether the field is empty or not. This may be
1612	// used to include empty fields in Patch requests.
1613	ForceSendFields []string `json:"-"`
1614
1615	// NullFields is a list of field names (e.g. "FailoverContext") to
1616	// include in API requests with the JSON null value. By default, fields
1617	// with empty values are omitted from API requests. However, any field
1618	// with an empty value appearing in NullFields will be sent to the
1619	// server as null. It is an error if a field in this list has a
1620	// non-empty value. This may be used to include null fields in Patch
1621	// requests.
1622	NullFields []string `json:"-"`
1623}
1624
1625func (s *InstancesFailoverRequest) MarshalJSON() ([]byte, error) {
1626	type NoMethod InstancesFailoverRequest
1627	raw := NoMethod(*s)
1628	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1629}
1630
1631// InstancesImportRequest: Database instance import request.
1632type InstancesImportRequest struct {
1633	// ImportContext: Contains details about the import operation.
1634	ImportContext *ImportContext `json:"importContext,omitempty"`
1635
1636	// ForceSendFields is a list of field names (e.g. "ImportContext") to
1637	// unconditionally include in API requests. By default, fields with
1638	// empty values are omitted from API requests. However, any non-pointer,
1639	// non-interface field appearing in ForceSendFields will be sent to the
1640	// server regardless of whether the field is empty or not. This may be
1641	// used to include empty fields in Patch requests.
1642	ForceSendFields []string `json:"-"`
1643
1644	// NullFields is a list of field names (e.g. "ImportContext") to include
1645	// in API requests with the JSON null value. By default, fields with
1646	// empty values are omitted from API requests. However, any field with
1647	// an empty value appearing in NullFields will be sent to the server as
1648	// null. It is an error if a field in this list has a non-empty value.
1649	// This may be used to include null fields in Patch requests.
1650	NullFields []string `json:"-"`
1651}
1652
1653func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) {
1654	type NoMethod InstancesImportRequest
1655	raw := NoMethod(*s)
1656	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1657}
1658
1659// InstancesListResponse: Database instances list response.
1660type InstancesListResponse struct {
1661	// Items: List of database instance resources.
1662	Items []*DatabaseInstance `json:"items,omitempty"`
1663
1664	// Kind: This is always sql#instancesList.
1665	Kind string `json:"kind,omitempty"`
1666
1667	// NextPageToken: The continuation token, used to page through large
1668	// result sets. Provide this value in a subsequent request to return the
1669	// next page of results.
1670	NextPageToken string `json:"nextPageToken,omitempty"`
1671
1672	// Warnings: List of warnings that ocurred while handling the request.
1673	Warnings []*ApiWarning `json:"warnings,omitempty"`
1674
1675	// ServerResponse contains the HTTP response code and headers from the
1676	// server.
1677	googleapi.ServerResponse `json:"-"`
1678
1679	// ForceSendFields is a list of field names (e.g. "Items") to
1680	// unconditionally include in API requests. By default, fields with
1681	// empty values are omitted from API requests. However, any non-pointer,
1682	// non-interface field appearing in ForceSendFields will be sent to the
1683	// server regardless of whether the field is empty or not. This may be
1684	// used to include empty fields in Patch requests.
1685	ForceSendFields []string `json:"-"`
1686
1687	// NullFields is a list of field names (e.g. "Items") to include in API
1688	// requests with the JSON null value. By default, fields with empty
1689	// values are omitted from API requests. However, any field with an
1690	// empty value appearing in NullFields will be sent to the server as
1691	// null. It is an error if a field in this list has a non-empty value.
1692	// This may be used to include null fields in Patch requests.
1693	NullFields []string `json:"-"`
1694}
1695
1696func (s *InstancesListResponse) MarshalJSON() ([]byte, error) {
1697	type NoMethod InstancesListResponse
1698	raw := NoMethod(*s)
1699	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1700}
1701
1702// InstancesListServerCasResponse: Instances ListServerCas response.
1703type InstancesListServerCasResponse struct {
1704	ActiveVersion string `json:"activeVersion,omitempty"`
1705
1706	// Certs: List of server CA certificates for the instance.
1707	Certs []*SslCert `json:"certs,omitempty"`
1708
1709	// Kind: This is always sql#instancesListServerCas.
1710	Kind string `json:"kind,omitempty"`
1711
1712	// ServerResponse contains the HTTP response code and headers from the
1713	// server.
1714	googleapi.ServerResponse `json:"-"`
1715
1716	// ForceSendFields is a list of field names (e.g. "ActiveVersion") to
1717	// unconditionally include in API requests. By default, fields with
1718	// empty values are omitted from API requests. However, any non-pointer,
1719	// non-interface field appearing in ForceSendFields will be sent to the
1720	// server regardless of whether the field is empty or not. This may be
1721	// used to include empty fields in Patch requests.
1722	ForceSendFields []string `json:"-"`
1723
1724	// NullFields is a list of field names (e.g. "ActiveVersion") to include
1725	// in API requests with the JSON null value. By default, fields with
1726	// empty values are omitted from API requests. However, any field with
1727	// an empty value appearing in NullFields will be sent to the server as
1728	// null. It is an error if a field in this list has a non-empty value.
1729	// This may be used to include null fields in Patch requests.
1730	NullFields []string `json:"-"`
1731}
1732
1733func (s *InstancesListServerCasResponse) MarshalJSON() ([]byte, error) {
1734	type NoMethod InstancesListServerCasResponse
1735	raw := NoMethod(*s)
1736	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1737}
1738
1739// InstancesRestoreBackupRequest: Database instance restore backup
1740// request.
1741type InstancesRestoreBackupRequest struct {
1742	// RestoreBackupContext: Parameters required to perform the restore
1743	// backup operation.
1744	RestoreBackupContext *RestoreBackupContext `json:"restoreBackupContext,omitempty"`
1745
1746	// ForceSendFields is a list of field names (e.g.
1747	// "RestoreBackupContext") to unconditionally include in API requests.
1748	// By default, fields with empty values are omitted from API requests.
1749	// However, any non-pointer, non-interface field appearing in
1750	// ForceSendFields will be sent to the server regardless of whether the
1751	// field is empty or not. This may be used to include empty fields in
1752	// Patch requests.
1753	ForceSendFields []string `json:"-"`
1754
1755	// NullFields is a list of field names (e.g. "RestoreBackupContext") to
1756	// include in API requests with the JSON null value. By default, fields
1757	// with empty values are omitted from API requests. However, any field
1758	// with an empty value appearing in NullFields will be sent to the
1759	// server as null. It is an error if a field in this list has a
1760	// non-empty value. This may be used to include null fields in Patch
1761	// requests.
1762	NullFields []string `json:"-"`
1763}
1764
1765func (s *InstancesRestoreBackupRequest) MarshalJSON() ([]byte, error) {
1766	type NoMethod InstancesRestoreBackupRequest
1767	raw := NoMethod(*s)
1768	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1769}
1770
1771// InstancesRotateServerCaRequest: Rotate Server CA request.
1772type InstancesRotateServerCaRequest struct {
1773	// RotateServerCaContext: Contains details about the rotate server CA
1774	// operation.
1775	RotateServerCaContext *RotateServerCaContext `json:"rotateServerCaContext,omitempty"`
1776
1777	// ForceSendFields is a list of field names (e.g.
1778	// "RotateServerCaContext") to unconditionally include in API requests.
1779	// By default, fields with empty values are omitted from API requests.
1780	// However, any non-pointer, non-interface field appearing in
1781	// ForceSendFields will be sent to the server regardless of whether the
1782	// field is empty or not. This may be used to include empty fields in
1783	// Patch requests.
1784	ForceSendFields []string `json:"-"`
1785
1786	// NullFields is a list of field names (e.g. "RotateServerCaContext") to
1787	// include in API requests with the JSON null value. By default, fields
1788	// with empty values are omitted from API requests. However, any field
1789	// with an empty value appearing in NullFields will be sent to the
1790	// server as null. It is an error if a field in this list has a
1791	// non-empty value. This may be used to include null fields in Patch
1792	// requests.
1793	NullFields []string `json:"-"`
1794}
1795
1796func (s *InstancesRotateServerCaRequest) MarshalJSON() ([]byte, error) {
1797	type NoMethod InstancesRotateServerCaRequest
1798	raw := NoMethod(*s)
1799	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1800}
1801
1802// InstancesTruncateLogRequest: Instance truncate log request.
1803type InstancesTruncateLogRequest struct {
1804	// TruncateLogContext: Contains details about the truncate log
1805	// operation.
1806	TruncateLogContext *TruncateLogContext `json:"truncateLogContext,omitempty"`
1807
1808	// ForceSendFields is a list of field names (e.g. "TruncateLogContext")
1809	// to unconditionally include in API requests. By default, fields with
1810	// empty values are omitted from API requests. However, any non-pointer,
1811	// non-interface field appearing in ForceSendFields will be sent to the
1812	// server regardless of whether the field is empty or not. This may be
1813	// used to include empty fields in Patch requests.
1814	ForceSendFields []string `json:"-"`
1815
1816	// NullFields is a list of field names (e.g. "TruncateLogContext") to
1817	// include in API requests with the JSON null value. By default, fields
1818	// with empty values are omitted from API requests. However, any field
1819	// with an empty value appearing in NullFields will be sent to the
1820	// server as null. It is an error if a field in this list has a
1821	// non-empty value. This may be used to include null fields in Patch
1822	// requests.
1823	NullFields []string `json:"-"`
1824}
1825
1826func (s *InstancesTruncateLogRequest) MarshalJSON() ([]byte, error) {
1827	type NoMethod InstancesTruncateLogRequest
1828	raw := NoMethod(*s)
1829	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1830}
1831
1832// IpConfiguration: IP Management configuration.
1833type IpConfiguration struct {
1834	// AuthorizedNetworks: The list of external networks that are allowed to
1835	// connect to the instance using the IP. In CIDR notation, also known as
1836	// 'slash' notation (e.g. 192.168.100.0/24).
1837	AuthorizedNetworks []*AclEntry `json:"authorizedNetworks,omitempty"`
1838
1839	// Ipv4Enabled: Whether the instance should be assigned an IP address or
1840	// not.
1841	Ipv4Enabled bool `json:"ipv4Enabled,omitempty"`
1842
1843	// PrivateNetwork: The resource link for the VPC network from which the
1844	// Cloud SQL instance is accessible for private IP. For example,
1845	// /projects/myProject/global/networks/default. This setting can be
1846	// updated, but it cannot be removed after it is set.
1847	PrivateNetwork string `json:"privateNetwork,omitempty"`
1848
1849	// RequireSsl: Whether SSL connections over IP should be enforced or
1850	// not.
1851	RequireSsl bool `json:"requireSsl,omitempty"`
1852
1853	// ForceSendFields is a list of field names (e.g. "AuthorizedNetworks")
1854	// to unconditionally include in API requests. By default, fields with
1855	// empty values are omitted from API requests. However, any non-pointer,
1856	// non-interface field appearing in ForceSendFields will be sent to the
1857	// server regardless of whether the field is empty or not. This may be
1858	// used to include empty fields in Patch requests.
1859	ForceSendFields []string `json:"-"`
1860
1861	// NullFields is a list of field names (e.g. "AuthorizedNetworks") to
1862	// include in API requests with the JSON null value. By default, fields
1863	// with empty values are omitted from API requests. However, any field
1864	// with an empty value appearing in NullFields will be sent to the
1865	// server as null. It is an error if a field in this list has a
1866	// non-empty value. This may be used to include null fields in Patch
1867	// requests.
1868	NullFields []string `json:"-"`
1869}
1870
1871func (s *IpConfiguration) MarshalJSON() ([]byte, error) {
1872	type NoMethod IpConfiguration
1873	raw := NoMethod(*s)
1874	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1875}
1876
1877// IpMapping: Database instance IP Mapping.
1878type IpMapping struct {
1879	// IpAddress: The IP address assigned.
1880	IpAddress string `json:"ipAddress,omitempty"`
1881
1882	// TimeToRetire: The due time for this IP to be retired in RFC 3339
1883	// format, for example 2012-11-15T16:19:00.094Z. This field is only
1884	// available when the IP is scheduled to be retired.
1885	TimeToRetire string `json:"timeToRetire,omitempty"`
1886
1887	// Type: The type of this IP address. A PRIMARY address is a public
1888	// address that can accept incoming connections. A PRIVATE address is a
1889	// private address that can accept incoming connections. An OUTGOING
1890	// address is the source address of connections originating from the
1891	// instance, if supported.
1892	Type string `json:"type,omitempty"`
1893
1894	// ForceSendFields is a list of field names (e.g. "IpAddress") to
1895	// unconditionally include in API requests. By default, fields with
1896	// empty values are omitted from API requests. However, any non-pointer,
1897	// non-interface field appearing in ForceSendFields will be sent to the
1898	// server regardless of whether the field is empty or not. This may be
1899	// used to include empty fields in Patch requests.
1900	ForceSendFields []string `json:"-"`
1901
1902	// NullFields is a list of field names (e.g. "IpAddress") to include in
1903	// API requests with the JSON null value. By default, fields with empty
1904	// values are omitted from API requests. However, any field with an
1905	// empty value appearing in NullFields will be sent to the server as
1906	// null. It is an error if a field in this list has a non-empty value.
1907	// This may be used to include null fields in Patch requests.
1908	NullFields []string `json:"-"`
1909}
1910
1911func (s *IpMapping) MarshalJSON() ([]byte, error) {
1912	type NoMethod IpMapping
1913	raw := NoMethod(*s)
1914	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1915}
1916
1917// LocationPreference: Preferred location. This specifies where a Cloud
1918// SQL instance should preferably be located, either in a specific
1919// Compute Engine zone, or co-located with an App Engine application.
1920// Note that if the preferred location is not available, the instance
1921// will be located as close as possible within the region. Only one
1922// location may be specified.
1923type LocationPreference struct {
1924	// FollowGaeApplication: The AppEngine application to follow, it must be
1925	// in the same region as the Cloud SQL instance.
1926	FollowGaeApplication string `json:"followGaeApplication,omitempty"`
1927
1928	// Kind: This is always sql#locationPreference.
1929	Kind string `json:"kind,omitempty"`
1930
1931	// Zone: The preferred Compute Engine zone (e.g. us-central1-a,
1932	// us-central1-b, etc.).
1933	Zone string `json:"zone,omitempty"`
1934
1935	// ForceSendFields is a list of field names (e.g.
1936	// "FollowGaeApplication") to unconditionally include in API requests.
1937	// By default, fields with empty values are omitted from API requests.
1938	// However, any non-pointer, non-interface field appearing in
1939	// ForceSendFields will be sent to the server regardless of whether the
1940	// field is empty or not. This may be used to include empty fields in
1941	// Patch requests.
1942	ForceSendFields []string `json:"-"`
1943
1944	// NullFields is a list of field names (e.g. "FollowGaeApplication") to
1945	// include in API requests with the JSON null value. By default, fields
1946	// with empty values are omitted from API requests. However, any field
1947	// with an empty value appearing in NullFields will be sent to the
1948	// server as null. It is an error if a field in this list has a
1949	// non-empty value. This may be used to include null fields in Patch
1950	// requests.
1951	NullFields []string `json:"-"`
1952}
1953
1954func (s *LocationPreference) MarshalJSON() ([]byte, error) {
1955	type NoMethod LocationPreference
1956	raw := NoMethod(*s)
1957	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1958}
1959
1960// MaintenanceWindow: Maintenance window. This specifies when a v2 Cloud
1961// SQL instance should preferably be restarted for system maintenance
1962// purposes.
1963type MaintenanceWindow struct {
1964	// Day: day of week (1-7), starting on Monday.
1965	Day int64 `json:"day,omitempty"`
1966
1967	// Hour: hour of day - 0 to 23.
1968	Hour int64 `json:"hour,omitempty"`
1969
1970	// Kind: This is always sql#maintenanceWindow.
1971	Kind string `json:"kind,omitempty"`
1972
1973	// UpdateTrack: Maintenance timing setting: canary (Earlier) or stable
1974	// (Later).
1975	//  Learn more.
1976	UpdateTrack string `json:"updateTrack,omitempty"`
1977
1978	// ForceSendFields is a list of field names (e.g. "Day") to
1979	// unconditionally include in API requests. By default, fields with
1980	// empty values are omitted from API requests. However, any non-pointer,
1981	// non-interface field appearing in ForceSendFields will be sent to the
1982	// server regardless of whether the field is empty or not. This may be
1983	// used to include empty fields in Patch requests.
1984	ForceSendFields []string `json:"-"`
1985
1986	// NullFields is a list of field names (e.g. "Day") to include in API
1987	// requests with the JSON null value. By default, fields with empty
1988	// values are omitted from API requests. However, any field with an
1989	// empty value appearing in NullFields will be sent to the server as
1990	// null. It is an error if a field in this list has a non-empty value.
1991	// This may be used to include null fields in Patch requests.
1992	NullFields []string `json:"-"`
1993}
1994
1995func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
1996	type NoMethod MaintenanceWindow
1997	raw := NoMethod(*s)
1998	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1999}
2000
2001// MySqlReplicaConfiguration: Read-replica configuration specific to
2002// MySQL databases.
2003type MySqlReplicaConfiguration struct {
2004	// CaCertificate: PEM representation of the trusted CA's x509
2005	// certificate.
2006	CaCertificate string `json:"caCertificate,omitempty"`
2007
2008	// ClientCertificate: PEM representation of the slave's x509
2009	// certificate.
2010	ClientCertificate string `json:"clientCertificate,omitempty"`
2011
2012	// ClientKey: PEM representation of the slave's private key. The
2013	// corresponsing public key is encoded in the client's certificate.
2014	ClientKey string `json:"clientKey,omitempty"`
2015
2016	// ConnectRetryInterval: Seconds to wait between connect retries.
2017	// MySQL's default is 60 seconds.
2018	ConnectRetryInterval int64 `json:"connectRetryInterval,omitempty"`
2019
2020	// DumpFilePath: Path to a SQL dump file in Google Cloud Storage from
2021	// which the slave instance is to be created. The URI is in the form
2022	// gs://bucketName/fileName. Compressed gzip files (.gz) are also
2023	// supported. Dumps should have the binlog co-ordinates from which
2024	// replication should begin. This can be accomplished by setting
2025	// --master-data to 1 when using mysqldump.
2026	DumpFilePath string `json:"dumpFilePath,omitempty"`
2027
2028	// Kind: This is always sql#mysqlReplicaConfiguration.
2029	Kind string `json:"kind,omitempty"`
2030
2031	// MasterHeartbeatPeriod: Interval in milliseconds between replication
2032	// heartbeats.
2033	MasterHeartbeatPeriod int64 `json:"masterHeartbeatPeriod,omitempty,string"`
2034
2035	// Password: The password for the replication connection.
2036	Password string `json:"password,omitempty"`
2037
2038	// SslCipher: A list of permissible ciphers to use for SSL encryption.
2039	SslCipher string `json:"sslCipher,omitempty"`
2040
2041	// Username: The username for the replication connection.
2042	Username string `json:"username,omitempty"`
2043
2044	// VerifyServerCertificate: Whether or not to check the master's Common
2045	// Name value in the certificate that it sends during the SSL handshake.
2046	VerifyServerCertificate bool `json:"verifyServerCertificate,omitempty"`
2047
2048	// ForceSendFields is a list of field names (e.g. "CaCertificate") to
2049	// unconditionally include in API requests. By default, fields with
2050	// empty values are omitted from API requests. However, any non-pointer,
2051	// non-interface field appearing in ForceSendFields will be sent to the
2052	// server regardless of whether the field is empty or not. This may be
2053	// used to include empty fields in Patch requests.
2054	ForceSendFields []string `json:"-"`
2055
2056	// NullFields is a list of field names (e.g. "CaCertificate") to include
2057	// in API requests with the JSON null value. By default, fields with
2058	// empty values are omitted from API requests. However, any field with
2059	// an empty value appearing in NullFields will be sent to the server as
2060	// null. It is an error if a field in this list has a non-empty value.
2061	// This may be used to include null fields in Patch requests.
2062	NullFields []string `json:"-"`
2063}
2064
2065func (s *MySqlReplicaConfiguration) MarshalJSON() ([]byte, error) {
2066	type NoMethod MySqlReplicaConfiguration
2067	raw := NoMethod(*s)
2068	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2069}
2070
2071// OnPremisesConfiguration: On-premises instance configuration.
2072type OnPremisesConfiguration struct {
2073	// HostPort: The host and port of the on-premises instance in host:port
2074	// format
2075	HostPort string `json:"hostPort,omitempty"`
2076
2077	// Kind: This is always sql#onPremisesConfiguration.
2078	Kind string `json:"kind,omitempty"`
2079
2080	// ForceSendFields is a list of field names (e.g. "HostPort") to
2081	// unconditionally include in API requests. By default, fields with
2082	// empty values are omitted from API requests. However, any non-pointer,
2083	// non-interface field appearing in ForceSendFields will be sent to the
2084	// server regardless of whether the field is empty or not. This may be
2085	// used to include empty fields in Patch requests.
2086	ForceSendFields []string `json:"-"`
2087
2088	// NullFields is a list of field names (e.g. "HostPort") to include in
2089	// API requests with the JSON null value. By default, fields with empty
2090	// values are omitted from API requests. However, any field with an
2091	// empty value appearing in NullFields will be sent to the server as
2092	// null. It is an error if a field in this list has a non-empty value.
2093	// This may be used to include null fields in Patch requests.
2094	NullFields []string `json:"-"`
2095}
2096
2097func (s *OnPremisesConfiguration) MarshalJSON() ([]byte, error) {
2098	type NoMethod OnPremisesConfiguration
2099	raw := NoMethod(*s)
2100	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2101}
2102
2103// Operation: An Operation resource. For successful operations that
2104// return an Operation resource, only the fields relevant to the
2105// operation are populated in the resource.
2106type Operation struct {
2107	// EndTime: The time this operation finished in UTC timezone in RFC 3339
2108	// format, for example 2012-11-15T16:19:00.094Z.
2109	EndTime string `json:"endTime,omitempty"`
2110
2111	// Error: If errors occurred during processing of this operation, this
2112	// field will be populated.
2113	Error *OperationErrors `json:"error,omitempty"`
2114
2115	// ExportContext: The context for export operation, if applicable.
2116	ExportContext *ExportContext `json:"exportContext,omitempty"`
2117
2118	// ImportContext: The context for import operation, if applicable.
2119	ImportContext *ImportContext `json:"importContext,omitempty"`
2120
2121	// InsertTime: The time this operation was enqueued in UTC timezone in
2122	// RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2123	InsertTime string `json:"insertTime,omitempty"`
2124
2125	// Kind: This is always sql#operation.
2126	Kind string `json:"kind,omitempty"`
2127
2128	// Name: An identifier that uniquely identifies the operation. You can
2129	// use this identifier to retrieve the Operations resource that has
2130	// information about the operation.
2131	Name string `json:"name,omitempty"`
2132
2133	// OperationType: The type of the operation. Valid values are CREATE,
2134	// DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME,
2135	// RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE,
2136	// DELETE_DATABASE .
2137	OperationType string `json:"operationType,omitempty"`
2138
2139	// SelfLink: The URI of this resource.
2140	SelfLink string `json:"selfLink,omitempty"`
2141
2142	// StartTime: The time this operation actually started in UTC timezone
2143	// in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2144	StartTime string `json:"startTime,omitempty"`
2145
2146	// Status: The status of an operation. Valid values are PENDING,
2147	// RUNNING, DONE, UNKNOWN.
2148	Status string `json:"status,omitempty"`
2149
2150	// TargetId: Name of the database instance related to this operation.
2151	TargetId string `json:"targetId,omitempty"`
2152
2153	TargetLink string `json:"targetLink,omitempty"`
2154
2155	// TargetProject: The project ID of the target instance related to this
2156	// operation.
2157	TargetProject string `json:"targetProject,omitempty"`
2158
2159	// User: The email address of the user who initiated this operation.
2160	User string `json:"user,omitempty"`
2161
2162	// ServerResponse contains the HTTP response code and headers from the
2163	// server.
2164	googleapi.ServerResponse `json:"-"`
2165
2166	// ForceSendFields is a list of field names (e.g. "EndTime") to
2167	// unconditionally include in API requests. By default, fields with
2168	// empty values are omitted from API requests. However, any non-pointer,
2169	// non-interface field appearing in ForceSendFields will be sent to the
2170	// server regardless of whether the field is empty or not. This may be
2171	// used to include empty fields in Patch requests.
2172	ForceSendFields []string `json:"-"`
2173
2174	// NullFields is a list of field names (e.g. "EndTime") to include in
2175	// API requests with the JSON null value. By default, fields with empty
2176	// values are omitted from API requests. However, any field with an
2177	// empty value appearing in NullFields will be sent to the server as
2178	// null. It is an error if a field in this list has a non-empty value.
2179	// This may be used to include null fields in Patch requests.
2180	NullFields []string `json:"-"`
2181}
2182
2183func (s *Operation) MarshalJSON() ([]byte, error) {
2184	type NoMethod Operation
2185	raw := NoMethod(*s)
2186	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2187}
2188
2189// OperationError: Database instance operation error.
2190type OperationError struct {
2191	// Code: Identifies the specific error that occurred.
2192	Code string `json:"code,omitempty"`
2193
2194	// Kind: This is always sql#operationError.
2195	Kind string `json:"kind,omitempty"`
2196
2197	// Message: Additional information about the error encountered.
2198	Message string `json:"message,omitempty"`
2199
2200	// ForceSendFields is a list of field names (e.g. "Code") to
2201	// unconditionally include in API requests. By default, fields with
2202	// empty values are omitted from API requests. However, any non-pointer,
2203	// non-interface field appearing in ForceSendFields will be sent to the
2204	// server regardless of whether the field is empty or not. This may be
2205	// used to include empty fields in Patch requests.
2206	ForceSendFields []string `json:"-"`
2207
2208	// NullFields is a list of field names (e.g. "Code") to include in API
2209	// requests with the JSON null value. By default, fields with empty
2210	// values are omitted from API requests. However, any field with an
2211	// empty value appearing in NullFields will be sent to the server as
2212	// null. It is an error if a field in this list has a non-empty value.
2213	// This may be used to include null fields in Patch requests.
2214	NullFields []string `json:"-"`
2215}
2216
2217func (s *OperationError) MarshalJSON() ([]byte, error) {
2218	type NoMethod OperationError
2219	raw := NoMethod(*s)
2220	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2221}
2222
2223// OperationErrors: Database instance operation errors list wrapper.
2224type OperationErrors struct {
2225	// Errors: The list of errors encountered while processing this
2226	// operation.
2227	Errors []*OperationError `json:"errors,omitempty"`
2228
2229	// Kind: This is always sql#operationErrors.
2230	Kind string `json:"kind,omitempty"`
2231
2232	// ForceSendFields is a list of field names (e.g. "Errors") to
2233	// unconditionally include in API requests. By default, fields with
2234	// empty values are omitted from API requests. However, any non-pointer,
2235	// non-interface field appearing in ForceSendFields will be sent to the
2236	// server regardless of whether the field is empty or not. This may be
2237	// used to include empty fields in Patch requests.
2238	ForceSendFields []string `json:"-"`
2239
2240	// NullFields is a list of field names (e.g. "Errors") to include in API
2241	// requests with the JSON null value. By default, fields with empty
2242	// values are omitted from API requests. However, any field with an
2243	// empty value appearing in NullFields will be sent to the server as
2244	// null. It is an error if a field in this list has a non-empty value.
2245	// This may be used to include null fields in Patch requests.
2246	NullFields []string `json:"-"`
2247}
2248
2249func (s *OperationErrors) MarshalJSON() ([]byte, error) {
2250	type NoMethod OperationErrors
2251	raw := NoMethod(*s)
2252	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2253}
2254
2255// OperationsListResponse: Database instance list operations response.
2256type OperationsListResponse struct {
2257	// Items: List of operation resources.
2258	Items []*Operation `json:"items,omitempty"`
2259
2260	// Kind: This is always sql#operationsList.
2261	Kind string `json:"kind,omitempty"`
2262
2263	// NextPageToken: The continuation token, used to page through large
2264	// result sets. Provide this value in a subsequent request to return the
2265	// next page of results.
2266	NextPageToken string `json:"nextPageToken,omitempty"`
2267
2268	// ServerResponse contains the HTTP response code and headers from the
2269	// server.
2270	googleapi.ServerResponse `json:"-"`
2271
2272	// ForceSendFields is a list of field names (e.g. "Items") to
2273	// unconditionally include in API requests. By default, fields with
2274	// empty values are omitted from API requests. However, any non-pointer,
2275	// non-interface field appearing in ForceSendFields will be sent to the
2276	// server regardless of whether the field is empty or not. This may be
2277	// used to include empty fields in Patch requests.
2278	ForceSendFields []string `json:"-"`
2279
2280	// NullFields is a list of field names (e.g. "Items") to include in API
2281	// requests with the JSON null value. By default, fields with empty
2282	// values are omitted from API requests. However, any field with an
2283	// empty value appearing in NullFields will be sent to the server as
2284	// null. It is an error if a field in this list has a non-empty value.
2285	// This may be used to include null fields in Patch requests.
2286	NullFields []string `json:"-"`
2287}
2288
2289func (s *OperationsListResponse) MarshalJSON() ([]byte, error) {
2290	type NoMethod OperationsListResponse
2291	raw := NoMethod(*s)
2292	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2293}
2294
2295// ReplicaConfiguration: Read-replica configuration for connecting to
2296// the master.
2297type ReplicaConfiguration struct {
2298	// FailoverTarget: Specifies if the replica is the failover target. If
2299	// the field is set to true the replica will be designated as a failover
2300	// replica. In case the master instance fails, the replica instance will
2301	// be promoted as the new master instance.
2302	// Only one replica can be specified as failover target, and the replica
2303	// has to be in different zone with the master instance.
2304	FailoverTarget bool `json:"failoverTarget,omitempty"`
2305
2306	// Kind: This is always sql#replicaConfiguration.
2307	Kind string `json:"kind,omitempty"`
2308
2309	// MysqlReplicaConfiguration: MySQL specific configuration when
2310	// replicating from a MySQL on-premises master. Replication
2311	// configuration information such as the username, password,
2312	// certificates, and keys are not stored in the instance metadata. The
2313	// configuration information is used only to set up the replication
2314	// connection and is stored by MySQL in a file named master.info in the
2315	// data directory.
2316	MysqlReplicaConfiguration *MySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"`
2317
2318	// ForceSendFields is a list of field names (e.g. "FailoverTarget") to
2319	// unconditionally include in API requests. By default, fields with
2320	// empty values are omitted from API requests. However, any non-pointer,
2321	// non-interface field appearing in ForceSendFields will be sent to the
2322	// server regardless of whether the field is empty or not. This may be
2323	// used to include empty fields in Patch requests.
2324	ForceSendFields []string `json:"-"`
2325
2326	// NullFields is a list of field names (e.g. "FailoverTarget") to
2327	// include in API requests with the JSON null value. By default, fields
2328	// with empty values are omitted from API requests. However, any field
2329	// with an empty value appearing in NullFields will be sent to the
2330	// server as null. It is an error if a field in this list has a
2331	// non-empty value. This may be used to include null fields in Patch
2332	// requests.
2333	NullFields []string `json:"-"`
2334}
2335
2336func (s *ReplicaConfiguration) MarshalJSON() ([]byte, error) {
2337	type NoMethod ReplicaConfiguration
2338	raw := NoMethod(*s)
2339	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2340}
2341
2342// RestoreBackupContext: Database instance restore from backup context.
2343type RestoreBackupContext struct {
2344	// BackupRunId: The ID of the backup run to restore from.
2345	BackupRunId int64 `json:"backupRunId,omitempty,string"`
2346
2347	// InstanceId: The ID of the instance that the backup was taken from.
2348	InstanceId string `json:"instanceId,omitempty"`
2349
2350	// Kind: This is always sql#restoreBackupContext.
2351	Kind string `json:"kind,omitempty"`
2352
2353	// Project: The full project ID of the source instance.
2354	Project string `json:"project,omitempty"`
2355
2356	// ForceSendFields is a list of field names (e.g. "BackupRunId") to
2357	// unconditionally include in API requests. By default, fields with
2358	// empty values are omitted from API requests. However, any non-pointer,
2359	// non-interface field appearing in ForceSendFields will be sent to the
2360	// server regardless of whether the field is empty or not. This may be
2361	// used to include empty fields in Patch requests.
2362	ForceSendFields []string `json:"-"`
2363
2364	// NullFields is a list of field names (e.g. "BackupRunId") to include
2365	// in API requests with the JSON null value. By default, fields with
2366	// empty values are omitted from API requests. However, any field with
2367	// an empty value appearing in NullFields will be sent to the server as
2368	// null. It is an error if a field in this list has a non-empty value.
2369	// This may be used to include null fields in Patch requests.
2370	NullFields []string `json:"-"`
2371}
2372
2373func (s *RestoreBackupContext) MarshalJSON() ([]byte, error) {
2374	type NoMethod RestoreBackupContext
2375	raw := NoMethod(*s)
2376	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2377}
2378
2379// RotateServerCaContext: Instance rotate server CA context.
2380type RotateServerCaContext struct {
2381	// Kind: This is always sql#rotateServerCaContext.
2382	Kind string `json:"kind,omitempty"`
2383
2384	// NextVersion: The fingerprint of the next version to be rotated to. If
2385	// left unspecified, will be rotated to the most recently added server
2386	// CA version.
2387	NextVersion string `json:"nextVersion,omitempty"`
2388
2389	// ForceSendFields is a list of field names (e.g. "Kind") to
2390	// unconditionally include in API requests. By default, fields with
2391	// empty values are omitted from API requests. However, any non-pointer,
2392	// non-interface field appearing in ForceSendFields will be sent to the
2393	// server regardless of whether the field is empty or not. This may be
2394	// used to include empty fields in Patch requests.
2395	ForceSendFields []string `json:"-"`
2396
2397	// NullFields is a list of field names (e.g. "Kind") to include in API
2398	// requests with the JSON null value. By default, fields with empty
2399	// values are omitted from API requests. However, any field with an
2400	// empty value appearing in NullFields will be sent to the server as
2401	// null. It is an error if a field in this list has a non-empty value.
2402	// This may be used to include null fields in Patch requests.
2403	NullFields []string `json:"-"`
2404}
2405
2406func (s *RotateServerCaContext) MarshalJSON() ([]byte, error) {
2407	type NoMethod RotateServerCaContext
2408	raw := NoMethod(*s)
2409	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2410}
2411
2412// Settings: Database instance settings.
2413type Settings struct {
2414	// ActivationPolicy: The activation policy specifies when the instance
2415	// is activated; it is applicable only when the instance state is
2416	// RUNNABLE. Valid values:
2417	// ALWAYS: The instance is on, and remains so even in the absence of
2418	// connection requests.
2419	// NEVER: The instance is off; it is not activated, even if a connection
2420	// request arrives.
2421	// ON_DEMAND: First Generation instances only. The instance responds to
2422	// incoming requests, and turns itself off when not in use. Instances
2423	// with PER_USE pricing turn off after 15 minutes of inactivity.
2424	// Instances with PER_PACKAGE pricing turn off after 12 hours of
2425	// inactivity.
2426	ActivationPolicy string `json:"activationPolicy,omitempty"`
2427
2428	// AuthorizedGaeApplications: The App Engine app IDs that can access
2429	// this instance. First Generation instances only.
2430	AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"`
2431
2432	// AvailabilityType: Availability type (PostgreSQL instances only).
2433	// Potential values:
2434	// ZONAL: The instance serves data from only one zone. Outages in that
2435	// zone affect data accessibility.
2436	// REGIONAL: The instance can serve data from more than one zone in a
2437	// region (it is highly available).
2438	// For more information, see Overview of the High Availability
2439	// Configuration.
2440	AvailabilityType string `json:"availabilityType,omitempty"`
2441
2442	// BackupConfiguration: The daily backup configuration for the instance.
2443	BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"`
2444
2445	// CrashSafeReplicationEnabled: Configuration specific to read replica
2446	// instances. Indicates whether database flags for crash-safe
2447	// replication are enabled. This property is only applicable to First
2448	// Generation instances.
2449	CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"`
2450
2451	// DataDiskSizeGb: The size of data disk, in GB. The data disk size
2452	// minimum is 10GB. Not used for First Generation instances.
2453	DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"`
2454
2455	// DataDiskType: The type of data disk: PD_SSD (default) or PD_HDD. Not
2456	// used for First Generation instances.
2457	DataDiskType string `json:"dataDiskType,omitempty"`
2458
2459	// DatabaseFlags: The database flags passed to the instance at startup.
2460	DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"`
2461
2462	// DatabaseReplicationEnabled: Configuration specific to read replica
2463	// instances. Indicates whether replication is enabled or not.
2464	DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"`
2465
2466	// IpConfiguration: The settings for IP Management. This allows to
2467	// enable or disable the instance IP and manage which external networks
2468	// can connect to the instance. The IPv4 address cannot be disabled for
2469	// Second Generation instances.
2470	IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"`
2471
2472	// Kind: This is always sql#settings.
2473	Kind string `json:"kind,omitempty"`
2474
2475	// LocationPreference: The location preference settings. This allows the
2476	// instance to be located as near as possible to either an App Engine
2477	// app or Compute Engine zone for better performance. App Engine
2478	// co-location is only applicable to First Generation instances.
2479	LocationPreference *LocationPreference `json:"locationPreference,omitempty"`
2480
2481	// MaintenanceWindow: The maintenance window for this instance. This
2482	// specifies when the instance can be restarted for maintenance
2483	// purposes. Not used for First Generation instances.
2484	MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
2485
2486	// PricingPlan: The pricing plan for this instance. This can be either
2487	// PER_USE or PACKAGE. Only PER_USE is supported for Second Generation
2488	// instances.
2489	PricingPlan string `json:"pricingPlan,omitempty"`
2490
2491	// ReplicationType: The type of replication this instance uses. This can
2492	// be either ASYNCHRONOUS or SYNCHRONOUS. This property is only
2493	// applicable to First Generation instances.
2494	ReplicationType string `json:"replicationType,omitempty"`
2495
2496	// SettingsVersion: The version of instance settings. This is a required
2497	// field for update method to make sure concurrent updates are handled
2498	// properly. During update, use the most recent settingsVersion value
2499	// for this instance and do not try to update this value.
2500	SettingsVersion int64 `json:"settingsVersion,omitempty,string"`
2501
2502	// StorageAutoResize: Configuration to increase storage size
2503	// automatically. The default value is true. Not used for First
2504	// Generation instances.
2505	StorageAutoResize *bool `json:"storageAutoResize,omitempty"`
2506
2507	// StorageAutoResizeLimit: The maximum size to which storage capacity
2508	// can be automatically increased. The default value is 0, which
2509	// specifies that there is no limit. Not used for First Generation
2510	// instances.
2511	StorageAutoResizeLimit int64 `json:"storageAutoResizeLimit,omitempty,string"`
2512
2513	// Tier: The tier (or machine type) for this instance, for example
2514	// db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL
2515	// instances). For MySQL instances, this property determines whether the
2516	// instance is First or Second Generation. For more information, see
2517	// Instance Settings.
2518	Tier string `json:"tier,omitempty"`
2519
2520	// UserLabels: User-provided labels, represented as a dictionary where
2521	// each label is a single key value pair.
2522	UserLabels map[string]string `json:"userLabels,omitempty"`
2523
2524	// ForceSendFields is a list of field names (e.g. "ActivationPolicy") to
2525	// unconditionally include in API requests. By default, fields with
2526	// empty values are omitted from API requests. However, any non-pointer,
2527	// non-interface field appearing in ForceSendFields will be sent to the
2528	// server regardless of whether the field is empty or not. This may be
2529	// used to include empty fields in Patch requests.
2530	ForceSendFields []string `json:"-"`
2531
2532	// NullFields is a list of field names (e.g. "ActivationPolicy") to
2533	// include in API requests with the JSON null value. By default, fields
2534	// with empty values are omitted from API requests. However, any field
2535	// with an empty value appearing in NullFields will be sent to the
2536	// server as null. It is an error if a field in this list has a
2537	// non-empty value. This may be used to include null fields in Patch
2538	// requests.
2539	NullFields []string `json:"-"`
2540}
2541
2542func (s *Settings) MarshalJSON() ([]byte, error) {
2543	type NoMethod Settings
2544	raw := NoMethod(*s)
2545	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2546}
2547
2548// SslCert: SslCerts Resource
2549type SslCert struct {
2550	// Cert: PEM representation.
2551	Cert string `json:"cert,omitempty"`
2552
2553	// CertSerialNumber: Serial number, as extracted from the certificate.
2554	CertSerialNumber string `json:"certSerialNumber,omitempty"`
2555
2556	// CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+.
2557	CommonName string `json:"commonName,omitempty"`
2558
2559	// CreateTime: The time when the certificate was created in RFC 3339
2560	// format, for example 2012-11-15T16:19:00.094Z
2561	CreateTime string `json:"createTime,omitempty"`
2562
2563	// ExpirationTime: The time when the certificate expires in RFC 3339
2564	// format, for example 2012-11-15T16:19:00.094Z.
2565	ExpirationTime string `json:"expirationTime,omitempty"`
2566
2567	// Instance: Name of the database instance.
2568	Instance string `json:"instance,omitempty"`
2569
2570	// Kind: This is always sql#sslCert.
2571	Kind string `json:"kind,omitempty"`
2572
2573	// SelfLink: The URI of this resource.
2574	SelfLink string `json:"selfLink,omitempty"`
2575
2576	// Sha1Fingerprint: Sha1 Fingerprint.
2577	Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"`
2578
2579	// ServerResponse contains the HTTP response code and headers from the
2580	// server.
2581	googleapi.ServerResponse `json:"-"`
2582
2583	// ForceSendFields is a list of field names (e.g. "Cert") to
2584	// unconditionally include in API requests. By default, fields with
2585	// empty values are omitted from API requests. However, any non-pointer,
2586	// non-interface field appearing in ForceSendFields will be sent to the
2587	// server regardless of whether the field is empty or not. This may be
2588	// used to include empty fields in Patch requests.
2589	ForceSendFields []string `json:"-"`
2590
2591	// NullFields is a list of field names (e.g. "Cert") to include in API
2592	// requests with the JSON null value. By default, fields with empty
2593	// values are omitted from API requests. However, any field with an
2594	// empty value appearing in NullFields will be sent to the server as
2595	// null. It is an error if a field in this list has a non-empty value.
2596	// This may be used to include null fields in Patch requests.
2597	NullFields []string `json:"-"`
2598}
2599
2600func (s *SslCert) MarshalJSON() ([]byte, error) {
2601	type NoMethod SslCert
2602	raw := NoMethod(*s)
2603	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2604}
2605
2606// SslCertDetail: SslCertDetail.
2607type SslCertDetail struct {
2608	// CertInfo: The public information about the cert.
2609	CertInfo *SslCert `json:"certInfo,omitempty"`
2610
2611	// CertPrivateKey: The private key for the client cert, in pem format.
2612	// Keep private in order to protect your security.
2613	CertPrivateKey string `json:"certPrivateKey,omitempty"`
2614
2615	// ForceSendFields is a list of field names (e.g. "CertInfo") to
2616	// unconditionally include in API requests. By default, fields with
2617	// empty values are omitted from API requests. However, any non-pointer,
2618	// non-interface field appearing in ForceSendFields will be sent to the
2619	// server regardless of whether the field is empty or not. This may be
2620	// used to include empty fields in Patch requests.
2621	ForceSendFields []string `json:"-"`
2622
2623	// NullFields is a list of field names (e.g. "CertInfo") to include in
2624	// API requests with the JSON null value. By default, fields with empty
2625	// values are omitted from API requests. However, any field with an
2626	// empty value appearing in NullFields will be sent to the server as
2627	// null. It is an error if a field in this list has a non-empty value.
2628	// This may be used to include null fields in Patch requests.
2629	NullFields []string `json:"-"`
2630}
2631
2632func (s *SslCertDetail) MarshalJSON() ([]byte, error) {
2633	type NoMethod SslCertDetail
2634	raw := NoMethod(*s)
2635	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2636}
2637
2638// SslCertsCreateEphemeralRequest: SslCerts create ephemeral certificate
2639// request.
2640type SslCertsCreateEphemeralRequest struct {
2641	// PublicKey: PEM encoded public key to include in the signed
2642	// certificate.
2643	PublicKey string `json:"public_key,omitempty"`
2644
2645	// ForceSendFields is a list of field names (e.g. "PublicKey") to
2646	// unconditionally include in API requests. By default, fields with
2647	// empty values are omitted from API requests. However, any non-pointer,
2648	// non-interface field appearing in ForceSendFields will be sent to the
2649	// server regardless of whether the field is empty or not. This may be
2650	// used to include empty fields in Patch requests.
2651	ForceSendFields []string `json:"-"`
2652
2653	// NullFields is a list of field names (e.g. "PublicKey") to include in
2654	// API requests with the JSON null value. By default, fields with empty
2655	// values are omitted from API requests. However, any field with an
2656	// empty value appearing in NullFields will be sent to the server as
2657	// null. It is an error if a field in this list has a non-empty value.
2658	// This may be used to include null fields in Patch requests.
2659	NullFields []string `json:"-"`
2660}
2661
2662func (s *SslCertsCreateEphemeralRequest) MarshalJSON() ([]byte, error) {
2663	type NoMethod SslCertsCreateEphemeralRequest
2664	raw := NoMethod(*s)
2665	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2666}
2667
2668// SslCertsInsertRequest: SslCerts insert request.
2669type SslCertsInsertRequest struct {
2670	// CommonName: User supplied name. Must be a distinct name from the
2671	// other certificates for this instance.
2672	CommonName string `json:"commonName,omitempty"`
2673
2674	// ForceSendFields is a list of field names (e.g. "CommonName") to
2675	// unconditionally include in API requests. By default, fields with
2676	// empty values are omitted from API requests. However, any non-pointer,
2677	// non-interface field appearing in ForceSendFields will be sent to the
2678	// server regardless of whether the field is empty or not. This may be
2679	// used to include empty fields in Patch requests.
2680	ForceSendFields []string `json:"-"`
2681
2682	// NullFields is a list of field names (e.g. "CommonName") to include in
2683	// API requests with the JSON null value. By default, fields with empty
2684	// values are omitted from API requests. However, any field with an
2685	// empty value appearing in NullFields will be sent to the server as
2686	// null. It is an error if a field in this list has a non-empty value.
2687	// This may be used to include null fields in Patch requests.
2688	NullFields []string `json:"-"`
2689}
2690
2691func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) {
2692	type NoMethod SslCertsInsertRequest
2693	raw := NoMethod(*s)
2694	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2695}
2696
2697// SslCertsInsertResponse: SslCert insert response.
2698type SslCertsInsertResponse struct {
2699	// ClientCert: The new client certificate and private key. For First
2700	// Generation instances, the new certificate does not take effect until
2701	// the instance is restarted.
2702	ClientCert *SslCertDetail `json:"clientCert,omitempty"`
2703
2704	// Kind: This is always sql#sslCertsInsert.
2705	Kind string `json:"kind,omitempty"`
2706
2707	// Operation: The operation to track the ssl certs insert request.
2708	Operation *Operation `json:"operation,omitempty"`
2709
2710	// ServerCaCert: The server Certificate Authority's certificate. If this
2711	// is missing you can force a new one to be generated by calling
2712	// resetSslConfig method on instances resource.
2713	ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
2714
2715	// ServerResponse contains the HTTP response code and headers from the
2716	// server.
2717	googleapi.ServerResponse `json:"-"`
2718
2719	// ForceSendFields is a list of field names (e.g. "ClientCert") to
2720	// unconditionally include in API requests. By default, fields with
2721	// empty values are omitted from API requests. However, any non-pointer,
2722	// non-interface field appearing in ForceSendFields will be sent to the
2723	// server regardless of whether the field is empty or not. This may be
2724	// used to include empty fields in Patch requests.
2725	ForceSendFields []string `json:"-"`
2726
2727	// NullFields is a list of field names (e.g. "ClientCert") to include in
2728	// API requests with the JSON null value. By default, fields with empty
2729	// values are omitted from API requests. However, any field with an
2730	// empty value appearing in NullFields will be sent to the server as
2731	// null. It is an error if a field in this list has a non-empty value.
2732	// This may be used to include null fields in Patch requests.
2733	NullFields []string `json:"-"`
2734}
2735
2736func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) {
2737	type NoMethod SslCertsInsertResponse
2738	raw := NoMethod(*s)
2739	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2740}
2741
2742// SslCertsListResponse: SslCerts list response.
2743type SslCertsListResponse struct {
2744	// Items: List of client certificates for the instance.
2745	Items []*SslCert `json:"items,omitempty"`
2746
2747	// Kind: This is always sql#sslCertsList.
2748	Kind string `json:"kind,omitempty"`
2749
2750	// ServerResponse contains the HTTP response code and headers from the
2751	// server.
2752	googleapi.ServerResponse `json:"-"`
2753
2754	// ForceSendFields is a list of field names (e.g. "Items") to
2755	// unconditionally include in API requests. By default, fields with
2756	// empty values are omitted from API requests. However, any non-pointer,
2757	// non-interface field appearing in ForceSendFields will be sent to the
2758	// server regardless of whether the field is empty or not. This may be
2759	// used to include empty fields in Patch requests.
2760	ForceSendFields []string `json:"-"`
2761
2762	// NullFields is a list of field names (e.g. "Items") to include in API
2763	// requests with the JSON null value. By default, fields with empty
2764	// values are omitted from API requests. However, any field with an
2765	// empty value appearing in NullFields will be sent to the server as
2766	// null. It is an error if a field in this list has a non-empty value.
2767	// This may be used to include null fields in Patch requests.
2768	NullFields []string `json:"-"`
2769}
2770
2771func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) {
2772	type NoMethod SslCertsListResponse
2773	raw := NoMethod(*s)
2774	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2775}
2776
2777// Tier: A Google Cloud SQL service tier resource.
2778type Tier struct {
2779	// DiskQuota: The maximum disk size of this tier in bytes.
2780	DiskQuota int64 `json:"DiskQuota,omitempty,string"`
2781
2782	// RAM: The maximum RAM usage of this tier in bytes.
2783	RAM int64 `json:"RAM,omitempty,string"`
2784
2785	// Kind: This is always sql#tier.
2786	Kind string `json:"kind,omitempty"`
2787
2788	// Region: The applicable regions for this tier.
2789	Region []string `json:"region,omitempty"`
2790
2791	// Tier: An identifier for the machine type, for example,
2792	// db-n1-standard-1. For related information, see Pricing.
2793	Tier string `json:"tier,omitempty"`
2794
2795	// ForceSendFields is a list of field names (e.g. "DiskQuota") to
2796	// unconditionally include in API requests. By default, fields with
2797	// empty values are omitted from API requests. However, any non-pointer,
2798	// non-interface field appearing in ForceSendFields will be sent to the
2799	// server regardless of whether the field is empty or not. This may be
2800	// used to include empty fields in Patch requests.
2801	ForceSendFields []string `json:"-"`
2802
2803	// NullFields is a list of field names (e.g. "DiskQuota") to include in
2804	// API requests with the JSON null value. By default, fields with empty
2805	// values are omitted from API requests. However, any field with an
2806	// empty value appearing in NullFields will be sent to the server as
2807	// null. It is an error if a field in this list has a non-empty value.
2808	// This may be used to include null fields in Patch requests.
2809	NullFields []string `json:"-"`
2810}
2811
2812func (s *Tier) MarshalJSON() ([]byte, error) {
2813	type NoMethod Tier
2814	raw := NoMethod(*s)
2815	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2816}
2817
2818// TiersListResponse: Tiers list response.
2819type TiersListResponse struct {
2820	// Items: List of tiers.
2821	Items []*Tier `json:"items,omitempty"`
2822
2823	// Kind: This is always sql#tiersList.
2824	Kind string `json:"kind,omitempty"`
2825
2826	// ServerResponse contains the HTTP response code and headers from the
2827	// server.
2828	googleapi.ServerResponse `json:"-"`
2829
2830	// ForceSendFields is a list of field names (e.g. "Items") to
2831	// unconditionally include in API requests. By default, fields with
2832	// empty values are omitted from API requests. However, any non-pointer,
2833	// non-interface field appearing in ForceSendFields will be sent to the
2834	// server regardless of whether the field is empty or not. This may be
2835	// used to include empty fields in Patch requests.
2836	ForceSendFields []string `json:"-"`
2837
2838	// NullFields is a list of field names (e.g. "Items") to include in API
2839	// requests with the JSON null value. By default, fields with empty
2840	// values are omitted from API requests. However, any field with an
2841	// empty value appearing in NullFields will be sent to the server as
2842	// null. It is an error if a field in this list has a non-empty value.
2843	// This may be used to include null fields in Patch requests.
2844	NullFields []string `json:"-"`
2845}
2846
2847func (s *TiersListResponse) MarshalJSON() ([]byte, error) {
2848	type NoMethod TiersListResponse
2849	raw := NoMethod(*s)
2850	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2851}
2852
2853// TruncateLogContext: Database Instance truncate log context.
2854type TruncateLogContext struct {
2855	// Kind: This is always sql#truncateLogContext.
2856	Kind string `json:"kind,omitempty"`
2857
2858	// LogType: The type of log to truncate. Valid values are
2859	// MYSQL_GENERAL_TABLE and MYSQL_SLOW_TABLE.
2860	LogType string `json:"logType,omitempty"`
2861
2862	// ForceSendFields is a list of field names (e.g. "Kind") to
2863	// unconditionally include in API requests. By default, fields with
2864	// empty values are omitted from API requests. However, any non-pointer,
2865	// non-interface field appearing in ForceSendFields will be sent to the
2866	// server regardless of whether the field is empty or not. This may be
2867	// used to include empty fields in Patch requests.
2868	ForceSendFields []string `json:"-"`
2869
2870	// NullFields is a list of field names (e.g. "Kind") to include in API
2871	// requests with the JSON null value. By default, fields with empty
2872	// values are omitted from API requests. However, any field with an
2873	// empty value appearing in NullFields will be sent to the server as
2874	// null. It is an error if a field in this list has a non-empty value.
2875	// This may be used to include null fields in Patch requests.
2876	NullFields []string `json:"-"`
2877}
2878
2879func (s *TruncateLogContext) MarshalJSON() ([]byte, error) {
2880	type NoMethod TruncateLogContext
2881	raw := NoMethod(*s)
2882	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2883}
2884
2885// User: A Cloud SQL user resource.
2886type User struct {
2887	// Etag: This field is deprecated and will be removed from a future
2888	// version of the API.
2889	Etag string `json:"etag,omitempty"`
2890
2891	// Host: The host name from which the user can connect. For insert
2892	// operations, host defaults to an empty string. For update operations,
2893	// host is specified as part of the request URL. The host name cannot be
2894	// updated after insertion.
2895	Host string `json:"host,omitempty"`
2896
2897	// Instance: The name of the Cloud SQL instance. This does not include
2898	// the project ID. Can be omitted for update since it is already
2899	// specified on the URL.
2900	Instance string `json:"instance,omitempty"`
2901
2902	// Kind: This is always sql#user.
2903	Kind string `json:"kind,omitempty"`
2904
2905	// Name: The name of the user in the Cloud SQL instance. Can be omitted
2906	// for update since it is already specified in the URL.
2907	Name string `json:"name,omitempty"`
2908
2909	// Password: The password for the user.
2910	Password string `json:"password,omitempty"`
2911
2912	// Project: The project ID of the project containing the Cloud SQL
2913	// database. The Google apps domain is prefixed if applicable. Can be
2914	// omitted for update since it is already specified on the URL.
2915	Project string `json:"project,omitempty"`
2916
2917	// ForceSendFields is a list of field names (e.g. "Etag") to
2918	// unconditionally include in API requests. By default, fields with
2919	// empty values are omitted from API requests. However, any non-pointer,
2920	// non-interface field appearing in ForceSendFields will be sent to the
2921	// server regardless of whether the field is empty or not. This may be
2922	// used to include empty fields in Patch requests.
2923	ForceSendFields []string `json:"-"`
2924
2925	// NullFields is a list of field names (e.g. "Etag") to include in API
2926	// requests with the JSON null value. By default, fields with empty
2927	// values are omitted from API requests. However, any field with an
2928	// empty value appearing in NullFields will be sent to the server as
2929	// null. It is an error if a field in this list has a non-empty value.
2930	// This may be used to include null fields in Patch requests.
2931	NullFields []string `json:"-"`
2932}
2933
2934func (s *User) MarshalJSON() ([]byte, error) {
2935	type NoMethod User
2936	raw := NoMethod(*s)
2937	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2938}
2939
2940// UsersListResponse: User list response.
2941type UsersListResponse struct {
2942	// Items: List of user resources in the instance.
2943	Items []*User `json:"items,omitempty"`
2944
2945	// Kind: This is always sql#usersList.
2946	Kind string `json:"kind,omitempty"`
2947
2948	// NextPageToken: An identifier that uniquely identifies the operation.
2949	// You can use this identifier to retrieve the Operations resource that
2950	// has information about the operation.
2951	NextPageToken string `json:"nextPageToken,omitempty"`
2952
2953	// ServerResponse contains the HTTP response code and headers from the
2954	// server.
2955	googleapi.ServerResponse `json:"-"`
2956
2957	// ForceSendFields is a list of field names (e.g. "Items") to
2958	// unconditionally include in API requests. By default, fields with
2959	// empty values are omitted from API requests. However, any non-pointer,
2960	// non-interface field appearing in ForceSendFields will be sent to the
2961	// server regardless of whether the field is empty or not. This may be
2962	// used to include empty fields in Patch requests.
2963	ForceSendFields []string `json:"-"`
2964
2965	// NullFields is a list of field names (e.g. "Items") to include in API
2966	// requests with the JSON null value. By default, fields with empty
2967	// values are omitted from API requests. However, any field with an
2968	// empty value appearing in NullFields will be sent to the server as
2969	// null. It is an error if a field in this list has a non-empty value.
2970	// This may be used to include null fields in Patch requests.
2971	NullFields []string `json:"-"`
2972}
2973
2974func (s *UsersListResponse) MarshalJSON() ([]byte, error) {
2975	type NoMethod UsersListResponse
2976	raw := NoMethod(*s)
2977	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2978}
2979
2980// method id "sql.backupRuns.delete":
2981
2982type BackupRunsDeleteCall struct {
2983	s          *Service
2984	project    string
2985	instance   string
2986	id         int64
2987	urlParams_ gensupport.URLParams
2988	ctx_       context.Context
2989	header_    http.Header
2990}
2991
2992// Delete: Deletes the backup taken by a backup run.
2993func (r *BackupRunsService) Delete(project string, instance string, id int64) *BackupRunsDeleteCall {
2994	c := &BackupRunsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2995	c.project = project
2996	c.instance = instance
2997	c.id = id
2998	return c
2999}
3000
3001// Fields allows partial responses to be retrieved. See
3002// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3003// for more information.
3004func (c *BackupRunsDeleteCall) Fields(s ...googleapi.Field) *BackupRunsDeleteCall {
3005	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3006	return c
3007}
3008
3009// Context sets the context to be used in this call's Do method. Any
3010// pending HTTP request will be aborted if the provided context is
3011// canceled.
3012func (c *BackupRunsDeleteCall) Context(ctx context.Context) *BackupRunsDeleteCall {
3013	c.ctx_ = ctx
3014	return c
3015}
3016
3017// Header returns an http.Header that can be modified by the caller to
3018// add HTTP headers to the request.
3019func (c *BackupRunsDeleteCall) Header() http.Header {
3020	if c.header_ == nil {
3021		c.header_ = make(http.Header)
3022	}
3023	return c.header_
3024}
3025
3026func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) {
3027	reqHeaders := make(http.Header)
3028	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3029	for k, v := range c.header_ {
3030		reqHeaders[k] = v
3031	}
3032	reqHeaders.Set("User-Agent", c.s.userAgent())
3033	var body io.Reader = nil
3034	c.urlParams_.Set("alt", alt)
3035	c.urlParams_.Set("prettyPrint", "false")
3036	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{id}")
3037	urls += "?" + c.urlParams_.Encode()
3038	req, err := http.NewRequest("DELETE", urls, body)
3039	if err != nil {
3040		return nil, err
3041	}
3042	req.Header = reqHeaders
3043	googleapi.Expand(req.URL, map[string]string{
3044		"project":  c.project,
3045		"instance": c.instance,
3046		"id":       strconv.FormatInt(c.id, 10),
3047	})
3048	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3049}
3050
3051// Do executes the "sql.backupRuns.delete" call.
3052// Exactly one of *Operation or error will be non-nil. Any non-2xx
3053// status code is an error. Response headers are in either
3054// *Operation.ServerResponse.Header or (if a response was returned at
3055// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3056// to check whether the returned error was because
3057// http.StatusNotModified was returned.
3058func (c *BackupRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3059	gensupport.SetOptions(c.urlParams_, opts...)
3060	res, err := c.doRequest("json")
3061	if res != nil && res.StatusCode == http.StatusNotModified {
3062		if res.Body != nil {
3063			res.Body.Close()
3064		}
3065		return nil, &googleapi.Error{
3066			Code:   res.StatusCode,
3067			Header: res.Header,
3068		}
3069	}
3070	if err != nil {
3071		return nil, err
3072	}
3073	defer googleapi.CloseBody(res)
3074	if err := googleapi.CheckResponse(res); err != nil {
3075		return nil, err
3076	}
3077	ret := &Operation{
3078		ServerResponse: googleapi.ServerResponse{
3079			Header:         res.Header,
3080			HTTPStatusCode: res.StatusCode,
3081		},
3082	}
3083	target := &ret
3084	if err := gensupport.DecodeResponse(target, res); err != nil {
3085		return nil, err
3086	}
3087	return ret, nil
3088	// {
3089	//   "description": "Deletes the backup taken by a backup run.",
3090	//   "httpMethod": "DELETE",
3091	//   "id": "sql.backupRuns.delete",
3092	//   "parameterOrder": [
3093	//     "project",
3094	//     "instance",
3095	//     "id"
3096	//   ],
3097	//   "parameters": {
3098	//     "id": {
3099	//       "description": "The ID of the Backup Run to delete. To find a Backup Run ID, use the list method.",
3100	//       "format": "int64",
3101	//       "location": "path",
3102	//       "required": true,
3103	//       "type": "string"
3104	//     },
3105	//     "instance": {
3106	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
3107	//       "location": "path",
3108	//       "required": true,
3109	//       "type": "string"
3110	//     },
3111	//     "project": {
3112	//       "description": "Project ID of the project that contains the instance.",
3113	//       "location": "path",
3114	//       "required": true,
3115	//       "type": "string"
3116	//     }
3117	//   },
3118	//   "path": "projects/{project}/instances/{instance}/backupRuns/{id}",
3119	//   "response": {
3120	//     "$ref": "Operation"
3121	//   },
3122	//   "scopes": [
3123	//     "https://www.googleapis.com/auth/cloud-platform",
3124	//     "https://www.googleapis.com/auth/sqlservice.admin"
3125	//   ]
3126	// }
3127
3128}
3129
3130// method id "sql.backupRuns.get":
3131
3132type BackupRunsGetCall struct {
3133	s            *Service
3134	project      string
3135	instance     string
3136	id           int64
3137	urlParams_   gensupport.URLParams
3138	ifNoneMatch_ string
3139	ctx_         context.Context
3140	header_      http.Header
3141}
3142
3143// Get: Retrieves a resource containing information about a backup run.
3144func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall {
3145	c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3146	c.project = project
3147	c.instance = instance
3148	c.id = id
3149	return c
3150}
3151
3152// Fields allows partial responses to be retrieved. See
3153// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3154// for more information.
3155func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall {
3156	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3157	return c
3158}
3159
3160// IfNoneMatch sets the optional parameter which makes the operation
3161// fail if the object's ETag matches the given value. This is useful for
3162// getting updates only after the object has changed since the last
3163// request. Use googleapi.IsNotModified to check whether the response
3164// error from Do is the result of In-None-Match.
3165func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall {
3166	c.ifNoneMatch_ = entityTag
3167	return c
3168}
3169
3170// Context sets the context to be used in this call's Do method. Any
3171// pending HTTP request will be aborted if the provided context is
3172// canceled.
3173func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall {
3174	c.ctx_ = ctx
3175	return c
3176}
3177
3178// Header returns an http.Header that can be modified by the caller to
3179// add HTTP headers to the request.
3180func (c *BackupRunsGetCall) Header() http.Header {
3181	if c.header_ == nil {
3182		c.header_ = make(http.Header)
3183	}
3184	return c.header_
3185}
3186
3187func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) {
3188	reqHeaders := make(http.Header)
3189	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3190	for k, v := range c.header_ {
3191		reqHeaders[k] = v
3192	}
3193	reqHeaders.Set("User-Agent", c.s.userAgent())
3194	if c.ifNoneMatch_ != "" {
3195		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3196	}
3197	var body io.Reader = nil
3198	c.urlParams_.Set("alt", alt)
3199	c.urlParams_.Set("prettyPrint", "false")
3200	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{id}")
3201	urls += "?" + c.urlParams_.Encode()
3202	req, err := http.NewRequest("GET", urls, body)
3203	if err != nil {
3204		return nil, err
3205	}
3206	req.Header = reqHeaders
3207	googleapi.Expand(req.URL, map[string]string{
3208		"project":  c.project,
3209		"instance": c.instance,
3210		"id":       strconv.FormatInt(c.id, 10),
3211	})
3212	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3213}
3214
3215// Do executes the "sql.backupRuns.get" call.
3216// Exactly one of *BackupRun or error will be non-nil. Any non-2xx
3217// status code is an error. Response headers are in either
3218// *BackupRun.ServerResponse.Header or (if a response was returned at
3219// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3220// to check whether the returned error was because
3221// http.StatusNotModified was returned.
3222func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) {
3223	gensupport.SetOptions(c.urlParams_, opts...)
3224	res, err := c.doRequest("json")
3225	if res != nil && res.StatusCode == http.StatusNotModified {
3226		if res.Body != nil {
3227			res.Body.Close()
3228		}
3229		return nil, &googleapi.Error{
3230			Code:   res.StatusCode,
3231			Header: res.Header,
3232		}
3233	}
3234	if err != nil {
3235		return nil, err
3236	}
3237	defer googleapi.CloseBody(res)
3238	if err := googleapi.CheckResponse(res); err != nil {
3239		return nil, err
3240	}
3241	ret := &BackupRun{
3242		ServerResponse: googleapi.ServerResponse{
3243			Header:         res.Header,
3244			HTTPStatusCode: res.StatusCode,
3245		},
3246	}
3247	target := &ret
3248	if err := gensupport.DecodeResponse(target, res); err != nil {
3249		return nil, err
3250	}
3251	return ret, nil
3252	// {
3253	//   "description": "Retrieves a resource containing information about a backup run.",
3254	//   "httpMethod": "GET",
3255	//   "id": "sql.backupRuns.get",
3256	//   "parameterOrder": [
3257	//     "project",
3258	//     "instance",
3259	//     "id"
3260	//   ],
3261	//   "parameters": {
3262	//     "id": {
3263	//       "description": "The ID of this Backup Run.",
3264	//       "format": "int64",
3265	//       "location": "path",
3266	//       "required": true,
3267	//       "type": "string"
3268	//     },
3269	//     "instance": {
3270	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
3271	//       "location": "path",
3272	//       "required": true,
3273	//       "type": "string"
3274	//     },
3275	//     "project": {
3276	//       "description": "Project ID of the project that contains the instance.",
3277	//       "location": "path",
3278	//       "required": true,
3279	//       "type": "string"
3280	//     }
3281	//   },
3282	//   "path": "projects/{project}/instances/{instance}/backupRuns/{id}",
3283	//   "response": {
3284	//     "$ref": "BackupRun"
3285	//   },
3286	//   "scopes": [
3287	//     "https://www.googleapis.com/auth/cloud-platform",
3288	//     "https://www.googleapis.com/auth/sqlservice.admin"
3289	//   ]
3290	// }
3291
3292}
3293
3294// method id "sql.backupRuns.insert":
3295
3296type BackupRunsInsertCall struct {
3297	s          *Service
3298	project    string
3299	instance   string
3300	backuprun  *BackupRun
3301	urlParams_ gensupport.URLParams
3302	ctx_       context.Context
3303	header_    http.Header
3304}
3305
3306// Insert: Creates a new backup run on demand. This method is applicable
3307// only to Second Generation instances.
3308func (r *BackupRunsService) Insert(project string, instance string, backuprun *BackupRun) *BackupRunsInsertCall {
3309	c := &BackupRunsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3310	c.project = project
3311	c.instance = instance
3312	c.backuprun = backuprun
3313	return c
3314}
3315
3316// Fields allows partial responses to be retrieved. See
3317// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3318// for more information.
3319func (c *BackupRunsInsertCall) Fields(s ...googleapi.Field) *BackupRunsInsertCall {
3320	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3321	return c
3322}
3323
3324// Context sets the context to be used in this call's Do method. Any
3325// pending HTTP request will be aborted if the provided context is
3326// canceled.
3327func (c *BackupRunsInsertCall) Context(ctx context.Context) *BackupRunsInsertCall {
3328	c.ctx_ = ctx
3329	return c
3330}
3331
3332// Header returns an http.Header that can be modified by the caller to
3333// add HTTP headers to the request.
3334func (c *BackupRunsInsertCall) Header() http.Header {
3335	if c.header_ == nil {
3336		c.header_ = make(http.Header)
3337	}
3338	return c.header_
3339}
3340
3341func (c *BackupRunsInsertCall) doRequest(alt string) (*http.Response, error) {
3342	reqHeaders := make(http.Header)
3343	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3344	for k, v := range c.header_ {
3345		reqHeaders[k] = v
3346	}
3347	reqHeaders.Set("User-Agent", c.s.userAgent())
3348	var body io.Reader = nil
3349	body, err := googleapi.WithoutDataWrapper.JSONReader(c.backuprun)
3350	if err != nil {
3351		return nil, err
3352	}
3353	reqHeaders.Set("Content-Type", "application/json")
3354	c.urlParams_.Set("alt", alt)
3355	c.urlParams_.Set("prettyPrint", "false")
3356	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns")
3357	urls += "?" + c.urlParams_.Encode()
3358	req, err := http.NewRequest("POST", urls, body)
3359	if err != nil {
3360		return nil, err
3361	}
3362	req.Header = reqHeaders
3363	googleapi.Expand(req.URL, map[string]string{
3364		"project":  c.project,
3365		"instance": c.instance,
3366	})
3367	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3368}
3369
3370// Do executes the "sql.backupRuns.insert" call.
3371// Exactly one of *Operation or error will be non-nil. Any non-2xx
3372// status code is an error. Response headers are in either
3373// *Operation.ServerResponse.Header or (if a response was returned at
3374// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3375// to check whether the returned error was because
3376// http.StatusNotModified was returned.
3377func (c *BackupRunsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3378	gensupport.SetOptions(c.urlParams_, opts...)
3379	res, err := c.doRequest("json")
3380	if res != nil && res.StatusCode == http.StatusNotModified {
3381		if res.Body != nil {
3382			res.Body.Close()
3383		}
3384		return nil, &googleapi.Error{
3385			Code:   res.StatusCode,
3386			Header: res.Header,
3387		}
3388	}
3389	if err != nil {
3390		return nil, err
3391	}
3392	defer googleapi.CloseBody(res)
3393	if err := googleapi.CheckResponse(res); err != nil {
3394		return nil, err
3395	}
3396	ret := &Operation{
3397		ServerResponse: googleapi.ServerResponse{
3398			Header:         res.Header,
3399			HTTPStatusCode: res.StatusCode,
3400		},
3401	}
3402	target := &ret
3403	if err := gensupport.DecodeResponse(target, res); err != nil {
3404		return nil, err
3405	}
3406	return ret, nil
3407	// {
3408	//   "description": "Creates a new backup run on demand. This method is applicable only to Second Generation instances.",
3409	//   "httpMethod": "POST",
3410	//   "id": "sql.backupRuns.insert",
3411	//   "parameterOrder": [
3412	//     "project",
3413	//     "instance"
3414	//   ],
3415	//   "parameters": {
3416	//     "instance": {
3417	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
3418	//       "location": "path",
3419	//       "required": true,
3420	//       "type": "string"
3421	//     },
3422	//     "project": {
3423	//       "description": "Project ID of the project that contains the instance.",
3424	//       "location": "path",
3425	//       "required": true,
3426	//       "type": "string"
3427	//     }
3428	//   },
3429	//   "path": "projects/{project}/instances/{instance}/backupRuns",
3430	//   "request": {
3431	//     "$ref": "BackupRun"
3432	//   },
3433	//   "response": {
3434	//     "$ref": "Operation"
3435	//   },
3436	//   "scopes": [
3437	//     "https://www.googleapis.com/auth/cloud-platform",
3438	//     "https://www.googleapis.com/auth/sqlservice.admin"
3439	//   ]
3440	// }
3441
3442}
3443
3444// method id "sql.backupRuns.list":
3445
3446type BackupRunsListCall struct {
3447	s            *Service
3448	project      string
3449	instance     string
3450	urlParams_   gensupport.URLParams
3451	ifNoneMatch_ string
3452	ctx_         context.Context
3453	header_      http.Header
3454}
3455
3456// List: Lists all backup runs associated with a given instance and
3457// configuration in the reverse chronological order of the backup
3458// initiation time.
3459func (r *BackupRunsService) List(project string, instance string) *BackupRunsListCall {
3460	c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3461	c.project = project
3462	c.instance = instance
3463	return c
3464}
3465
3466// MaxResults sets the optional parameter "maxResults": Maximum number
3467// of backup runs per response.
3468func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall {
3469	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3470	return c
3471}
3472
3473// PageToken sets the optional parameter "pageToken": A
3474// previously-returned page token representing part of the larger set of
3475// results to view.
3476func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall {
3477	c.urlParams_.Set("pageToken", pageToken)
3478	return c
3479}
3480
3481// Fields allows partial responses to be retrieved. See
3482// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3483// for more information.
3484func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall {
3485	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3486	return c
3487}
3488
3489// IfNoneMatch sets the optional parameter which makes the operation
3490// fail if the object's ETag matches the given value. This is useful for
3491// getting updates only after the object has changed since the last
3492// request. Use googleapi.IsNotModified to check whether the response
3493// error from Do is the result of In-None-Match.
3494func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall {
3495	c.ifNoneMatch_ = entityTag
3496	return c
3497}
3498
3499// Context sets the context to be used in this call's Do method. Any
3500// pending HTTP request will be aborted if the provided context is
3501// canceled.
3502func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall {
3503	c.ctx_ = ctx
3504	return c
3505}
3506
3507// Header returns an http.Header that can be modified by the caller to
3508// add HTTP headers to the request.
3509func (c *BackupRunsListCall) Header() http.Header {
3510	if c.header_ == nil {
3511		c.header_ = make(http.Header)
3512	}
3513	return c.header_
3514}
3515
3516func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) {
3517	reqHeaders := make(http.Header)
3518	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3519	for k, v := range c.header_ {
3520		reqHeaders[k] = v
3521	}
3522	reqHeaders.Set("User-Agent", c.s.userAgent())
3523	if c.ifNoneMatch_ != "" {
3524		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3525	}
3526	var body io.Reader = nil
3527	c.urlParams_.Set("alt", alt)
3528	c.urlParams_.Set("prettyPrint", "false")
3529	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns")
3530	urls += "?" + c.urlParams_.Encode()
3531	req, err := http.NewRequest("GET", urls, body)
3532	if err != nil {
3533		return nil, err
3534	}
3535	req.Header = reqHeaders
3536	googleapi.Expand(req.URL, map[string]string{
3537		"project":  c.project,
3538		"instance": c.instance,
3539	})
3540	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3541}
3542
3543// Do executes the "sql.backupRuns.list" call.
3544// Exactly one of *BackupRunsListResponse or error will be non-nil. Any
3545// non-2xx status code is an error. Response headers are in either
3546// *BackupRunsListResponse.ServerResponse.Header or (if a response was
3547// returned at all) in error.(*googleapi.Error).Header. Use
3548// googleapi.IsNotModified to check whether the returned error was
3549// because http.StatusNotModified was returned.
3550func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) {
3551	gensupport.SetOptions(c.urlParams_, opts...)
3552	res, err := c.doRequest("json")
3553	if res != nil && res.StatusCode == http.StatusNotModified {
3554		if res.Body != nil {
3555			res.Body.Close()
3556		}
3557		return nil, &googleapi.Error{
3558			Code:   res.StatusCode,
3559			Header: res.Header,
3560		}
3561	}
3562	if err != nil {
3563		return nil, err
3564	}
3565	defer googleapi.CloseBody(res)
3566	if err := googleapi.CheckResponse(res); err != nil {
3567		return nil, err
3568	}
3569	ret := &BackupRunsListResponse{
3570		ServerResponse: googleapi.ServerResponse{
3571			Header:         res.Header,
3572			HTTPStatusCode: res.StatusCode,
3573		},
3574	}
3575	target := &ret
3576	if err := gensupport.DecodeResponse(target, res); err != nil {
3577		return nil, err
3578	}
3579	return ret, nil
3580	// {
3581	//   "description": "Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time.",
3582	//   "httpMethod": "GET",
3583	//   "id": "sql.backupRuns.list",
3584	//   "parameterOrder": [
3585	//     "project",
3586	//     "instance"
3587	//   ],
3588	//   "parameters": {
3589	//     "instance": {
3590	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
3591	//       "location": "path",
3592	//       "required": true,
3593	//       "type": "string"
3594	//     },
3595	//     "maxResults": {
3596	//       "description": "Maximum number of backup runs per response.",
3597	//       "format": "int32",
3598	//       "location": "query",
3599	//       "type": "integer"
3600	//     },
3601	//     "pageToken": {
3602	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
3603	//       "location": "query",
3604	//       "type": "string"
3605	//     },
3606	//     "project": {
3607	//       "description": "Project ID of the project that contains the instance.",
3608	//       "location": "path",
3609	//       "required": true,
3610	//       "type": "string"
3611	//     }
3612	//   },
3613	//   "path": "projects/{project}/instances/{instance}/backupRuns",
3614	//   "response": {
3615	//     "$ref": "BackupRunsListResponse"
3616	//   },
3617	//   "scopes": [
3618	//     "https://www.googleapis.com/auth/cloud-platform",
3619	//     "https://www.googleapis.com/auth/sqlservice.admin"
3620	//   ]
3621	// }
3622
3623}
3624
3625// Pages invokes f for each page of results.
3626// A non-nil error returned from f will halt the iteration.
3627// The provided context supersedes any context provided to the Context method.
3628func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error {
3629	c.ctx_ = ctx
3630	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3631	for {
3632		x, err := c.Do()
3633		if err != nil {
3634			return err
3635		}
3636		if err := f(x); err != nil {
3637			return err
3638		}
3639		if x.NextPageToken == "" {
3640			return nil
3641		}
3642		c.PageToken(x.NextPageToken)
3643	}
3644}
3645
3646// method id "sql.databases.delete":
3647
3648type DatabasesDeleteCall struct {
3649	s          *Service
3650	project    string
3651	instance   string
3652	database   string
3653	urlParams_ gensupport.URLParams
3654	ctx_       context.Context
3655	header_    http.Header
3656}
3657
3658// Delete: Deletes a database from a Cloud SQL instance.
3659func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall {
3660	c := &DatabasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3661	c.project = project
3662	c.instance = instance
3663	c.database = database
3664	return c
3665}
3666
3667// Fields allows partial responses to be retrieved. See
3668// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3669// for more information.
3670func (c *DatabasesDeleteCall) Fields(s ...googleapi.Field) *DatabasesDeleteCall {
3671	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3672	return c
3673}
3674
3675// Context sets the context to be used in this call's Do method. Any
3676// pending HTTP request will be aborted if the provided context is
3677// canceled.
3678func (c *DatabasesDeleteCall) Context(ctx context.Context) *DatabasesDeleteCall {
3679	c.ctx_ = ctx
3680	return c
3681}
3682
3683// Header returns an http.Header that can be modified by the caller to
3684// add HTTP headers to the request.
3685func (c *DatabasesDeleteCall) Header() http.Header {
3686	if c.header_ == nil {
3687		c.header_ = make(http.Header)
3688	}
3689	return c.header_
3690}
3691
3692func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) {
3693	reqHeaders := make(http.Header)
3694	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3695	for k, v := range c.header_ {
3696		reqHeaders[k] = v
3697	}
3698	reqHeaders.Set("User-Agent", c.s.userAgent())
3699	var body io.Reader = nil
3700	c.urlParams_.Set("alt", alt)
3701	c.urlParams_.Set("prettyPrint", "false")
3702	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}")
3703	urls += "?" + c.urlParams_.Encode()
3704	req, err := http.NewRequest("DELETE", urls, body)
3705	if err != nil {
3706		return nil, err
3707	}
3708	req.Header = reqHeaders
3709	googleapi.Expand(req.URL, map[string]string{
3710		"project":  c.project,
3711		"instance": c.instance,
3712		"database": c.database,
3713	})
3714	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3715}
3716
3717// Do executes the "sql.databases.delete" call.
3718// Exactly one of *Operation or error will be non-nil. Any non-2xx
3719// status code is an error. Response headers are in either
3720// *Operation.ServerResponse.Header or (if a response was returned at
3721// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3722// to check whether the returned error was because
3723// http.StatusNotModified was returned.
3724func (c *DatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3725	gensupport.SetOptions(c.urlParams_, opts...)
3726	res, err := c.doRequest("json")
3727	if res != nil && res.StatusCode == http.StatusNotModified {
3728		if res.Body != nil {
3729			res.Body.Close()
3730		}
3731		return nil, &googleapi.Error{
3732			Code:   res.StatusCode,
3733			Header: res.Header,
3734		}
3735	}
3736	if err != nil {
3737		return nil, err
3738	}
3739	defer googleapi.CloseBody(res)
3740	if err := googleapi.CheckResponse(res); err != nil {
3741		return nil, err
3742	}
3743	ret := &Operation{
3744		ServerResponse: googleapi.ServerResponse{
3745			Header:         res.Header,
3746			HTTPStatusCode: res.StatusCode,
3747		},
3748	}
3749	target := &ret
3750	if err := gensupport.DecodeResponse(target, res); err != nil {
3751		return nil, err
3752	}
3753	return ret, nil
3754	// {
3755	//   "description": "Deletes a database from a Cloud SQL instance.",
3756	//   "httpMethod": "DELETE",
3757	//   "id": "sql.databases.delete",
3758	//   "parameterOrder": [
3759	//     "project",
3760	//     "instance",
3761	//     "database"
3762	//   ],
3763	//   "parameters": {
3764	//     "database": {
3765	//       "description": "Name of the database to be deleted in the instance.",
3766	//       "location": "path",
3767	//       "required": true,
3768	//       "type": "string"
3769	//     },
3770	//     "instance": {
3771	//       "description": "Database instance ID. This does not include the project ID.",
3772	//       "location": "path",
3773	//       "required": true,
3774	//       "type": "string"
3775	//     },
3776	//     "project": {
3777	//       "description": "Project ID of the project that contains the instance.",
3778	//       "location": "path",
3779	//       "required": true,
3780	//       "type": "string"
3781	//     }
3782	//   },
3783	//   "path": "projects/{project}/instances/{instance}/databases/{database}",
3784	//   "response": {
3785	//     "$ref": "Operation"
3786	//   },
3787	//   "scopes": [
3788	//     "https://www.googleapis.com/auth/cloud-platform",
3789	//     "https://www.googleapis.com/auth/sqlservice.admin"
3790	//   ]
3791	// }
3792
3793}
3794
3795// method id "sql.databases.get":
3796
3797type DatabasesGetCall struct {
3798	s            *Service
3799	project      string
3800	instance     string
3801	database     string
3802	urlParams_   gensupport.URLParams
3803	ifNoneMatch_ string
3804	ctx_         context.Context
3805	header_      http.Header
3806}
3807
3808// Get: Retrieves a resource containing information about a database
3809// inside a Cloud SQL instance.
3810func (r *DatabasesService) Get(project string, instance string, database string) *DatabasesGetCall {
3811	c := &DatabasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3812	c.project = project
3813	c.instance = instance
3814	c.database = database
3815	return c
3816}
3817
3818// Fields allows partial responses to be retrieved. See
3819// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3820// for more information.
3821func (c *DatabasesGetCall) Fields(s ...googleapi.Field) *DatabasesGetCall {
3822	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3823	return c
3824}
3825
3826// IfNoneMatch sets the optional parameter which makes the operation
3827// fail if the object's ETag matches the given value. This is useful for
3828// getting updates only after the object has changed since the last
3829// request. Use googleapi.IsNotModified to check whether the response
3830// error from Do is the result of In-None-Match.
3831func (c *DatabasesGetCall) IfNoneMatch(entityTag string) *DatabasesGetCall {
3832	c.ifNoneMatch_ = entityTag
3833	return c
3834}
3835
3836// Context sets the context to be used in this call's Do method. Any
3837// pending HTTP request will be aborted if the provided context is
3838// canceled.
3839func (c *DatabasesGetCall) Context(ctx context.Context) *DatabasesGetCall {
3840	c.ctx_ = ctx
3841	return c
3842}
3843
3844// Header returns an http.Header that can be modified by the caller to
3845// add HTTP headers to the request.
3846func (c *DatabasesGetCall) Header() http.Header {
3847	if c.header_ == nil {
3848		c.header_ = make(http.Header)
3849	}
3850	return c.header_
3851}
3852
3853func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) {
3854	reqHeaders := make(http.Header)
3855	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3856	for k, v := range c.header_ {
3857		reqHeaders[k] = v
3858	}
3859	reqHeaders.Set("User-Agent", c.s.userAgent())
3860	if c.ifNoneMatch_ != "" {
3861		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3862	}
3863	var body io.Reader = nil
3864	c.urlParams_.Set("alt", alt)
3865	c.urlParams_.Set("prettyPrint", "false")
3866	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}")
3867	urls += "?" + c.urlParams_.Encode()
3868	req, err := http.NewRequest("GET", urls, body)
3869	if err != nil {
3870		return nil, err
3871	}
3872	req.Header = reqHeaders
3873	googleapi.Expand(req.URL, map[string]string{
3874		"project":  c.project,
3875		"instance": c.instance,
3876		"database": c.database,
3877	})
3878	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3879}
3880
3881// Do executes the "sql.databases.get" call.
3882// Exactly one of *Database or error will be non-nil. Any non-2xx status
3883// code is an error. Response headers are in either
3884// *Database.ServerResponse.Header or (if a response was returned at
3885// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3886// to check whether the returned error was because
3887// http.StatusNotModified was returned.
3888func (c *DatabasesGetCall) Do(opts ...googleapi.CallOption) (*Database, error) {
3889	gensupport.SetOptions(c.urlParams_, opts...)
3890	res, err := c.doRequest("json")
3891	if res != nil && res.StatusCode == http.StatusNotModified {
3892		if res.Body != nil {
3893			res.Body.Close()
3894		}
3895		return nil, &googleapi.Error{
3896			Code:   res.StatusCode,
3897			Header: res.Header,
3898		}
3899	}
3900	if err != nil {
3901		return nil, err
3902	}
3903	defer googleapi.CloseBody(res)
3904	if err := googleapi.CheckResponse(res); err != nil {
3905		return nil, err
3906	}
3907	ret := &Database{
3908		ServerResponse: googleapi.ServerResponse{
3909			Header:         res.Header,
3910			HTTPStatusCode: res.StatusCode,
3911		},
3912	}
3913	target := &ret
3914	if err := gensupport.DecodeResponse(target, res); err != nil {
3915		return nil, err
3916	}
3917	return ret, nil
3918	// {
3919	//   "description": "Retrieves a resource containing information about a database inside a Cloud SQL instance.",
3920	//   "httpMethod": "GET",
3921	//   "id": "sql.databases.get",
3922	//   "parameterOrder": [
3923	//     "project",
3924	//     "instance",
3925	//     "database"
3926	//   ],
3927	//   "parameters": {
3928	//     "database": {
3929	//       "description": "Name of the database in the instance.",
3930	//       "location": "path",
3931	//       "required": true,
3932	//       "type": "string"
3933	//     },
3934	//     "instance": {
3935	//       "description": "Database instance ID. This does not include the project ID.",
3936	//       "location": "path",
3937	//       "required": true,
3938	//       "type": "string"
3939	//     },
3940	//     "project": {
3941	//       "description": "Project ID of the project that contains the instance.",
3942	//       "location": "path",
3943	//       "required": true,
3944	//       "type": "string"
3945	//     }
3946	//   },
3947	//   "path": "projects/{project}/instances/{instance}/databases/{database}",
3948	//   "response": {
3949	//     "$ref": "Database"
3950	//   },
3951	//   "scopes": [
3952	//     "https://www.googleapis.com/auth/cloud-platform",
3953	//     "https://www.googleapis.com/auth/sqlservice.admin"
3954	//   ]
3955	// }
3956
3957}
3958
3959// method id "sql.databases.insert":
3960
3961type DatabasesInsertCall struct {
3962	s          *Service
3963	project    string
3964	instance   string
3965	database   *Database
3966	urlParams_ gensupport.URLParams
3967	ctx_       context.Context
3968	header_    http.Header
3969}
3970
3971// Insert: Inserts a resource containing information about a database
3972// inside a Cloud SQL instance.
3973func (r *DatabasesService) Insert(project string, instance string, database *Database) *DatabasesInsertCall {
3974	c := &DatabasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3975	c.project = project
3976	c.instance = instance
3977	c.database = database
3978	return c
3979}
3980
3981// Fields allows partial responses to be retrieved. See
3982// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3983// for more information.
3984func (c *DatabasesInsertCall) Fields(s ...googleapi.Field) *DatabasesInsertCall {
3985	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3986	return c
3987}
3988
3989// Context sets the context to be used in this call's Do method. Any
3990// pending HTTP request will be aborted if the provided context is
3991// canceled.
3992func (c *DatabasesInsertCall) Context(ctx context.Context) *DatabasesInsertCall {
3993	c.ctx_ = ctx
3994	return c
3995}
3996
3997// Header returns an http.Header that can be modified by the caller to
3998// add HTTP headers to the request.
3999func (c *DatabasesInsertCall) Header() http.Header {
4000	if c.header_ == nil {
4001		c.header_ = make(http.Header)
4002	}
4003	return c.header_
4004}
4005
4006func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) {
4007	reqHeaders := make(http.Header)
4008	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4009	for k, v := range c.header_ {
4010		reqHeaders[k] = v
4011	}
4012	reqHeaders.Set("User-Agent", c.s.userAgent())
4013	var body io.Reader = nil
4014	body, err := googleapi.WithoutDataWrapper.JSONReader(c.database)
4015	if err != nil {
4016		return nil, err
4017	}
4018	reqHeaders.Set("Content-Type", "application/json")
4019	c.urlParams_.Set("alt", alt)
4020	c.urlParams_.Set("prettyPrint", "false")
4021	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases")
4022	urls += "?" + c.urlParams_.Encode()
4023	req, err := http.NewRequest("POST", urls, body)
4024	if err != nil {
4025		return nil, err
4026	}
4027	req.Header = reqHeaders
4028	googleapi.Expand(req.URL, map[string]string{
4029		"project":  c.project,
4030		"instance": c.instance,
4031	})
4032	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4033}
4034
4035// Do executes the "sql.databases.insert" call.
4036// Exactly one of *Operation or error will be non-nil. Any non-2xx
4037// status code is an error. Response headers are in either
4038// *Operation.ServerResponse.Header or (if a response was returned at
4039// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4040// to check whether the returned error was because
4041// http.StatusNotModified was returned.
4042func (c *DatabasesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4043	gensupport.SetOptions(c.urlParams_, opts...)
4044	res, err := c.doRequest("json")
4045	if res != nil && res.StatusCode == http.StatusNotModified {
4046		if res.Body != nil {
4047			res.Body.Close()
4048		}
4049		return nil, &googleapi.Error{
4050			Code:   res.StatusCode,
4051			Header: res.Header,
4052		}
4053	}
4054	if err != nil {
4055		return nil, err
4056	}
4057	defer googleapi.CloseBody(res)
4058	if err := googleapi.CheckResponse(res); err != nil {
4059		return nil, err
4060	}
4061	ret := &Operation{
4062		ServerResponse: googleapi.ServerResponse{
4063			Header:         res.Header,
4064			HTTPStatusCode: res.StatusCode,
4065		},
4066	}
4067	target := &ret
4068	if err := gensupport.DecodeResponse(target, res); err != nil {
4069		return nil, err
4070	}
4071	return ret, nil
4072	// {
4073	//   "description": "Inserts a resource containing information about a database inside a Cloud SQL instance.",
4074	//   "httpMethod": "POST",
4075	//   "id": "sql.databases.insert",
4076	//   "parameterOrder": [
4077	//     "project",
4078	//     "instance"
4079	//   ],
4080	//   "parameters": {
4081	//     "instance": {
4082	//       "description": "Database instance ID. This does not include the project ID.",
4083	//       "location": "path",
4084	//       "required": true,
4085	//       "type": "string"
4086	//     },
4087	//     "project": {
4088	//       "description": "Project ID of the project that contains the instance.",
4089	//       "location": "path",
4090	//       "required": true,
4091	//       "type": "string"
4092	//     }
4093	//   },
4094	//   "path": "projects/{project}/instances/{instance}/databases",
4095	//   "request": {
4096	//     "$ref": "Database"
4097	//   },
4098	//   "response": {
4099	//     "$ref": "Operation"
4100	//   },
4101	//   "scopes": [
4102	//     "https://www.googleapis.com/auth/cloud-platform",
4103	//     "https://www.googleapis.com/auth/sqlservice.admin"
4104	//   ]
4105	// }
4106
4107}
4108
4109// method id "sql.databases.list":
4110
4111type DatabasesListCall struct {
4112	s            *Service
4113	project      string
4114	instance     string
4115	urlParams_   gensupport.URLParams
4116	ifNoneMatch_ string
4117	ctx_         context.Context
4118	header_      http.Header
4119}
4120
4121// List: Lists databases in the specified Cloud SQL instance.
4122func (r *DatabasesService) List(project string, instance string) *DatabasesListCall {
4123	c := &DatabasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4124	c.project = project
4125	c.instance = instance
4126	return c
4127}
4128
4129// Fields allows partial responses to be retrieved. See
4130// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4131// for more information.
4132func (c *DatabasesListCall) Fields(s ...googleapi.Field) *DatabasesListCall {
4133	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4134	return c
4135}
4136
4137// IfNoneMatch sets the optional parameter which makes the operation
4138// fail if the object's ETag matches the given value. This is useful for
4139// getting updates only after the object has changed since the last
4140// request. Use googleapi.IsNotModified to check whether the response
4141// error from Do is the result of In-None-Match.
4142func (c *DatabasesListCall) IfNoneMatch(entityTag string) *DatabasesListCall {
4143	c.ifNoneMatch_ = entityTag
4144	return c
4145}
4146
4147// Context sets the context to be used in this call's Do method. Any
4148// pending HTTP request will be aborted if the provided context is
4149// canceled.
4150func (c *DatabasesListCall) Context(ctx context.Context) *DatabasesListCall {
4151	c.ctx_ = ctx
4152	return c
4153}
4154
4155// Header returns an http.Header that can be modified by the caller to
4156// add HTTP headers to the request.
4157func (c *DatabasesListCall) Header() http.Header {
4158	if c.header_ == nil {
4159		c.header_ = make(http.Header)
4160	}
4161	return c.header_
4162}
4163
4164func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) {
4165	reqHeaders := make(http.Header)
4166	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4167	for k, v := range c.header_ {
4168		reqHeaders[k] = v
4169	}
4170	reqHeaders.Set("User-Agent", c.s.userAgent())
4171	if c.ifNoneMatch_ != "" {
4172		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4173	}
4174	var body io.Reader = nil
4175	c.urlParams_.Set("alt", alt)
4176	c.urlParams_.Set("prettyPrint", "false")
4177	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases")
4178	urls += "?" + c.urlParams_.Encode()
4179	req, err := http.NewRequest("GET", urls, body)
4180	if err != nil {
4181		return nil, err
4182	}
4183	req.Header = reqHeaders
4184	googleapi.Expand(req.URL, map[string]string{
4185		"project":  c.project,
4186		"instance": c.instance,
4187	})
4188	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4189}
4190
4191// Do executes the "sql.databases.list" call.
4192// Exactly one of *DatabasesListResponse or error will be non-nil. Any
4193// non-2xx status code is an error. Response headers are in either
4194// *DatabasesListResponse.ServerResponse.Header or (if a response was
4195// returned at all) in error.(*googleapi.Error).Header. Use
4196// googleapi.IsNotModified to check whether the returned error was
4197// because http.StatusNotModified was returned.
4198func (c *DatabasesListCall) Do(opts ...googleapi.CallOption) (*DatabasesListResponse, error) {
4199	gensupport.SetOptions(c.urlParams_, opts...)
4200	res, err := c.doRequest("json")
4201	if res != nil && res.StatusCode == http.StatusNotModified {
4202		if res.Body != nil {
4203			res.Body.Close()
4204		}
4205		return nil, &googleapi.Error{
4206			Code:   res.StatusCode,
4207			Header: res.Header,
4208		}
4209	}
4210	if err != nil {
4211		return nil, err
4212	}
4213	defer googleapi.CloseBody(res)
4214	if err := googleapi.CheckResponse(res); err != nil {
4215		return nil, err
4216	}
4217	ret := &DatabasesListResponse{
4218		ServerResponse: googleapi.ServerResponse{
4219			Header:         res.Header,
4220			HTTPStatusCode: res.StatusCode,
4221		},
4222	}
4223	target := &ret
4224	if err := gensupport.DecodeResponse(target, res); err != nil {
4225		return nil, err
4226	}
4227	return ret, nil
4228	// {
4229	//   "description": "Lists databases in the specified Cloud SQL instance.",
4230	//   "httpMethod": "GET",
4231	//   "id": "sql.databases.list",
4232	//   "parameterOrder": [
4233	//     "project",
4234	//     "instance"
4235	//   ],
4236	//   "parameters": {
4237	//     "instance": {
4238	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
4239	//       "location": "path",
4240	//       "required": true,
4241	//       "type": "string"
4242	//     },
4243	//     "project": {
4244	//       "description": "Project ID of the project that contains the instance.",
4245	//       "location": "path",
4246	//       "required": true,
4247	//       "type": "string"
4248	//     }
4249	//   },
4250	//   "path": "projects/{project}/instances/{instance}/databases",
4251	//   "response": {
4252	//     "$ref": "DatabasesListResponse"
4253	//   },
4254	//   "scopes": [
4255	//     "https://www.googleapis.com/auth/cloud-platform",
4256	//     "https://www.googleapis.com/auth/sqlservice.admin"
4257	//   ]
4258	// }
4259
4260}
4261
4262// method id "sql.databases.patch":
4263
4264type DatabasesPatchCall struct {
4265	s          *Service
4266	project    string
4267	instance   string
4268	database   string
4269	database2  *Database
4270	urlParams_ gensupport.URLParams
4271	ctx_       context.Context
4272	header_    http.Header
4273}
4274
4275// Patch: Updates a resource containing information about a database
4276// inside a Cloud SQL instance. This method supports patch semantics.
4277func (r *DatabasesService) Patch(project string, instance string, database string, database2 *Database) *DatabasesPatchCall {
4278	c := &DatabasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4279	c.project = project
4280	c.instance = instance
4281	c.database = database
4282	c.database2 = database2
4283	return c
4284}
4285
4286// Fields allows partial responses to be retrieved. See
4287// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4288// for more information.
4289func (c *DatabasesPatchCall) Fields(s ...googleapi.Field) *DatabasesPatchCall {
4290	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4291	return c
4292}
4293
4294// Context sets the context to be used in this call's Do method. Any
4295// pending HTTP request will be aborted if the provided context is
4296// canceled.
4297func (c *DatabasesPatchCall) Context(ctx context.Context) *DatabasesPatchCall {
4298	c.ctx_ = ctx
4299	return c
4300}
4301
4302// Header returns an http.Header that can be modified by the caller to
4303// add HTTP headers to the request.
4304func (c *DatabasesPatchCall) Header() http.Header {
4305	if c.header_ == nil {
4306		c.header_ = make(http.Header)
4307	}
4308	return c.header_
4309}
4310
4311func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) {
4312	reqHeaders := make(http.Header)
4313	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4314	for k, v := range c.header_ {
4315		reqHeaders[k] = v
4316	}
4317	reqHeaders.Set("User-Agent", c.s.userAgent())
4318	var body io.Reader = nil
4319	body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2)
4320	if err != nil {
4321		return nil, err
4322	}
4323	reqHeaders.Set("Content-Type", "application/json")
4324	c.urlParams_.Set("alt", alt)
4325	c.urlParams_.Set("prettyPrint", "false")
4326	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}")
4327	urls += "?" + c.urlParams_.Encode()
4328	req, err := http.NewRequest("PATCH", urls, body)
4329	if err != nil {
4330		return nil, err
4331	}
4332	req.Header = reqHeaders
4333	googleapi.Expand(req.URL, map[string]string{
4334		"project":  c.project,
4335		"instance": c.instance,
4336		"database": c.database,
4337	})
4338	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4339}
4340
4341// Do executes the "sql.databases.patch" call.
4342// Exactly one of *Operation or error will be non-nil. Any non-2xx
4343// status code is an error. Response headers are in either
4344// *Operation.ServerResponse.Header or (if a response was returned at
4345// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4346// to check whether the returned error was because
4347// http.StatusNotModified was returned.
4348func (c *DatabasesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4349	gensupport.SetOptions(c.urlParams_, opts...)
4350	res, err := c.doRequest("json")
4351	if res != nil && res.StatusCode == http.StatusNotModified {
4352		if res.Body != nil {
4353			res.Body.Close()
4354		}
4355		return nil, &googleapi.Error{
4356			Code:   res.StatusCode,
4357			Header: res.Header,
4358		}
4359	}
4360	if err != nil {
4361		return nil, err
4362	}
4363	defer googleapi.CloseBody(res)
4364	if err := googleapi.CheckResponse(res); err != nil {
4365		return nil, err
4366	}
4367	ret := &Operation{
4368		ServerResponse: googleapi.ServerResponse{
4369			Header:         res.Header,
4370			HTTPStatusCode: res.StatusCode,
4371		},
4372	}
4373	target := &ret
4374	if err := gensupport.DecodeResponse(target, res); err != nil {
4375		return nil, err
4376	}
4377	return ret, nil
4378	// {
4379	//   "description": "Updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.",
4380	//   "httpMethod": "PATCH",
4381	//   "id": "sql.databases.patch",
4382	//   "parameterOrder": [
4383	//     "project",
4384	//     "instance",
4385	//     "database"
4386	//   ],
4387	//   "parameters": {
4388	//     "database": {
4389	//       "description": "Name of the database to be updated in the instance.",
4390	//       "location": "path",
4391	//       "required": true,
4392	//       "type": "string"
4393	//     },
4394	//     "instance": {
4395	//       "description": "Database instance ID. This does not include the project ID.",
4396	//       "location": "path",
4397	//       "required": true,
4398	//       "type": "string"
4399	//     },
4400	//     "project": {
4401	//       "description": "Project ID of the project that contains the instance.",
4402	//       "location": "path",
4403	//       "required": true,
4404	//       "type": "string"
4405	//     }
4406	//   },
4407	//   "path": "projects/{project}/instances/{instance}/databases/{database}",
4408	//   "request": {
4409	//     "$ref": "Database"
4410	//   },
4411	//   "response": {
4412	//     "$ref": "Operation"
4413	//   },
4414	//   "scopes": [
4415	//     "https://www.googleapis.com/auth/cloud-platform",
4416	//     "https://www.googleapis.com/auth/sqlservice.admin"
4417	//   ]
4418	// }
4419
4420}
4421
4422// method id "sql.databases.update":
4423
4424type DatabasesUpdateCall struct {
4425	s          *Service
4426	project    string
4427	instance   string
4428	database   string
4429	database2  *Database
4430	urlParams_ gensupport.URLParams
4431	ctx_       context.Context
4432	header_    http.Header
4433}
4434
4435// Update: Updates a resource containing information about a database
4436// inside a Cloud SQL instance.
4437func (r *DatabasesService) Update(project string, instance string, database string, database2 *Database) *DatabasesUpdateCall {
4438	c := &DatabasesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4439	c.project = project
4440	c.instance = instance
4441	c.database = database
4442	c.database2 = database2
4443	return c
4444}
4445
4446// Fields allows partial responses to be retrieved. See
4447// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4448// for more information.
4449func (c *DatabasesUpdateCall) Fields(s ...googleapi.Field) *DatabasesUpdateCall {
4450	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4451	return c
4452}
4453
4454// Context sets the context to be used in this call's Do method. Any
4455// pending HTTP request will be aborted if the provided context is
4456// canceled.
4457func (c *DatabasesUpdateCall) Context(ctx context.Context) *DatabasesUpdateCall {
4458	c.ctx_ = ctx
4459	return c
4460}
4461
4462// Header returns an http.Header that can be modified by the caller to
4463// add HTTP headers to the request.
4464func (c *DatabasesUpdateCall) Header() http.Header {
4465	if c.header_ == nil {
4466		c.header_ = make(http.Header)
4467	}
4468	return c.header_
4469}
4470
4471func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) {
4472	reqHeaders := make(http.Header)
4473	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4474	for k, v := range c.header_ {
4475		reqHeaders[k] = v
4476	}
4477	reqHeaders.Set("User-Agent", c.s.userAgent())
4478	var body io.Reader = nil
4479	body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2)
4480	if err != nil {
4481		return nil, err
4482	}
4483	reqHeaders.Set("Content-Type", "application/json")
4484	c.urlParams_.Set("alt", alt)
4485	c.urlParams_.Set("prettyPrint", "false")
4486	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}")
4487	urls += "?" + c.urlParams_.Encode()
4488	req, err := http.NewRequest("PUT", urls, body)
4489	if err != nil {
4490		return nil, err
4491	}
4492	req.Header = reqHeaders
4493	googleapi.Expand(req.URL, map[string]string{
4494		"project":  c.project,
4495		"instance": c.instance,
4496		"database": c.database,
4497	})
4498	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4499}
4500
4501// Do executes the "sql.databases.update" call.
4502// Exactly one of *Operation or error will be non-nil. Any non-2xx
4503// status code is an error. Response headers are in either
4504// *Operation.ServerResponse.Header or (if a response was returned at
4505// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4506// to check whether the returned error was because
4507// http.StatusNotModified was returned.
4508func (c *DatabasesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4509	gensupport.SetOptions(c.urlParams_, opts...)
4510	res, err := c.doRequest("json")
4511	if res != nil && res.StatusCode == http.StatusNotModified {
4512		if res.Body != nil {
4513			res.Body.Close()
4514		}
4515		return nil, &googleapi.Error{
4516			Code:   res.StatusCode,
4517			Header: res.Header,
4518		}
4519	}
4520	if err != nil {
4521		return nil, err
4522	}
4523	defer googleapi.CloseBody(res)
4524	if err := googleapi.CheckResponse(res); err != nil {
4525		return nil, err
4526	}
4527	ret := &Operation{
4528		ServerResponse: googleapi.ServerResponse{
4529			Header:         res.Header,
4530			HTTPStatusCode: res.StatusCode,
4531		},
4532	}
4533	target := &ret
4534	if err := gensupport.DecodeResponse(target, res); err != nil {
4535		return nil, err
4536	}
4537	return ret, nil
4538	// {
4539	//   "description": "Updates a resource containing information about a database inside a Cloud SQL instance.",
4540	//   "httpMethod": "PUT",
4541	//   "id": "sql.databases.update",
4542	//   "parameterOrder": [
4543	//     "project",
4544	//     "instance",
4545	//     "database"
4546	//   ],
4547	//   "parameters": {
4548	//     "database": {
4549	//       "description": "Name of the database to be updated in the instance.",
4550	//       "location": "path",
4551	//       "required": true,
4552	//       "type": "string"
4553	//     },
4554	//     "instance": {
4555	//       "description": "Database instance ID. This does not include the project ID.",
4556	//       "location": "path",
4557	//       "required": true,
4558	//       "type": "string"
4559	//     },
4560	//     "project": {
4561	//       "description": "Project ID of the project that contains the instance.",
4562	//       "location": "path",
4563	//       "required": true,
4564	//       "type": "string"
4565	//     }
4566	//   },
4567	//   "path": "projects/{project}/instances/{instance}/databases/{database}",
4568	//   "request": {
4569	//     "$ref": "Database"
4570	//   },
4571	//   "response": {
4572	//     "$ref": "Operation"
4573	//   },
4574	//   "scopes": [
4575	//     "https://www.googleapis.com/auth/cloud-platform",
4576	//     "https://www.googleapis.com/auth/sqlservice.admin"
4577	//   ]
4578	// }
4579
4580}
4581
4582// method id "sql.flags.list":
4583
4584type FlagsListCall struct {
4585	s            *Service
4586	urlParams_   gensupport.URLParams
4587	ifNoneMatch_ string
4588	ctx_         context.Context
4589	header_      http.Header
4590}
4591
4592// List: List all available database flags for Cloud SQL instances.
4593func (r *FlagsService) List() *FlagsListCall {
4594	c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4595	return c
4596}
4597
4598// DatabaseVersion sets the optional parameter "databaseVersion":
4599// Database type and version you want to retrieve flags for. By default,
4600// this method returns flags for all database types and versions.
4601func (c *FlagsListCall) DatabaseVersion(databaseVersion string) *FlagsListCall {
4602	c.urlParams_.Set("databaseVersion", databaseVersion)
4603	return c
4604}
4605
4606// Fields allows partial responses to be retrieved. See
4607// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4608// for more information.
4609func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall {
4610	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4611	return c
4612}
4613
4614// IfNoneMatch sets the optional parameter which makes the operation
4615// fail if the object's ETag matches the given value. This is useful for
4616// getting updates only after the object has changed since the last
4617// request. Use googleapi.IsNotModified to check whether the response
4618// error from Do is the result of In-None-Match.
4619func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall {
4620	c.ifNoneMatch_ = entityTag
4621	return c
4622}
4623
4624// Context sets the context to be used in this call's Do method. Any
4625// pending HTTP request will be aborted if the provided context is
4626// canceled.
4627func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall {
4628	c.ctx_ = ctx
4629	return c
4630}
4631
4632// Header returns an http.Header that can be modified by the caller to
4633// add HTTP headers to the request.
4634func (c *FlagsListCall) Header() http.Header {
4635	if c.header_ == nil {
4636		c.header_ = make(http.Header)
4637	}
4638	return c.header_
4639}
4640
4641func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) {
4642	reqHeaders := make(http.Header)
4643	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4644	for k, v := range c.header_ {
4645		reqHeaders[k] = v
4646	}
4647	reqHeaders.Set("User-Agent", c.s.userAgent())
4648	if c.ifNoneMatch_ != "" {
4649		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4650	}
4651	var body io.Reader = nil
4652	c.urlParams_.Set("alt", alt)
4653	c.urlParams_.Set("prettyPrint", "false")
4654	urls := googleapi.ResolveRelative(c.s.BasePath, "flags")
4655	urls += "?" + c.urlParams_.Encode()
4656	req, err := http.NewRequest("GET", urls, body)
4657	if err != nil {
4658		return nil, err
4659	}
4660	req.Header = reqHeaders
4661	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4662}
4663
4664// Do executes the "sql.flags.list" call.
4665// Exactly one of *FlagsListResponse or error will be non-nil. Any
4666// non-2xx status code is an error. Response headers are in either
4667// *FlagsListResponse.ServerResponse.Header or (if a response was
4668// returned at all) in error.(*googleapi.Error).Header. Use
4669// googleapi.IsNotModified to check whether the returned error was
4670// because http.StatusNotModified was returned.
4671func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) {
4672	gensupport.SetOptions(c.urlParams_, opts...)
4673	res, err := c.doRequest("json")
4674	if res != nil && res.StatusCode == http.StatusNotModified {
4675		if res.Body != nil {
4676			res.Body.Close()
4677		}
4678		return nil, &googleapi.Error{
4679			Code:   res.StatusCode,
4680			Header: res.Header,
4681		}
4682	}
4683	if err != nil {
4684		return nil, err
4685	}
4686	defer googleapi.CloseBody(res)
4687	if err := googleapi.CheckResponse(res); err != nil {
4688		return nil, err
4689	}
4690	ret := &FlagsListResponse{
4691		ServerResponse: googleapi.ServerResponse{
4692			Header:         res.Header,
4693			HTTPStatusCode: res.StatusCode,
4694		},
4695	}
4696	target := &ret
4697	if err := gensupport.DecodeResponse(target, res); err != nil {
4698		return nil, err
4699	}
4700	return ret, nil
4701	// {
4702	//   "description": "List all available database flags for Cloud SQL instances.",
4703	//   "httpMethod": "GET",
4704	//   "id": "sql.flags.list",
4705	//   "parameters": {
4706	//     "databaseVersion": {
4707	//       "description": "Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions.",
4708	//       "location": "query",
4709	//       "type": "string"
4710	//     }
4711	//   },
4712	//   "path": "flags",
4713	//   "response": {
4714	//     "$ref": "FlagsListResponse"
4715	//   },
4716	//   "scopes": [
4717	//     "https://www.googleapis.com/auth/cloud-platform",
4718	//     "https://www.googleapis.com/auth/sqlservice.admin"
4719	//   ]
4720	// }
4721
4722}
4723
4724// method id "sql.instances.addServerCa":
4725
4726type InstancesAddServerCaCall struct {
4727	s          *Service
4728	project    string
4729	instance   string
4730	urlParams_ gensupport.URLParams
4731	ctx_       context.Context
4732	header_    http.Header
4733}
4734
4735// AddServerCa: Add a new trusted Certificate Authority (CA) version for
4736// the specified instance. Required to prepare for a certificate
4737// rotation. If a CA version was previously added but never used in a
4738// certificate rotation, this operation replaces that version. There
4739// cannot be more than one CA version waiting to be rotated in.
4740func (r *InstancesService) AddServerCa(project string, instance string) *InstancesAddServerCaCall {
4741	c := &InstancesAddServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4742	c.project = project
4743	c.instance = instance
4744	return c
4745}
4746
4747// Fields allows partial responses to be retrieved. See
4748// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4749// for more information.
4750func (c *InstancesAddServerCaCall) Fields(s ...googleapi.Field) *InstancesAddServerCaCall {
4751	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4752	return c
4753}
4754
4755// Context sets the context to be used in this call's Do method. Any
4756// pending HTTP request will be aborted if the provided context is
4757// canceled.
4758func (c *InstancesAddServerCaCall) Context(ctx context.Context) *InstancesAddServerCaCall {
4759	c.ctx_ = ctx
4760	return c
4761}
4762
4763// Header returns an http.Header that can be modified by the caller to
4764// add HTTP headers to the request.
4765func (c *InstancesAddServerCaCall) Header() http.Header {
4766	if c.header_ == nil {
4767		c.header_ = make(http.Header)
4768	}
4769	return c.header_
4770}
4771
4772func (c *InstancesAddServerCaCall) doRequest(alt string) (*http.Response, error) {
4773	reqHeaders := make(http.Header)
4774	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4775	for k, v := range c.header_ {
4776		reqHeaders[k] = v
4777	}
4778	reqHeaders.Set("User-Agent", c.s.userAgent())
4779	var body io.Reader = nil
4780	c.urlParams_.Set("alt", alt)
4781	c.urlParams_.Set("prettyPrint", "false")
4782	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/addServerCa")
4783	urls += "?" + c.urlParams_.Encode()
4784	req, err := http.NewRequest("POST", urls, body)
4785	if err != nil {
4786		return nil, err
4787	}
4788	req.Header = reqHeaders
4789	googleapi.Expand(req.URL, map[string]string{
4790		"project":  c.project,
4791		"instance": c.instance,
4792	})
4793	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4794}
4795
4796// Do executes the "sql.instances.addServerCa" call.
4797// Exactly one of *Operation or error will be non-nil. Any non-2xx
4798// status code is an error. Response headers are in either
4799// *Operation.ServerResponse.Header or (if a response was returned at
4800// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4801// to check whether the returned error was because
4802// http.StatusNotModified was returned.
4803func (c *InstancesAddServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4804	gensupport.SetOptions(c.urlParams_, opts...)
4805	res, err := c.doRequest("json")
4806	if res != nil && res.StatusCode == http.StatusNotModified {
4807		if res.Body != nil {
4808			res.Body.Close()
4809		}
4810		return nil, &googleapi.Error{
4811			Code:   res.StatusCode,
4812			Header: res.Header,
4813		}
4814	}
4815	if err != nil {
4816		return nil, err
4817	}
4818	defer googleapi.CloseBody(res)
4819	if err := googleapi.CheckResponse(res); err != nil {
4820		return nil, err
4821	}
4822	ret := &Operation{
4823		ServerResponse: googleapi.ServerResponse{
4824			Header:         res.Header,
4825			HTTPStatusCode: res.StatusCode,
4826		},
4827	}
4828	target := &ret
4829	if err := gensupport.DecodeResponse(target, res); err != nil {
4830		return nil, err
4831	}
4832	return ret, nil
4833	// {
4834	//   "description": "Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in.",
4835	//   "httpMethod": "POST",
4836	//   "id": "sql.instances.addServerCa",
4837	//   "parameterOrder": [
4838	//     "project",
4839	//     "instance"
4840	//   ],
4841	//   "parameters": {
4842	//     "instance": {
4843	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
4844	//       "location": "path",
4845	//       "required": true,
4846	//       "type": "string"
4847	//     },
4848	//     "project": {
4849	//       "description": "Project ID of the project that contains the instance.",
4850	//       "location": "path",
4851	//       "required": true,
4852	//       "type": "string"
4853	//     }
4854	//   },
4855	//   "path": "projects/{project}/instances/{instance}/addServerCa",
4856	//   "response": {
4857	//     "$ref": "Operation"
4858	//   },
4859	//   "scopes": [
4860	//     "https://www.googleapis.com/auth/cloud-platform",
4861	//     "https://www.googleapis.com/auth/sqlservice.admin"
4862	//   ]
4863	// }
4864
4865}
4866
4867// method id "sql.instances.clone":
4868
4869type InstancesCloneCall struct {
4870	s                     *Service
4871	project               string
4872	instance              string
4873	instancesclonerequest *InstancesCloneRequest
4874	urlParams_            gensupport.URLParams
4875	ctx_                  context.Context
4876	header_               http.Header
4877}
4878
4879// Clone: Creates a Cloud SQL instance as a clone of the source
4880// instance.
4881func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall {
4882	c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4883	c.project = project
4884	c.instance = instance
4885	c.instancesclonerequest = instancesclonerequest
4886	return c
4887}
4888
4889// Fields allows partial responses to be retrieved. See
4890// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4891// for more information.
4892func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall {
4893	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4894	return c
4895}
4896
4897// Context sets the context to be used in this call's Do method. Any
4898// pending HTTP request will be aborted if the provided context is
4899// canceled.
4900func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall {
4901	c.ctx_ = ctx
4902	return c
4903}
4904
4905// Header returns an http.Header that can be modified by the caller to
4906// add HTTP headers to the request.
4907func (c *InstancesCloneCall) Header() http.Header {
4908	if c.header_ == nil {
4909		c.header_ = make(http.Header)
4910	}
4911	return c.header_
4912}
4913
4914func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) {
4915	reqHeaders := make(http.Header)
4916	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4917	for k, v := range c.header_ {
4918		reqHeaders[k] = v
4919	}
4920	reqHeaders.Set("User-Agent", c.s.userAgent())
4921	var body io.Reader = nil
4922	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest)
4923	if err != nil {
4924		return nil, err
4925	}
4926	reqHeaders.Set("Content-Type", "application/json")
4927	c.urlParams_.Set("alt", alt)
4928	c.urlParams_.Set("prettyPrint", "false")
4929	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/clone")
4930	urls += "?" + c.urlParams_.Encode()
4931	req, err := http.NewRequest("POST", urls, body)
4932	if err != nil {
4933		return nil, err
4934	}
4935	req.Header = reqHeaders
4936	googleapi.Expand(req.URL, map[string]string{
4937		"project":  c.project,
4938		"instance": c.instance,
4939	})
4940	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4941}
4942
4943// Do executes the "sql.instances.clone" call.
4944// Exactly one of *Operation or error will be non-nil. Any non-2xx
4945// status code is an error. Response headers are in either
4946// *Operation.ServerResponse.Header or (if a response was returned at
4947// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4948// to check whether the returned error was because
4949// http.StatusNotModified was returned.
4950func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4951	gensupport.SetOptions(c.urlParams_, opts...)
4952	res, err := c.doRequest("json")
4953	if res != nil && res.StatusCode == http.StatusNotModified {
4954		if res.Body != nil {
4955			res.Body.Close()
4956		}
4957		return nil, &googleapi.Error{
4958			Code:   res.StatusCode,
4959			Header: res.Header,
4960		}
4961	}
4962	if err != nil {
4963		return nil, err
4964	}
4965	defer googleapi.CloseBody(res)
4966	if err := googleapi.CheckResponse(res); err != nil {
4967		return nil, err
4968	}
4969	ret := &Operation{
4970		ServerResponse: googleapi.ServerResponse{
4971			Header:         res.Header,
4972			HTTPStatusCode: res.StatusCode,
4973		},
4974	}
4975	target := &ret
4976	if err := gensupport.DecodeResponse(target, res); err != nil {
4977		return nil, err
4978	}
4979	return ret, nil
4980	// {
4981	//   "description": "Creates a Cloud SQL instance as a clone of the source instance.",
4982	//   "httpMethod": "POST",
4983	//   "id": "sql.instances.clone",
4984	//   "parameterOrder": [
4985	//     "project",
4986	//     "instance"
4987	//   ],
4988	//   "parameters": {
4989	//     "instance": {
4990	//       "description": "The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.",
4991	//       "location": "path",
4992	//       "required": true,
4993	//       "type": "string"
4994	//     },
4995	//     "project": {
4996	//       "description": "Project ID of the source as well as the clone Cloud SQL instance.",
4997	//       "location": "path",
4998	//       "required": true,
4999	//       "type": "string"
5000	//     }
5001	//   },
5002	//   "path": "projects/{project}/instances/{instance}/clone",
5003	//   "request": {
5004	//     "$ref": "InstancesCloneRequest"
5005	//   },
5006	//   "response": {
5007	//     "$ref": "Operation"
5008	//   },
5009	//   "scopes": [
5010	//     "https://www.googleapis.com/auth/cloud-platform",
5011	//     "https://www.googleapis.com/auth/sqlservice.admin"
5012	//   ]
5013	// }
5014
5015}
5016
5017// method id "sql.instances.delete":
5018
5019type InstancesDeleteCall struct {
5020	s          *Service
5021	project    string
5022	instance   string
5023	urlParams_ gensupport.URLParams
5024	ctx_       context.Context
5025	header_    http.Header
5026}
5027
5028// Delete: Deletes a Cloud SQL instance.
5029func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall {
5030	c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5031	c.project = project
5032	c.instance = instance
5033	return c
5034}
5035
5036// Fields allows partial responses to be retrieved. See
5037// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5038// for more information.
5039func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
5040	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5041	return c
5042}
5043
5044// Context sets the context to be used in this call's Do method. Any
5045// pending HTTP request will be aborted if the provided context is
5046// canceled.
5047func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
5048	c.ctx_ = ctx
5049	return c
5050}
5051
5052// Header returns an http.Header that can be modified by the caller to
5053// add HTTP headers to the request.
5054func (c *InstancesDeleteCall) Header() http.Header {
5055	if c.header_ == nil {
5056		c.header_ = make(http.Header)
5057	}
5058	return c.header_
5059}
5060
5061func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
5062	reqHeaders := make(http.Header)
5063	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5064	for k, v := range c.header_ {
5065		reqHeaders[k] = v
5066	}
5067	reqHeaders.Set("User-Agent", c.s.userAgent())
5068	var body io.Reader = nil
5069	c.urlParams_.Set("alt", alt)
5070	c.urlParams_.Set("prettyPrint", "false")
5071	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
5072	urls += "?" + c.urlParams_.Encode()
5073	req, err := http.NewRequest("DELETE", urls, body)
5074	if err != nil {
5075		return nil, err
5076	}
5077	req.Header = reqHeaders
5078	googleapi.Expand(req.URL, map[string]string{
5079		"project":  c.project,
5080		"instance": c.instance,
5081	})
5082	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5083}
5084
5085// Do executes the "sql.instances.delete" call.
5086// Exactly one of *Operation or error will be non-nil. Any non-2xx
5087// status code is an error. Response headers are in either
5088// *Operation.ServerResponse.Header or (if a response was returned at
5089// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5090// to check whether the returned error was because
5091// http.StatusNotModified was returned.
5092func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5093	gensupport.SetOptions(c.urlParams_, opts...)
5094	res, err := c.doRequest("json")
5095	if res != nil && res.StatusCode == http.StatusNotModified {
5096		if res.Body != nil {
5097			res.Body.Close()
5098		}
5099		return nil, &googleapi.Error{
5100			Code:   res.StatusCode,
5101			Header: res.Header,
5102		}
5103	}
5104	if err != nil {
5105		return nil, err
5106	}
5107	defer googleapi.CloseBody(res)
5108	if err := googleapi.CheckResponse(res); err != nil {
5109		return nil, err
5110	}
5111	ret := &Operation{
5112		ServerResponse: googleapi.ServerResponse{
5113			Header:         res.Header,
5114			HTTPStatusCode: res.StatusCode,
5115		},
5116	}
5117	target := &ret
5118	if err := gensupport.DecodeResponse(target, res); err != nil {
5119		return nil, err
5120	}
5121	return ret, nil
5122	// {
5123	//   "description": "Deletes a Cloud SQL instance.",
5124	//   "httpMethod": "DELETE",
5125	//   "id": "sql.instances.delete",
5126	//   "parameterOrder": [
5127	//     "project",
5128	//     "instance"
5129	//   ],
5130	//   "parameters": {
5131	//     "instance": {
5132	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
5133	//       "location": "path",
5134	//       "required": true,
5135	//       "type": "string"
5136	//     },
5137	//     "project": {
5138	//       "description": "Project ID of the project that contains the instance to be deleted.",
5139	//       "location": "path",
5140	//       "required": true,
5141	//       "type": "string"
5142	//     }
5143	//   },
5144	//   "path": "projects/{project}/instances/{instance}",
5145	//   "response": {
5146	//     "$ref": "Operation"
5147	//   },
5148	//   "scopes": [
5149	//     "https://www.googleapis.com/auth/cloud-platform",
5150	//     "https://www.googleapis.com/auth/sqlservice.admin"
5151	//   ]
5152	// }
5153
5154}
5155
5156// method id "sql.instances.demoteMaster":
5157
5158type InstancesDemoteMasterCall struct {
5159	s                            *Service
5160	project                      string
5161	instance                     string
5162	instancesdemotemasterrequest *InstancesDemoteMasterRequest
5163	urlParams_                   gensupport.URLParams
5164	ctx_                         context.Context
5165	header_                      http.Header
5166}
5167
5168// DemoteMaster: Demotes the stand-alone instance to be a Cloud SQL read
5169// replica for an external database server.
5170func (r *InstancesService) DemoteMaster(project string, instance string, instancesdemotemasterrequest *InstancesDemoteMasterRequest) *InstancesDemoteMasterCall {
5171	c := &InstancesDemoteMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5172	c.project = project
5173	c.instance = instance
5174	c.instancesdemotemasterrequest = instancesdemotemasterrequest
5175	return c
5176}
5177
5178// Fields allows partial responses to be retrieved. See
5179// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5180// for more information.
5181func (c *InstancesDemoteMasterCall) Fields(s ...googleapi.Field) *InstancesDemoteMasterCall {
5182	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5183	return c
5184}
5185
5186// Context sets the context to be used in this call's Do method. Any
5187// pending HTTP request will be aborted if the provided context is
5188// canceled.
5189func (c *InstancesDemoteMasterCall) Context(ctx context.Context) *InstancesDemoteMasterCall {
5190	c.ctx_ = ctx
5191	return c
5192}
5193
5194// Header returns an http.Header that can be modified by the caller to
5195// add HTTP headers to the request.
5196func (c *InstancesDemoteMasterCall) Header() http.Header {
5197	if c.header_ == nil {
5198		c.header_ = make(http.Header)
5199	}
5200	return c.header_
5201}
5202
5203func (c *InstancesDemoteMasterCall) doRequest(alt string) (*http.Response, error) {
5204	reqHeaders := make(http.Header)
5205	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5206	for k, v := range c.header_ {
5207		reqHeaders[k] = v
5208	}
5209	reqHeaders.Set("User-Agent", c.s.userAgent())
5210	var body io.Reader = nil
5211	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemotemasterrequest)
5212	if err != nil {
5213		return nil, err
5214	}
5215	reqHeaders.Set("Content-Type", "application/json")
5216	c.urlParams_.Set("alt", alt)
5217	c.urlParams_.Set("prettyPrint", "false")
5218	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/demoteMaster")
5219	urls += "?" + c.urlParams_.Encode()
5220	req, err := http.NewRequest("POST", urls, body)
5221	if err != nil {
5222		return nil, err
5223	}
5224	req.Header = reqHeaders
5225	googleapi.Expand(req.URL, map[string]string{
5226		"project":  c.project,
5227		"instance": c.instance,
5228	})
5229	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5230}
5231
5232// Do executes the "sql.instances.demoteMaster" call.
5233// Exactly one of *Operation or error will be non-nil. Any non-2xx
5234// status code is an error. Response headers are in either
5235// *Operation.ServerResponse.Header or (if a response was returned at
5236// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5237// to check whether the returned error was because
5238// http.StatusNotModified was returned.
5239func (c *InstancesDemoteMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5240	gensupport.SetOptions(c.urlParams_, opts...)
5241	res, err := c.doRequest("json")
5242	if res != nil && res.StatusCode == http.StatusNotModified {
5243		if res.Body != nil {
5244			res.Body.Close()
5245		}
5246		return nil, &googleapi.Error{
5247			Code:   res.StatusCode,
5248			Header: res.Header,
5249		}
5250	}
5251	if err != nil {
5252		return nil, err
5253	}
5254	defer googleapi.CloseBody(res)
5255	if err := googleapi.CheckResponse(res); err != nil {
5256		return nil, err
5257	}
5258	ret := &Operation{
5259		ServerResponse: googleapi.ServerResponse{
5260			Header:         res.Header,
5261			HTTPStatusCode: res.StatusCode,
5262		},
5263	}
5264	target := &ret
5265	if err := gensupport.DecodeResponse(target, res); err != nil {
5266		return nil, err
5267	}
5268	return ret, nil
5269	// {
5270	//   "description": "Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.",
5271	//   "httpMethod": "POST",
5272	//   "id": "sql.instances.demoteMaster",
5273	//   "parameterOrder": [
5274	//     "project",
5275	//     "instance"
5276	//   ],
5277	//   "parameters": {
5278	//     "instance": {
5279	//       "description": "Cloud SQL instance name.",
5280	//       "location": "path",
5281	//       "required": true,
5282	//       "type": "string"
5283	//     },
5284	//     "project": {
5285	//       "description": "ID of the project that contains the instance.",
5286	//       "location": "path",
5287	//       "required": true,
5288	//       "type": "string"
5289	//     }
5290	//   },
5291	//   "path": "projects/{project}/instances/{instance}/demoteMaster",
5292	//   "request": {
5293	//     "$ref": "InstancesDemoteMasterRequest"
5294	//   },
5295	//   "response": {
5296	//     "$ref": "Operation"
5297	//   },
5298	//   "scopes": [
5299	//     "https://www.googleapis.com/auth/cloud-platform",
5300	//     "https://www.googleapis.com/auth/sqlservice.admin"
5301	//   ]
5302	// }
5303
5304}
5305
5306// method id "sql.instances.export":
5307
5308type InstancesExportCall struct {
5309	s                      *Service
5310	project                string
5311	instance               string
5312	instancesexportrequest *InstancesExportRequest
5313	urlParams_             gensupport.URLParams
5314	ctx_                   context.Context
5315	header_                http.Header
5316}
5317
5318// Export: Exports data from a Cloud SQL instance to a Cloud Storage
5319// bucket as a SQL dump or CSV file.
5320func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall {
5321	c := &InstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5322	c.project = project
5323	c.instance = instance
5324	c.instancesexportrequest = instancesexportrequest
5325	return c
5326}
5327
5328// Fields allows partial responses to be retrieved. See
5329// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5330// for more information.
5331func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall {
5332	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5333	return c
5334}
5335
5336// Context sets the context to be used in this call's Do method. Any
5337// pending HTTP request will be aborted if the provided context is
5338// canceled.
5339func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall {
5340	c.ctx_ = ctx
5341	return c
5342}
5343
5344// Header returns an http.Header that can be modified by the caller to
5345// add HTTP headers to the request.
5346func (c *InstancesExportCall) Header() http.Header {
5347	if c.header_ == nil {
5348		c.header_ = make(http.Header)
5349	}
5350	return c.header_
5351}
5352
5353func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) {
5354	reqHeaders := make(http.Header)
5355	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5356	for k, v := range c.header_ {
5357		reqHeaders[k] = v
5358	}
5359	reqHeaders.Set("User-Agent", c.s.userAgent())
5360	var body io.Reader = nil
5361	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest)
5362	if err != nil {
5363		return nil, err
5364	}
5365	reqHeaders.Set("Content-Type", "application/json")
5366	c.urlParams_.Set("alt", alt)
5367	c.urlParams_.Set("prettyPrint", "false")
5368	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/export")
5369	urls += "?" + c.urlParams_.Encode()
5370	req, err := http.NewRequest("POST", urls, body)
5371	if err != nil {
5372		return nil, err
5373	}
5374	req.Header = reqHeaders
5375	googleapi.Expand(req.URL, map[string]string{
5376		"project":  c.project,
5377		"instance": c.instance,
5378	})
5379	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5380}
5381
5382// Do executes the "sql.instances.export" call.
5383// Exactly one of *Operation or error will be non-nil. Any non-2xx
5384// status code is an error. Response headers are in either
5385// *Operation.ServerResponse.Header or (if a response was returned at
5386// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5387// to check whether the returned error was because
5388// http.StatusNotModified was returned.
5389func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5390	gensupport.SetOptions(c.urlParams_, opts...)
5391	res, err := c.doRequest("json")
5392	if res != nil && res.StatusCode == http.StatusNotModified {
5393		if res.Body != nil {
5394			res.Body.Close()
5395		}
5396		return nil, &googleapi.Error{
5397			Code:   res.StatusCode,
5398			Header: res.Header,
5399		}
5400	}
5401	if err != nil {
5402		return nil, err
5403	}
5404	defer googleapi.CloseBody(res)
5405	if err := googleapi.CheckResponse(res); err != nil {
5406		return nil, err
5407	}
5408	ret := &Operation{
5409		ServerResponse: googleapi.ServerResponse{
5410			Header:         res.Header,
5411			HTTPStatusCode: res.StatusCode,
5412		},
5413	}
5414	target := &ret
5415	if err := gensupport.DecodeResponse(target, res); err != nil {
5416		return nil, err
5417	}
5418	return ret, nil
5419	// {
5420	//   "description": "Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.",
5421	//   "httpMethod": "POST",
5422	//   "id": "sql.instances.export",
5423	//   "parameterOrder": [
5424	//     "project",
5425	//     "instance"
5426	//   ],
5427	//   "parameters": {
5428	//     "instance": {
5429	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
5430	//       "location": "path",
5431	//       "required": true,
5432	//       "type": "string"
5433	//     },
5434	//     "project": {
5435	//       "description": "Project ID of the project that contains the instance to be exported.",
5436	//       "location": "path",
5437	//       "required": true,
5438	//       "type": "string"
5439	//     }
5440	//   },
5441	//   "path": "projects/{project}/instances/{instance}/export",
5442	//   "request": {
5443	//     "$ref": "InstancesExportRequest"
5444	//   },
5445	//   "response": {
5446	//     "$ref": "Operation"
5447	//   },
5448	//   "scopes": [
5449	//     "https://www.googleapis.com/auth/cloud-platform"
5450	//   ]
5451	// }
5452
5453}
5454
5455// method id "sql.instances.failover":
5456
5457type InstancesFailoverCall struct {
5458	s                        *Service
5459	project                  string
5460	instance                 string
5461	instancesfailoverrequest *InstancesFailoverRequest
5462	urlParams_               gensupport.URLParams
5463	ctx_                     context.Context
5464	header_                  http.Header
5465}
5466
5467// Failover: Failover the instance to its failover replica instance.
5468func (r *InstancesService) Failover(project string, instance string, instancesfailoverrequest *InstancesFailoverRequest) *InstancesFailoverCall {
5469	c := &InstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5470	c.project = project
5471	c.instance = instance
5472	c.instancesfailoverrequest = instancesfailoverrequest
5473	return c
5474}
5475
5476// Fields allows partial responses to be retrieved. See
5477// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5478// for more information.
5479func (c *InstancesFailoverCall) Fields(s ...googleapi.Field) *InstancesFailoverCall {
5480	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5481	return c
5482}
5483
5484// Context sets the context to be used in this call's Do method. Any
5485// pending HTTP request will be aborted if the provided context is
5486// canceled.
5487func (c *InstancesFailoverCall) Context(ctx context.Context) *InstancesFailoverCall {
5488	c.ctx_ = ctx
5489	return c
5490}
5491
5492// Header returns an http.Header that can be modified by the caller to
5493// add HTTP headers to the request.
5494func (c *InstancesFailoverCall) Header() http.Header {
5495	if c.header_ == nil {
5496		c.header_ = make(http.Header)
5497	}
5498	return c.header_
5499}
5500
5501func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) {
5502	reqHeaders := make(http.Header)
5503	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5504	for k, v := range c.header_ {
5505		reqHeaders[k] = v
5506	}
5507	reqHeaders.Set("User-Agent", c.s.userAgent())
5508	var body io.Reader = nil
5509	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest)
5510	if err != nil {
5511		return nil, err
5512	}
5513	reqHeaders.Set("Content-Type", "application/json")
5514	c.urlParams_.Set("alt", alt)
5515	c.urlParams_.Set("prettyPrint", "false")
5516	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/failover")
5517	urls += "?" + c.urlParams_.Encode()
5518	req, err := http.NewRequest("POST", urls, body)
5519	if err != nil {
5520		return nil, err
5521	}
5522	req.Header = reqHeaders
5523	googleapi.Expand(req.URL, map[string]string{
5524		"project":  c.project,
5525		"instance": c.instance,
5526	})
5527	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5528}
5529
5530// Do executes the "sql.instances.failover" call.
5531// Exactly one of *Operation or error will be non-nil. Any non-2xx
5532// status code is an error. Response headers are in either
5533// *Operation.ServerResponse.Header or (if a response was returned at
5534// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5535// to check whether the returned error was because
5536// http.StatusNotModified was returned.
5537func (c *InstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5538	gensupport.SetOptions(c.urlParams_, opts...)
5539	res, err := c.doRequest("json")
5540	if res != nil && res.StatusCode == http.StatusNotModified {
5541		if res.Body != nil {
5542			res.Body.Close()
5543		}
5544		return nil, &googleapi.Error{
5545			Code:   res.StatusCode,
5546			Header: res.Header,
5547		}
5548	}
5549	if err != nil {
5550		return nil, err
5551	}
5552	defer googleapi.CloseBody(res)
5553	if err := googleapi.CheckResponse(res); err != nil {
5554		return nil, err
5555	}
5556	ret := &Operation{
5557		ServerResponse: googleapi.ServerResponse{
5558			Header:         res.Header,
5559			HTTPStatusCode: res.StatusCode,
5560		},
5561	}
5562	target := &ret
5563	if err := gensupport.DecodeResponse(target, res); err != nil {
5564		return nil, err
5565	}
5566	return ret, nil
5567	// {
5568	//   "description": "Failover the instance to its failover replica instance.",
5569	//   "httpMethod": "POST",
5570	//   "id": "sql.instances.failover",
5571	//   "parameterOrder": [
5572	//     "project",
5573	//     "instance"
5574	//   ],
5575	//   "parameters": {
5576	//     "instance": {
5577	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
5578	//       "location": "path",
5579	//       "required": true,
5580	//       "type": "string"
5581	//     },
5582	//     "project": {
5583	//       "description": "ID of the project that contains the read replica.",
5584	//       "location": "path",
5585	//       "required": true,
5586	//       "type": "string"
5587	//     }
5588	//   },
5589	//   "path": "projects/{project}/instances/{instance}/failover",
5590	//   "request": {
5591	//     "$ref": "InstancesFailoverRequest"
5592	//   },
5593	//   "response": {
5594	//     "$ref": "Operation"
5595	//   },
5596	//   "scopes": [
5597	//     "https://www.googleapis.com/auth/cloud-platform",
5598	//     "https://www.googleapis.com/auth/sqlservice.admin"
5599	//   ]
5600	// }
5601
5602}
5603
5604// method id "sql.instances.get":
5605
5606type InstancesGetCall struct {
5607	s            *Service
5608	project      string
5609	instance     string
5610	urlParams_   gensupport.URLParams
5611	ifNoneMatch_ string
5612	ctx_         context.Context
5613	header_      http.Header
5614}
5615
5616// Get: Retrieves a resource containing information about a Cloud SQL
5617// instance.
5618func (r *InstancesService) Get(project string, instance string) *InstancesGetCall {
5619	c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5620	c.project = project
5621	c.instance = instance
5622	return c
5623}
5624
5625// Fields allows partial responses to be retrieved. See
5626// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5627// for more information.
5628func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
5629	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5630	return c
5631}
5632
5633// IfNoneMatch sets the optional parameter which makes the operation
5634// fail if the object's ETag matches the given value. This is useful for
5635// getting updates only after the object has changed since the last
5636// request. Use googleapi.IsNotModified to check whether the response
5637// error from Do is the result of In-None-Match.
5638func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
5639	c.ifNoneMatch_ = entityTag
5640	return c
5641}
5642
5643// Context sets the context to be used in this call's Do method. Any
5644// pending HTTP request will be aborted if the provided context is
5645// canceled.
5646func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
5647	c.ctx_ = ctx
5648	return c
5649}
5650
5651// Header returns an http.Header that can be modified by the caller to
5652// add HTTP headers to the request.
5653func (c *InstancesGetCall) Header() http.Header {
5654	if c.header_ == nil {
5655		c.header_ = make(http.Header)
5656	}
5657	return c.header_
5658}
5659
5660func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
5661	reqHeaders := make(http.Header)
5662	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5663	for k, v := range c.header_ {
5664		reqHeaders[k] = v
5665	}
5666	reqHeaders.Set("User-Agent", c.s.userAgent())
5667	if c.ifNoneMatch_ != "" {
5668		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5669	}
5670	var body io.Reader = nil
5671	c.urlParams_.Set("alt", alt)
5672	c.urlParams_.Set("prettyPrint", "false")
5673	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
5674	urls += "?" + c.urlParams_.Encode()
5675	req, err := http.NewRequest("GET", urls, body)
5676	if err != nil {
5677		return nil, err
5678	}
5679	req.Header = reqHeaders
5680	googleapi.Expand(req.URL, map[string]string{
5681		"project":  c.project,
5682		"instance": c.instance,
5683	})
5684	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5685}
5686
5687// Do executes the "sql.instances.get" call.
5688// Exactly one of *DatabaseInstance or error will be non-nil. Any
5689// non-2xx status code is an error. Response headers are in either
5690// *DatabaseInstance.ServerResponse.Header or (if a response was
5691// returned at all) in error.(*googleapi.Error).Header. Use
5692// googleapi.IsNotModified to check whether the returned error was
5693// because http.StatusNotModified was returned.
5694func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) {
5695	gensupport.SetOptions(c.urlParams_, opts...)
5696	res, err := c.doRequest("json")
5697	if res != nil && res.StatusCode == http.StatusNotModified {
5698		if res.Body != nil {
5699			res.Body.Close()
5700		}
5701		return nil, &googleapi.Error{
5702			Code:   res.StatusCode,
5703			Header: res.Header,
5704		}
5705	}
5706	if err != nil {
5707		return nil, err
5708	}
5709	defer googleapi.CloseBody(res)
5710	if err := googleapi.CheckResponse(res); err != nil {
5711		return nil, err
5712	}
5713	ret := &DatabaseInstance{
5714		ServerResponse: googleapi.ServerResponse{
5715			Header:         res.Header,
5716			HTTPStatusCode: res.StatusCode,
5717		},
5718	}
5719	target := &ret
5720	if err := gensupport.DecodeResponse(target, res); err != nil {
5721		return nil, err
5722	}
5723	return ret, nil
5724	// {
5725	//   "description": "Retrieves a resource containing information about a Cloud SQL instance.",
5726	//   "httpMethod": "GET",
5727	//   "id": "sql.instances.get",
5728	//   "parameterOrder": [
5729	//     "project",
5730	//     "instance"
5731	//   ],
5732	//   "parameters": {
5733	//     "instance": {
5734	//       "description": "Database instance ID. This does not include the project ID.",
5735	//       "location": "path",
5736	//       "required": true,
5737	//       "type": "string"
5738	//     },
5739	//     "project": {
5740	//       "description": "Project ID of the project that contains the instance.",
5741	//       "location": "path",
5742	//       "required": true,
5743	//       "type": "string"
5744	//     }
5745	//   },
5746	//   "path": "projects/{project}/instances/{instance}",
5747	//   "response": {
5748	//     "$ref": "DatabaseInstance"
5749	//   },
5750	//   "scopes": [
5751	//     "https://www.googleapis.com/auth/cloud-platform",
5752	//     "https://www.googleapis.com/auth/sqlservice.admin"
5753	//   ]
5754	// }
5755
5756}
5757
5758// method id "sql.instances.import":
5759
5760type InstancesImportCall struct {
5761	s                      *Service
5762	project                string
5763	instance               string
5764	instancesimportrequest *InstancesImportRequest
5765	urlParams_             gensupport.URLParams
5766	ctx_                   context.Context
5767	header_                http.Header
5768}
5769
5770// Import: Imports data into a Cloud SQL instance from a SQL dump or CSV
5771// file in Cloud Storage.
5772func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall {
5773	c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5774	c.project = project
5775	c.instance = instance
5776	c.instancesimportrequest = instancesimportrequest
5777	return c
5778}
5779
5780// Fields allows partial responses to be retrieved. See
5781// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5782// for more information.
5783func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall {
5784	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5785	return c
5786}
5787
5788// Context sets the context to be used in this call's Do method. Any
5789// pending HTTP request will be aborted if the provided context is
5790// canceled.
5791func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall {
5792	c.ctx_ = ctx
5793	return c
5794}
5795
5796// Header returns an http.Header that can be modified by the caller to
5797// add HTTP headers to the request.
5798func (c *InstancesImportCall) Header() http.Header {
5799	if c.header_ == nil {
5800		c.header_ = make(http.Header)
5801	}
5802	return c.header_
5803}
5804
5805func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) {
5806	reqHeaders := make(http.Header)
5807	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5808	for k, v := range c.header_ {
5809		reqHeaders[k] = v
5810	}
5811	reqHeaders.Set("User-Agent", c.s.userAgent())
5812	var body io.Reader = nil
5813	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest)
5814	if err != nil {
5815		return nil, err
5816	}
5817	reqHeaders.Set("Content-Type", "application/json")
5818	c.urlParams_.Set("alt", alt)
5819	c.urlParams_.Set("prettyPrint", "false")
5820	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/import")
5821	urls += "?" + c.urlParams_.Encode()
5822	req, err := http.NewRequest("POST", urls, body)
5823	if err != nil {
5824		return nil, err
5825	}
5826	req.Header = reqHeaders
5827	googleapi.Expand(req.URL, map[string]string{
5828		"project":  c.project,
5829		"instance": c.instance,
5830	})
5831	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5832}
5833
5834// Do executes the "sql.instances.import" call.
5835// Exactly one of *Operation or error will be non-nil. Any non-2xx
5836// status code is an error. Response headers are in either
5837// *Operation.ServerResponse.Header or (if a response was returned at
5838// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5839// to check whether the returned error was because
5840// http.StatusNotModified was returned.
5841func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5842	gensupport.SetOptions(c.urlParams_, opts...)
5843	res, err := c.doRequest("json")
5844	if res != nil && res.StatusCode == http.StatusNotModified {
5845		if res.Body != nil {
5846			res.Body.Close()
5847		}
5848		return nil, &googleapi.Error{
5849			Code:   res.StatusCode,
5850			Header: res.Header,
5851		}
5852	}
5853	if err != nil {
5854		return nil, err
5855	}
5856	defer googleapi.CloseBody(res)
5857	if err := googleapi.CheckResponse(res); err != nil {
5858		return nil, err
5859	}
5860	ret := &Operation{
5861		ServerResponse: googleapi.ServerResponse{
5862			Header:         res.Header,
5863			HTTPStatusCode: res.StatusCode,
5864		},
5865	}
5866	target := &ret
5867	if err := gensupport.DecodeResponse(target, res); err != nil {
5868		return nil, err
5869	}
5870	return ret, nil
5871	// {
5872	//   "description": "Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.",
5873	//   "httpMethod": "POST",
5874	//   "id": "sql.instances.import",
5875	//   "parameterOrder": [
5876	//     "project",
5877	//     "instance"
5878	//   ],
5879	//   "parameters": {
5880	//     "instance": {
5881	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
5882	//       "location": "path",
5883	//       "required": true,
5884	//       "type": "string"
5885	//     },
5886	//     "project": {
5887	//       "description": "Project ID of the project that contains the instance.",
5888	//       "location": "path",
5889	//       "required": true,
5890	//       "type": "string"
5891	//     }
5892	//   },
5893	//   "path": "projects/{project}/instances/{instance}/import",
5894	//   "request": {
5895	//     "$ref": "InstancesImportRequest"
5896	//   },
5897	//   "response": {
5898	//     "$ref": "Operation"
5899	//   },
5900	//   "scopes": [
5901	//     "https://www.googleapis.com/auth/cloud-platform"
5902	//   ]
5903	// }
5904
5905}
5906
5907// method id "sql.instances.insert":
5908
5909type InstancesInsertCall struct {
5910	s                *Service
5911	project          string
5912	databaseinstance *DatabaseInstance
5913	urlParams_       gensupport.URLParams
5914	ctx_             context.Context
5915	header_          http.Header
5916}
5917
5918// Insert: Creates a new Cloud SQL instance.
5919func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall {
5920	c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5921	c.project = project
5922	c.databaseinstance = databaseinstance
5923	return c
5924}
5925
5926// Fields allows partial responses to be retrieved. See
5927// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5928// for more information.
5929func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
5930	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5931	return c
5932}
5933
5934// Context sets the context to be used in this call's Do method. Any
5935// pending HTTP request will be aborted if the provided context is
5936// canceled.
5937func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
5938	c.ctx_ = ctx
5939	return c
5940}
5941
5942// Header returns an http.Header that can be modified by the caller to
5943// add HTTP headers to the request.
5944func (c *InstancesInsertCall) Header() http.Header {
5945	if c.header_ == nil {
5946		c.header_ = make(http.Header)
5947	}
5948	return c.header_
5949}
5950
5951func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
5952	reqHeaders := make(http.Header)
5953	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5954	for k, v := range c.header_ {
5955		reqHeaders[k] = v
5956	}
5957	reqHeaders.Set("User-Agent", c.s.userAgent())
5958	var body io.Reader = nil
5959	body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
5960	if err != nil {
5961		return nil, err
5962	}
5963	reqHeaders.Set("Content-Type", "application/json")
5964	c.urlParams_.Set("alt", alt)
5965	c.urlParams_.Set("prettyPrint", "false")
5966	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances")
5967	urls += "?" + c.urlParams_.Encode()
5968	req, err := http.NewRequest("POST", urls, body)
5969	if err != nil {
5970		return nil, err
5971	}
5972	req.Header = reqHeaders
5973	googleapi.Expand(req.URL, map[string]string{
5974		"project": c.project,
5975	})
5976	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5977}
5978
5979// Do executes the "sql.instances.insert" call.
5980// Exactly one of *Operation or error will be non-nil. Any non-2xx
5981// status code is an error. Response headers are in either
5982// *Operation.ServerResponse.Header or (if a response was returned at
5983// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5984// to check whether the returned error was because
5985// http.StatusNotModified was returned.
5986func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5987	gensupport.SetOptions(c.urlParams_, opts...)
5988	res, err := c.doRequest("json")
5989	if res != nil && res.StatusCode == http.StatusNotModified {
5990		if res.Body != nil {
5991			res.Body.Close()
5992		}
5993		return nil, &googleapi.Error{
5994			Code:   res.StatusCode,
5995			Header: res.Header,
5996		}
5997	}
5998	if err != nil {
5999		return nil, err
6000	}
6001	defer googleapi.CloseBody(res)
6002	if err := googleapi.CheckResponse(res); err != nil {
6003		return nil, err
6004	}
6005	ret := &Operation{
6006		ServerResponse: googleapi.ServerResponse{
6007			Header:         res.Header,
6008			HTTPStatusCode: res.StatusCode,
6009		},
6010	}
6011	target := &ret
6012	if err := gensupport.DecodeResponse(target, res); err != nil {
6013		return nil, err
6014	}
6015	return ret, nil
6016	// {
6017	//   "description": "Creates a new Cloud SQL instance.",
6018	//   "httpMethod": "POST",
6019	//   "id": "sql.instances.insert",
6020	//   "parameterOrder": [
6021	//     "project"
6022	//   ],
6023	//   "parameters": {
6024	//     "project": {
6025	//       "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.",
6026	//       "location": "path",
6027	//       "required": true,
6028	//       "type": "string"
6029	//     }
6030	//   },
6031	//   "path": "projects/{project}/instances",
6032	//   "request": {
6033	//     "$ref": "DatabaseInstance"
6034	//   },
6035	//   "response": {
6036	//     "$ref": "Operation"
6037	//   },
6038	//   "scopes": [
6039	//     "https://www.googleapis.com/auth/cloud-platform",
6040	//     "https://www.googleapis.com/auth/sqlservice.admin"
6041	//   ]
6042	// }
6043
6044}
6045
6046// method id "sql.instances.list":
6047
6048type InstancesListCall struct {
6049	s            *Service
6050	project      string
6051	urlParams_   gensupport.URLParams
6052	ifNoneMatch_ string
6053	ctx_         context.Context
6054	header_      http.Header
6055}
6056
6057// List: Lists instances under a given project in the alphabetical order
6058// of the instance name.
6059func (r *InstancesService) List(project string) *InstancesListCall {
6060	c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6061	c.project = project
6062	return c
6063}
6064
6065// Filter sets the optional parameter "filter": An expression for
6066// filtering the results of the request, such as by name or label.
6067func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
6068	c.urlParams_.Set("filter", filter)
6069	return c
6070}
6071
6072// MaxResults sets the optional parameter "maxResults": The maximum
6073// number of results to return per response.
6074func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
6075	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
6076	return c
6077}
6078
6079// PageToken sets the optional parameter "pageToken": A
6080// previously-returned page token representing part of the larger set of
6081// results to view.
6082func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
6083	c.urlParams_.Set("pageToken", pageToken)
6084	return c
6085}
6086
6087// Fields allows partial responses to be retrieved. See
6088// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6089// for more information.
6090func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
6091	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6092	return c
6093}
6094
6095// IfNoneMatch sets the optional parameter which makes the operation
6096// fail if the object's ETag matches the given value. This is useful for
6097// getting updates only after the object has changed since the last
6098// request. Use googleapi.IsNotModified to check whether the response
6099// error from Do is the result of In-None-Match.
6100func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
6101	c.ifNoneMatch_ = entityTag
6102	return c
6103}
6104
6105// Context sets the context to be used in this call's Do method. Any
6106// pending HTTP request will be aborted if the provided context is
6107// canceled.
6108func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
6109	c.ctx_ = ctx
6110	return c
6111}
6112
6113// Header returns an http.Header that can be modified by the caller to
6114// add HTTP headers to the request.
6115func (c *InstancesListCall) Header() http.Header {
6116	if c.header_ == nil {
6117		c.header_ = make(http.Header)
6118	}
6119	return c.header_
6120}
6121
6122func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
6123	reqHeaders := make(http.Header)
6124	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6125	for k, v := range c.header_ {
6126		reqHeaders[k] = v
6127	}
6128	reqHeaders.Set("User-Agent", c.s.userAgent())
6129	if c.ifNoneMatch_ != "" {
6130		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6131	}
6132	var body io.Reader = nil
6133	c.urlParams_.Set("alt", alt)
6134	c.urlParams_.Set("prettyPrint", "false")
6135	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances")
6136	urls += "?" + c.urlParams_.Encode()
6137	req, err := http.NewRequest("GET", urls, body)
6138	if err != nil {
6139		return nil, err
6140	}
6141	req.Header = reqHeaders
6142	googleapi.Expand(req.URL, map[string]string{
6143		"project": c.project,
6144	})
6145	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6146}
6147
6148// Do executes the "sql.instances.list" call.
6149// Exactly one of *InstancesListResponse or error will be non-nil. Any
6150// non-2xx status code is an error. Response headers are in either
6151// *InstancesListResponse.ServerResponse.Header or (if a response was
6152// returned at all) in error.(*googleapi.Error).Header. Use
6153// googleapi.IsNotModified to check whether the returned error was
6154// because http.StatusNotModified was returned.
6155func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) {
6156	gensupport.SetOptions(c.urlParams_, opts...)
6157	res, err := c.doRequest("json")
6158	if res != nil && res.StatusCode == http.StatusNotModified {
6159		if res.Body != nil {
6160			res.Body.Close()
6161		}
6162		return nil, &googleapi.Error{
6163			Code:   res.StatusCode,
6164			Header: res.Header,
6165		}
6166	}
6167	if err != nil {
6168		return nil, err
6169	}
6170	defer googleapi.CloseBody(res)
6171	if err := googleapi.CheckResponse(res); err != nil {
6172		return nil, err
6173	}
6174	ret := &InstancesListResponse{
6175		ServerResponse: googleapi.ServerResponse{
6176			Header:         res.Header,
6177			HTTPStatusCode: res.StatusCode,
6178		},
6179	}
6180	target := &ret
6181	if err := gensupport.DecodeResponse(target, res); err != nil {
6182		return nil, err
6183	}
6184	return ret, nil
6185	// {
6186	//   "description": "Lists instances under a given project in the alphabetical order of the instance name.",
6187	//   "httpMethod": "GET",
6188	//   "id": "sql.instances.list",
6189	//   "parameterOrder": [
6190	//     "project"
6191	//   ],
6192	//   "parameters": {
6193	//     "filter": {
6194	//       "description": "An expression for filtering the results of the request, such as by name or label.",
6195	//       "location": "query",
6196	//       "type": "string"
6197	//     },
6198	//     "maxResults": {
6199	//       "description": "The maximum number of results to return per response.",
6200	//       "format": "uint32",
6201	//       "location": "query",
6202	//       "type": "integer"
6203	//     },
6204	//     "pageToken": {
6205	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
6206	//       "location": "query",
6207	//       "type": "string"
6208	//     },
6209	//     "project": {
6210	//       "description": "Project ID of the project for which to list Cloud SQL instances.",
6211	//       "location": "path",
6212	//       "required": true,
6213	//       "type": "string"
6214	//     }
6215	//   },
6216	//   "path": "projects/{project}/instances",
6217	//   "response": {
6218	//     "$ref": "InstancesListResponse"
6219	//   },
6220	//   "scopes": [
6221	//     "https://www.googleapis.com/auth/cloud-platform",
6222	//     "https://www.googleapis.com/auth/sqlservice.admin"
6223	//   ]
6224	// }
6225
6226}
6227
6228// Pages invokes f for each page of results.
6229// A non-nil error returned from f will halt the iteration.
6230// The provided context supersedes any context provided to the Context method.
6231func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error {
6232	c.ctx_ = ctx
6233	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
6234	for {
6235		x, err := c.Do()
6236		if err != nil {
6237			return err
6238		}
6239		if err := f(x); err != nil {
6240			return err
6241		}
6242		if x.NextPageToken == "" {
6243			return nil
6244		}
6245		c.PageToken(x.NextPageToken)
6246	}
6247}
6248
6249// method id "sql.instances.listServerCas":
6250
6251type InstancesListServerCasCall struct {
6252	s            *Service
6253	project      string
6254	instance     string
6255	urlParams_   gensupport.URLParams
6256	ifNoneMatch_ string
6257	ctx_         context.Context
6258	header_      http.Header
6259}
6260
6261// ListServerCas: Lists all of the trusted Certificate Authorities (CAs)
6262// for the specified instance. There can be up to three CAs listed: the
6263// CA that was used to sign the certificate that is currently in use, a
6264// CA that has been added but not yet used to sign a certificate, and a
6265// CA used to sign a certificate that has previously rotated out.
6266func (r *InstancesService) ListServerCas(project string, instance string) *InstancesListServerCasCall {
6267	c := &InstancesListServerCasCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6268	c.project = project
6269	c.instance = instance
6270	return c
6271}
6272
6273// Fields allows partial responses to be retrieved. See
6274// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6275// for more information.
6276func (c *InstancesListServerCasCall) Fields(s ...googleapi.Field) *InstancesListServerCasCall {
6277	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6278	return c
6279}
6280
6281// IfNoneMatch sets the optional parameter which makes the operation
6282// fail if the object's ETag matches the given value. This is useful for
6283// getting updates only after the object has changed since the last
6284// request. Use googleapi.IsNotModified to check whether the response
6285// error from Do is the result of In-None-Match.
6286func (c *InstancesListServerCasCall) IfNoneMatch(entityTag string) *InstancesListServerCasCall {
6287	c.ifNoneMatch_ = entityTag
6288	return c
6289}
6290
6291// Context sets the context to be used in this call's Do method. Any
6292// pending HTTP request will be aborted if the provided context is
6293// canceled.
6294func (c *InstancesListServerCasCall) Context(ctx context.Context) *InstancesListServerCasCall {
6295	c.ctx_ = ctx
6296	return c
6297}
6298
6299// Header returns an http.Header that can be modified by the caller to
6300// add HTTP headers to the request.
6301func (c *InstancesListServerCasCall) Header() http.Header {
6302	if c.header_ == nil {
6303		c.header_ = make(http.Header)
6304	}
6305	return c.header_
6306}
6307
6308func (c *InstancesListServerCasCall) doRequest(alt string) (*http.Response, error) {
6309	reqHeaders := make(http.Header)
6310	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6311	for k, v := range c.header_ {
6312		reqHeaders[k] = v
6313	}
6314	reqHeaders.Set("User-Agent", c.s.userAgent())
6315	if c.ifNoneMatch_ != "" {
6316		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6317	}
6318	var body io.Reader = nil
6319	c.urlParams_.Set("alt", alt)
6320	c.urlParams_.Set("prettyPrint", "false")
6321	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/listServerCas")
6322	urls += "?" + c.urlParams_.Encode()
6323	req, err := http.NewRequest("GET", urls, body)
6324	if err != nil {
6325		return nil, err
6326	}
6327	req.Header = reqHeaders
6328	googleapi.Expand(req.URL, map[string]string{
6329		"project":  c.project,
6330		"instance": c.instance,
6331	})
6332	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6333}
6334
6335// Do executes the "sql.instances.listServerCas" call.
6336// Exactly one of *InstancesListServerCasResponse or error will be
6337// non-nil. Any non-2xx status code is an error. Response headers are in
6338// either *InstancesListServerCasResponse.ServerResponse.Header or (if a
6339// response was returned at all) in error.(*googleapi.Error).Header. Use
6340// googleapi.IsNotModified to check whether the returned error was
6341// because http.StatusNotModified was returned.
6342func (c *InstancesListServerCasCall) Do(opts ...googleapi.CallOption) (*InstancesListServerCasResponse, error) {
6343	gensupport.SetOptions(c.urlParams_, opts...)
6344	res, err := c.doRequest("json")
6345	if res != nil && res.StatusCode == http.StatusNotModified {
6346		if res.Body != nil {
6347			res.Body.Close()
6348		}
6349		return nil, &googleapi.Error{
6350			Code:   res.StatusCode,
6351			Header: res.Header,
6352		}
6353	}
6354	if err != nil {
6355		return nil, err
6356	}
6357	defer googleapi.CloseBody(res)
6358	if err := googleapi.CheckResponse(res); err != nil {
6359		return nil, err
6360	}
6361	ret := &InstancesListServerCasResponse{
6362		ServerResponse: googleapi.ServerResponse{
6363			Header:         res.Header,
6364			HTTPStatusCode: res.StatusCode,
6365		},
6366	}
6367	target := &ret
6368	if err := gensupport.DecodeResponse(target, res); err != nil {
6369		return nil, err
6370	}
6371	return ret, nil
6372	// {
6373	//   "description": "Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.",
6374	//   "httpMethod": "GET",
6375	//   "id": "sql.instances.listServerCas",
6376	//   "parameterOrder": [
6377	//     "project",
6378	//     "instance"
6379	//   ],
6380	//   "parameters": {
6381	//     "instance": {
6382	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
6383	//       "location": "path",
6384	//       "required": true,
6385	//       "type": "string"
6386	//     },
6387	//     "project": {
6388	//       "description": "Project ID of the project that contains the instance.",
6389	//       "location": "path",
6390	//       "required": true,
6391	//       "type": "string"
6392	//     }
6393	//   },
6394	//   "path": "projects/{project}/instances/{instance}/listServerCas",
6395	//   "response": {
6396	//     "$ref": "InstancesListServerCasResponse"
6397	//   },
6398	//   "scopes": [
6399	//     "https://www.googleapis.com/auth/cloud-platform",
6400	//     "https://www.googleapis.com/auth/sqlservice.admin"
6401	//   ]
6402	// }
6403
6404}
6405
6406// method id "sql.instances.patch":
6407
6408type InstancesPatchCall struct {
6409	s                *Service
6410	project          string
6411	instance         string
6412	databaseinstance *DatabaseInstance
6413	urlParams_       gensupport.URLParams
6414	ctx_             context.Context
6415	header_          http.Header
6416}
6417
6418// Patch: Updates settings of a Cloud SQL instance. Caution: This is not
6419// a partial update, so you must include values for all the settings
6420// that you want to retain. For partial updates, use patch.. This method
6421// supports patch semantics.
6422func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall {
6423	c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6424	c.project = project
6425	c.instance = instance
6426	c.databaseinstance = databaseinstance
6427	return c
6428}
6429
6430// Fields allows partial responses to be retrieved. See
6431// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6432// for more information.
6433func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall {
6434	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6435	return c
6436}
6437
6438// Context sets the context to be used in this call's Do method. Any
6439// pending HTTP request will be aborted if the provided context is
6440// canceled.
6441func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall {
6442	c.ctx_ = ctx
6443	return c
6444}
6445
6446// Header returns an http.Header that can be modified by the caller to
6447// add HTTP headers to the request.
6448func (c *InstancesPatchCall) Header() http.Header {
6449	if c.header_ == nil {
6450		c.header_ = make(http.Header)
6451	}
6452	return c.header_
6453}
6454
6455func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) {
6456	reqHeaders := make(http.Header)
6457	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6458	for k, v := range c.header_ {
6459		reqHeaders[k] = v
6460	}
6461	reqHeaders.Set("User-Agent", c.s.userAgent())
6462	var body io.Reader = nil
6463	body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
6464	if err != nil {
6465		return nil, err
6466	}
6467	reqHeaders.Set("Content-Type", "application/json")
6468	c.urlParams_.Set("alt", alt)
6469	c.urlParams_.Set("prettyPrint", "false")
6470	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
6471	urls += "?" + c.urlParams_.Encode()
6472	req, err := http.NewRequest("PATCH", urls, body)
6473	if err != nil {
6474		return nil, err
6475	}
6476	req.Header = reqHeaders
6477	googleapi.Expand(req.URL, map[string]string{
6478		"project":  c.project,
6479		"instance": c.instance,
6480	})
6481	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6482}
6483
6484// Do executes the "sql.instances.patch" call.
6485// Exactly one of *Operation or error will be non-nil. Any non-2xx
6486// status code is an error. Response headers are in either
6487// *Operation.ServerResponse.Header or (if a response was returned at
6488// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6489// to check whether the returned error was because
6490// http.StatusNotModified was returned.
6491func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6492	gensupport.SetOptions(c.urlParams_, opts...)
6493	res, err := c.doRequest("json")
6494	if res != nil && res.StatusCode == http.StatusNotModified {
6495		if res.Body != nil {
6496			res.Body.Close()
6497		}
6498		return nil, &googleapi.Error{
6499			Code:   res.StatusCode,
6500			Header: res.Header,
6501		}
6502	}
6503	if err != nil {
6504		return nil, err
6505	}
6506	defer googleapi.CloseBody(res)
6507	if err := googleapi.CheckResponse(res); err != nil {
6508		return nil, err
6509	}
6510	ret := &Operation{
6511		ServerResponse: googleapi.ServerResponse{
6512			Header:         res.Header,
6513			HTTPStatusCode: res.StatusCode,
6514		},
6515	}
6516	target := &ret
6517	if err := gensupport.DecodeResponse(target, res); err != nil {
6518		return nil, err
6519	}
6520	return ret, nil
6521	// {
6522	//   "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics.",
6523	//   "httpMethod": "PATCH",
6524	//   "id": "sql.instances.patch",
6525	//   "parameterOrder": [
6526	//     "project",
6527	//     "instance"
6528	//   ],
6529	//   "parameters": {
6530	//     "instance": {
6531	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
6532	//       "location": "path",
6533	//       "required": true,
6534	//       "type": "string"
6535	//     },
6536	//     "project": {
6537	//       "description": "Project ID of the project that contains the instance.",
6538	//       "location": "path",
6539	//       "required": true,
6540	//       "type": "string"
6541	//     }
6542	//   },
6543	//   "path": "projects/{project}/instances/{instance}",
6544	//   "request": {
6545	//     "$ref": "DatabaseInstance"
6546	//   },
6547	//   "response": {
6548	//     "$ref": "Operation"
6549	//   },
6550	//   "scopes": [
6551	//     "https://www.googleapis.com/auth/cloud-platform",
6552	//     "https://www.googleapis.com/auth/sqlservice.admin"
6553	//   ]
6554	// }
6555
6556}
6557
6558// method id "sql.instances.promoteReplica":
6559
6560type InstancesPromoteReplicaCall struct {
6561	s          *Service
6562	project    string
6563	instance   string
6564	urlParams_ gensupport.URLParams
6565	ctx_       context.Context
6566	header_    http.Header
6567}
6568
6569// PromoteReplica: Promotes the read replica instance to be a
6570// stand-alone Cloud SQL instance.
6571func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall {
6572	c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6573	c.project = project
6574	c.instance = instance
6575	return c
6576}
6577
6578// Fields allows partial responses to be retrieved. See
6579// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6580// for more information.
6581func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall {
6582	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6583	return c
6584}
6585
6586// Context sets the context to be used in this call's Do method. Any
6587// pending HTTP request will be aborted if the provided context is
6588// canceled.
6589func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall {
6590	c.ctx_ = ctx
6591	return c
6592}
6593
6594// Header returns an http.Header that can be modified by the caller to
6595// add HTTP headers to the request.
6596func (c *InstancesPromoteReplicaCall) Header() http.Header {
6597	if c.header_ == nil {
6598		c.header_ = make(http.Header)
6599	}
6600	return c.header_
6601}
6602
6603func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) {
6604	reqHeaders := make(http.Header)
6605	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6606	for k, v := range c.header_ {
6607		reqHeaders[k] = v
6608	}
6609	reqHeaders.Set("User-Agent", c.s.userAgent())
6610	var body io.Reader = nil
6611	c.urlParams_.Set("alt", alt)
6612	c.urlParams_.Set("prettyPrint", "false")
6613	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/promoteReplica")
6614	urls += "?" + c.urlParams_.Encode()
6615	req, err := http.NewRequest("POST", urls, body)
6616	if err != nil {
6617		return nil, err
6618	}
6619	req.Header = reqHeaders
6620	googleapi.Expand(req.URL, map[string]string{
6621		"project":  c.project,
6622		"instance": c.instance,
6623	})
6624	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6625}
6626
6627// Do executes the "sql.instances.promoteReplica" call.
6628// Exactly one of *Operation or error will be non-nil. Any non-2xx
6629// status code is an error. Response headers are in either
6630// *Operation.ServerResponse.Header or (if a response was returned at
6631// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6632// to check whether the returned error was because
6633// http.StatusNotModified was returned.
6634func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6635	gensupport.SetOptions(c.urlParams_, opts...)
6636	res, err := c.doRequest("json")
6637	if res != nil && res.StatusCode == http.StatusNotModified {
6638		if res.Body != nil {
6639			res.Body.Close()
6640		}
6641		return nil, &googleapi.Error{
6642			Code:   res.StatusCode,
6643			Header: res.Header,
6644		}
6645	}
6646	if err != nil {
6647		return nil, err
6648	}
6649	defer googleapi.CloseBody(res)
6650	if err := googleapi.CheckResponse(res); err != nil {
6651		return nil, err
6652	}
6653	ret := &Operation{
6654		ServerResponse: googleapi.ServerResponse{
6655			Header:         res.Header,
6656			HTTPStatusCode: res.StatusCode,
6657		},
6658	}
6659	target := &ret
6660	if err := gensupport.DecodeResponse(target, res); err != nil {
6661		return nil, err
6662	}
6663	return ret, nil
6664	// {
6665	//   "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance.",
6666	//   "httpMethod": "POST",
6667	//   "id": "sql.instances.promoteReplica",
6668	//   "parameterOrder": [
6669	//     "project",
6670	//     "instance"
6671	//   ],
6672	//   "parameters": {
6673	//     "instance": {
6674	//       "description": "Cloud SQL read replica instance name.",
6675	//       "location": "path",
6676	//       "required": true,
6677	//       "type": "string"
6678	//     },
6679	//     "project": {
6680	//       "description": "ID of the project that contains the read replica.",
6681	//       "location": "path",
6682	//       "required": true,
6683	//       "type": "string"
6684	//     }
6685	//   },
6686	//   "path": "projects/{project}/instances/{instance}/promoteReplica",
6687	//   "response": {
6688	//     "$ref": "Operation"
6689	//   },
6690	//   "scopes": [
6691	//     "https://www.googleapis.com/auth/cloud-platform",
6692	//     "https://www.googleapis.com/auth/sqlservice.admin"
6693	//   ]
6694	// }
6695
6696}
6697
6698// method id "sql.instances.resetSslConfig":
6699
6700type InstancesResetSslConfigCall struct {
6701	s          *Service
6702	project    string
6703	instance   string
6704	urlParams_ gensupport.URLParams
6705	ctx_       context.Context
6706	header_    http.Header
6707}
6708
6709// ResetSslConfig: Deletes all client certificates and generates a new
6710// server SSL certificate for the instance.
6711func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall {
6712	c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6713	c.project = project
6714	c.instance = instance
6715	return c
6716}
6717
6718// Fields allows partial responses to be retrieved. See
6719// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6720// for more information.
6721func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall {
6722	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6723	return c
6724}
6725
6726// Context sets the context to be used in this call's Do method. Any
6727// pending HTTP request will be aborted if the provided context is
6728// canceled.
6729func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall {
6730	c.ctx_ = ctx
6731	return c
6732}
6733
6734// Header returns an http.Header that can be modified by the caller to
6735// add HTTP headers to the request.
6736func (c *InstancesResetSslConfigCall) Header() http.Header {
6737	if c.header_ == nil {
6738		c.header_ = make(http.Header)
6739	}
6740	return c.header_
6741}
6742
6743func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) {
6744	reqHeaders := make(http.Header)
6745	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6746	for k, v := range c.header_ {
6747		reqHeaders[k] = v
6748	}
6749	reqHeaders.Set("User-Agent", c.s.userAgent())
6750	var body io.Reader = nil
6751	c.urlParams_.Set("alt", alt)
6752	c.urlParams_.Set("prettyPrint", "false")
6753	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/resetSslConfig")
6754	urls += "?" + c.urlParams_.Encode()
6755	req, err := http.NewRequest("POST", urls, body)
6756	if err != nil {
6757		return nil, err
6758	}
6759	req.Header = reqHeaders
6760	googleapi.Expand(req.URL, map[string]string{
6761		"project":  c.project,
6762		"instance": c.instance,
6763	})
6764	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6765}
6766
6767// Do executes the "sql.instances.resetSslConfig" call.
6768// Exactly one of *Operation or error will be non-nil. Any non-2xx
6769// status code is an error. Response headers are in either
6770// *Operation.ServerResponse.Header or (if a response was returned at
6771// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6772// to check whether the returned error was because
6773// http.StatusNotModified was returned.
6774func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6775	gensupport.SetOptions(c.urlParams_, opts...)
6776	res, err := c.doRequest("json")
6777	if res != nil && res.StatusCode == http.StatusNotModified {
6778		if res.Body != nil {
6779			res.Body.Close()
6780		}
6781		return nil, &googleapi.Error{
6782			Code:   res.StatusCode,
6783			Header: res.Header,
6784		}
6785	}
6786	if err != nil {
6787		return nil, err
6788	}
6789	defer googleapi.CloseBody(res)
6790	if err := googleapi.CheckResponse(res); err != nil {
6791		return nil, err
6792	}
6793	ret := &Operation{
6794		ServerResponse: googleapi.ServerResponse{
6795			Header:         res.Header,
6796			HTTPStatusCode: res.StatusCode,
6797		},
6798	}
6799	target := &ret
6800	if err := gensupport.DecodeResponse(target, res); err != nil {
6801		return nil, err
6802	}
6803	return ret, nil
6804	// {
6805	//   "description": "Deletes all client certificates and generates a new server SSL certificate for the instance.",
6806	//   "httpMethod": "POST",
6807	//   "id": "sql.instances.resetSslConfig",
6808	//   "parameterOrder": [
6809	//     "project",
6810	//     "instance"
6811	//   ],
6812	//   "parameters": {
6813	//     "instance": {
6814	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
6815	//       "location": "path",
6816	//       "required": true,
6817	//       "type": "string"
6818	//     },
6819	//     "project": {
6820	//       "description": "Project ID of the project that contains the instance.",
6821	//       "location": "path",
6822	//       "required": true,
6823	//       "type": "string"
6824	//     }
6825	//   },
6826	//   "path": "projects/{project}/instances/{instance}/resetSslConfig",
6827	//   "response": {
6828	//     "$ref": "Operation"
6829	//   },
6830	//   "scopes": [
6831	//     "https://www.googleapis.com/auth/cloud-platform",
6832	//     "https://www.googleapis.com/auth/sqlservice.admin"
6833	//   ]
6834	// }
6835
6836}
6837
6838// method id "sql.instances.restart":
6839
6840type InstancesRestartCall struct {
6841	s          *Service
6842	project    string
6843	instance   string
6844	urlParams_ gensupport.URLParams
6845	ctx_       context.Context
6846	header_    http.Header
6847}
6848
6849// Restart: Restarts a Cloud SQL instance.
6850func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall {
6851	c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6852	c.project = project
6853	c.instance = instance
6854	return c
6855}
6856
6857// Fields allows partial responses to be retrieved. See
6858// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6859// for more information.
6860func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall {
6861	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6862	return c
6863}
6864
6865// Context sets the context to be used in this call's Do method. Any
6866// pending HTTP request will be aborted if the provided context is
6867// canceled.
6868func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall {
6869	c.ctx_ = ctx
6870	return c
6871}
6872
6873// Header returns an http.Header that can be modified by the caller to
6874// add HTTP headers to the request.
6875func (c *InstancesRestartCall) Header() http.Header {
6876	if c.header_ == nil {
6877		c.header_ = make(http.Header)
6878	}
6879	return c.header_
6880}
6881
6882func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) {
6883	reqHeaders := make(http.Header)
6884	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6885	for k, v := range c.header_ {
6886		reqHeaders[k] = v
6887	}
6888	reqHeaders.Set("User-Agent", c.s.userAgent())
6889	var body io.Reader = nil
6890	c.urlParams_.Set("alt", alt)
6891	c.urlParams_.Set("prettyPrint", "false")
6892	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restart")
6893	urls += "?" + c.urlParams_.Encode()
6894	req, err := http.NewRequest("POST", urls, body)
6895	if err != nil {
6896		return nil, err
6897	}
6898	req.Header = reqHeaders
6899	googleapi.Expand(req.URL, map[string]string{
6900		"project":  c.project,
6901		"instance": c.instance,
6902	})
6903	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6904}
6905
6906// Do executes the "sql.instances.restart" call.
6907// Exactly one of *Operation or error will be non-nil. Any non-2xx
6908// status code is an error. Response headers are in either
6909// *Operation.ServerResponse.Header or (if a response was returned at
6910// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6911// to check whether the returned error was because
6912// http.StatusNotModified was returned.
6913func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6914	gensupport.SetOptions(c.urlParams_, opts...)
6915	res, err := c.doRequest("json")
6916	if res != nil && res.StatusCode == http.StatusNotModified {
6917		if res.Body != nil {
6918			res.Body.Close()
6919		}
6920		return nil, &googleapi.Error{
6921			Code:   res.StatusCode,
6922			Header: res.Header,
6923		}
6924	}
6925	if err != nil {
6926		return nil, err
6927	}
6928	defer googleapi.CloseBody(res)
6929	if err := googleapi.CheckResponse(res); err != nil {
6930		return nil, err
6931	}
6932	ret := &Operation{
6933		ServerResponse: googleapi.ServerResponse{
6934			Header:         res.Header,
6935			HTTPStatusCode: res.StatusCode,
6936		},
6937	}
6938	target := &ret
6939	if err := gensupport.DecodeResponse(target, res); err != nil {
6940		return nil, err
6941	}
6942	return ret, nil
6943	// {
6944	//   "description": "Restarts a Cloud SQL instance.",
6945	//   "httpMethod": "POST",
6946	//   "id": "sql.instances.restart",
6947	//   "parameterOrder": [
6948	//     "project",
6949	//     "instance"
6950	//   ],
6951	//   "parameters": {
6952	//     "instance": {
6953	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
6954	//       "location": "path",
6955	//       "required": true,
6956	//       "type": "string"
6957	//     },
6958	//     "project": {
6959	//       "description": "Project ID of the project that contains the instance to be restarted.",
6960	//       "location": "path",
6961	//       "required": true,
6962	//       "type": "string"
6963	//     }
6964	//   },
6965	//   "path": "projects/{project}/instances/{instance}/restart",
6966	//   "response": {
6967	//     "$ref": "Operation"
6968	//   },
6969	//   "scopes": [
6970	//     "https://www.googleapis.com/auth/cloud-platform",
6971	//     "https://www.googleapis.com/auth/sqlservice.admin"
6972	//   ]
6973	// }
6974
6975}
6976
6977// method id "sql.instances.restoreBackup":
6978
6979type InstancesRestoreBackupCall struct {
6980	s                             *Service
6981	project                       string
6982	instance                      string
6983	instancesrestorebackuprequest *InstancesRestoreBackupRequest
6984	urlParams_                    gensupport.URLParams
6985	ctx_                          context.Context
6986	header_                       http.Header
6987}
6988
6989// RestoreBackup: Restores a backup of a Cloud SQL instance.
6990func (r *InstancesService) RestoreBackup(project string, instance string, instancesrestorebackuprequest *InstancesRestoreBackupRequest) *InstancesRestoreBackupCall {
6991	c := &InstancesRestoreBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6992	c.project = project
6993	c.instance = instance
6994	c.instancesrestorebackuprequest = instancesrestorebackuprequest
6995	return c
6996}
6997
6998// Fields allows partial responses to be retrieved. See
6999// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7000// for more information.
7001func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall {
7002	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7003	return c
7004}
7005
7006// Context sets the context to be used in this call's Do method. Any
7007// pending HTTP request will be aborted if the provided context is
7008// canceled.
7009func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall {
7010	c.ctx_ = ctx
7011	return c
7012}
7013
7014// Header returns an http.Header that can be modified by the caller to
7015// add HTTP headers to the request.
7016func (c *InstancesRestoreBackupCall) Header() http.Header {
7017	if c.header_ == nil {
7018		c.header_ = make(http.Header)
7019	}
7020	return c.header_
7021}
7022
7023func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) {
7024	reqHeaders := make(http.Header)
7025	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7026	for k, v := range c.header_ {
7027		reqHeaders[k] = v
7028	}
7029	reqHeaders.Set("User-Agent", c.s.userAgent())
7030	var body io.Reader = nil
7031	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest)
7032	if err != nil {
7033		return nil, err
7034	}
7035	reqHeaders.Set("Content-Type", "application/json")
7036	c.urlParams_.Set("alt", alt)
7037	c.urlParams_.Set("prettyPrint", "false")
7038	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restoreBackup")
7039	urls += "?" + c.urlParams_.Encode()
7040	req, err := http.NewRequest("POST", urls, body)
7041	if err != nil {
7042		return nil, err
7043	}
7044	req.Header = reqHeaders
7045	googleapi.Expand(req.URL, map[string]string{
7046		"project":  c.project,
7047		"instance": c.instance,
7048	})
7049	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7050}
7051
7052// Do executes the "sql.instances.restoreBackup" call.
7053// Exactly one of *Operation or error will be non-nil. Any non-2xx
7054// status code is an error. Response headers are in either
7055// *Operation.ServerResponse.Header or (if a response was returned at
7056// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7057// to check whether the returned error was because
7058// http.StatusNotModified was returned.
7059func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7060	gensupport.SetOptions(c.urlParams_, opts...)
7061	res, err := c.doRequest("json")
7062	if res != nil && res.StatusCode == http.StatusNotModified {
7063		if res.Body != nil {
7064			res.Body.Close()
7065		}
7066		return nil, &googleapi.Error{
7067			Code:   res.StatusCode,
7068			Header: res.Header,
7069		}
7070	}
7071	if err != nil {
7072		return nil, err
7073	}
7074	defer googleapi.CloseBody(res)
7075	if err := googleapi.CheckResponse(res); err != nil {
7076		return nil, err
7077	}
7078	ret := &Operation{
7079		ServerResponse: googleapi.ServerResponse{
7080			Header:         res.Header,
7081			HTTPStatusCode: res.StatusCode,
7082		},
7083	}
7084	target := &ret
7085	if err := gensupport.DecodeResponse(target, res); err != nil {
7086		return nil, err
7087	}
7088	return ret, nil
7089	// {
7090	//   "description": "Restores a backup of a Cloud SQL instance.",
7091	//   "httpMethod": "POST",
7092	//   "id": "sql.instances.restoreBackup",
7093	//   "parameterOrder": [
7094	//     "project",
7095	//     "instance"
7096	//   ],
7097	//   "parameters": {
7098	//     "instance": {
7099	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
7100	//       "location": "path",
7101	//       "required": true,
7102	//       "type": "string"
7103	//     },
7104	//     "project": {
7105	//       "description": "Project ID of the project that contains the instance.",
7106	//       "location": "path",
7107	//       "required": true,
7108	//       "type": "string"
7109	//     }
7110	//   },
7111	//   "path": "projects/{project}/instances/{instance}/restoreBackup",
7112	//   "request": {
7113	//     "$ref": "InstancesRestoreBackupRequest"
7114	//   },
7115	//   "response": {
7116	//     "$ref": "Operation"
7117	//   },
7118	//   "scopes": [
7119	//     "https://www.googleapis.com/auth/cloud-platform",
7120	//     "https://www.googleapis.com/auth/sqlservice.admin"
7121	//   ]
7122	// }
7123
7124}
7125
7126// method id "sql.instances.rotateServerCa":
7127
7128type InstancesRotateServerCaCall struct {
7129	s                              *Service
7130	project                        string
7131	instance                       string
7132	instancesrotateservercarequest *InstancesRotateServerCaRequest
7133	urlParams_                     gensupport.URLParams
7134	ctx_                           context.Context
7135	header_                        http.Header
7136}
7137
7138// RotateServerCa: Rotates the server certificate to one signed by the
7139// Certificate Authority (CA) version previously added with the
7140// addServerCA method.
7141func (r *InstancesService) RotateServerCa(project string, instance string, instancesrotateservercarequest *InstancesRotateServerCaRequest) *InstancesRotateServerCaCall {
7142	c := &InstancesRotateServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7143	c.project = project
7144	c.instance = instance
7145	c.instancesrotateservercarequest = instancesrotateservercarequest
7146	return c
7147}
7148
7149// Fields allows partial responses to be retrieved. See
7150// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7151// for more information.
7152func (c *InstancesRotateServerCaCall) Fields(s ...googleapi.Field) *InstancesRotateServerCaCall {
7153	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7154	return c
7155}
7156
7157// Context sets the context to be used in this call's Do method. Any
7158// pending HTTP request will be aborted if the provided context is
7159// canceled.
7160func (c *InstancesRotateServerCaCall) Context(ctx context.Context) *InstancesRotateServerCaCall {
7161	c.ctx_ = ctx
7162	return c
7163}
7164
7165// Header returns an http.Header that can be modified by the caller to
7166// add HTTP headers to the request.
7167func (c *InstancesRotateServerCaCall) Header() http.Header {
7168	if c.header_ == nil {
7169		c.header_ = make(http.Header)
7170	}
7171	return c.header_
7172}
7173
7174func (c *InstancesRotateServerCaCall) doRequest(alt string) (*http.Response, error) {
7175	reqHeaders := make(http.Header)
7176	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7177	for k, v := range c.header_ {
7178		reqHeaders[k] = v
7179	}
7180	reqHeaders.Set("User-Agent", c.s.userAgent())
7181	var body io.Reader = nil
7182	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercarequest)
7183	if err != nil {
7184		return nil, err
7185	}
7186	reqHeaders.Set("Content-Type", "application/json")
7187	c.urlParams_.Set("alt", alt)
7188	c.urlParams_.Set("prettyPrint", "false")
7189	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/rotateServerCa")
7190	urls += "?" + c.urlParams_.Encode()
7191	req, err := http.NewRequest("POST", urls, body)
7192	if err != nil {
7193		return nil, err
7194	}
7195	req.Header = reqHeaders
7196	googleapi.Expand(req.URL, map[string]string{
7197		"project":  c.project,
7198		"instance": c.instance,
7199	})
7200	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7201}
7202
7203// Do executes the "sql.instances.rotateServerCa" call.
7204// Exactly one of *Operation or error will be non-nil. Any non-2xx
7205// status code is an error. Response headers are in either
7206// *Operation.ServerResponse.Header or (if a response was returned at
7207// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7208// to check whether the returned error was because
7209// http.StatusNotModified was returned.
7210func (c *InstancesRotateServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7211	gensupport.SetOptions(c.urlParams_, opts...)
7212	res, err := c.doRequest("json")
7213	if res != nil && res.StatusCode == http.StatusNotModified {
7214		if res.Body != nil {
7215			res.Body.Close()
7216		}
7217		return nil, &googleapi.Error{
7218			Code:   res.StatusCode,
7219			Header: res.Header,
7220		}
7221	}
7222	if err != nil {
7223		return nil, err
7224	}
7225	defer googleapi.CloseBody(res)
7226	if err := googleapi.CheckResponse(res); err != nil {
7227		return nil, err
7228	}
7229	ret := &Operation{
7230		ServerResponse: googleapi.ServerResponse{
7231			Header:         res.Header,
7232			HTTPStatusCode: res.StatusCode,
7233		},
7234	}
7235	target := &ret
7236	if err := gensupport.DecodeResponse(target, res); err != nil {
7237		return nil, err
7238	}
7239	return ret, nil
7240	// {
7241	//   "description": "Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.",
7242	//   "httpMethod": "POST",
7243	//   "id": "sql.instances.rotateServerCa",
7244	//   "parameterOrder": [
7245	//     "project",
7246	//     "instance"
7247	//   ],
7248	//   "parameters": {
7249	//     "instance": {
7250	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
7251	//       "location": "path",
7252	//       "required": true,
7253	//       "type": "string"
7254	//     },
7255	//     "project": {
7256	//       "description": "Project ID of the project that contains the instance.",
7257	//       "location": "path",
7258	//       "required": true,
7259	//       "type": "string"
7260	//     }
7261	//   },
7262	//   "path": "projects/{project}/instances/{instance}/rotateServerCa",
7263	//   "request": {
7264	//     "$ref": "InstancesRotateServerCaRequest"
7265	//   },
7266	//   "response": {
7267	//     "$ref": "Operation"
7268	//   },
7269	//   "scopes": [
7270	//     "https://www.googleapis.com/auth/cloud-platform",
7271	//     "https://www.googleapis.com/auth/sqlservice.admin"
7272	//   ]
7273	// }
7274
7275}
7276
7277// method id "sql.instances.startReplica":
7278
7279type InstancesStartReplicaCall struct {
7280	s          *Service
7281	project    string
7282	instance   string
7283	urlParams_ gensupport.URLParams
7284	ctx_       context.Context
7285	header_    http.Header
7286}
7287
7288// StartReplica: Starts the replication in the read replica instance.
7289func (r *InstancesService) StartReplica(project string, instance string) *InstancesStartReplicaCall {
7290	c := &InstancesStartReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7291	c.project = project
7292	c.instance = instance
7293	return c
7294}
7295
7296// Fields allows partial responses to be retrieved. See
7297// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7298// for more information.
7299func (c *InstancesStartReplicaCall) Fields(s ...googleapi.Field) *InstancesStartReplicaCall {
7300	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7301	return c
7302}
7303
7304// Context sets the context to be used in this call's Do method. Any
7305// pending HTTP request will be aborted if the provided context is
7306// canceled.
7307func (c *InstancesStartReplicaCall) Context(ctx context.Context) *InstancesStartReplicaCall {
7308	c.ctx_ = ctx
7309	return c
7310}
7311
7312// Header returns an http.Header that can be modified by the caller to
7313// add HTTP headers to the request.
7314func (c *InstancesStartReplicaCall) Header() http.Header {
7315	if c.header_ == nil {
7316		c.header_ = make(http.Header)
7317	}
7318	return c.header_
7319}
7320
7321func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) {
7322	reqHeaders := make(http.Header)
7323	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7324	for k, v := range c.header_ {
7325		reqHeaders[k] = v
7326	}
7327	reqHeaders.Set("User-Agent", c.s.userAgent())
7328	var body io.Reader = nil
7329	c.urlParams_.Set("alt", alt)
7330	c.urlParams_.Set("prettyPrint", "false")
7331	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/startReplica")
7332	urls += "?" + c.urlParams_.Encode()
7333	req, err := http.NewRequest("POST", urls, body)
7334	if err != nil {
7335		return nil, err
7336	}
7337	req.Header = reqHeaders
7338	googleapi.Expand(req.URL, map[string]string{
7339		"project":  c.project,
7340		"instance": c.instance,
7341	})
7342	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7343}
7344
7345// Do executes the "sql.instances.startReplica" call.
7346// Exactly one of *Operation or error will be non-nil. Any non-2xx
7347// status code is an error. Response headers are in either
7348// *Operation.ServerResponse.Header or (if a response was returned at
7349// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7350// to check whether the returned error was because
7351// http.StatusNotModified was returned.
7352func (c *InstancesStartReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7353	gensupport.SetOptions(c.urlParams_, opts...)
7354	res, err := c.doRequest("json")
7355	if res != nil && res.StatusCode == http.StatusNotModified {
7356		if res.Body != nil {
7357			res.Body.Close()
7358		}
7359		return nil, &googleapi.Error{
7360			Code:   res.StatusCode,
7361			Header: res.Header,
7362		}
7363	}
7364	if err != nil {
7365		return nil, err
7366	}
7367	defer googleapi.CloseBody(res)
7368	if err := googleapi.CheckResponse(res); err != nil {
7369		return nil, err
7370	}
7371	ret := &Operation{
7372		ServerResponse: googleapi.ServerResponse{
7373			Header:         res.Header,
7374			HTTPStatusCode: res.StatusCode,
7375		},
7376	}
7377	target := &ret
7378	if err := gensupport.DecodeResponse(target, res); err != nil {
7379		return nil, err
7380	}
7381	return ret, nil
7382	// {
7383	//   "description": "Starts the replication in the read replica instance.",
7384	//   "httpMethod": "POST",
7385	//   "id": "sql.instances.startReplica",
7386	//   "parameterOrder": [
7387	//     "project",
7388	//     "instance"
7389	//   ],
7390	//   "parameters": {
7391	//     "instance": {
7392	//       "description": "Cloud SQL read replica instance name.",
7393	//       "location": "path",
7394	//       "required": true,
7395	//       "type": "string"
7396	//     },
7397	//     "project": {
7398	//       "description": "ID of the project that contains the read replica.",
7399	//       "location": "path",
7400	//       "required": true,
7401	//       "type": "string"
7402	//     }
7403	//   },
7404	//   "path": "projects/{project}/instances/{instance}/startReplica",
7405	//   "response": {
7406	//     "$ref": "Operation"
7407	//   },
7408	//   "scopes": [
7409	//     "https://www.googleapis.com/auth/cloud-platform",
7410	//     "https://www.googleapis.com/auth/sqlservice.admin"
7411	//   ]
7412	// }
7413
7414}
7415
7416// method id "sql.instances.stopReplica":
7417
7418type InstancesStopReplicaCall struct {
7419	s          *Service
7420	project    string
7421	instance   string
7422	urlParams_ gensupport.URLParams
7423	ctx_       context.Context
7424	header_    http.Header
7425}
7426
7427// StopReplica: Stops the replication in the read replica instance.
7428func (r *InstancesService) StopReplica(project string, instance string) *InstancesStopReplicaCall {
7429	c := &InstancesStopReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7430	c.project = project
7431	c.instance = instance
7432	return c
7433}
7434
7435// Fields allows partial responses to be retrieved. See
7436// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7437// for more information.
7438func (c *InstancesStopReplicaCall) Fields(s ...googleapi.Field) *InstancesStopReplicaCall {
7439	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7440	return c
7441}
7442
7443// Context sets the context to be used in this call's Do method. Any
7444// pending HTTP request will be aborted if the provided context is
7445// canceled.
7446func (c *InstancesStopReplicaCall) Context(ctx context.Context) *InstancesStopReplicaCall {
7447	c.ctx_ = ctx
7448	return c
7449}
7450
7451// Header returns an http.Header that can be modified by the caller to
7452// add HTTP headers to the request.
7453func (c *InstancesStopReplicaCall) Header() http.Header {
7454	if c.header_ == nil {
7455		c.header_ = make(http.Header)
7456	}
7457	return c.header_
7458}
7459
7460func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) {
7461	reqHeaders := make(http.Header)
7462	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7463	for k, v := range c.header_ {
7464		reqHeaders[k] = v
7465	}
7466	reqHeaders.Set("User-Agent", c.s.userAgent())
7467	var body io.Reader = nil
7468	c.urlParams_.Set("alt", alt)
7469	c.urlParams_.Set("prettyPrint", "false")
7470	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/stopReplica")
7471	urls += "?" + c.urlParams_.Encode()
7472	req, err := http.NewRequest("POST", urls, body)
7473	if err != nil {
7474		return nil, err
7475	}
7476	req.Header = reqHeaders
7477	googleapi.Expand(req.URL, map[string]string{
7478		"project":  c.project,
7479		"instance": c.instance,
7480	})
7481	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7482}
7483
7484// Do executes the "sql.instances.stopReplica" call.
7485// Exactly one of *Operation or error will be non-nil. Any non-2xx
7486// status code is an error. Response headers are in either
7487// *Operation.ServerResponse.Header or (if a response was returned at
7488// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7489// to check whether the returned error was because
7490// http.StatusNotModified was returned.
7491func (c *InstancesStopReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7492	gensupport.SetOptions(c.urlParams_, opts...)
7493	res, err := c.doRequest("json")
7494	if res != nil && res.StatusCode == http.StatusNotModified {
7495		if res.Body != nil {
7496			res.Body.Close()
7497		}
7498		return nil, &googleapi.Error{
7499			Code:   res.StatusCode,
7500			Header: res.Header,
7501		}
7502	}
7503	if err != nil {
7504		return nil, err
7505	}
7506	defer googleapi.CloseBody(res)
7507	if err := googleapi.CheckResponse(res); err != nil {
7508		return nil, err
7509	}
7510	ret := &Operation{
7511		ServerResponse: googleapi.ServerResponse{
7512			Header:         res.Header,
7513			HTTPStatusCode: res.StatusCode,
7514		},
7515	}
7516	target := &ret
7517	if err := gensupport.DecodeResponse(target, res); err != nil {
7518		return nil, err
7519	}
7520	return ret, nil
7521	// {
7522	//   "description": "Stops the replication in the read replica instance.",
7523	//   "httpMethod": "POST",
7524	//   "id": "sql.instances.stopReplica",
7525	//   "parameterOrder": [
7526	//     "project",
7527	//     "instance"
7528	//   ],
7529	//   "parameters": {
7530	//     "instance": {
7531	//       "description": "Cloud SQL read replica instance name.",
7532	//       "location": "path",
7533	//       "required": true,
7534	//       "type": "string"
7535	//     },
7536	//     "project": {
7537	//       "description": "ID of the project that contains the read replica.",
7538	//       "location": "path",
7539	//       "required": true,
7540	//       "type": "string"
7541	//     }
7542	//   },
7543	//   "path": "projects/{project}/instances/{instance}/stopReplica",
7544	//   "response": {
7545	//     "$ref": "Operation"
7546	//   },
7547	//   "scopes": [
7548	//     "https://www.googleapis.com/auth/cloud-platform",
7549	//     "https://www.googleapis.com/auth/sqlservice.admin"
7550	//   ]
7551	// }
7552
7553}
7554
7555// method id "sql.instances.truncateLog":
7556
7557type InstancesTruncateLogCall struct {
7558	s                           *Service
7559	project                     string
7560	instance                    string
7561	instancestruncatelogrequest *InstancesTruncateLogRequest
7562	urlParams_                  gensupport.URLParams
7563	ctx_                        context.Context
7564	header_                     http.Header
7565}
7566
7567// TruncateLog: Truncate MySQL general and slow query log tables
7568func (r *InstancesService) TruncateLog(project string, instance string, instancestruncatelogrequest *InstancesTruncateLogRequest) *InstancesTruncateLogCall {
7569	c := &InstancesTruncateLogCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7570	c.project = project
7571	c.instance = instance
7572	c.instancestruncatelogrequest = instancestruncatelogrequest
7573	return c
7574}
7575
7576// Fields allows partial responses to be retrieved. See
7577// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7578// for more information.
7579func (c *InstancesTruncateLogCall) Fields(s ...googleapi.Field) *InstancesTruncateLogCall {
7580	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7581	return c
7582}
7583
7584// Context sets the context to be used in this call's Do method. Any
7585// pending HTTP request will be aborted if the provided context is
7586// canceled.
7587func (c *InstancesTruncateLogCall) Context(ctx context.Context) *InstancesTruncateLogCall {
7588	c.ctx_ = ctx
7589	return c
7590}
7591
7592// Header returns an http.Header that can be modified by the caller to
7593// add HTTP headers to the request.
7594func (c *InstancesTruncateLogCall) Header() http.Header {
7595	if c.header_ == nil {
7596		c.header_ = make(http.Header)
7597	}
7598	return c.header_
7599}
7600
7601func (c *InstancesTruncateLogCall) doRequest(alt string) (*http.Response, error) {
7602	reqHeaders := make(http.Header)
7603	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7604	for k, v := range c.header_ {
7605		reqHeaders[k] = v
7606	}
7607	reqHeaders.Set("User-Agent", c.s.userAgent())
7608	var body io.Reader = nil
7609	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancestruncatelogrequest)
7610	if err != nil {
7611		return nil, err
7612	}
7613	reqHeaders.Set("Content-Type", "application/json")
7614	c.urlParams_.Set("alt", alt)
7615	c.urlParams_.Set("prettyPrint", "false")
7616	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/truncateLog")
7617	urls += "?" + c.urlParams_.Encode()
7618	req, err := http.NewRequest("POST", urls, body)
7619	if err != nil {
7620		return nil, err
7621	}
7622	req.Header = reqHeaders
7623	googleapi.Expand(req.URL, map[string]string{
7624		"project":  c.project,
7625		"instance": c.instance,
7626	})
7627	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7628}
7629
7630// Do executes the "sql.instances.truncateLog" call.
7631// Exactly one of *Operation or error will be non-nil. Any non-2xx
7632// status code is an error. Response headers are in either
7633// *Operation.ServerResponse.Header or (if a response was returned at
7634// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7635// to check whether the returned error was because
7636// http.StatusNotModified was returned.
7637func (c *InstancesTruncateLogCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7638	gensupport.SetOptions(c.urlParams_, opts...)
7639	res, err := c.doRequest("json")
7640	if res != nil && res.StatusCode == http.StatusNotModified {
7641		if res.Body != nil {
7642			res.Body.Close()
7643		}
7644		return nil, &googleapi.Error{
7645			Code:   res.StatusCode,
7646			Header: res.Header,
7647		}
7648	}
7649	if err != nil {
7650		return nil, err
7651	}
7652	defer googleapi.CloseBody(res)
7653	if err := googleapi.CheckResponse(res); err != nil {
7654		return nil, err
7655	}
7656	ret := &Operation{
7657		ServerResponse: googleapi.ServerResponse{
7658			Header:         res.Header,
7659			HTTPStatusCode: res.StatusCode,
7660		},
7661	}
7662	target := &ret
7663	if err := gensupport.DecodeResponse(target, res); err != nil {
7664		return nil, err
7665	}
7666	return ret, nil
7667	// {
7668	//   "description": "Truncate MySQL general and slow query log tables",
7669	//   "httpMethod": "POST",
7670	//   "id": "sql.instances.truncateLog",
7671	//   "parameterOrder": [
7672	//     "project",
7673	//     "instance"
7674	//   ],
7675	//   "parameters": {
7676	//     "instance": {
7677	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
7678	//       "location": "path",
7679	//       "required": true,
7680	//       "type": "string"
7681	//     },
7682	//     "project": {
7683	//       "description": "Project ID of the Cloud SQL project.",
7684	//       "location": "path",
7685	//       "required": true,
7686	//       "type": "string"
7687	//     }
7688	//   },
7689	//   "path": "projects/{project}/instances/{instance}/truncateLog",
7690	//   "request": {
7691	//     "$ref": "InstancesTruncateLogRequest"
7692	//   },
7693	//   "response": {
7694	//     "$ref": "Operation"
7695	//   },
7696	//   "scopes": [
7697	//     "https://www.googleapis.com/auth/cloud-platform",
7698	//     "https://www.googleapis.com/auth/sqlservice.admin"
7699	//   ]
7700	// }
7701
7702}
7703
7704// method id "sql.instances.update":
7705
7706type InstancesUpdateCall struct {
7707	s                *Service
7708	project          string
7709	instance         string
7710	databaseinstance *DatabaseInstance
7711	urlParams_       gensupport.URLParams
7712	ctx_             context.Context
7713	header_          http.Header
7714}
7715
7716// Update: Updates settings of a Cloud SQL instance. Caution: This is
7717// not a partial update, so you must include values for all the settings
7718// that you want to retain. For partial updates, use patch.
7719func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall {
7720	c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7721	c.project = project
7722	c.instance = instance
7723	c.databaseinstance = databaseinstance
7724	return c
7725}
7726
7727// Fields allows partial responses to be retrieved. See
7728// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7729// for more information.
7730func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall {
7731	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7732	return c
7733}
7734
7735// Context sets the context to be used in this call's Do method. Any
7736// pending HTTP request will be aborted if the provided context is
7737// canceled.
7738func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall {
7739	c.ctx_ = ctx
7740	return c
7741}
7742
7743// Header returns an http.Header that can be modified by the caller to
7744// add HTTP headers to the request.
7745func (c *InstancesUpdateCall) Header() http.Header {
7746	if c.header_ == nil {
7747		c.header_ = make(http.Header)
7748	}
7749	return c.header_
7750}
7751
7752func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) {
7753	reqHeaders := make(http.Header)
7754	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7755	for k, v := range c.header_ {
7756		reqHeaders[k] = v
7757	}
7758	reqHeaders.Set("User-Agent", c.s.userAgent())
7759	var body io.Reader = nil
7760	body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
7761	if err != nil {
7762		return nil, err
7763	}
7764	reqHeaders.Set("Content-Type", "application/json")
7765	c.urlParams_.Set("alt", alt)
7766	c.urlParams_.Set("prettyPrint", "false")
7767	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}")
7768	urls += "?" + c.urlParams_.Encode()
7769	req, err := http.NewRequest("PUT", urls, body)
7770	if err != nil {
7771		return nil, err
7772	}
7773	req.Header = reqHeaders
7774	googleapi.Expand(req.URL, map[string]string{
7775		"project":  c.project,
7776		"instance": c.instance,
7777	})
7778	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7779}
7780
7781// Do executes the "sql.instances.update" call.
7782// Exactly one of *Operation or error will be non-nil. Any non-2xx
7783// status code is an error. Response headers are in either
7784// *Operation.ServerResponse.Header or (if a response was returned at
7785// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7786// to check whether the returned error was because
7787// http.StatusNotModified was returned.
7788func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7789	gensupport.SetOptions(c.urlParams_, opts...)
7790	res, err := c.doRequest("json")
7791	if res != nil && res.StatusCode == http.StatusNotModified {
7792		if res.Body != nil {
7793			res.Body.Close()
7794		}
7795		return nil, &googleapi.Error{
7796			Code:   res.StatusCode,
7797			Header: res.Header,
7798		}
7799	}
7800	if err != nil {
7801		return nil, err
7802	}
7803	defer googleapi.CloseBody(res)
7804	if err := googleapi.CheckResponse(res); err != nil {
7805		return nil, err
7806	}
7807	ret := &Operation{
7808		ServerResponse: googleapi.ServerResponse{
7809			Header:         res.Header,
7810			HTTPStatusCode: res.StatusCode,
7811		},
7812	}
7813	target := &ret
7814	if err := gensupport.DecodeResponse(target, res); err != nil {
7815		return nil, err
7816	}
7817	return ret, nil
7818	// {
7819	//   "description": "Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.",
7820	//   "httpMethod": "PUT",
7821	//   "id": "sql.instances.update",
7822	//   "parameterOrder": [
7823	//     "project",
7824	//     "instance"
7825	//   ],
7826	//   "parameters": {
7827	//     "instance": {
7828	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
7829	//       "location": "path",
7830	//       "required": true,
7831	//       "type": "string"
7832	//     },
7833	//     "project": {
7834	//       "description": "Project ID of the project that contains the instance.",
7835	//       "location": "path",
7836	//       "required": true,
7837	//       "type": "string"
7838	//     }
7839	//   },
7840	//   "path": "projects/{project}/instances/{instance}",
7841	//   "request": {
7842	//     "$ref": "DatabaseInstance"
7843	//   },
7844	//   "response": {
7845	//     "$ref": "Operation"
7846	//   },
7847	//   "scopes": [
7848	//     "https://www.googleapis.com/auth/cloud-platform",
7849	//     "https://www.googleapis.com/auth/sqlservice.admin"
7850	//   ]
7851	// }
7852
7853}
7854
7855// method id "sql.operations.get":
7856
7857type OperationsGetCall struct {
7858	s            *Service
7859	project      string
7860	operation    string
7861	urlParams_   gensupport.URLParams
7862	ifNoneMatch_ string
7863	ctx_         context.Context
7864	header_      http.Header
7865}
7866
7867// Get: Retrieves an instance operation that has been performed on an
7868// instance.
7869func (r *OperationsService) Get(project string, operation string) *OperationsGetCall {
7870	c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7871	c.project = project
7872	c.operation = operation
7873	return c
7874}
7875
7876// Fields allows partial responses to be retrieved. See
7877// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7878// for more information.
7879func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
7880	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7881	return c
7882}
7883
7884// IfNoneMatch sets the optional parameter which makes the operation
7885// fail if the object's ETag matches the given value. This is useful for
7886// getting updates only after the object has changed since the last
7887// request. Use googleapi.IsNotModified to check whether the response
7888// error from Do is the result of In-None-Match.
7889func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
7890	c.ifNoneMatch_ = entityTag
7891	return c
7892}
7893
7894// Context sets the context to be used in this call's Do method. Any
7895// pending HTTP request will be aborted if the provided context is
7896// canceled.
7897func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
7898	c.ctx_ = ctx
7899	return c
7900}
7901
7902// Header returns an http.Header that can be modified by the caller to
7903// add HTTP headers to the request.
7904func (c *OperationsGetCall) Header() http.Header {
7905	if c.header_ == nil {
7906		c.header_ = make(http.Header)
7907	}
7908	return c.header_
7909}
7910
7911func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
7912	reqHeaders := make(http.Header)
7913	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7914	for k, v := range c.header_ {
7915		reqHeaders[k] = v
7916	}
7917	reqHeaders.Set("User-Agent", c.s.userAgent())
7918	if c.ifNoneMatch_ != "" {
7919		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7920	}
7921	var body io.Reader = nil
7922	c.urlParams_.Set("alt", alt)
7923	c.urlParams_.Set("prettyPrint", "false")
7924	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/operations/{operation}")
7925	urls += "?" + c.urlParams_.Encode()
7926	req, err := http.NewRequest("GET", urls, body)
7927	if err != nil {
7928		return nil, err
7929	}
7930	req.Header = reqHeaders
7931	googleapi.Expand(req.URL, map[string]string{
7932		"project":   c.project,
7933		"operation": c.operation,
7934	})
7935	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7936}
7937
7938// Do executes the "sql.operations.get" call.
7939// Exactly one of *Operation or error will be non-nil. Any non-2xx
7940// status code is an error. Response headers are in either
7941// *Operation.ServerResponse.Header or (if a response was returned at
7942// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7943// to check whether the returned error was because
7944// http.StatusNotModified was returned.
7945func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7946	gensupport.SetOptions(c.urlParams_, opts...)
7947	res, err := c.doRequest("json")
7948	if res != nil && res.StatusCode == http.StatusNotModified {
7949		if res.Body != nil {
7950			res.Body.Close()
7951		}
7952		return nil, &googleapi.Error{
7953			Code:   res.StatusCode,
7954			Header: res.Header,
7955		}
7956	}
7957	if err != nil {
7958		return nil, err
7959	}
7960	defer googleapi.CloseBody(res)
7961	if err := googleapi.CheckResponse(res); err != nil {
7962		return nil, err
7963	}
7964	ret := &Operation{
7965		ServerResponse: googleapi.ServerResponse{
7966			Header:         res.Header,
7967			HTTPStatusCode: res.StatusCode,
7968		},
7969	}
7970	target := &ret
7971	if err := gensupport.DecodeResponse(target, res); err != nil {
7972		return nil, err
7973	}
7974	return ret, nil
7975	// {
7976	//   "description": "Retrieves an instance operation that has been performed on an instance.",
7977	//   "httpMethod": "GET",
7978	//   "id": "sql.operations.get",
7979	//   "parameterOrder": [
7980	//     "project",
7981	//     "operation"
7982	//   ],
7983	//   "parameters": {
7984	//     "operation": {
7985	//       "description": "Instance operation ID.",
7986	//       "location": "path",
7987	//       "required": true,
7988	//       "type": "string"
7989	//     },
7990	//     "project": {
7991	//       "description": "Project ID of the project that contains the instance.",
7992	//       "location": "path",
7993	//       "required": true,
7994	//       "type": "string"
7995	//     }
7996	//   },
7997	//   "path": "projects/{project}/operations/{operation}",
7998	//   "response": {
7999	//     "$ref": "Operation"
8000	//   },
8001	//   "scopes": [
8002	//     "https://www.googleapis.com/auth/cloud-platform",
8003	//     "https://www.googleapis.com/auth/sqlservice.admin"
8004	//   ]
8005	// }
8006
8007}
8008
8009// method id "sql.operations.list":
8010
8011type OperationsListCall struct {
8012	s            *Service
8013	project      string
8014	urlParams_   gensupport.URLParams
8015	ifNoneMatch_ string
8016	ctx_         context.Context
8017	header_      http.Header
8018}
8019
8020// List: Lists all instance operations that have been performed on the
8021// given Cloud SQL instance in the reverse chronological order of the
8022// start time.
8023func (r *OperationsService) List(project string, instance string) *OperationsListCall {
8024	c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8025	c.project = project
8026	c.urlParams_.Set("instance", instance)
8027	return c
8028}
8029
8030// MaxResults sets the optional parameter "maxResults": Maximum number
8031// of operations per response.
8032func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall {
8033	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
8034	return c
8035}
8036
8037// PageToken sets the optional parameter "pageToken": A
8038// previously-returned page token representing part of the larger set of
8039// results to view.
8040func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
8041	c.urlParams_.Set("pageToken", pageToken)
8042	return c
8043}
8044
8045// Fields allows partial responses to be retrieved. See
8046// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8047// for more information.
8048func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
8049	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8050	return c
8051}
8052
8053// IfNoneMatch sets the optional parameter which makes the operation
8054// fail if the object's ETag matches the given value. This is useful for
8055// getting updates only after the object has changed since the last
8056// request. Use googleapi.IsNotModified to check whether the response
8057// error from Do is the result of In-None-Match.
8058func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
8059	c.ifNoneMatch_ = entityTag
8060	return c
8061}
8062
8063// Context sets the context to be used in this call's Do method. Any
8064// pending HTTP request will be aborted if the provided context is
8065// canceled.
8066func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
8067	c.ctx_ = ctx
8068	return c
8069}
8070
8071// Header returns an http.Header that can be modified by the caller to
8072// add HTTP headers to the request.
8073func (c *OperationsListCall) Header() http.Header {
8074	if c.header_ == nil {
8075		c.header_ = make(http.Header)
8076	}
8077	return c.header_
8078}
8079
8080func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
8081	reqHeaders := make(http.Header)
8082	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
8083	for k, v := range c.header_ {
8084		reqHeaders[k] = v
8085	}
8086	reqHeaders.Set("User-Agent", c.s.userAgent())
8087	if c.ifNoneMatch_ != "" {
8088		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8089	}
8090	var body io.Reader = nil
8091	c.urlParams_.Set("alt", alt)
8092	c.urlParams_.Set("prettyPrint", "false")
8093	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/operations")
8094	urls += "?" + c.urlParams_.Encode()
8095	req, err := http.NewRequest("GET", urls, body)
8096	if err != nil {
8097		return nil, err
8098	}
8099	req.Header = reqHeaders
8100	googleapi.Expand(req.URL, map[string]string{
8101		"project": c.project,
8102	})
8103	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8104}
8105
8106// Do executes the "sql.operations.list" call.
8107// Exactly one of *OperationsListResponse or error will be non-nil. Any
8108// non-2xx status code is an error. Response headers are in either
8109// *OperationsListResponse.ServerResponse.Header or (if a response was
8110// returned at all) in error.(*googleapi.Error).Header. Use
8111// googleapi.IsNotModified to check whether the returned error was
8112// because http.StatusNotModified was returned.
8113func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) {
8114	gensupport.SetOptions(c.urlParams_, opts...)
8115	res, err := c.doRequest("json")
8116	if res != nil && res.StatusCode == http.StatusNotModified {
8117		if res.Body != nil {
8118			res.Body.Close()
8119		}
8120		return nil, &googleapi.Error{
8121			Code:   res.StatusCode,
8122			Header: res.Header,
8123		}
8124	}
8125	if err != nil {
8126		return nil, err
8127	}
8128	defer googleapi.CloseBody(res)
8129	if err := googleapi.CheckResponse(res); err != nil {
8130		return nil, err
8131	}
8132	ret := &OperationsListResponse{
8133		ServerResponse: googleapi.ServerResponse{
8134			Header:         res.Header,
8135			HTTPStatusCode: res.StatusCode,
8136		},
8137	}
8138	target := &ret
8139	if err := gensupport.DecodeResponse(target, res); err != nil {
8140		return nil, err
8141	}
8142	return ret, nil
8143	// {
8144	//   "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.",
8145	//   "httpMethod": "GET",
8146	//   "id": "sql.operations.list",
8147	//   "parameterOrder": [
8148	//     "project",
8149	//     "instance"
8150	//   ],
8151	//   "parameters": {
8152	//     "instance": {
8153	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8154	//       "location": "query",
8155	//       "required": true,
8156	//       "type": "string"
8157	//     },
8158	//     "maxResults": {
8159	//       "description": "Maximum number of operations per response.",
8160	//       "format": "uint32",
8161	//       "location": "query",
8162	//       "type": "integer"
8163	//     },
8164	//     "pageToken": {
8165	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
8166	//       "location": "query",
8167	//       "type": "string"
8168	//     },
8169	//     "project": {
8170	//       "description": "Project ID of the project that contains the instance.",
8171	//       "location": "path",
8172	//       "required": true,
8173	//       "type": "string"
8174	//     }
8175	//   },
8176	//   "path": "projects/{project}/operations",
8177	//   "response": {
8178	//     "$ref": "OperationsListResponse"
8179	//   },
8180	//   "scopes": [
8181	//     "https://www.googleapis.com/auth/cloud-platform",
8182	//     "https://www.googleapis.com/auth/sqlservice.admin"
8183	//   ]
8184	// }
8185
8186}
8187
8188// Pages invokes f for each page of results.
8189// A non-nil error returned from f will halt the iteration.
8190// The provided context supersedes any context provided to the Context method.
8191func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error {
8192	c.ctx_ = ctx
8193	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
8194	for {
8195		x, err := c.Do()
8196		if err != nil {
8197			return err
8198		}
8199		if err := f(x); err != nil {
8200			return err
8201		}
8202		if x.NextPageToken == "" {
8203			return nil
8204		}
8205		c.PageToken(x.NextPageToken)
8206	}
8207}
8208
8209// method id "sql.sslCerts.createEphemeral":
8210
8211type SslCertsCreateEphemeralCall struct {
8212	s                              *Service
8213	project                        string
8214	instance                       string
8215	sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest
8216	urlParams_                     gensupport.URLParams
8217	ctx_                           context.Context
8218	header_                        http.Header
8219}
8220
8221// CreateEphemeral: Generates a short-lived X509 certificate containing
8222// the provided public key and signed by a private key specific to the
8223// target instance. Users may use the certificate to authenticate as
8224// themselves when connecting to the database.
8225func (r *SslCertsService) CreateEphemeral(project string, instance string, sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest) *SslCertsCreateEphemeralCall {
8226	c := &SslCertsCreateEphemeralCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8227	c.project = project
8228	c.instance = instance
8229	c.sslcertscreateephemeralrequest = sslcertscreateephemeralrequest
8230	return c
8231}
8232
8233// Fields allows partial responses to be retrieved. See
8234// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8235// for more information.
8236func (c *SslCertsCreateEphemeralCall) Fields(s ...googleapi.Field) *SslCertsCreateEphemeralCall {
8237	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8238	return c
8239}
8240
8241// Context sets the context to be used in this call's Do method. Any
8242// pending HTTP request will be aborted if the provided context is
8243// canceled.
8244func (c *SslCertsCreateEphemeralCall) Context(ctx context.Context) *SslCertsCreateEphemeralCall {
8245	c.ctx_ = ctx
8246	return c
8247}
8248
8249// Header returns an http.Header that can be modified by the caller to
8250// add HTTP headers to the request.
8251func (c *SslCertsCreateEphemeralCall) Header() http.Header {
8252	if c.header_ == nil {
8253		c.header_ = make(http.Header)
8254	}
8255	return c.header_
8256}
8257
8258func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) {
8259	reqHeaders := make(http.Header)
8260	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
8261	for k, v := range c.header_ {
8262		reqHeaders[k] = v
8263	}
8264	reqHeaders.Set("User-Agent", c.s.userAgent())
8265	var body io.Reader = nil
8266	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest)
8267	if err != nil {
8268		return nil, err
8269	}
8270	reqHeaders.Set("Content-Type", "application/json")
8271	c.urlParams_.Set("alt", alt)
8272	c.urlParams_.Set("prettyPrint", "false")
8273	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/createEphemeral")
8274	urls += "?" + c.urlParams_.Encode()
8275	req, err := http.NewRequest("POST", urls, body)
8276	if err != nil {
8277		return nil, err
8278	}
8279	req.Header = reqHeaders
8280	googleapi.Expand(req.URL, map[string]string{
8281		"project":  c.project,
8282		"instance": c.instance,
8283	})
8284	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8285}
8286
8287// Do executes the "sql.sslCerts.createEphemeral" call.
8288// Exactly one of *SslCert or error will be non-nil. Any non-2xx status
8289// code is an error. Response headers are in either
8290// *SslCert.ServerResponse.Header or (if a response was returned at all)
8291// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8292// check whether the returned error was because http.StatusNotModified
8293// was returned.
8294func (c *SslCertsCreateEphemeralCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
8295	gensupport.SetOptions(c.urlParams_, opts...)
8296	res, err := c.doRequest("json")
8297	if res != nil && res.StatusCode == http.StatusNotModified {
8298		if res.Body != nil {
8299			res.Body.Close()
8300		}
8301		return nil, &googleapi.Error{
8302			Code:   res.StatusCode,
8303			Header: res.Header,
8304		}
8305	}
8306	if err != nil {
8307		return nil, err
8308	}
8309	defer googleapi.CloseBody(res)
8310	if err := googleapi.CheckResponse(res); err != nil {
8311		return nil, err
8312	}
8313	ret := &SslCert{
8314		ServerResponse: googleapi.ServerResponse{
8315			Header:         res.Header,
8316			HTTPStatusCode: res.StatusCode,
8317		},
8318	}
8319	target := &ret
8320	if err := gensupport.DecodeResponse(target, res); err != nil {
8321		return nil, err
8322	}
8323	return ret, nil
8324	// {
8325	//   "description": "Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.",
8326	//   "httpMethod": "POST",
8327	//   "id": "sql.sslCerts.createEphemeral",
8328	//   "parameterOrder": [
8329	//     "project",
8330	//     "instance"
8331	//   ],
8332	//   "parameters": {
8333	//     "instance": {
8334	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8335	//       "location": "path",
8336	//       "required": true,
8337	//       "type": "string"
8338	//     },
8339	//     "project": {
8340	//       "description": "Project ID of the Cloud SQL project.",
8341	//       "location": "path",
8342	//       "required": true,
8343	//       "type": "string"
8344	//     }
8345	//   },
8346	//   "path": "projects/{project}/instances/{instance}/createEphemeral",
8347	//   "request": {
8348	//     "$ref": "SslCertsCreateEphemeralRequest"
8349	//   },
8350	//   "response": {
8351	//     "$ref": "SslCert"
8352	//   },
8353	//   "scopes": [
8354	//     "https://www.googleapis.com/auth/cloud-platform",
8355	//     "https://www.googleapis.com/auth/sqlservice.admin"
8356	//   ]
8357	// }
8358
8359}
8360
8361// method id "sql.sslCerts.delete":
8362
8363type SslCertsDeleteCall struct {
8364	s               *Service
8365	project         string
8366	instance        string
8367	sha1Fingerprint string
8368	urlParams_      gensupport.URLParams
8369	ctx_            context.Context
8370	header_         http.Header
8371}
8372
8373// Delete: Deletes the SSL certificate. For First Generation instances,
8374// the certificate remains valid until the instance is restarted.
8375func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall {
8376	c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8377	c.project = project
8378	c.instance = instance
8379	c.sha1Fingerprint = sha1Fingerprint
8380	return c
8381}
8382
8383// Fields allows partial responses to be retrieved. See
8384// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8385// for more information.
8386func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall {
8387	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8388	return c
8389}
8390
8391// Context sets the context to be used in this call's Do method. Any
8392// pending HTTP request will be aborted if the provided context is
8393// canceled.
8394func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall {
8395	c.ctx_ = ctx
8396	return c
8397}
8398
8399// Header returns an http.Header that can be modified by the caller to
8400// add HTTP headers to the request.
8401func (c *SslCertsDeleteCall) Header() http.Header {
8402	if c.header_ == nil {
8403		c.header_ = make(http.Header)
8404	}
8405	return c.header_
8406}
8407
8408func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) {
8409	reqHeaders := make(http.Header)
8410	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
8411	for k, v := range c.header_ {
8412		reqHeaders[k] = v
8413	}
8414	reqHeaders.Set("User-Agent", c.s.userAgent())
8415	var body io.Reader = nil
8416	c.urlParams_.Set("alt", alt)
8417	c.urlParams_.Set("prettyPrint", "false")
8418	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
8419	urls += "?" + c.urlParams_.Encode()
8420	req, err := http.NewRequest("DELETE", urls, body)
8421	if err != nil {
8422		return nil, err
8423	}
8424	req.Header = reqHeaders
8425	googleapi.Expand(req.URL, map[string]string{
8426		"project":         c.project,
8427		"instance":        c.instance,
8428		"sha1Fingerprint": c.sha1Fingerprint,
8429	})
8430	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8431}
8432
8433// Do executes the "sql.sslCerts.delete" call.
8434// Exactly one of *Operation or error will be non-nil. Any non-2xx
8435// status code is an error. Response headers are in either
8436// *Operation.ServerResponse.Header or (if a response was returned at
8437// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8438// to check whether the returned error was because
8439// http.StatusNotModified was returned.
8440func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8441	gensupport.SetOptions(c.urlParams_, opts...)
8442	res, err := c.doRequest("json")
8443	if res != nil && res.StatusCode == http.StatusNotModified {
8444		if res.Body != nil {
8445			res.Body.Close()
8446		}
8447		return nil, &googleapi.Error{
8448			Code:   res.StatusCode,
8449			Header: res.Header,
8450		}
8451	}
8452	if err != nil {
8453		return nil, err
8454	}
8455	defer googleapi.CloseBody(res)
8456	if err := googleapi.CheckResponse(res); err != nil {
8457		return nil, err
8458	}
8459	ret := &Operation{
8460		ServerResponse: googleapi.ServerResponse{
8461			Header:         res.Header,
8462			HTTPStatusCode: res.StatusCode,
8463		},
8464	}
8465	target := &ret
8466	if err := gensupport.DecodeResponse(target, res); err != nil {
8467		return nil, err
8468	}
8469	return ret, nil
8470	// {
8471	//   "description": "Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.",
8472	//   "httpMethod": "DELETE",
8473	//   "id": "sql.sslCerts.delete",
8474	//   "parameterOrder": [
8475	//     "project",
8476	//     "instance",
8477	//     "sha1Fingerprint"
8478	//   ],
8479	//   "parameters": {
8480	//     "instance": {
8481	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8482	//       "location": "path",
8483	//       "required": true,
8484	//       "type": "string"
8485	//     },
8486	//     "project": {
8487	//       "description": "Project ID of the project that contains the instance.",
8488	//       "location": "path",
8489	//       "required": true,
8490	//       "type": "string"
8491	//     },
8492	//     "sha1Fingerprint": {
8493	//       "description": "Sha1 FingerPrint.",
8494	//       "location": "path",
8495	//       "required": true,
8496	//       "type": "string"
8497	//     }
8498	//   },
8499	//   "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
8500	//   "response": {
8501	//     "$ref": "Operation"
8502	//   },
8503	//   "scopes": [
8504	//     "https://www.googleapis.com/auth/cloud-platform",
8505	//     "https://www.googleapis.com/auth/sqlservice.admin"
8506	//   ]
8507	// }
8508
8509}
8510
8511// method id "sql.sslCerts.get":
8512
8513type SslCertsGetCall struct {
8514	s               *Service
8515	project         string
8516	instance        string
8517	sha1Fingerprint string
8518	urlParams_      gensupport.URLParams
8519	ifNoneMatch_    string
8520	ctx_            context.Context
8521	header_         http.Header
8522}
8523
8524// Get: Retrieves a particular SSL certificate. Does not include the
8525// private key (required for usage). The private key must be saved from
8526// the response to initial creation.
8527func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall {
8528	c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8529	c.project = project
8530	c.instance = instance
8531	c.sha1Fingerprint = sha1Fingerprint
8532	return c
8533}
8534
8535// Fields allows partial responses to be retrieved. See
8536// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8537// for more information.
8538func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall {
8539	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8540	return c
8541}
8542
8543// IfNoneMatch sets the optional parameter which makes the operation
8544// fail if the object's ETag matches the given value. This is useful for
8545// getting updates only after the object has changed since the last
8546// request. Use googleapi.IsNotModified to check whether the response
8547// error from Do is the result of In-None-Match.
8548func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall {
8549	c.ifNoneMatch_ = entityTag
8550	return c
8551}
8552
8553// Context sets the context to be used in this call's Do method. Any
8554// pending HTTP request will be aborted if the provided context is
8555// canceled.
8556func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall {
8557	c.ctx_ = ctx
8558	return c
8559}
8560
8561// Header returns an http.Header that can be modified by the caller to
8562// add HTTP headers to the request.
8563func (c *SslCertsGetCall) Header() http.Header {
8564	if c.header_ == nil {
8565		c.header_ = make(http.Header)
8566	}
8567	return c.header_
8568}
8569
8570func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) {
8571	reqHeaders := make(http.Header)
8572	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
8573	for k, v := range c.header_ {
8574		reqHeaders[k] = v
8575	}
8576	reqHeaders.Set("User-Agent", c.s.userAgent())
8577	if c.ifNoneMatch_ != "" {
8578		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8579	}
8580	var body io.Reader = nil
8581	c.urlParams_.Set("alt", alt)
8582	c.urlParams_.Set("prettyPrint", "false")
8583	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
8584	urls += "?" + c.urlParams_.Encode()
8585	req, err := http.NewRequest("GET", urls, body)
8586	if err != nil {
8587		return nil, err
8588	}
8589	req.Header = reqHeaders
8590	googleapi.Expand(req.URL, map[string]string{
8591		"project":         c.project,
8592		"instance":        c.instance,
8593		"sha1Fingerprint": c.sha1Fingerprint,
8594	})
8595	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8596}
8597
8598// Do executes the "sql.sslCerts.get" call.
8599// Exactly one of *SslCert or error will be non-nil. Any non-2xx status
8600// code is an error. Response headers are in either
8601// *SslCert.ServerResponse.Header or (if a response was returned at all)
8602// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8603// check whether the returned error was because http.StatusNotModified
8604// was returned.
8605func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
8606	gensupport.SetOptions(c.urlParams_, opts...)
8607	res, err := c.doRequest("json")
8608	if res != nil && res.StatusCode == http.StatusNotModified {
8609		if res.Body != nil {
8610			res.Body.Close()
8611		}
8612		return nil, &googleapi.Error{
8613			Code:   res.StatusCode,
8614			Header: res.Header,
8615		}
8616	}
8617	if err != nil {
8618		return nil, err
8619	}
8620	defer googleapi.CloseBody(res)
8621	if err := googleapi.CheckResponse(res); err != nil {
8622		return nil, err
8623	}
8624	ret := &SslCert{
8625		ServerResponse: googleapi.ServerResponse{
8626			Header:         res.Header,
8627			HTTPStatusCode: res.StatusCode,
8628		},
8629	}
8630	target := &ret
8631	if err := gensupport.DecodeResponse(target, res); err != nil {
8632		return nil, err
8633	}
8634	return ret, nil
8635	// {
8636	//   "description": "Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.",
8637	//   "httpMethod": "GET",
8638	//   "id": "sql.sslCerts.get",
8639	//   "parameterOrder": [
8640	//     "project",
8641	//     "instance",
8642	//     "sha1Fingerprint"
8643	//   ],
8644	//   "parameters": {
8645	//     "instance": {
8646	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8647	//       "location": "path",
8648	//       "required": true,
8649	//       "type": "string"
8650	//     },
8651	//     "project": {
8652	//       "description": "Project ID of the project that contains the instance.",
8653	//       "location": "path",
8654	//       "required": true,
8655	//       "type": "string"
8656	//     },
8657	//     "sha1Fingerprint": {
8658	//       "description": "Sha1 FingerPrint.",
8659	//       "location": "path",
8660	//       "required": true,
8661	//       "type": "string"
8662	//     }
8663	//   },
8664	//   "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
8665	//   "response": {
8666	//     "$ref": "SslCert"
8667	//   },
8668	//   "scopes": [
8669	//     "https://www.googleapis.com/auth/cloud-platform",
8670	//     "https://www.googleapis.com/auth/sqlservice.admin"
8671	//   ]
8672	// }
8673
8674}
8675
8676// method id "sql.sslCerts.insert":
8677
8678type SslCertsInsertCall struct {
8679	s                     *Service
8680	project               string
8681	instance              string
8682	sslcertsinsertrequest *SslCertsInsertRequest
8683	urlParams_            gensupport.URLParams
8684	ctx_                  context.Context
8685	header_               http.Header
8686}
8687
8688// Insert: Creates an SSL certificate and returns it along with the
8689// private key and server certificate authority. The new certificate
8690// will not be usable until the instance is restarted.
8691func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall {
8692	c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8693	c.project = project
8694	c.instance = instance
8695	c.sslcertsinsertrequest = sslcertsinsertrequest
8696	return c
8697}
8698
8699// Fields allows partial responses to be retrieved. See
8700// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8701// for more information.
8702func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall {
8703	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8704	return c
8705}
8706
8707// Context sets the context to be used in this call's Do method. Any
8708// pending HTTP request will be aborted if the provided context is
8709// canceled.
8710func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall {
8711	c.ctx_ = ctx
8712	return c
8713}
8714
8715// Header returns an http.Header that can be modified by the caller to
8716// add HTTP headers to the request.
8717func (c *SslCertsInsertCall) Header() http.Header {
8718	if c.header_ == nil {
8719		c.header_ = make(http.Header)
8720	}
8721	return c.header_
8722}
8723
8724func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) {
8725	reqHeaders := make(http.Header)
8726	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
8727	for k, v := range c.header_ {
8728		reqHeaders[k] = v
8729	}
8730	reqHeaders.Set("User-Agent", c.s.userAgent())
8731	var body io.Reader = nil
8732	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest)
8733	if err != nil {
8734		return nil, err
8735	}
8736	reqHeaders.Set("Content-Type", "application/json")
8737	c.urlParams_.Set("alt", alt)
8738	c.urlParams_.Set("prettyPrint", "false")
8739	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts")
8740	urls += "?" + c.urlParams_.Encode()
8741	req, err := http.NewRequest("POST", urls, body)
8742	if err != nil {
8743		return nil, err
8744	}
8745	req.Header = reqHeaders
8746	googleapi.Expand(req.URL, map[string]string{
8747		"project":  c.project,
8748		"instance": c.instance,
8749	})
8750	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8751}
8752
8753// Do executes the "sql.sslCerts.insert" call.
8754// Exactly one of *SslCertsInsertResponse or error will be non-nil. Any
8755// non-2xx status code is an error. Response headers are in either
8756// *SslCertsInsertResponse.ServerResponse.Header or (if a response was
8757// returned at all) in error.(*googleapi.Error).Header. Use
8758// googleapi.IsNotModified to check whether the returned error was
8759// because http.StatusNotModified was returned.
8760func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) {
8761	gensupport.SetOptions(c.urlParams_, opts...)
8762	res, err := c.doRequest("json")
8763	if res != nil && res.StatusCode == http.StatusNotModified {
8764		if res.Body != nil {
8765			res.Body.Close()
8766		}
8767		return nil, &googleapi.Error{
8768			Code:   res.StatusCode,
8769			Header: res.Header,
8770		}
8771	}
8772	if err != nil {
8773		return nil, err
8774	}
8775	defer googleapi.CloseBody(res)
8776	if err := googleapi.CheckResponse(res); err != nil {
8777		return nil, err
8778	}
8779	ret := &SslCertsInsertResponse{
8780		ServerResponse: googleapi.ServerResponse{
8781			Header:         res.Header,
8782			HTTPStatusCode: res.StatusCode,
8783		},
8784	}
8785	target := &ret
8786	if err := gensupport.DecodeResponse(target, res); err != nil {
8787		return nil, err
8788	}
8789	return ret, nil
8790	// {
8791	//   "description": "Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.",
8792	//   "httpMethod": "POST",
8793	//   "id": "sql.sslCerts.insert",
8794	//   "parameterOrder": [
8795	//     "project",
8796	//     "instance"
8797	//   ],
8798	//   "parameters": {
8799	//     "instance": {
8800	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8801	//       "location": "path",
8802	//       "required": true,
8803	//       "type": "string"
8804	//     },
8805	//     "project": {
8806	//       "description": "Project ID of the project that contains the instance.",
8807	//       "location": "path",
8808	//       "required": true,
8809	//       "type": "string"
8810	//     }
8811	//   },
8812	//   "path": "projects/{project}/instances/{instance}/sslCerts",
8813	//   "request": {
8814	//     "$ref": "SslCertsInsertRequest"
8815	//   },
8816	//   "response": {
8817	//     "$ref": "SslCertsInsertResponse"
8818	//   },
8819	//   "scopes": [
8820	//     "https://www.googleapis.com/auth/cloud-platform",
8821	//     "https://www.googleapis.com/auth/sqlservice.admin"
8822	//   ]
8823	// }
8824
8825}
8826
8827// method id "sql.sslCerts.list":
8828
8829type SslCertsListCall struct {
8830	s            *Service
8831	project      string
8832	instance     string
8833	urlParams_   gensupport.URLParams
8834	ifNoneMatch_ string
8835	ctx_         context.Context
8836	header_      http.Header
8837}
8838
8839// List: Lists all of the current SSL certificates for the instance.
8840func (r *SslCertsService) List(project string, instance string) *SslCertsListCall {
8841	c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8842	c.project = project
8843	c.instance = instance
8844	return c
8845}
8846
8847// Fields allows partial responses to be retrieved. See
8848// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8849// for more information.
8850func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall {
8851	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8852	return c
8853}
8854
8855// IfNoneMatch sets the optional parameter which makes the operation
8856// fail if the object's ETag matches the given value. This is useful for
8857// getting updates only after the object has changed since the last
8858// request. Use googleapi.IsNotModified to check whether the response
8859// error from Do is the result of In-None-Match.
8860func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall {
8861	c.ifNoneMatch_ = entityTag
8862	return c
8863}
8864
8865// Context sets the context to be used in this call's Do method. Any
8866// pending HTTP request will be aborted if the provided context is
8867// canceled.
8868func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall {
8869	c.ctx_ = ctx
8870	return c
8871}
8872
8873// Header returns an http.Header that can be modified by the caller to
8874// add HTTP headers to the request.
8875func (c *SslCertsListCall) Header() http.Header {
8876	if c.header_ == nil {
8877		c.header_ = make(http.Header)
8878	}
8879	return c.header_
8880}
8881
8882func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) {
8883	reqHeaders := make(http.Header)
8884	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
8885	for k, v := range c.header_ {
8886		reqHeaders[k] = v
8887	}
8888	reqHeaders.Set("User-Agent", c.s.userAgent())
8889	if c.ifNoneMatch_ != "" {
8890		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8891	}
8892	var body io.Reader = nil
8893	c.urlParams_.Set("alt", alt)
8894	c.urlParams_.Set("prettyPrint", "false")
8895	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts")
8896	urls += "?" + c.urlParams_.Encode()
8897	req, err := http.NewRequest("GET", urls, body)
8898	if err != nil {
8899		return nil, err
8900	}
8901	req.Header = reqHeaders
8902	googleapi.Expand(req.URL, map[string]string{
8903		"project":  c.project,
8904		"instance": c.instance,
8905	})
8906	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8907}
8908
8909// Do executes the "sql.sslCerts.list" call.
8910// Exactly one of *SslCertsListResponse or error will be non-nil. Any
8911// non-2xx status code is an error. Response headers are in either
8912// *SslCertsListResponse.ServerResponse.Header or (if a response was
8913// returned at all) in error.(*googleapi.Error).Header. Use
8914// googleapi.IsNotModified to check whether the returned error was
8915// because http.StatusNotModified was returned.
8916func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) {
8917	gensupport.SetOptions(c.urlParams_, opts...)
8918	res, err := c.doRequest("json")
8919	if res != nil && res.StatusCode == http.StatusNotModified {
8920		if res.Body != nil {
8921			res.Body.Close()
8922		}
8923		return nil, &googleapi.Error{
8924			Code:   res.StatusCode,
8925			Header: res.Header,
8926		}
8927	}
8928	if err != nil {
8929		return nil, err
8930	}
8931	defer googleapi.CloseBody(res)
8932	if err := googleapi.CheckResponse(res); err != nil {
8933		return nil, err
8934	}
8935	ret := &SslCertsListResponse{
8936		ServerResponse: googleapi.ServerResponse{
8937			Header:         res.Header,
8938			HTTPStatusCode: res.StatusCode,
8939		},
8940	}
8941	target := &ret
8942	if err := gensupport.DecodeResponse(target, res); err != nil {
8943		return nil, err
8944	}
8945	return ret, nil
8946	// {
8947	//   "description": "Lists all of the current SSL certificates for the instance.",
8948	//   "httpMethod": "GET",
8949	//   "id": "sql.sslCerts.list",
8950	//   "parameterOrder": [
8951	//     "project",
8952	//     "instance"
8953	//   ],
8954	//   "parameters": {
8955	//     "instance": {
8956	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8957	//       "location": "path",
8958	//       "required": true,
8959	//       "type": "string"
8960	//     },
8961	//     "project": {
8962	//       "description": "Project ID of the project that contains the instance.",
8963	//       "location": "path",
8964	//       "required": true,
8965	//       "type": "string"
8966	//     }
8967	//   },
8968	//   "path": "projects/{project}/instances/{instance}/sslCerts",
8969	//   "response": {
8970	//     "$ref": "SslCertsListResponse"
8971	//   },
8972	//   "scopes": [
8973	//     "https://www.googleapis.com/auth/cloud-platform",
8974	//     "https://www.googleapis.com/auth/sqlservice.admin"
8975	//   ]
8976	// }
8977
8978}
8979
8980// method id "sql.tiers.list":
8981
8982type TiersListCall struct {
8983	s            *Service
8984	project      string
8985	urlParams_   gensupport.URLParams
8986	ifNoneMatch_ string
8987	ctx_         context.Context
8988	header_      http.Header
8989}
8990
8991// List: Lists all available machine types (tiers) for Cloud SQL, for
8992// example, db-n1-standard-1. For related information, see Pricing.
8993func (r *TiersService) List(project string) *TiersListCall {
8994	c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8995	c.project = project
8996	return c
8997}
8998
8999// Fields allows partial responses to be retrieved. See
9000// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9001// for more information.
9002func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall {
9003	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9004	return c
9005}
9006
9007// IfNoneMatch sets the optional parameter which makes the operation
9008// fail if the object's ETag matches the given value. This is useful for
9009// getting updates only after the object has changed since the last
9010// request. Use googleapi.IsNotModified to check whether the response
9011// error from Do is the result of In-None-Match.
9012func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall {
9013	c.ifNoneMatch_ = entityTag
9014	return c
9015}
9016
9017// Context sets the context to be used in this call's Do method. Any
9018// pending HTTP request will be aborted if the provided context is
9019// canceled.
9020func (c *TiersListCall) Context(ctx context.Context) *TiersListCall {
9021	c.ctx_ = ctx
9022	return c
9023}
9024
9025// Header returns an http.Header that can be modified by the caller to
9026// add HTTP headers to the request.
9027func (c *TiersListCall) Header() http.Header {
9028	if c.header_ == nil {
9029		c.header_ = make(http.Header)
9030	}
9031	return c.header_
9032}
9033
9034func (c *TiersListCall) doRequest(alt string) (*http.Response, error) {
9035	reqHeaders := make(http.Header)
9036	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
9037	for k, v := range c.header_ {
9038		reqHeaders[k] = v
9039	}
9040	reqHeaders.Set("User-Agent", c.s.userAgent())
9041	if c.ifNoneMatch_ != "" {
9042		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9043	}
9044	var body io.Reader = nil
9045	c.urlParams_.Set("alt", alt)
9046	c.urlParams_.Set("prettyPrint", "false")
9047	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/tiers")
9048	urls += "?" + c.urlParams_.Encode()
9049	req, err := http.NewRequest("GET", urls, body)
9050	if err != nil {
9051		return nil, err
9052	}
9053	req.Header = reqHeaders
9054	googleapi.Expand(req.URL, map[string]string{
9055		"project": c.project,
9056	})
9057	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9058}
9059
9060// Do executes the "sql.tiers.list" call.
9061// Exactly one of *TiersListResponse or error will be non-nil. Any
9062// non-2xx status code is an error. Response headers are in either
9063// *TiersListResponse.ServerResponse.Header or (if a response was
9064// returned at all) in error.(*googleapi.Error).Header. Use
9065// googleapi.IsNotModified to check whether the returned error was
9066// because http.StatusNotModified was returned.
9067func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) {
9068	gensupport.SetOptions(c.urlParams_, opts...)
9069	res, err := c.doRequest("json")
9070	if res != nil && res.StatusCode == http.StatusNotModified {
9071		if res.Body != nil {
9072			res.Body.Close()
9073		}
9074		return nil, &googleapi.Error{
9075			Code:   res.StatusCode,
9076			Header: res.Header,
9077		}
9078	}
9079	if err != nil {
9080		return nil, err
9081	}
9082	defer googleapi.CloseBody(res)
9083	if err := googleapi.CheckResponse(res); err != nil {
9084		return nil, err
9085	}
9086	ret := &TiersListResponse{
9087		ServerResponse: googleapi.ServerResponse{
9088			Header:         res.Header,
9089			HTTPStatusCode: res.StatusCode,
9090		},
9091	}
9092	target := &ret
9093	if err := gensupport.DecodeResponse(target, res); err != nil {
9094		return nil, err
9095	}
9096	return ret, nil
9097	// {
9098	//   "description": "Lists all available machine types (tiers) for Cloud SQL, for example, db-n1-standard-1. For related information, see Pricing.",
9099	//   "httpMethod": "GET",
9100	//   "id": "sql.tiers.list",
9101	//   "parameterOrder": [
9102	//     "project"
9103	//   ],
9104	//   "parameters": {
9105	//     "project": {
9106	//       "description": "Project ID of the project for which to list tiers.",
9107	//       "location": "path",
9108	//       "required": true,
9109	//       "type": "string"
9110	//     }
9111	//   },
9112	//   "path": "projects/{project}/tiers",
9113	//   "response": {
9114	//     "$ref": "TiersListResponse"
9115	//   },
9116	//   "scopes": [
9117	//     "https://www.googleapis.com/auth/cloud-platform",
9118	//     "https://www.googleapis.com/auth/sqlservice.admin"
9119	//   ]
9120	// }
9121
9122}
9123
9124// method id "sql.users.delete":
9125
9126type UsersDeleteCall struct {
9127	s          *Service
9128	project    string
9129	instance   string
9130	urlParams_ gensupport.URLParams
9131	ctx_       context.Context
9132	header_    http.Header
9133}
9134
9135// Delete: Deletes a user from a Cloud SQL instance.
9136func (r *UsersService) Delete(project string, instance string, host string, name string) *UsersDeleteCall {
9137	c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9138	c.project = project
9139	c.instance = instance
9140	c.urlParams_.Set("host", host)
9141	c.urlParams_.Set("name", name)
9142	return c
9143}
9144
9145// Fields allows partial responses to be retrieved. See
9146// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9147// for more information.
9148func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall {
9149	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9150	return c
9151}
9152
9153// Context sets the context to be used in this call's Do method. Any
9154// pending HTTP request will be aborted if the provided context is
9155// canceled.
9156func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall {
9157	c.ctx_ = ctx
9158	return c
9159}
9160
9161// Header returns an http.Header that can be modified by the caller to
9162// add HTTP headers to the request.
9163func (c *UsersDeleteCall) Header() http.Header {
9164	if c.header_ == nil {
9165		c.header_ = make(http.Header)
9166	}
9167	return c.header_
9168}
9169
9170func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) {
9171	reqHeaders := make(http.Header)
9172	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
9173	for k, v := range c.header_ {
9174		reqHeaders[k] = v
9175	}
9176	reqHeaders.Set("User-Agent", c.s.userAgent())
9177	var body io.Reader = nil
9178	c.urlParams_.Set("alt", alt)
9179	c.urlParams_.Set("prettyPrint", "false")
9180	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users")
9181	urls += "?" + c.urlParams_.Encode()
9182	req, err := http.NewRequest("DELETE", urls, body)
9183	if err != nil {
9184		return nil, err
9185	}
9186	req.Header = reqHeaders
9187	googleapi.Expand(req.URL, map[string]string{
9188		"project":  c.project,
9189		"instance": c.instance,
9190	})
9191	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9192}
9193
9194// Do executes the "sql.users.delete" call.
9195// Exactly one of *Operation or error will be non-nil. Any non-2xx
9196// status code is an error. Response headers are in either
9197// *Operation.ServerResponse.Header or (if a response was returned at
9198// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9199// to check whether the returned error was because
9200// http.StatusNotModified was returned.
9201func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9202	gensupport.SetOptions(c.urlParams_, opts...)
9203	res, err := c.doRequest("json")
9204	if res != nil && res.StatusCode == http.StatusNotModified {
9205		if res.Body != nil {
9206			res.Body.Close()
9207		}
9208		return nil, &googleapi.Error{
9209			Code:   res.StatusCode,
9210			Header: res.Header,
9211		}
9212	}
9213	if err != nil {
9214		return nil, err
9215	}
9216	defer googleapi.CloseBody(res)
9217	if err := googleapi.CheckResponse(res); err != nil {
9218		return nil, err
9219	}
9220	ret := &Operation{
9221		ServerResponse: googleapi.ServerResponse{
9222			Header:         res.Header,
9223			HTTPStatusCode: res.StatusCode,
9224		},
9225	}
9226	target := &ret
9227	if err := gensupport.DecodeResponse(target, res); err != nil {
9228		return nil, err
9229	}
9230	return ret, nil
9231	// {
9232	//   "description": "Deletes a user from a Cloud SQL instance.",
9233	//   "httpMethod": "DELETE",
9234	//   "id": "sql.users.delete",
9235	//   "parameterOrder": [
9236	//     "project",
9237	//     "instance",
9238	//     "host",
9239	//     "name"
9240	//   ],
9241	//   "parameters": {
9242	//     "host": {
9243	//       "description": "Host of the user in the instance.",
9244	//       "location": "query",
9245	//       "required": true,
9246	//       "type": "string"
9247	//     },
9248	//     "instance": {
9249	//       "description": "Database instance ID. This does not include the project ID.",
9250	//       "location": "path",
9251	//       "required": true,
9252	//       "type": "string"
9253	//     },
9254	//     "name": {
9255	//       "description": "Name of the user in the instance.",
9256	//       "location": "query",
9257	//       "required": true,
9258	//       "type": "string"
9259	//     },
9260	//     "project": {
9261	//       "description": "Project ID of the project that contains the instance.",
9262	//       "location": "path",
9263	//       "required": true,
9264	//       "type": "string"
9265	//     }
9266	//   },
9267	//   "path": "projects/{project}/instances/{instance}/users",
9268	//   "response": {
9269	//     "$ref": "Operation"
9270	//   },
9271	//   "scopes": [
9272	//     "https://www.googleapis.com/auth/cloud-platform",
9273	//     "https://www.googleapis.com/auth/sqlservice.admin"
9274	//   ]
9275	// }
9276
9277}
9278
9279// method id "sql.users.insert":
9280
9281type UsersInsertCall struct {
9282	s          *Service
9283	project    string
9284	instance   string
9285	user       *User
9286	urlParams_ gensupport.URLParams
9287	ctx_       context.Context
9288	header_    http.Header
9289}
9290
9291// Insert: Creates a new user in a Cloud SQL instance.
9292func (r *UsersService) Insert(project string, instance string, user *User) *UsersInsertCall {
9293	c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9294	c.project = project
9295	c.instance = instance
9296	c.user = user
9297	return c
9298}
9299
9300// Fields allows partial responses to be retrieved. See
9301// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9302// for more information.
9303func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall {
9304	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9305	return c
9306}
9307
9308// Context sets the context to be used in this call's Do method. Any
9309// pending HTTP request will be aborted if the provided context is
9310// canceled.
9311func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall {
9312	c.ctx_ = ctx
9313	return c
9314}
9315
9316// Header returns an http.Header that can be modified by the caller to
9317// add HTTP headers to the request.
9318func (c *UsersInsertCall) Header() http.Header {
9319	if c.header_ == nil {
9320		c.header_ = make(http.Header)
9321	}
9322	return c.header_
9323}
9324
9325func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) {
9326	reqHeaders := make(http.Header)
9327	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
9328	for k, v := range c.header_ {
9329		reqHeaders[k] = v
9330	}
9331	reqHeaders.Set("User-Agent", c.s.userAgent())
9332	var body io.Reader = nil
9333	body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
9334	if err != nil {
9335		return nil, err
9336	}
9337	reqHeaders.Set("Content-Type", "application/json")
9338	c.urlParams_.Set("alt", alt)
9339	c.urlParams_.Set("prettyPrint", "false")
9340	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users")
9341	urls += "?" + c.urlParams_.Encode()
9342	req, err := http.NewRequest("POST", urls, body)
9343	if err != nil {
9344		return nil, err
9345	}
9346	req.Header = reqHeaders
9347	googleapi.Expand(req.URL, map[string]string{
9348		"project":  c.project,
9349		"instance": c.instance,
9350	})
9351	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9352}
9353
9354// Do executes the "sql.users.insert" call.
9355// Exactly one of *Operation or error will be non-nil. Any non-2xx
9356// status code is an error. Response headers are in either
9357// *Operation.ServerResponse.Header or (if a response was returned at
9358// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9359// to check whether the returned error was because
9360// http.StatusNotModified was returned.
9361func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9362	gensupport.SetOptions(c.urlParams_, opts...)
9363	res, err := c.doRequest("json")
9364	if res != nil && res.StatusCode == http.StatusNotModified {
9365		if res.Body != nil {
9366			res.Body.Close()
9367		}
9368		return nil, &googleapi.Error{
9369			Code:   res.StatusCode,
9370			Header: res.Header,
9371		}
9372	}
9373	if err != nil {
9374		return nil, err
9375	}
9376	defer googleapi.CloseBody(res)
9377	if err := googleapi.CheckResponse(res); err != nil {
9378		return nil, err
9379	}
9380	ret := &Operation{
9381		ServerResponse: googleapi.ServerResponse{
9382			Header:         res.Header,
9383			HTTPStatusCode: res.StatusCode,
9384		},
9385	}
9386	target := &ret
9387	if err := gensupport.DecodeResponse(target, res); err != nil {
9388		return nil, err
9389	}
9390	return ret, nil
9391	// {
9392	//   "description": "Creates a new user in a Cloud SQL instance.",
9393	//   "httpMethod": "POST",
9394	//   "id": "sql.users.insert",
9395	//   "parameterOrder": [
9396	//     "project",
9397	//     "instance"
9398	//   ],
9399	//   "parameters": {
9400	//     "instance": {
9401	//       "description": "Database instance ID. This does not include the project ID.",
9402	//       "location": "path",
9403	//       "required": true,
9404	//       "type": "string"
9405	//     },
9406	//     "project": {
9407	//       "description": "Project ID of the project that contains the instance.",
9408	//       "location": "path",
9409	//       "required": true,
9410	//       "type": "string"
9411	//     }
9412	//   },
9413	//   "path": "projects/{project}/instances/{instance}/users",
9414	//   "request": {
9415	//     "$ref": "User"
9416	//   },
9417	//   "response": {
9418	//     "$ref": "Operation"
9419	//   },
9420	//   "scopes": [
9421	//     "https://www.googleapis.com/auth/cloud-platform",
9422	//     "https://www.googleapis.com/auth/sqlservice.admin"
9423	//   ]
9424	// }
9425
9426}
9427
9428// method id "sql.users.list":
9429
9430type UsersListCall struct {
9431	s            *Service
9432	project      string
9433	instance     string
9434	urlParams_   gensupport.URLParams
9435	ifNoneMatch_ string
9436	ctx_         context.Context
9437	header_      http.Header
9438}
9439
9440// List: Lists users in the specified Cloud SQL instance.
9441func (r *UsersService) List(project string, instance string) *UsersListCall {
9442	c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9443	c.project = project
9444	c.instance = instance
9445	return c
9446}
9447
9448// Fields allows partial responses to be retrieved. See
9449// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9450// for more information.
9451func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall {
9452	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9453	return c
9454}
9455
9456// IfNoneMatch sets the optional parameter which makes the operation
9457// fail if the object's ETag matches the given value. This is useful for
9458// getting updates only after the object has changed since the last
9459// request. Use googleapi.IsNotModified to check whether the response
9460// error from Do is the result of In-None-Match.
9461func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall {
9462	c.ifNoneMatch_ = entityTag
9463	return c
9464}
9465
9466// Context sets the context to be used in this call's Do method. Any
9467// pending HTTP request will be aborted if the provided context is
9468// canceled.
9469func (c *UsersListCall) Context(ctx context.Context) *UsersListCall {
9470	c.ctx_ = ctx
9471	return c
9472}
9473
9474// Header returns an http.Header that can be modified by the caller to
9475// add HTTP headers to the request.
9476func (c *UsersListCall) Header() http.Header {
9477	if c.header_ == nil {
9478		c.header_ = make(http.Header)
9479	}
9480	return c.header_
9481}
9482
9483func (c *UsersListCall) doRequest(alt string) (*http.Response, error) {
9484	reqHeaders := make(http.Header)
9485	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
9486	for k, v := range c.header_ {
9487		reqHeaders[k] = v
9488	}
9489	reqHeaders.Set("User-Agent", c.s.userAgent())
9490	if c.ifNoneMatch_ != "" {
9491		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9492	}
9493	var body io.Reader = nil
9494	c.urlParams_.Set("alt", alt)
9495	c.urlParams_.Set("prettyPrint", "false")
9496	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users")
9497	urls += "?" + c.urlParams_.Encode()
9498	req, err := http.NewRequest("GET", urls, body)
9499	if err != nil {
9500		return nil, err
9501	}
9502	req.Header = reqHeaders
9503	googleapi.Expand(req.URL, map[string]string{
9504		"project":  c.project,
9505		"instance": c.instance,
9506	})
9507	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9508}
9509
9510// Do executes the "sql.users.list" call.
9511// Exactly one of *UsersListResponse or error will be non-nil. Any
9512// non-2xx status code is an error. Response headers are in either
9513// *UsersListResponse.ServerResponse.Header or (if a response was
9514// returned at all) in error.(*googleapi.Error).Header. Use
9515// googleapi.IsNotModified to check whether the returned error was
9516// because http.StatusNotModified was returned.
9517func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) {
9518	gensupport.SetOptions(c.urlParams_, opts...)
9519	res, err := c.doRequest("json")
9520	if res != nil && res.StatusCode == http.StatusNotModified {
9521		if res.Body != nil {
9522			res.Body.Close()
9523		}
9524		return nil, &googleapi.Error{
9525			Code:   res.StatusCode,
9526			Header: res.Header,
9527		}
9528	}
9529	if err != nil {
9530		return nil, err
9531	}
9532	defer googleapi.CloseBody(res)
9533	if err := googleapi.CheckResponse(res); err != nil {
9534		return nil, err
9535	}
9536	ret := &UsersListResponse{
9537		ServerResponse: googleapi.ServerResponse{
9538			Header:         res.Header,
9539			HTTPStatusCode: res.StatusCode,
9540		},
9541	}
9542	target := &ret
9543	if err := gensupport.DecodeResponse(target, res); err != nil {
9544		return nil, err
9545	}
9546	return ret, nil
9547	// {
9548	//   "description": "Lists users in the specified Cloud SQL instance.",
9549	//   "httpMethod": "GET",
9550	//   "id": "sql.users.list",
9551	//   "parameterOrder": [
9552	//     "project",
9553	//     "instance"
9554	//   ],
9555	//   "parameters": {
9556	//     "instance": {
9557	//       "description": "Database instance ID. This does not include the project ID.",
9558	//       "location": "path",
9559	//       "required": true,
9560	//       "type": "string"
9561	//     },
9562	//     "project": {
9563	//       "description": "Project ID of the project that contains the instance.",
9564	//       "location": "path",
9565	//       "required": true,
9566	//       "type": "string"
9567	//     }
9568	//   },
9569	//   "path": "projects/{project}/instances/{instance}/users",
9570	//   "response": {
9571	//     "$ref": "UsersListResponse"
9572	//   },
9573	//   "scopes": [
9574	//     "https://www.googleapis.com/auth/cloud-platform",
9575	//     "https://www.googleapis.com/auth/sqlservice.admin"
9576	//   ]
9577	// }
9578
9579}
9580
9581// method id "sql.users.update":
9582
9583type UsersUpdateCall struct {
9584	s          *Service
9585	project    string
9586	instance   string
9587	user       *User
9588	urlParams_ gensupport.URLParams
9589	ctx_       context.Context
9590	header_    http.Header
9591}
9592
9593// Update: Updates an existing user in a Cloud SQL instance.
9594func (r *UsersService) Update(project string, instance string, name string, user *User) *UsersUpdateCall {
9595	c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9596	c.project = project
9597	c.instance = instance
9598	c.urlParams_.Set("name", name)
9599	c.user = user
9600	return c
9601}
9602
9603// Host sets the optional parameter "host": Host of the user in the
9604// instance. For a MySQL instance, it's required; For a PostgreSQL
9605// instance, it's optional.
9606func (c *UsersUpdateCall) Host(host string) *UsersUpdateCall {
9607	c.urlParams_.Set("host", host)
9608	return c
9609}
9610
9611// Fields allows partial responses to be retrieved. See
9612// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9613// for more information.
9614func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall {
9615	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9616	return c
9617}
9618
9619// Context sets the context to be used in this call's Do method. Any
9620// pending HTTP request will be aborted if the provided context is
9621// canceled.
9622func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall {
9623	c.ctx_ = ctx
9624	return c
9625}
9626
9627// Header returns an http.Header that can be modified by the caller to
9628// add HTTP headers to the request.
9629func (c *UsersUpdateCall) Header() http.Header {
9630	if c.header_ == nil {
9631		c.header_ = make(http.Header)
9632	}
9633	return c.header_
9634}
9635
9636func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) {
9637	reqHeaders := make(http.Header)
9638	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
9639	for k, v := range c.header_ {
9640		reqHeaders[k] = v
9641	}
9642	reqHeaders.Set("User-Agent", c.s.userAgent())
9643	var body io.Reader = nil
9644	body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
9645	if err != nil {
9646		return nil, err
9647	}
9648	reqHeaders.Set("Content-Type", "application/json")
9649	c.urlParams_.Set("alt", alt)
9650	c.urlParams_.Set("prettyPrint", "false")
9651	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users")
9652	urls += "?" + c.urlParams_.Encode()
9653	req, err := http.NewRequest("PUT", urls, body)
9654	if err != nil {
9655		return nil, err
9656	}
9657	req.Header = reqHeaders
9658	googleapi.Expand(req.URL, map[string]string{
9659		"project":  c.project,
9660		"instance": c.instance,
9661	})
9662	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9663}
9664
9665// Do executes the "sql.users.update" call.
9666// Exactly one of *Operation or error will be non-nil. Any non-2xx
9667// status code is an error. Response headers are in either
9668// *Operation.ServerResponse.Header or (if a response was returned at
9669// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9670// to check whether the returned error was because
9671// http.StatusNotModified was returned.
9672func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9673	gensupport.SetOptions(c.urlParams_, opts...)
9674	res, err := c.doRequest("json")
9675	if res != nil && res.StatusCode == http.StatusNotModified {
9676		if res.Body != nil {
9677			res.Body.Close()
9678		}
9679		return nil, &googleapi.Error{
9680			Code:   res.StatusCode,
9681			Header: res.Header,
9682		}
9683	}
9684	if err != nil {
9685		return nil, err
9686	}
9687	defer googleapi.CloseBody(res)
9688	if err := googleapi.CheckResponse(res); err != nil {
9689		return nil, err
9690	}
9691	ret := &Operation{
9692		ServerResponse: googleapi.ServerResponse{
9693			Header:         res.Header,
9694			HTTPStatusCode: res.StatusCode,
9695		},
9696	}
9697	target := &ret
9698	if err := gensupport.DecodeResponse(target, res); err != nil {
9699		return nil, err
9700	}
9701	return ret, nil
9702	// {
9703	//   "description": "Updates an existing user in a Cloud SQL instance.",
9704	//   "httpMethod": "PUT",
9705	//   "id": "sql.users.update",
9706	//   "parameterOrder": [
9707	//     "project",
9708	//     "instance",
9709	//     "name"
9710	//   ],
9711	//   "parameters": {
9712	//     "host": {
9713	//       "description": "Host of the user in the instance. For a MySQL instance, it's required; For a PostgreSQL instance, it's optional.",
9714	//       "location": "query",
9715	//       "type": "string"
9716	//     },
9717	//     "instance": {
9718	//       "description": "Database instance ID. This does not include the project ID.",
9719	//       "location": "path",
9720	//       "required": true,
9721	//       "type": "string"
9722	//     },
9723	//     "name": {
9724	//       "description": "Name of the user in the instance.",
9725	//       "location": "query",
9726	//       "required": true,
9727	//       "type": "string"
9728	//     },
9729	//     "project": {
9730	//       "description": "Project ID of the project that contains the instance.",
9731	//       "location": "path",
9732	//       "required": true,
9733	//       "type": "string"
9734	//     }
9735	//   },
9736	//   "path": "projects/{project}/instances/{instance}/users",
9737	//   "request": {
9738	//     "$ref": "User"
9739	//   },
9740	//   "response": {
9741	//     "$ref": "Operation"
9742	//   },
9743	//   "scopes": [
9744	//     "https://www.googleapis.com/auth/cloud-platform",
9745	//     "https://www.googleapis.com/auth/sqlservice.admin"
9746	//   ]
9747	// }
9748
9749}
9750