1// Copyright 2021 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://developers.google.com/cloud-sql/
10//
11// Creating a client
12//
13// Usage example:
14//
15//   import "google.golang.org/api/sqladmin/v1"
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/v1"
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	internaloption "google.golang.org/api/option/internaloption"
60	htransport "google.golang.org/api/transport/http"
61)
62
63// Always reference these packages, just in case the auto-generated code
64// below doesn't.
65var _ = bytes.NewBuffer
66var _ = strconv.Itoa
67var _ = fmt.Sprintf
68var _ = json.NewDecoder
69var _ = io.Copy
70var _ = url.Parse
71var _ = gensupport.MarshalJSON
72var _ = googleapi.Version
73var _ = errors.New
74var _ = strings.Replace
75var _ = context.Canceled
76var _ = internaloption.WithDefaultEndpoint
77
78const apiId = "sqladmin:v1"
79const apiName = "sqladmin"
80const apiVersion = "v1"
81const basePath = "https://sqladmin.googleapis.com/"
82const mtlsBasePath = "https://sqladmin.mtls.googleapis.com/"
83
84// OAuth2 scopes used by this API.
85const (
86	// See, edit, configure, and delete your Google Cloud Platform data
87	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
88
89	// Manage your Google SQL Service instances
90	SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin"
91)
92
93// NewService creates a new Service.
94func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
95	scopesOption := option.WithScopes(
96		"https://www.googleapis.com/auth/cloud-platform",
97		"https://www.googleapis.com/auth/sqlservice.admin",
98	)
99	// NOTE: prepend, so we don't override user-specified scopes.
100	opts = append([]option.ClientOption{scopesOption}, opts...)
101	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
102	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
103	client, endpoint, err := htransport.NewClient(ctx, opts...)
104	if err != nil {
105		return nil, err
106	}
107	s, err := New(client)
108	if err != nil {
109		return nil, err
110	}
111	if endpoint != "" {
112		s.BasePath = endpoint
113	}
114	return s, nil
115}
116
117// New creates a new Service. It uses the provided http.Client for requests.
118//
119// Deprecated: please use NewService instead.
120// To provide a custom HTTP client, use option.WithHTTPClient.
121// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
122func New(client *http.Client) (*Service, error) {
123	if client == nil {
124		return nil, errors.New("client is nil")
125	}
126	s := &Service{client: client, BasePath: basePath}
127	s.BackupRuns = NewBackupRunsService(s)
128	s.Connect = NewConnectService(s)
129	s.Databases = NewDatabasesService(s)
130	s.Flags = NewFlagsService(s)
131	s.Instances = NewInstancesService(s)
132	s.Operations = NewOperationsService(s)
133	s.Projects = NewProjectsService(s)
134	s.SslCerts = NewSslCertsService(s)
135	s.Tiers = NewTiersService(s)
136	s.Users = NewUsersService(s)
137	return s, nil
138}
139
140type Service struct {
141	client    *http.Client
142	BasePath  string // API endpoint base URL
143	UserAgent string // optional additional User-Agent fragment
144
145	BackupRuns *BackupRunsService
146
147	Connect *ConnectService
148
149	Databases *DatabasesService
150
151	Flags *FlagsService
152
153	Instances *InstancesService
154
155	Operations *OperationsService
156
157	Projects *ProjectsService
158
159	SslCerts *SslCertsService
160
161	Tiers *TiersService
162
163	Users *UsersService
164}
165
166func (s *Service) userAgent() string {
167	if s.UserAgent == "" {
168		return googleapi.UserAgent
169	}
170	return googleapi.UserAgent + " " + s.UserAgent
171}
172
173func NewBackupRunsService(s *Service) *BackupRunsService {
174	rs := &BackupRunsService{s: s}
175	return rs
176}
177
178type BackupRunsService struct {
179	s *Service
180}
181
182func NewConnectService(s *Service) *ConnectService {
183	rs := &ConnectService{s: s}
184	return rs
185}
186
187type ConnectService struct {
188	s *Service
189}
190
191func NewDatabasesService(s *Service) *DatabasesService {
192	rs := &DatabasesService{s: s}
193	return rs
194}
195
196type DatabasesService struct {
197	s *Service
198}
199
200func NewFlagsService(s *Service) *FlagsService {
201	rs := &FlagsService{s: s}
202	return rs
203}
204
205type FlagsService struct {
206	s *Service
207}
208
209func NewInstancesService(s *Service) *InstancesService {
210	rs := &InstancesService{s: s}
211	return rs
212}
213
214type InstancesService struct {
215	s *Service
216}
217
218func NewOperationsService(s *Service) *OperationsService {
219	rs := &OperationsService{s: s}
220	return rs
221}
222
223type OperationsService struct {
224	s *Service
225}
226
227func NewProjectsService(s *Service) *ProjectsService {
228	rs := &ProjectsService{s: s}
229	rs.Instances = NewProjectsInstancesService(s)
230	return rs
231}
232
233type ProjectsService struct {
234	s *Service
235
236	Instances *ProjectsInstancesService
237}
238
239func NewProjectsInstancesService(s *Service) *ProjectsInstancesService {
240	rs := &ProjectsInstancesService{s: s}
241	return rs
242}
243
244type ProjectsInstancesService struct {
245	s *Service
246}
247
248func NewSslCertsService(s *Service) *SslCertsService {
249	rs := &SslCertsService{s: s}
250	return rs
251}
252
253type SslCertsService struct {
254	s *Service
255}
256
257func NewTiersService(s *Service) *TiersService {
258	rs := &TiersService{s: s}
259	return rs
260}
261
262type TiersService struct {
263	s *Service
264}
265
266func NewUsersService(s *Service) *UsersService {
267	rs := &UsersService{s: s}
268	return rs
269}
270
271type UsersService struct {
272	s *Service
273}
274
275// AclEntry: An entry for an Access Control list.
276type AclEntry struct {
277	// ExpirationTime: The time when this access control entry expires in
278	// RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example
279	// **2012-11-15T16:19:00.094Z**.
280	ExpirationTime string `json:"expirationTime,omitempty"`
281
282	// Kind: This is always **sql#aclEntry**.
283	Kind string `json:"kind,omitempty"`
284
285	// Name: Optional. A label to identify this entry.
286	Name string `json:"name,omitempty"`
287
288	// Value: The allowlisted value for the access control list.
289	Value string `json:"value,omitempty"`
290
291	// ForceSendFields is a list of field names (e.g. "ExpirationTime") to
292	// unconditionally include in API requests. By default, fields with
293	// empty or default values are omitted from API requests. However, any
294	// non-pointer, non-interface field appearing in ForceSendFields will be
295	// sent to the server regardless of whether the field is empty or not.
296	// This may be used to include empty fields in Patch requests.
297	ForceSendFields []string `json:"-"`
298
299	// NullFields is a list of field names (e.g. "ExpirationTime") to
300	// include in API requests with the JSON null value. By default, fields
301	// with empty values are omitted from API requests. However, any field
302	// with an empty value appearing in NullFields will be sent to the
303	// server as null. It is an error if a field in this list has a
304	// non-empty value. This may be used to include null fields in Patch
305	// requests.
306	NullFields []string `json:"-"`
307}
308
309func (s *AclEntry) MarshalJSON() ([]byte, error) {
310	type NoMethod AclEntry
311	raw := NoMethod(*s)
312	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
313}
314
315// ApiWarning: An Admin API warning message.
316type ApiWarning struct {
317	// Code: Code to uniquely identify the warning type.
318	//
319	// Possible values:
320	//   "SQL_API_WARNING_CODE_UNSPECIFIED" - An unknown or unset warning
321	// type from Cloud SQL API.
322	//   "REGION_UNREACHABLE" - Warning when one or more regions are not
323	// reachable. The returned result set may be incomplete.
324	Code string `json:"code,omitempty"`
325
326	// Message: The warning message.
327	Message string `json:"message,omitempty"`
328
329	// Region: The region name for REGION_UNREACHABLE warning.
330	Region string `json:"region,omitempty"`
331
332	// ForceSendFields is a list of field names (e.g. "Code") to
333	// unconditionally include in API requests. By default, fields with
334	// empty or default values are omitted from API requests. However, any
335	// non-pointer, non-interface field appearing in ForceSendFields will be
336	// sent to the server regardless of whether the field is empty or not.
337	// This may be used to include empty fields in Patch requests.
338	ForceSendFields []string `json:"-"`
339
340	// NullFields is a list of field names (e.g. "Code") to include in API
341	// requests with the JSON null value. By default, fields with empty
342	// values are omitted from API requests. However, any field with an
343	// empty value appearing in NullFields will be sent to the server as
344	// null. It is an error if a field in this list has a non-empty value.
345	// This may be used to include null fields in Patch requests.
346	NullFields []string `json:"-"`
347}
348
349func (s *ApiWarning) MarshalJSON() ([]byte, error) {
350	type NoMethod ApiWarning
351	raw := NoMethod(*s)
352	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
353}
354
355// BackupConfiguration: Database instance backup configuration.
356type BackupConfiguration struct {
357	// BackupRetentionSettings: Backup retention settings.
358	BackupRetentionSettings *BackupRetentionSettings `json:"backupRetentionSettings,omitempty"`
359
360	// BinaryLogEnabled: (MySQL only) Whether binary log is enabled. If
361	// backup configuration is disabled, binarylog must be disabled as well.
362	BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"`
363
364	// Enabled: Whether this configuration is enabled.
365	Enabled bool `json:"enabled,omitempty"`
366
367	// Kind: This is always **sql#backupConfiguration**.
368	Kind string `json:"kind,omitempty"`
369
370	// Location: Location of the backup
371	Location string `json:"location,omitempty"`
372
373	// PointInTimeRecoveryEnabled: (Postgres only) Whether point in time
374	// recovery is enabled.
375	PointInTimeRecoveryEnabled bool `json:"pointInTimeRecoveryEnabled,omitempty"`
376
377	// ReplicationLogArchivingEnabled: Reserved for future use.
378	ReplicationLogArchivingEnabled bool `json:"replicationLogArchivingEnabled,omitempty"`
379
380	// StartTime: Start time for the daily backup configuration in UTC
381	// timezone in the 24 hour format - **HH:MM**.
382	StartTime string `json:"startTime,omitempty"`
383
384	// TransactionLogRetentionDays: The number of days of transaction logs
385	// we retain for point in time restore, from 1-7.
386	TransactionLogRetentionDays int64 `json:"transactionLogRetentionDays,omitempty"`
387
388	// ForceSendFields is a list of field names (e.g.
389	// "BackupRetentionSettings") to unconditionally include in API
390	// requests. By default, fields with empty or default values are omitted
391	// from API requests. However, any non-pointer, non-interface field
392	// appearing in ForceSendFields will be sent to the server regardless of
393	// whether the field is empty or not. This may be used to include empty
394	// fields in Patch requests.
395	ForceSendFields []string `json:"-"`
396
397	// NullFields is a list of field names (e.g. "BackupRetentionSettings")
398	// to include in API requests with the JSON null value. By default,
399	// fields with empty values are omitted from API requests. However, any
400	// field with an empty value appearing in NullFields will be sent to the
401	// server as null. It is an error if a field in this list has a
402	// non-empty value. This may be used to include null fields in Patch
403	// requests.
404	NullFields []string `json:"-"`
405}
406
407func (s *BackupConfiguration) MarshalJSON() ([]byte, error) {
408	type NoMethod BackupConfiguration
409	raw := NoMethod(*s)
410	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
411}
412
413// BackupContext: Backup context.
414type BackupContext struct {
415	// BackupId: The identifier of the backup.
416	BackupId int64 `json:"backupId,omitempty,string"`
417
418	// Kind: This is always **sql#backupContext**.
419	Kind string `json:"kind,omitempty"`
420
421	// ForceSendFields is a list of field names (e.g. "BackupId") to
422	// unconditionally include in API requests. By default, fields with
423	// empty or default values are omitted from API requests. However, any
424	// non-pointer, non-interface field appearing in ForceSendFields will be
425	// sent to the server regardless of whether the field is empty or not.
426	// This may be used to include empty fields in Patch requests.
427	ForceSendFields []string `json:"-"`
428
429	// NullFields is a list of field names (e.g. "BackupId") to include in
430	// API requests with the JSON null value. By default, fields with empty
431	// values are omitted from API requests. However, any field with an
432	// empty value appearing in NullFields will be sent to the server as
433	// null. It is an error if a field in this list has a non-empty value.
434	// This may be used to include null fields in Patch requests.
435	NullFields []string `json:"-"`
436}
437
438func (s *BackupContext) MarshalJSON() ([]byte, error) {
439	type NoMethod BackupContext
440	raw := NoMethod(*s)
441	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
442}
443
444// BackupRetentionSettings: We currently only support backup retention
445// by specifying the number of backups we will retain.
446type BackupRetentionSettings struct {
447	// RetainedBackups: Depending on the value of retention_unit, this is
448	// used to determine if a backup needs to be deleted. If retention_unit
449	// is 'COUNT', we will retain this many backups.
450	RetainedBackups int64 `json:"retainedBackups,omitempty"`
451
452	// RetentionUnit: The unit that 'retained_backups' represents.
453	//
454	// Possible values:
455	//   "RETENTION_UNIT_UNSPECIFIED" - Backup retention unit is
456	// unspecified, will be treated as COUNT.
457	//   "COUNT" - Retention will be by count, eg. "retain the most recent 7
458	// backups".
459	RetentionUnit string `json:"retentionUnit,omitempty"`
460
461	// ForceSendFields is a list of field names (e.g. "RetainedBackups") to
462	// unconditionally include in API requests. By default, fields with
463	// empty or default values are omitted from API requests. However, any
464	// non-pointer, non-interface field appearing in ForceSendFields will be
465	// sent to the server regardless of whether the field is empty or not.
466	// This may be used to include empty fields in Patch requests.
467	ForceSendFields []string `json:"-"`
468
469	// NullFields is a list of field names (e.g. "RetainedBackups") to
470	// include in API requests with the JSON null value. By default, fields
471	// with empty values are omitted from API requests. However, any field
472	// with an empty value appearing in NullFields will be sent to the
473	// server as null. It is an error if a field in this list has a
474	// non-empty value. This may be used to include null fields in Patch
475	// requests.
476	NullFields []string `json:"-"`
477}
478
479func (s *BackupRetentionSettings) MarshalJSON() ([]byte, error) {
480	type NoMethod BackupRetentionSettings
481	raw := NoMethod(*s)
482	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
483}
484
485// BackupRun: A BackupRun resource.
486type BackupRun struct {
487	// BackupKind: Specifies the kind of backup, PHYSICAL or
488	// DEFAULT_SNAPSHOT.
489	//
490	// Possible values:
491	//   "SQL_BACKUP_KIND_UNSPECIFIED" - This is an unknown BackupKind.
492	//   "SNAPSHOT" - The snapshot based backups
493	//   "PHYSICAL" - Physical backups
494	BackupKind string `json:"backupKind,omitempty"`
495
496	// Description: The description of this run, only applicable to
497	// on-demand backups.
498	Description string `json:"description,omitempty"`
499
500	// DiskEncryptionConfiguration: Encryption configuration specific to a
501	// backup.
502	DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"`
503
504	// DiskEncryptionStatus: Encryption status specific to a backup.
505	DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"`
506
507	// EndTime: The time the backup operation completed in UTC timezone in
508	// RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.
509	EndTime string `json:"endTime,omitempty"`
510
511	// EnqueuedTime: The time the run was enqueued in UTC timezone in RFC
512	// 3339 format, for example *2012-11-15T16:19:00.094Z*.
513	EnqueuedTime string `json:"enqueuedTime,omitempty"`
514
515	// Error: Information about why the backup operation failed. This is
516	// only present if the run has the FAILED status.
517	Error *OperationError `json:"error,omitempty"`
518
519	// Id: The identifier for this backup run. Unique only for a specific
520	// Cloud SQL instance.
521	Id int64 `json:"id,omitempty,string"`
522
523	// Instance: Name of the database instance.
524	Instance string `json:"instance,omitempty"`
525
526	// Kind: This is always *sql#backupRun*.
527	Kind string `json:"kind,omitempty"`
528
529	// Location: Location of the backups.
530	Location string `json:"location,omitempty"`
531
532	// SelfLink: The URI of this resource.
533	SelfLink string `json:"selfLink,omitempty"`
534
535	// StartTime: The time the backup operation actually started in UTC
536	// timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.
537	StartTime string `json:"startTime,omitempty"`
538
539	// Status: The status of this run.
540	//
541	// Possible values:
542	//   "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" - The status of the run is
543	// unknown.
544	//   "ENQUEUED" - The backup operation was enqueued.
545	//   "OVERDUE" - The backup is overdue across a given backup window.
546	// Indicates a problem. Example: Long-running operation in progress
547	// during the whole window.
548	//   "RUNNING" - The backup is in progress.
549	//   "FAILED" - The backup failed.
550	//   "SUCCESSFUL" - The backup was successful.
551	//   "SKIPPED" - The backup was skipped (without problems) for a given
552	// backup window. Example: Instance was idle.
553	//   "DELETION_PENDING" - The backup is about to be deleted.
554	//   "DELETION_FAILED" - The backup deletion failed.
555	//   "DELETED" - The backup has been deleted.
556	Status string `json:"status,omitempty"`
557
558	// Type: The type of this run; can be either "AUTOMATED" or "ON_DEMAND".
559	// This field defaults to "ON_DEMAND" and is ignored, when specified for
560	// insert requests.
561	//
562	// Possible values:
563	//   "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" - This is an unknown BackupRun
564	// type.
565	//   "AUTOMATED" - The backup schedule automatically triggers a backup.
566	//   "ON_DEMAND" - The user manually triggers a backup.
567	Type string `json:"type,omitempty"`
568
569	// WindowStartTime: The start time of the backup window during which
570	// this the backup was attempted in RFC 3339 format, for example
571	// *2012-11-15T16:19:00.094Z*.
572	WindowStartTime string `json:"windowStartTime,omitempty"`
573
574	// ServerResponse contains the HTTP response code and headers from the
575	// server.
576	googleapi.ServerResponse `json:"-"`
577
578	// ForceSendFields is a list of field names (e.g. "BackupKind") to
579	// unconditionally include in API requests. By default, fields with
580	// empty or default values are omitted from API requests. However, any
581	// non-pointer, non-interface field appearing in ForceSendFields will be
582	// sent to the server regardless of whether the field is empty or not.
583	// This may be used to include empty fields in Patch requests.
584	ForceSendFields []string `json:"-"`
585
586	// NullFields is a list of field names (e.g. "BackupKind") to include in
587	// API requests with the JSON null value. By default, fields with empty
588	// values are omitted from API requests. However, any field with an
589	// empty value appearing in NullFields will be sent to the server as
590	// null. It is an error if a field in this list has a non-empty value.
591	// This may be used to include null fields in Patch requests.
592	NullFields []string `json:"-"`
593}
594
595func (s *BackupRun) MarshalJSON() ([]byte, error) {
596	type NoMethod BackupRun
597	raw := NoMethod(*s)
598	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
599}
600
601// BackupRunsListResponse: Backup run list results.
602type BackupRunsListResponse struct {
603	// Items: A list of backup runs in reverse chronological order of the
604	// enqueued time.
605	Items []*BackupRun `json:"items,omitempty"`
606
607	// Kind: This is always *sql#backupRunsList*.
608	Kind string `json:"kind,omitempty"`
609
610	// NextPageToken: The continuation token, used to page through large
611	// result sets. Provide this value in a subsequent request to return the
612	// next page of results.
613	NextPageToken string `json:"nextPageToken,omitempty"`
614
615	// ServerResponse contains the HTTP response code and headers from the
616	// server.
617	googleapi.ServerResponse `json:"-"`
618
619	// ForceSendFields is a list of field names (e.g. "Items") to
620	// unconditionally include in API requests. By default, fields with
621	// empty or default values are omitted from API requests. However, any
622	// non-pointer, non-interface field appearing in ForceSendFields will be
623	// sent to the server regardless of whether the field is empty or not.
624	// This may be used to include empty fields in Patch requests.
625	ForceSendFields []string `json:"-"`
626
627	// NullFields is a list of field names (e.g. "Items") to include in API
628	// requests with the JSON null value. By default, fields with empty
629	// values are omitted from API requests. However, any field with an
630	// empty value appearing in NullFields will be sent to the server as
631	// null. It is an error if a field in this list has a non-empty value.
632	// This may be used to include null fields in Patch requests.
633	NullFields []string `json:"-"`
634}
635
636func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) {
637	type NoMethod BackupRunsListResponse
638	raw := NoMethod(*s)
639	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
640}
641
642// BinLogCoordinates: Binary log coordinates.
643type BinLogCoordinates struct {
644	// BinLogFileName: Name of the binary log file for a Cloud SQL instance.
645	BinLogFileName string `json:"binLogFileName,omitempty"`
646
647	// BinLogPosition: Position (offset) within the binary log file.
648	BinLogPosition int64 `json:"binLogPosition,omitempty,string"`
649
650	// Kind: This is always *sql#binLogCoordinates*.
651	Kind string `json:"kind,omitempty"`
652
653	// ForceSendFields is a list of field names (e.g. "BinLogFileName") to
654	// unconditionally include in API requests. By default, fields with
655	// empty or default values are omitted from API requests. However, any
656	// non-pointer, non-interface field appearing in ForceSendFields will be
657	// sent to the server regardless of whether the field is empty or not.
658	// This may be used to include empty fields in Patch requests.
659	ForceSendFields []string `json:"-"`
660
661	// NullFields is a list of field names (e.g. "BinLogFileName") to
662	// include in API requests with the JSON null value. By default, fields
663	// with empty values are omitted from API requests. However, any field
664	// with an empty value appearing in NullFields will be sent to the
665	// server as null. It is an error if a field in this list has a
666	// non-empty value. This may be used to include null fields in Patch
667	// requests.
668	NullFields []string `json:"-"`
669}
670
671func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) {
672	type NoMethod BinLogCoordinates
673	raw := NoMethod(*s)
674	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
675}
676
677// CloneContext: Database instance clone context.
678type CloneContext struct {
679	// BinLogCoordinates: Binary log coordinates, if specified, identify the
680	// position up to which the source instance is cloned. If not specified,
681	// the source instance is cloned up to the most recent binary log
682	// coordinates.
683	BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"`
684
685	// DestinationInstanceName: Name of the Cloud SQL instance to be created
686	// as a clone.
687	DestinationInstanceName string `json:"destinationInstanceName,omitempty"`
688
689	// Kind: This is always *sql#cloneContext*.
690	Kind string `json:"kind,omitempty"`
691
692	// PitrTimestampMs: Reserved for future use.
693	PitrTimestampMs int64 `json:"pitrTimestampMs,omitempty,string"`
694
695	// PointInTime: Timestamp, if specified, identifies the time to which
696	// the source instance is cloned.
697	PointInTime string `json:"pointInTime,omitempty"`
698
699	// ForceSendFields is a list of field names (e.g. "BinLogCoordinates")
700	// to unconditionally include in API requests. By default, fields with
701	// empty or default values are omitted from API requests. However, any
702	// non-pointer, non-interface field appearing in ForceSendFields will be
703	// sent to the server regardless of whether the field is empty or not.
704	// This may be used to include empty fields in Patch requests.
705	ForceSendFields []string `json:"-"`
706
707	// NullFields is a list of field names (e.g. "BinLogCoordinates") to
708	// include in API requests with the JSON null value. By default, fields
709	// with empty values are omitted from API requests. However, any field
710	// with an empty value appearing in NullFields will be sent to the
711	// server as null. It is an error if a field in this list has a
712	// non-empty value. This may be used to include null fields in Patch
713	// requests.
714	NullFields []string `json:"-"`
715}
716
717func (s *CloneContext) MarshalJSON() ([]byte, error) {
718	type NoMethod CloneContext
719	raw := NoMethod(*s)
720	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
721}
722
723// ConnectSettings: Connect settings retrieval response.
724type ConnectSettings struct {
725	// BackendType: **SECOND_GEN**: Cloud SQL database instance.
726	// **EXTERNAL**: A database server that is not managed by Google. This
727	// property is read-only; use the **tier** property in the **settings**
728	// object to determine the database type.
729	//
730	// Possible values:
731	//   "SQL_BACKEND_TYPE_UNSPECIFIED" - This is an unknown backend type
732	// for instance.
733	//   "FIRST_GEN" - V1 speckle instance.
734	//   "SECOND_GEN" - V2 speckle instance.
735	//   "EXTERNAL" - On premises instance.
736	BackendType string `json:"backendType,omitempty"`
737
738	// DatabaseVersion: The database engine type and version. The
739	// **databaseVersion** field cannot be changed after instance creation.
740	// MySQL instances: **MYSQL_8_0**, **MYSQL_5_7** (default), or
741	// **MYSQL_5_6**. PostgreSQL instances: **POSTGRES_9_6**,
742	// **POSTGRES_10**, **POSTGRES_11** or **POSTGRES_12** (default). SQL
743	// Server instances: **SQLSERVER_2017_STANDARD** (default),
744	// **SQLSERVER_2017_ENTERPRISE**, **SQLSERVER_2017_EXPRESS**, or
745	// **SQLSERVER_2017_WEB**.
746	//
747	// Possible values:
748	//   "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database
749	// version.
750	//   "MYSQL_5_1" - The database version is MySQL 5.1.
751	//   "MYSQL_5_5" - The database version is MySQL 5.5.
752	//   "MYSQL_5_6" - The database version is MySQL 5.6.
753	//   "MYSQL_5_7" - The database version is MySQL 5.7.
754	//   "POSTGRES_9_6" - The database version is PostgreSQL 9.6.
755	//   "POSTGRES_11" - The database version is PostgreSQL 11.
756	//   "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017
757	// Standard.
758	//   "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server
759	// 2017 Enterprise.
760	//   "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017
761	// Express.
762	//   "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web.
763	//   "POSTGRES_10" - The database version is PostgreSQL 10.
764	//   "POSTGRES_12" - The database version is PostgreSQL 12.
765	//   "POSTGRES_13" - The database version is PostgreSQL 13.
766	//   "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019
767	// Standard.
768	//   "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server
769	// 2019 Enterprise.
770	//   "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019
771	// Express.
772	//   "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web.
773	DatabaseVersion string `json:"databaseVersion,omitempty"`
774
775	// IpAddresses: The assigned IP addresses for the instance.
776	IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
777
778	// Kind: This is always `sql#connectSettings`.
779	Kind string `json:"kind,omitempty"`
780
781	// ServerCaCert: SSL configuration.
782	ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
783
784	// ServerResponse contains the HTTP response code and headers from the
785	// server.
786	googleapi.ServerResponse `json:"-"`
787
788	// ForceSendFields is a list of field names (e.g. "BackendType") to
789	// unconditionally include in API requests. By default, fields with
790	// empty or default values are omitted from API requests. However, any
791	// non-pointer, non-interface field appearing in ForceSendFields will be
792	// sent to the server regardless of whether the field is empty or not.
793	// This may be used to include empty fields in Patch requests.
794	ForceSendFields []string `json:"-"`
795
796	// NullFields is a list of field names (e.g. "BackendType") to include
797	// in API requests with the JSON null value. By default, fields with
798	// empty values are omitted from API requests. However, any field with
799	// an empty value appearing in NullFields will be sent to the server as
800	// null. It is an error if a field in this list has a non-empty value.
801	// This may be used to include null fields in Patch requests.
802	NullFields []string `json:"-"`
803}
804
805func (s *ConnectSettings) MarshalJSON() ([]byte, error) {
806	type NoMethod ConnectSettings
807	raw := NoMethod(*s)
808	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
809}
810
811// Database: Represents a SQL database on the Cloud SQL instance.
812type Database struct {
813	// Charset: The Cloud SQL charset value.
814	Charset string `json:"charset,omitempty"`
815
816	// Collation: The Cloud SQL collation value.
817	Collation string `json:"collation,omitempty"`
818
819	// Etag: This field is deprecated and will be removed from a future
820	// version of the API.
821	Etag string `json:"etag,omitempty"`
822
823	// Instance: The name of the Cloud SQL instance. This does not include
824	// the project ID.
825	Instance string `json:"instance,omitempty"`
826
827	// Kind: This is always **sql#database**.
828	Kind string `json:"kind,omitempty"`
829
830	// Name: The name of the database in the Cloud SQL instance. This does
831	// not include the project ID or instance name.
832	Name string `json:"name,omitempty"`
833
834	// Project: The project ID of the project containing the Cloud SQL
835	// database. The Google apps domain is prefixed if applicable.
836	Project string `json:"project,omitempty"`
837
838	// SelfLink: The URI of this resource.
839	SelfLink string `json:"selfLink,omitempty"`
840
841	SqlserverDatabaseDetails *SqlServerDatabaseDetails `json:"sqlserverDatabaseDetails,omitempty"`
842
843	// ServerResponse contains the HTTP response code and headers from the
844	// server.
845	googleapi.ServerResponse `json:"-"`
846
847	// ForceSendFields is a list of field names (e.g. "Charset") to
848	// unconditionally include in API requests. By default, fields with
849	// empty or default values are omitted from API requests. However, any
850	// non-pointer, non-interface field appearing in ForceSendFields will be
851	// sent to the server regardless of whether the field is empty or not.
852	// This may be used to include empty fields in Patch requests.
853	ForceSendFields []string `json:"-"`
854
855	// NullFields is a list of field names (e.g. "Charset") to include in
856	// API requests with the JSON null value. By default, fields with empty
857	// values are omitted from API requests. However, any field with an
858	// empty value appearing in NullFields will be sent to the server as
859	// null. It is an error if a field in this list has a non-empty value.
860	// This may be used to include null fields in Patch requests.
861	NullFields []string `json:"-"`
862}
863
864func (s *Database) MarshalJSON() ([]byte, error) {
865	type NoMethod Database
866	raw := NoMethod(*s)
867	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
868}
869
870// DatabaseFlags: Database flags for Cloud SQL instances.
871type DatabaseFlags struct {
872	// Name: The name of the flag. These flags are passed at instance
873	// startup, so include both server options and system variables. Flags
874	// are specified with underscores, not hyphens. For more information,
875	// see Configuring Database Flags
876	// (https://cloud.google.com/sql/docs/mysql/flags) in the Cloud SQL
877	// documentation.
878	Name string `json:"name,omitempty"`
879
880	// Value: The value of the flag. Booleans are set to **on** for true and
881	// **off** for false. This field must be omitted if the flag doesn't
882	// take a value.
883	Value string `json:"value,omitempty"`
884
885	// ForceSendFields is a list of field names (e.g. "Name") to
886	// unconditionally include in API requests. By default, fields with
887	// empty or default values are omitted from API requests. However, any
888	// non-pointer, non-interface field appearing in ForceSendFields will be
889	// sent to the server regardless of whether the field is empty or not.
890	// This may be used to include empty fields in Patch requests.
891	ForceSendFields []string `json:"-"`
892
893	// NullFields is a list of field names (e.g. "Name") to include in API
894	// requests with the JSON null value. By default, fields with empty
895	// values are omitted from API requests. However, any field with an
896	// empty value appearing in NullFields will be sent to the server as
897	// null. It is an error if a field in this list has a non-empty value.
898	// This may be used to include null fields in Patch requests.
899	NullFields []string `json:"-"`
900}
901
902func (s *DatabaseFlags) MarshalJSON() ([]byte, error) {
903	type NoMethod DatabaseFlags
904	raw := NoMethod(*s)
905	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
906}
907
908// DatabaseInstance: A Cloud SQL instance resource.
909type DatabaseInstance struct {
910	// BackendType:  *SECOND_GEN*: Cloud SQL database instance. *EXTERNAL*:
911	// A database server that is not managed by Google. This property is
912	// read-only; use the *tier* property in the *settings* object to
913	// determine the database type.
914	//
915	// Possible values:
916	//   "SQL_BACKEND_TYPE_UNSPECIFIED" - This is an unknown backend type
917	// for instance.
918	//   "FIRST_GEN" - V1 speckle instance.
919	//   "SECOND_GEN" - V2 speckle instance.
920	//   "EXTERNAL" - On premises instance.
921	BackendType string `json:"backendType,omitempty"`
922
923	// ConnectionName: Connection name of the Cloud SQL instance used in
924	// connection strings.
925	ConnectionName string `json:"connectionName,omitempty"`
926
927	// CurrentDiskSize: The current disk usage of the instance in bytes.
928	// This property has been deprecated. Use the
929	// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
930	// Monitoring API instead. Please see this announcement for details.
931	CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"`
932
933	// DatabaseVersion: The database engine type and version. The
934	// *databaseVersion* field cannot be changed after instance creation.
935	// MySQL instances: *MYSQL_8_0*, *MYSQL_5_7* (default), or *MYSQL_5_6*.
936	// PostgreSQL instances: *POSTGRES_9_6*, *POSTGRES_10*, *POSTGRES_11*,
937	// *POSTGRES_12*, *POSTGRES_13* (default). SQL Server instances:
938	// *SQLSERVER_2019_STANDARD*, *SQLSERVER_2019_ENTERPRISE*,
939	// *SQLSERVER_2019_EXPRESS*, or *SQLSERVER_2019_WEB*,
940	// *SQLSERVER_2017_STANDARD* (default), *SQLSERVER_2017_ENTERPRISE*,
941	// *SQLSERVER_2017_EXPRESS*, or *SQLSERVER_2017_WEB*.
942	//
943	// Possible values:
944	//   "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database
945	// version.
946	//   "MYSQL_5_1" - The database version is MySQL 5.1.
947	//   "MYSQL_5_5" - The database version is MySQL 5.5.
948	//   "MYSQL_5_6" - The database version is MySQL 5.6.
949	//   "MYSQL_5_7" - The database version is MySQL 5.7.
950	//   "POSTGRES_9_6" - The database version is PostgreSQL 9.6.
951	//   "POSTGRES_11" - The database version is PostgreSQL 11.
952	//   "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017
953	// Standard.
954	//   "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server
955	// 2017 Enterprise.
956	//   "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017
957	// Express.
958	//   "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web.
959	//   "POSTGRES_10" - The database version is PostgreSQL 10.
960	//   "POSTGRES_12" - The database version is PostgreSQL 12.
961	//   "POSTGRES_13" - The database version is PostgreSQL 13.
962	//   "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019
963	// Standard.
964	//   "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server
965	// 2019 Enterprise.
966	//   "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019
967	// Express.
968	//   "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web.
969	DatabaseVersion string `json:"databaseVersion,omitempty"`
970
971	// DiskEncryptionConfiguration: Disk encryption configuration specific
972	// to an instance.
973	DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"`
974
975	// DiskEncryptionStatus: Disk encryption status specific to an instance.
976	DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"`
977
978	// Etag: This field is deprecated and will be removed from a future
979	// version of the API. Use the *settings.settingsVersion* field instead.
980	Etag string `json:"etag,omitempty"`
981
982	// FailoverReplica: The name and status of the failover replica.
983	FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"`
984
985	// GceZone: The Compute Engine zone that the instance is currently
986	// serving from. This value could be different from the zone that was
987	// specified when the instance was created if the instance has failed
988	// over to its secondary zone.
989	GceZone string `json:"gceZone,omitempty"`
990
991	// InstanceType: The instance type. This can be one of the following.
992	// *CLOUD_SQL_INSTANCE*: A Cloud SQL instance that is not replicating
993	// from a primary instance. *ON_PREMISES_INSTANCE*: An instance running
994	// on the customer's premises. *READ_REPLICA_INSTANCE*: A Cloud SQL
995	// instance configured as a read-replica.
996	//
997	// Possible values:
998	//   "SQL_INSTANCE_TYPE_UNSPECIFIED" - This is an unknown Cloud SQL
999	// instance type.
1000	//   "CLOUD_SQL_INSTANCE" - A regular Cloud SQL instance.
1001	//   "ON_PREMISES_INSTANCE" - An instance running on the customer's
1002	// premises that is not managed by Cloud SQL.
1003	//   "READ_REPLICA_INSTANCE" - A Cloud SQL instance acting as a
1004	// read-replica.
1005	InstanceType string `json:"instanceType,omitempty"`
1006
1007	// IpAddresses: The assigned IP addresses for the instance.
1008	IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
1009
1010	// Ipv6Address: The IPv6 address assigned to the instance. (Deprecated)
1011	// This property was applicable only to First Generation instances.
1012	Ipv6Address string `json:"ipv6Address,omitempty"`
1013
1014	// Kind: This is always *sql#instance*.
1015	Kind string `json:"kind,omitempty"`
1016
1017	// MasterInstanceName: The name of the instance which will act as
1018	// primary in the replication setup.
1019	MasterInstanceName string `json:"masterInstanceName,omitempty"`
1020
1021	// MaxDiskSize: The maximum disk size of the instance in bytes.
1022	MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"`
1023
1024	// Name: Name of the Cloud SQL instance. This does not include the
1025	// project ID.
1026	Name string `json:"name,omitempty"`
1027
1028	// OnPremisesConfiguration: Configuration specific to on-premises
1029	// instances.
1030	OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"`
1031
1032	// OutOfDiskReport: This field represents the report generated by the
1033	// proactive database wellness job for OutOfDisk issues. Writers: -- the
1034	// proactive database wellness job for OOD. Readers: -- the Pantheon
1035	// frontend -- the proactive database wellness job
1036	OutOfDiskReport *SqlOutOfDiskReport `json:"outOfDiskReport,omitempty"`
1037
1038	// Project: The project ID of the project containing the Cloud SQL
1039	// instance. The Google apps domain is prefixed if applicable.
1040	Project string `json:"project,omitempty"`
1041
1042	// Region: The geographical region. Can be *us-central* (*FIRST_GEN*
1043	// instances only) *us-central1* (*SECOND_GEN* instances only)
1044	// *asia-east1* or *europe-west1*. Defaults to *us-central* or
1045	// *us-central1* depending on the instance type. The region cannot be
1046	// changed after instance creation.
1047	Region string `json:"region,omitempty"`
1048
1049	// ReplicaConfiguration: Configuration specific to failover replicas and
1050	// read replicas.
1051	ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"`
1052
1053	// ReplicaNames: The replicas of the instance.
1054	ReplicaNames []string `json:"replicaNames,omitempty"`
1055
1056	// RootPassword: Initial root password. Use only on creation.
1057	RootPassword string `json:"rootPassword,omitempty"`
1058
1059	// SatisfiesPzs: The status indicating if instance satisfiesPzs.
1060	// Reserved for future use.
1061	SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
1062
1063	// ScheduledMaintenance: The start time of any upcoming scheduled
1064	// maintenance for this instance.
1065	ScheduledMaintenance *SqlScheduledMaintenance `json:"scheduledMaintenance,omitempty"`
1066
1067	// SecondaryGceZone: The Compute Engine zone that the failover instance
1068	// is currently serving from for a regional instance. This value could
1069	// be different from the zone that was specified when the instance was
1070	// created if the instance has failed over to its secondary/failover
1071	// zone. Reserved for future use.
1072	SecondaryGceZone string `json:"secondaryGceZone,omitempty"`
1073
1074	// SelfLink: The URI of this resource.
1075	SelfLink string `json:"selfLink,omitempty"`
1076
1077	// ServerCaCert: SSL configuration.
1078	ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
1079
1080	// ServiceAccountEmailAddress: The service account email address
1081	// assigned to the instance. This property is read-only.
1082	ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"`
1083
1084	// Settings: The user settings.
1085	Settings *Settings `json:"settings,omitempty"`
1086
1087	// State: The current serving state of the Cloud SQL instance. This can
1088	// be one of the following. *SQL_INSTANCE_STATE_UNSPECIFIED*: The state
1089	// of the instance is unknown. *RUNNABLE*: The instance is running, or
1090	// has been stopped by owner. *SUSPENDED*: The instance is not
1091	// available, for example due to problems with billing.
1092	// *PENDING_DELETE*: The instance is being deleted. *PENDING_CREATE*:
1093	// The instance is being created. *MAINTENANCE*: The instance is down
1094	// for maintenance. *FAILED*: The instance creation failed.
1095	//
1096	// Possible values:
1097	//   "SQL_INSTANCE_STATE_UNSPECIFIED" - The state of the instance is
1098	// unknown.
1099	//   "RUNNABLE" - The instance is running, or has been stopped by owner.
1100	//   "SUSPENDED" - The instance is not available, for example due to
1101	// problems with billing.
1102	//   "PENDING_DELETE" - The instance is being deleted.
1103	//   "PENDING_CREATE" - The instance is being created.
1104	//   "MAINTENANCE" - The instance is down for maintenance.
1105	//   "FAILED" - The creation of the instance failed or a fatal error
1106	// occurred during maintenance.
1107	State string `json:"state,omitempty"`
1108
1109	// SuspensionReason: If the instance state is SUSPENDED, the reason for
1110	// the suspension.
1111	//
1112	// Possible values:
1113	//   "SQL_SUSPENSION_REASON_UNSPECIFIED" - This is an unknown suspension
1114	// reason.
1115	//   "BILLING_ISSUE" - The instance is suspended due to billing issues
1116	// (for example:, GCP account issue)
1117	//   "LEGAL_ISSUE" - The instance is suspended due to illegal content
1118	// (for example:, child pornography, copyrighted material, etc.).
1119	//   "OPERATIONAL_ISSUE" - The instance is causing operational issues
1120	// (for example:, causing the database to crash).
1121	//   "KMS_KEY_ISSUE" - The KMS key used by the instance is either
1122	// revoked or denied access to
1123	SuspensionReason []string `json:"suspensionReason,omitempty"`
1124
1125	// ServerResponse contains the HTTP response code and headers from the
1126	// server.
1127	googleapi.ServerResponse `json:"-"`
1128
1129	// ForceSendFields is a list of field names (e.g. "BackendType") to
1130	// unconditionally include in API requests. By default, fields with
1131	// empty or default values are omitted from API requests. However, any
1132	// non-pointer, non-interface field appearing in ForceSendFields will be
1133	// sent to the server regardless of whether the field is empty or not.
1134	// This may be used to include empty fields in Patch requests.
1135	ForceSendFields []string `json:"-"`
1136
1137	// NullFields is a list of field names (e.g. "BackendType") to include
1138	// in API requests with the JSON null value. By default, fields with
1139	// empty values are omitted from API requests. However, any field with
1140	// an empty value appearing in NullFields will be sent to the server as
1141	// null. It is an error if a field in this list has a non-empty value.
1142	// This may be used to include null fields in Patch requests.
1143	NullFields []string `json:"-"`
1144}
1145
1146func (s *DatabaseInstance) MarshalJSON() ([]byte, error) {
1147	type NoMethod DatabaseInstance
1148	raw := NoMethod(*s)
1149	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1150}
1151
1152// DatabaseInstanceFailoverReplica: The name and status of the failover
1153// replica.
1154type DatabaseInstanceFailoverReplica struct {
1155	// Available: The availability status of the failover replica. A false
1156	// status indicates that the failover replica is out of sync. The
1157	// primary instance can only failover to the failover replica when the
1158	// status is true.
1159	Available bool `json:"available,omitempty"`
1160
1161	// Name: The name of the failover replica. If specified at instance
1162	// creation, a failover replica is created for the instance. The name
1163	// doesn't include the project ID.
1164	Name string `json:"name,omitempty"`
1165
1166	// ForceSendFields is a list of field names (e.g. "Available") to
1167	// unconditionally include in API requests. By default, fields with
1168	// empty or default values are omitted from API requests. However, any
1169	// non-pointer, non-interface field appearing in ForceSendFields will be
1170	// sent to the server regardless of whether the field is empty or not.
1171	// This may be used to include empty fields in Patch requests.
1172	ForceSendFields []string `json:"-"`
1173
1174	// NullFields is a list of field names (e.g. "Available") to include in
1175	// API requests with the JSON null value. By default, fields with empty
1176	// values are omitted from API requests. However, any field with an
1177	// empty value appearing in NullFields will be sent to the server as
1178	// null. It is an error if a field in this list has a non-empty value.
1179	// This may be used to include null fields in Patch requests.
1180	NullFields []string `json:"-"`
1181}
1182
1183func (s *DatabaseInstanceFailoverReplica) MarshalJSON() ([]byte, error) {
1184	type NoMethod DatabaseInstanceFailoverReplica
1185	raw := NoMethod(*s)
1186	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1187}
1188
1189// DatabasesListResponse: Database list response.
1190type DatabasesListResponse struct {
1191	// Items: List of database resources in the instance.
1192	Items []*Database `json:"items,omitempty"`
1193
1194	// Kind: This is always *sql#databasesList*.
1195	Kind string `json:"kind,omitempty"`
1196
1197	// ServerResponse contains the HTTP response code and headers from the
1198	// server.
1199	googleapi.ServerResponse `json:"-"`
1200
1201	// ForceSendFields is a list of field names (e.g. "Items") to
1202	// unconditionally include in API requests. By default, fields with
1203	// empty or default values are omitted from API requests. However, any
1204	// non-pointer, non-interface field appearing in ForceSendFields will be
1205	// sent to the server regardless of whether the field is empty or not.
1206	// This may be used to include empty fields in Patch requests.
1207	ForceSendFields []string `json:"-"`
1208
1209	// NullFields is a list of field names (e.g. "Items") to include in API
1210	// requests with the JSON null value. By default, fields with empty
1211	// values are omitted from API requests. However, any field with an
1212	// empty value appearing in NullFields will be sent to the server as
1213	// null. It is an error if a field in this list has a non-empty value.
1214	// This may be used to include null fields in Patch requests.
1215	NullFields []string `json:"-"`
1216}
1217
1218func (s *DatabasesListResponse) MarshalJSON() ([]byte, error) {
1219	type NoMethod DatabasesListResponse
1220	raw := NoMethod(*s)
1221	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1222}
1223
1224// DemoteMasterConfiguration: Read-replica configuration for connecting
1225// to the on-premises primary instance.
1226type DemoteMasterConfiguration struct {
1227	// Kind: This is always **sql#demoteMasterConfiguration**.
1228	Kind string `json:"kind,omitempty"`
1229
1230	// MysqlReplicaConfiguration: MySQL specific configuration when
1231	// replicating from a MySQL on-premises primary instance. Replication
1232	// configuration information such as the username, password,
1233	// certificates, and keys are not stored in the instance metadata. The
1234	// configuration information is used only to set up the replication
1235	// connection and is stored by MySQL in a file named **master.info** in
1236	// the data directory.
1237	MysqlReplicaConfiguration *DemoteMasterMySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"`
1238
1239	// ForceSendFields is a list of field names (e.g. "Kind") to
1240	// unconditionally include in API requests. By default, fields with
1241	// empty or default values are omitted from API requests. However, any
1242	// non-pointer, non-interface field appearing in ForceSendFields will be
1243	// sent to the server regardless of whether the field is empty or not.
1244	// This may be used to include empty fields in Patch requests.
1245	ForceSendFields []string `json:"-"`
1246
1247	// NullFields is a list of field names (e.g. "Kind") to include in API
1248	// requests with the JSON null value. By default, fields with empty
1249	// values are omitted from API requests. However, any field with an
1250	// empty value appearing in NullFields will be sent to the server as
1251	// null. It is an error if a field in this list has a non-empty value.
1252	// This may be used to include null fields in Patch requests.
1253	NullFields []string `json:"-"`
1254}
1255
1256func (s *DemoteMasterConfiguration) MarshalJSON() ([]byte, error) {
1257	type NoMethod DemoteMasterConfiguration
1258	raw := NoMethod(*s)
1259	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1260}
1261
1262// DemoteMasterContext: Database instance demote primary instance
1263// context.
1264type DemoteMasterContext struct {
1265	// Kind: This is always *sql#demoteMasterContext*.
1266	Kind string `json:"kind,omitempty"`
1267
1268	// MasterInstanceName: The name of the instance which will act as
1269	// on-premises primary instance in the replication setup.
1270	MasterInstanceName string `json:"masterInstanceName,omitempty"`
1271
1272	// ReplicaConfiguration: Configuration specific to read-replicas
1273	// replicating from the on-premises primary instance.
1274	ReplicaConfiguration *DemoteMasterConfiguration `json:"replicaConfiguration,omitempty"`
1275
1276	// VerifyGtidConsistency: Verify GTID consistency for demote operation.
1277	// Default value: *True*. Setting this flag to false enables you to
1278	// bypass GTID consistency check between on-premises primary instance
1279	// and Cloud SQL instance during the demotion operation but also exposes
1280	// you to the risk of future replication failures. Change the value
1281	// value only if you know the reason for the GTID divergence and are
1282	// confident that doing so will not cause any replication issues.
1283	VerifyGtidConsistency bool `json:"verifyGtidConsistency,omitempty"`
1284
1285	// ForceSendFields is a list of field names (e.g. "Kind") to
1286	// unconditionally include in API requests. By default, fields with
1287	// empty or default values are omitted from API requests. However, any
1288	// non-pointer, non-interface field appearing in ForceSendFields will be
1289	// sent to the server regardless of whether the field is empty or not.
1290	// This may be used to include empty fields in Patch requests.
1291	ForceSendFields []string `json:"-"`
1292
1293	// NullFields is a list of field names (e.g. "Kind") to include in API
1294	// requests with the JSON null value. By default, fields with empty
1295	// values are omitted from API requests. However, any field with an
1296	// empty value appearing in NullFields will be sent to the server as
1297	// null. It is an error if a field in this list has a non-empty value.
1298	// This may be used to include null fields in Patch requests.
1299	NullFields []string `json:"-"`
1300}
1301
1302func (s *DemoteMasterContext) MarshalJSON() ([]byte, error) {
1303	type NoMethod DemoteMasterContext
1304	raw := NoMethod(*s)
1305	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1306}
1307
1308// DemoteMasterMySqlReplicaConfiguration: Read-replica configuration
1309// specific to MySQL databases.
1310type DemoteMasterMySqlReplicaConfiguration struct {
1311	// CaCertificate: PEM representation of the trusted CA's x509
1312	// certificate.
1313	CaCertificate string `json:"caCertificate,omitempty"`
1314
1315	// ClientCertificate: PEM representation of the replica's x509
1316	// certificate.
1317	ClientCertificate string `json:"clientCertificate,omitempty"`
1318
1319	// ClientKey: PEM representation of the replica's private key. The
1320	// corresponsing public key is encoded in the client's certificate. The
1321	// format of the replica's private key can be either PKCS #1 or PKCS #8.
1322	ClientKey string `json:"clientKey,omitempty"`
1323
1324	// Kind: This is always **sql#demoteMasterMysqlReplicaConfiguration**.
1325	Kind string `json:"kind,omitempty"`
1326
1327	// Password: The password for the replication connection.
1328	Password string `json:"password,omitempty"`
1329
1330	// Username: The username for the replication connection.
1331	Username string `json:"username,omitempty"`
1332
1333	// ForceSendFields is a list of field names (e.g. "CaCertificate") to
1334	// unconditionally include in API requests. By default, fields with
1335	// empty or default values are omitted from API requests. However, any
1336	// non-pointer, non-interface field appearing in ForceSendFields will be
1337	// sent to the server regardless of whether the field is empty or not.
1338	// This may be used to include empty fields in Patch requests.
1339	ForceSendFields []string `json:"-"`
1340
1341	// NullFields is a list of field names (e.g. "CaCertificate") to include
1342	// in API requests with the JSON null value. By default, fields with
1343	// empty values are omitted from API requests. However, any field with
1344	// an empty value appearing in NullFields will be sent to the server as
1345	// null. It is an error if a field in this list has a non-empty value.
1346	// This may be used to include null fields in Patch requests.
1347	NullFields []string `json:"-"`
1348}
1349
1350func (s *DemoteMasterMySqlReplicaConfiguration) MarshalJSON() ([]byte, error) {
1351	type NoMethod DemoteMasterMySqlReplicaConfiguration
1352	raw := NoMethod(*s)
1353	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1354}
1355
1356// DenyMaintenancePeriod: Deny maintenance Periods. This specifies a
1357// date range during when all CSA rollout will be denied.
1358type DenyMaintenancePeriod struct {
1359	// EndDate: "deny maintenance period" end date. If the year of the end
1360	// date is empty, the year of the start date also must be empty. In this
1361	// case, it means the no maintenance interval recurs every year. The
1362	// date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
1363	EndDate string `json:"endDate,omitempty"`
1364
1365	// StartDate: "deny maintenance period" start date. If the year of the
1366	// start date is empty, the year of the end date also must be empty. In
1367	// this case, it means the no maintenance interval recurs every year.
1368	// The date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e.,
1369	// 11-01
1370	StartDate string `json:"startDate,omitempty"`
1371
1372	// Time: Time in UTC when the "deny maintenance period" starts on
1373	// start_date and ends on end_date. The time is in format: HH:mm:SS,
1374	// i.e., 00:00:00
1375	Time string `json:"time,omitempty"`
1376
1377	// ForceSendFields is a list of field names (e.g. "EndDate") to
1378	// unconditionally include in API requests. By default, fields with
1379	// empty or default values are omitted from API requests. However, any
1380	// non-pointer, non-interface field appearing in ForceSendFields will be
1381	// sent to the server regardless of whether the field is empty or not.
1382	// This may be used to include empty fields in Patch requests.
1383	ForceSendFields []string `json:"-"`
1384
1385	// NullFields is a list of field names (e.g. "EndDate") to include in
1386	// API requests with the JSON null value. By default, fields with empty
1387	// values are omitted from API requests. However, any field with an
1388	// empty value appearing in NullFields will be sent to the server as
1389	// null. It is an error if a field in this list has a non-empty value.
1390	// This may be used to include null fields in Patch requests.
1391	NullFields []string `json:"-"`
1392}
1393
1394func (s *DenyMaintenancePeriod) MarshalJSON() ([]byte, error) {
1395	type NoMethod DenyMaintenancePeriod
1396	raw := NoMethod(*s)
1397	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1398}
1399
1400// DiskEncryptionConfiguration: Disk encryption configuration for an
1401// instance.
1402type DiskEncryptionConfiguration struct {
1403	// Kind: This is always **sql#diskEncryptionConfiguration**.
1404	Kind string `json:"kind,omitempty"`
1405
1406	// KmsKeyName: Resource name of KMS key for disk encryption
1407	KmsKeyName string `json:"kmsKeyName,omitempty"`
1408
1409	// ForceSendFields is a list of field names (e.g. "Kind") to
1410	// unconditionally include in API requests. By default, fields with
1411	// empty or default values are omitted from API requests. However, any
1412	// non-pointer, non-interface field appearing in ForceSendFields will be
1413	// sent to the server regardless of whether the field is empty or not.
1414	// This may be used to include empty fields in Patch requests.
1415	ForceSendFields []string `json:"-"`
1416
1417	// NullFields is a list of field names (e.g. "Kind") to include in API
1418	// requests with the JSON null value. By default, fields with empty
1419	// values are omitted from API requests. However, any field with an
1420	// empty value appearing in NullFields will be sent to the server as
1421	// null. It is an error if a field in this list has a non-empty value.
1422	// This may be used to include null fields in Patch requests.
1423	NullFields []string `json:"-"`
1424}
1425
1426func (s *DiskEncryptionConfiguration) MarshalJSON() ([]byte, error) {
1427	type NoMethod DiskEncryptionConfiguration
1428	raw := NoMethod(*s)
1429	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1430}
1431
1432// DiskEncryptionStatus: Disk encryption status for an instance.
1433type DiskEncryptionStatus struct {
1434	// Kind: This is always **sql#diskEncryptionStatus**.
1435	Kind string `json:"kind,omitempty"`
1436
1437	// KmsKeyVersionName: KMS key version used to encrypt the Cloud SQL
1438	// instance resource
1439	KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"`
1440
1441	// ForceSendFields is a list of field names (e.g. "Kind") to
1442	// unconditionally include in API requests. By default, fields with
1443	// empty or default values are omitted from API requests. However, any
1444	// non-pointer, non-interface field appearing in ForceSendFields will be
1445	// sent to the server regardless of whether the field is empty or not.
1446	// This may be used to include empty fields in Patch requests.
1447	ForceSendFields []string `json:"-"`
1448
1449	// NullFields is a list of field names (e.g. "Kind") to include in API
1450	// requests with the JSON null value. By default, fields with empty
1451	// values are omitted from API requests. However, any field with an
1452	// empty value appearing in NullFields will be sent to the server as
1453	// null. It is an error if a field in this list has a non-empty value.
1454	// This may be used to include null fields in Patch requests.
1455	NullFields []string `json:"-"`
1456}
1457
1458func (s *DiskEncryptionStatus) MarshalJSON() ([]byte, error) {
1459	type NoMethod DiskEncryptionStatus
1460	raw := NoMethod(*s)
1461	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1462}
1463
1464// ExportContext: Database instance export context.
1465type ExportContext struct {
1466	// CsvExportOptions: Options for exporting data as CSV. **MySQL** and
1467	// **PostgreSQL** instances only.
1468	CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"`
1469
1470	// Databases: Databases to be exported. **MySQL instances:** If
1471	// **fileType** is **SQL** and no database is specified, all databases
1472	// are exported, except for the **mysql** system database. If
1473	// **fileType** is **CSV**, you can specify one database, either by
1474	// using this property or by using the **csvExportOptions.selectQuery**
1475	// property, which takes precedence over this property. **PostgreSQL
1476	// instances:** You must specify one database to be exported. If
1477	// **fileType** is **CSV**, this database must match the one specified
1478	// in the **csvExportOptions.selectQuery** property. **SQL Server
1479	// instances:** You must specify one database to be exported, and the
1480	// **fileType** must be **BAK**.
1481	Databases []string `json:"databases,omitempty"`
1482
1483	// FileType: The file type for the specified uri. **SQL**: The file
1484	// contains SQL statements. **CSV**: The file contains CSV data.
1485	// **BAK**: The file contains backup data for a SQL Server instance.
1486	//
1487	// Possible values:
1488	//   "SQL_FILE_TYPE_UNSPECIFIED" - Unknown file type.
1489	//   "SQL" - File containing SQL statements.
1490	//   "CSV" - File in CSV format.
1491	//   "BAK"
1492	FileType string `json:"fileType,omitempty"`
1493
1494	// Kind: This is always **sql#exportContext**.
1495	Kind string `json:"kind,omitempty"`
1496
1497	// Offload: Option for export offload.
1498	Offload bool `json:"offload,omitempty"`
1499
1500	// SqlExportOptions: Options for exporting data as SQL statements.
1501	SqlExportOptions *ExportContextSqlExportOptions `json:"sqlExportOptions,omitempty"`
1502
1503	// Uri: The path to the file in Google Cloud Storage where the export
1504	// will be stored. The URI is in the form **gs://bucketName/fileName**.
1505	// If the file already exists, the request succeeds, but the operation
1506	// fails. If **fileType** is **SQL** and the filename ends with .gz, the
1507	// contents are compressed.
1508	Uri string `json:"uri,omitempty"`
1509
1510	// ForceSendFields is a list of field names (e.g. "CsvExportOptions") to
1511	// unconditionally include in API requests. By default, fields with
1512	// empty or default values are omitted from API requests. However, any
1513	// non-pointer, non-interface field appearing in ForceSendFields will be
1514	// sent to the server regardless of whether the field is empty or not.
1515	// This may be used to include empty fields in Patch requests.
1516	ForceSendFields []string `json:"-"`
1517
1518	// NullFields is a list of field names (e.g. "CsvExportOptions") to
1519	// include in API requests with the JSON null value. By default, fields
1520	// with empty values are omitted from API requests. However, any field
1521	// with an empty value appearing in NullFields will be sent to the
1522	// server as null. It is an error if a field in this list has a
1523	// non-empty value. This may be used to include null fields in Patch
1524	// requests.
1525	NullFields []string `json:"-"`
1526}
1527
1528func (s *ExportContext) MarshalJSON() ([]byte, error) {
1529	type NoMethod ExportContext
1530	raw := NoMethod(*s)
1531	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1532}
1533
1534// ExportContextCsvExportOptions: Options for exporting data as CSV.
1535// **MySQL** and **PostgreSQL** instances only.
1536type ExportContextCsvExportOptions struct {
1537	// SelectQuery: The select query used to extract the data.
1538	SelectQuery string `json:"selectQuery,omitempty"`
1539
1540	// ForceSendFields is a list of field names (e.g. "SelectQuery") to
1541	// unconditionally include in API requests. By default, fields with
1542	// empty or default values are omitted from API requests. However, any
1543	// non-pointer, non-interface field appearing in ForceSendFields will be
1544	// sent to the server regardless of whether the field is empty or not.
1545	// This may be used to include empty fields in Patch requests.
1546	ForceSendFields []string `json:"-"`
1547
1548	// NullFields is a list of field names (e.g. "SelectQuery") to include
1549	// in API requests with the JSON null value. By default, fields with
1550	// empty values are omitted from API requests. However, any field with
1551	// an empty value appearing in NullFields will be sent to the server as
1552	// null. It is an error if a field in this list has a non-empty value.
1553	// This may be used to include null fields in Patch requests.
1554	NullFields []string `json:"-"`
1555}
1556
1557func (s *ExportContextCsvExportOptions) MarshalJSON() ([]byte, error) {
1558	type NoMethod ExportContextCsvExportOptions
1559	raw := NoMethod(*s)
1560	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1561}
1562
1563// ExportContextSqlExportOptions: Options for exporting data as SQL
1564// statements.
1565type ExportContextSqlExportOptions struct {
1566	// MysqlExportOptions: Options for exporting from MySQL.
1567	MysqlExportOptions *ExportContextSqlExportOptionsMysqlExportOptions `json:"mysqlExportOptions,omitempty"`
1568
1569	// SchemaOnly: Export only schemas.
1570	SchemaOnly bool `json:"schemaOnly,omitempty"`
1571
1572	// Tables: Tables to export, or that were exported, from the specified
1573	// database. If you specify tables, specify one and only one database.
1574	// For PostgreSQL instances, you can specify only one table.
1575	Tables []string `json:"tables,omitempty"`
1576
1577	// ForceSendFields is a list of field names (e.g. "MysqlExportOptions")
1578	// to unconditionally include in API requests. By default, fields with
1579	// empty or default values are omitted from API requests. However, any
1580	// non-pointer, non-interface field appearing in ForceSendFields will be
1581	// sent to the server regardless of whether the field is empty or not.
1582	// This may be used to include empty fields in Patch requests.
1583	ForceSendFields []string `json:"-"`
1584
1585	// NullFields is a list of field names (e.g. "MysqlExportOptions") to
1586	// include in API requests with the JSON null value. By default, fields
1587	// with empty values are omitted from API requests. However, any field
1588	// with an empty value appearing in NullFields will be sent to the
1589	// server as null. It is an error if a field in this list has a
1590	// non-empty value. This may be used to include null fields in Patch
1591	// requests.
1592	NullFields []string `json:"-"`
1593}
1594
1595func (s *ExportContextSqlExportOptions) MarshalJSON() ([]byte, error) {
1596	type NoMethod ExportContextSqlExportOptions
1597	raw := NoMethod(*s)
1598	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1599}
1600
1601// ExportContextSqlExportOptionsMysqlExportOptions: Options for
1602// exporting from MySQL.
1603type ExportContextSqlExportOptionsMysqlExportOptions struct {
1604	// MasterData: Option to include SQL statement required to set up
1605	// replication. If set to **1**, the dump file includes a CHANGE MASTER
1606	// TO statement with the binary log coordinates, and --set-gtid-purged
1607	// is set to ON. If set to **2**, the CHANGE MASTER TO statement is
1608	// written as a SQL comment and has no effect. If set to any value other
1609	// than **1**, --set-gtid-purged is set to OFF.
1610	MasterData int64 `json:"masterData,omitempty"`
1611
1612	// ForceSendFields is a list of field names (e.g. "MasterData") to
1613	// unconditionally include in API requests. By default, fields with
1614	// empty or default values are omitted from API requests. However, any
1615	// non-pointer, non-interface field appearing in ForceSendFields will be
1616	// sent to the server regardless of whether the field is empty or not.
1617	// This may be used to include empty fields in Patch requests.
1618	ForceSendFields []string `json:"-"`
1619
1620	// NullFields is a list of field names (e.g. "MasterData") to include in
1621	// API requests with the JSON null value. By default, fields with empty
1622	// values are omitted from API requests. However, any field with an
1623	// empty value appearing in NullFields will be sent to the server as
1624	// null. It is an error if a field in this list has a non-empty value.
1625	// This may be used to include null fields in Patch requests.
1626	NullFields []string `json:"-"`
1627}
1628
1629func (s *ExportContextSqlExportOptionsMysqlExportOptions) MarshalJSON() ([]byte, error) {
1630	type NoMethod ExportContextSqlExportOptionsMysqlExportOptions
1631	raw := NoMethod(*s)
1632	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1633}
1634
1635// FailoverContext: Database instance failover context.
1636type FailoverContext struct {
1637	// Kind: This is always *sql#failoverContext*.
1638	Kind string `json:"kind,omitempty"`
1639
1640	// SettingsVersion: The current settings version of this instance.
1641	// Request will be rejected if this version doesn't match the current
1642	// settings version.
1643	SettingsVersion int64 `json:"settingsVersion,omitempty,string"`
1644
1645	// ForceSendFields is a list of field names (e.g. "Kind") to
1646	// unconditionally include in API requests. By default, fields with
1647	// empty or default values are omitted from API requests. However, any
1648	// non-pointer, non-interface field appearing in ForceSendFields will be
1649	// sent to the server regardless of whether the field is empty or not.
1650	// This may be used to include empty fields in Patch requests.
1651	ForceSendFields []string `json:"-"`
1652
1653	// NullFields is a list of field names (e.g. "Kind") to include in API
1654	// requests with the JSON null value. By default, fields with empty
1655	// values are omitted from API requests. However, any field with an
1656	// empty value appearing in NullFields will be sent to the server as
1657	// null. It is an error if a field in this list has a non-empty value.
1658	// This may be used to include null fields in Patch requests.
1659	NullFields []string `json:"-"`
1660}
1661
1662func (s *FailoverContext) MarshalJSON() ([]byte, error) {
1663	type NoMethod FailoverContext
1664	raw := NoMethod(*s)
1665	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1666}
1667
1668// Flag: A flag resource.
1669type Flag struct {
1670	// AllowedIntValues: Use this field if only certain integers are
1671	// accepted. Can be combined with min_value and max_value to add
1672	// additional values.
1673	AllowedIntValues googleapi.Int64s `json:"allowedIntValues,omitempty"`
1674
1675	// AllowedStringValues: For **STRING** flags, a list of strings that the
1676	// value can be set to.
1677	AllowedStringValues []string `json:"allowedStringValues,omitempty"`
1678
1679	// AppliesTo: The database version this flag applies to. Can be
1680	// **MYSQL_8_0**, **MYSQL_5_6**, or **MYSQL_5_7**.
1681	//
1682	// Possible values:
1683	//   "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database
1684	// version.
1685	//   "MYSQL_5_1" - The database version is MySQL 5.1.
1686	//   "MYSQL_5_5" - The database version is MySQL 5.5.
1687	//   "MYSQL_5_6" - The database version is MySQL 5.6.
1688	//   "MYSQL_5_7" - The database version is MySQL 5.7.
1689	//   "POSTGRES_9_6" - The database version is PostgreSQL 9.6.
1690	//   "POSTGRES_11" - The database version is PostgreSQL 11.
1691	//   "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017
1692	// Standard.
1693	//   "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server
1694	// 2017 Enterprise.
1695	//   "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017
1696	// Express.
1697	//   "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web.
1698	//   "POSTGRES_10" - The database version is PostgreSQL 10.
1699	//   "POSTGRES_12" - The database version is PostgreSQL 12.
1700	//   "POSTGRES_13" - The database version is PostgreSQL 13.
1701	//   "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019
1702	// Standard.
1703	//   "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server
1704	// 2019 Enterprise.
1705	//   "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019
1706	// Express.
1707	//   "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web.
1708	AppliesTo []string `json:"appliesTo,omitempty"`
1709
1710	// InBeta: Whether or not the flag is considered in beta.
1711	InBeta bool `json:"inBeta,omitempty"`
1712
1713	// Kind: This is always **sql#flag**.
1714	Kind string `json:"kind,omitempty"`
1715
1716	// MaxValue: For **INTEGER** flags, the maximum allowed value.
1717	MaxValue int64 `json:"maxValue,omitempty,string"`
1718
1719	// MinValue: For **INTEGER** flags, the minimum allowed value.
1720	MinValue int64 `json:"minValue,omitempty,string"`
1721
1722	// Name: This is the name of the flag. Flag names always use
1723	// underscores, not hyphens, for example: **max_allowed_packet**
1724	Name string `json:"name,omitempty"`
1725
1726	// RequiresRestart: Indicates whether changing this flag will trigger a
1727	// database restart. Only applicable to Second Generation instances.
1728	RequiresRestart bool `json:"requiresRestart,omitempty"`
1729
1730	// Type: The type of the flag. Flags are typed to being **BOOLEAN**,
1731	// **STRING**, **INTEGER** or **NONE**. **NONE** is used for flags which
1732	// do not take a value, such as **skip_grant_tables**.
1733	//
1734	// Possible values:
1735	//   "SQL_FLAG_TYPE_UNSPECIFIED" - This is an unknown flag type.
1736	//   "BOOLEAN" - Boolean type flag.
1737	//   "STRING" - String type flag.
1738	//   "INTEGER" - Integer type flag.
1739	//   "NONE" - Flag type used for a server startup option.
1740	//   "MYSQL_TIMEZONE_OFFSET" - Type introduced specially for MySQL
1741	// TimeZone offset. Accept a string value with the format [-12:59,
1742	// 13:00].
1743	//   "FLOAT" - Float type flag.
1744	//   "REPEATED_STRING" - Comma-separated list of the strings in a
1745	// SqlFlagType enum.
1746	Type string `json:"type,omitempty"`
1747
1748	// ForceSendFields is a list of field names (e.g. "AllowedIntValues") to
1749	// unconditionally include in API requests. By default, fields with
1750	// empty or default values are omitted from API requests. However, any
1751	// non-pointer, non-interface field appearing in ForceSendFields will be
1752	// sent to the server regardless of whether the field is empty or not.
1753	// This may be used to include empty fields in Patch requests.
1754	ForceSendFields []string `json:"-"`
1755
1756	// NullFields is a list of field names (e.g. "AllowedIntValues") to
1757	// include in API requests with the JSON null value. By default, fields
1758	// with empty values are omitted from API requests. However, any field
1759	// with an empty value appearing in NullFields will be sent to the
1760	// server as null. It is an error if a field in this list has a
1761	// non-empty value. This may be used to include null fields in Patch
1762	// requests.
1763	NullFields []string `json:"-"`
1764}
1765
1766func (s *Flag) MarshalJSON() ([]byte, error) {
1767	type NoMethod Flag
1768	raw := NoMethod(*s)
1769	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1770}
1771
1772// FlagsListResponse: Flags list response.
1773type FlagsListResponse struct {
1774	// Items: List of flags.
1775	Items []*Flag `json:"items,omitempty"`
1776
1777	// Kind: This is always **sql#flagsList**.
1778	Kind string `json:"kind,omitempty"`
1779
1780	// ServerResponse contains the HTTP response code and headers from the
1781	// server.
1782	googleapi.ServerResponse `json:"-"`
1783
1784	// ForceSendFields is a list of field names (e.g. "Items") to
1785	// unconditionally include in API requests. By default, fields with
1786	// empty or default values are omitted from API requests. However, any
1787	// non-pointer, non-interface field appearing in ForceSendFields will be
1788	// sent to the server regardless of whether the field is empty or not.
1789	// This may be used to include empty fields in Patch requests.
1790	ForceSendFields []string `json:"-"`
1791
1792	// NullFields is a list of field names (e.g. "Items") to include in API
1793	// requests with the JSON null value. By default, fields with empty
1794	// values are omitted from API requests. However, any field with an
1795	// empty value appearing in NullFields will be sent to the server as
1796	// null. It is an error if a field in this list has a non-empty value.
1797	// This may be used to include null fields in Patch requests.
1798	NullFields []string `json:"-"`
1799}
1800
1801func (s *FlagsListResponse) MarshalJSON() ([]byte, error) {
1802	type NoMethod FlagsListResponse
1803	raw := NoMethod(*s)
1804	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1805}
1806
1807// GenerateEphemeralCertRequest: Ephemeral certificate creation request.
1808type GenerateEphemeralCertRequest struct {
1809	// AccessToken: Optional. Access token to include in the signed
1810	// certificate.
1811	AccessToken string `json:"access_token,omitempty"`
1812
1813	// PublicKey: PEM encoded public key to include in the signed
1814	// certificate.
1815	PublicKey string `json:"public_key,omitempty"`
1816
1817	// ReadTime: Optional. Optional snapshot read timestamp to trade
1818	// freshness for performance.
1819	ReadTime string `json:"readTime,omitempty"`
1820
1821	// ForceSendFields is a list of field names (e.g. "AccessToken") to
1822	// unconditionally include in API requests. By default, fields with
1823	// empty or default values are omitted from API requests. However, any
1824	// non-pointer, non-interface field appearing in ForceSendFields will be
1825	// sent to the server regardless of whether the field is empty or not.
1826	// This may be used to include empty fields in Patch requests.
1827	ForceSendFields []string `json:"-"`
1828
1829	// NullFields is a list of field names (e.g. "AccessToken") to include
1830	// in API requests with the JSON null value. By default, fields with
1831	// empty values are omitted from API requests. However, any field with
1832	// an empty value appearing in NullFields will be sent to the server as
1833	// null. It is an error if a field in this list has a non-empty value.
1834	// This may be used to include null fields in Patch requests.
1835	NullFields []string `json:"-"`
1836}
1837
1838func (s *GenerateEphemeralCertRequest) MarshalJSON() ([]byte, error) {
1839	type NoMethod GenerateEphemeralCertRequest
1840	raw := NoMethod(*s)
1841	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1842}
1843
1844// GenerateEphemeralCertResponse: Ephemeral certificate creation
1845// request.
1846type GenerateEphemeralCertResponse struct {
1847	// EphemeralCert: Generated cert
1848	EphemeralCert *SslCert `json:"ephemeralCert,omitempty"`
1849
1850	// ServerResponse contains the HTTP response code and headers from the
1851	// server.
1852	googleapi.ServerResponse `json:"-"`
1853
1854	// ForceSendFields is a list of field names (e.g. "EphemeralCert") to
1855	// unconditionally include in API requests. By default, fields with
1856	// empty or default values are omitted from API requests. However, any
1857	// non-pointer, non-interface field appearing in ForceSendFields will be
1858	// sent to the server regardless of whether the field is empty or not.
1859	// This may be used to include empty fields in Patch requests.
1860	ForceSendFields []string `json:"-"`
1861
1862	// NullFields is a list of field names (e.g. "EphemeralCert") to include
1863	// in API requests with the JSON null value. By default, fields with
1864	// empty values are omitted from API requests. However, any field with
1865	// an empty value appearing in NullFields will be sent to the server as
1866	// null. It is an error if a field in this list has a non-empty value.
1867	// This may be used to include null fields in Patch requests.
1868	NullFields []string `json:"-"`
1869}
1870
1871func (s *GenerateEphemeralCertResponse) MarshalJSON() ([]byte, error) {
1872	type NoMethod GenerateEphemeralCertResponse
1873	raw := NoMethod(*s)
1874	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1875}
1876
1877// ImportContext: Database instance import context.
1878type ImportContext struct {
1879	// BakImportOptions: Import parameters specific to SQL Server .BAK files
1880	BakImportOptions *ImportContextBakImportOptions `json:"bakImportOptions,omitempty"`
1881
1882	// CsvImportOptions: Options for importing data as CSV.
1883	CsvImportOptions *ImportContextCsvImportOptions `json:"csvImportOptions,omitempty"`
1884
1885	// Database: The target database for the import. If **fileType** is
1886	// **SQL**, this field is required only if the import file does not
1887	// specify a database, and is overridden by any database specification
1888	// in the import file. If **fileType** is **CSV**, one database must be
1889	// specified.
1890	Database string `json:"database,omitempty"`
1891
1892	// FileType: The file type for the specified uri. **SQL**: The file
1893	// contains SQL statements. **CSV**: The file contains CSV data.
1894	//
1895	// Possible values:
1896	//   "SQL_FILE_TYPE_UNSPECIFIED" - Unknown file type.
1897	//   "SQL" - File containing SQL statements.
1898	//   "CSV" - File in CSV format.
1899	//   "BAK"
1900	FileType string `json:"fileType,omitempty"`
1901
1902	// ImportUser: The PostgreSQL user for this import operation. PostgreSQL
1903	// instances only.
1904	ImportUser string `json:"importUser,omitempty"`
1905
1906	// Kind: This is always **sql#importContext**.
1907	Kind string `json:"kind,omitempty"`
1908
1909	// Uri: Path to the import file in Cloud Storage, in the form
1910	// **gs://bucketName/fileName**. Compressed gzip files (.gz) are
1911	// supported when **fileType** is **SQL**. The instance must have write
1912	// permissions to the bucket and read access to the file.
1913	Uri string `json:"uri,omitempty"`
1914
1915	// ForceSendFields is a list of field names (e.g. "BakImportOptions") to
1916	// unconditionally include in API requests. By default, fields with
1917	// empty or default values are omitted from API requests. However, any
1918	// non-pointer, non-interface field appearing in ForceSendFields will be
1919	// sent to the server regardless of whether the field is empty or not.
1920	// This may be used to include empty fields in Patch requests.
1921	ForceSendFields []string `json:"-"`
1922
1923	// NullFields is a list of field names (e.g. "BakImportOptions") to
1924	// include in API requests with the JSON null value. By default, fields
1925	// with empty values are omitted from API requests. However, any field
1926	// with an empty value appearing in NullFields will be sent to the
1927	// server as null. It is an error if a field in this list has a
1928	// non-empty value. This may be used to include null fields in Patch
1929	// requests.
1930	NullFields []string `json:"-"`
1931}
1932
1933func (s *ImportContext) MarshalJSON() ([]byte, error) {
1934	type NoMethod ImportContext
1935	raw := NoMethod(*s)
1936	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1937}
1938
1939// ImportContextBakImportOptions: Import parameters specific to SQL
1940// Server .BAK files
1941type ImportContextBakImportOptions struct {
1942	EncryptionOptions *ImportContextBakImportOptionsEncryptionOptions `json:"encryptionOptions,omitempty"`
1943
1944	// ForceSendFields is a list of field names (e.g. "EncryptionOptions")
1945	// to unconditionally include in API requests. By default, fields with
1946	// empty or default values are omitted from API requests. However, any
1947	// non-pointer, non-interface field appearing in ForceSendFields will be
1948	// sent to the server regardless of whether the field is empty or not.
1949	// This may be used to include empty fields in Patch requests.
1950	ForceSendFields []string `json:"-"`
1951
1952	// NullFields is a list of field names (e.g. "EncryptionOptions") to
1953	// include in API requests with the JSON null value. By default, fields
1954	// with empty values are omitted from API requests. However, any field
1955	// with an empty value appearing in NullFields will be sent to the
1956	// server as null. It is an error if a field in this list has a
1957	// non-empty value. This may be used to include null fields in Patch
1958	// requests.
1959	NullFields []string `json:"-"`
1960}
1961
1962func (s *ImportContextBakImportOptions) MarshalJSON() ([]byte, error) {
1963	type NoMethod ImportContextBakImportOptions
1964	raw := NoMethod(*s)
1965	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1966}
1967
1968type ImportContextBakImportOptionsEncryptionOptions struct {
1969	// CertPath: Path to the Certificate (.cer) in Cloud Storage, in the
1970	// form **gs://bucketName/fileName**. The instance must have write
1971	// permissions to the bucket and read access to the file.
1972	CertPath string `json:"certPath,omitempty"`
1973
1974	// PvkPassword: Password that encrypts the private key
1975	PvkPassword string `json:"pvkPassword,omitempty"`
1976
1977	// PvkPath: Path to the Certificate Private Key (.pvk) in Cloud Storage,
1978	// in the form **gs://bucketName/fileName**. The instance must have
1979	// write permissions to the bucket and read access to the file.
1980	PvkPath string `json:"pvkPath,omitempty"`
1981
1982	// ForceSendFields is a list of field names (e.g. "CertPath") to
1983	// unconditionally include in API requests. By default, fields with
1984	// empty or default values are omitted from API requests. However, any
1985	// non-pointer, non-interface field appearing in ForceSendFields will be
1986	// sent to the server regardless of whether the field is empty or not.
1987	// This may be used to include empty fields in Patch requests.
1988	ForceSendFields []string `json:"-"`
1989
1990	// NullFields is a list of field names (e.g. "CertPath") to include in
1991	// API requests with the JSON null value. By default, fields with empty
1992	// values are omitted from API requests. However, any field with an
1993	// empty value appearing in NullFields will be sent to the server as
1994	// null. It is an error if a field in this list has a non-empty value.
1995	// This may be used to include null fields in Patch requests.
1996	NullFields []string `json:"-"`
1997}
1998
1999func (s *ImportContextBakImportOptionsEncryptionOptions) MarshalJSON() ([]byte, error) {
2000	type NoMethod ImportContextBakImportOptionsEncryptionOptions
2001	raw := NoMethod(*s)
2002	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2003}
2004
2005// ImportContextCsvImportOptions: Options for importing data as CSV.
2006type ImportContextCsvImportOptions struct {
2007	// Columns: The columns to which CSV data is imported. If not specified,
2008	// all columns of the database table are loaded with CSV data.
2009	Columns []string `json:"columns,omitempty"`
2010
2011	// Table: The table to which CSV data is imported.
2012	Table string `json:"table,omitempty"`
2013
2014	// ForceSendFields is a list of field names (e.g. "Columns") to
2015	// unconditionally include in API requests. By default, fields with
2016	// empty or default values are omitted from API requests. However, any
2017	// non-pointer, non-interface field appearing in ForceSendFields will be
2018	// sent to the server regardless of whether the field is empty or not.
2019	// This may be used to include empty fields in Patch requests.
2020	ForceSendFields []string `json:"-"`
2021
2022	// NullFields is a list of field names (e.g. "Columns") to include in
2023	// API requests with the JSON null value. By default, fields with empty
2024	// values are omitted from API requests. However, any field with an
2025	// empty value appearing in NullFields will be sent to the server as
2026	// null. It is an error if a field in this list has a non-empty value.
2027	// This may be used to include null fields in Patch requests.
2028	NullFields []string `json:"-"`
2029}
2030
2031func (s *ImportContextCsvImportOptions) MarshalJSON() ([]byte, error) {
2032	type NoMethod ImportContextCsvImportOptions
2033	raw := NoMethod(*s)
2034	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2035}
2036
2037// InsightsConfig: Insights configuration. This specifies when Cloud SQL
2038// Insights feature is enabled and optional configuration.
2039type InsightsConfig struct {
2040	// QueryInsightsEnabled: Whether Query Insights feature is enabled.
2041	QueryInsightsEnabled bool `json:"queryInsightsEnabled,omitempty"`
2042
2043	// QueryPlansPerMinute: Number of query execution plans captured by
2044	// Insights per minute for all queries combined. Default is 5.
2045	QueryPlansPerMinute int64 `json:"queryPlansPerMinute,omitempty"`
2046
2047	// QueryStringLength: Maximum query length stored in bytes. Default
2048	// value: 1024 bytes. Range: 256-4500 bytes. Query length more than this
2049	// field value will be truncated to this value. When unset, query length
2050	// will be the default value. Changing query length will restart the
2051	// database.
2052	QueryStringLength int64 `json:"queryStringLength,omitempty"`
2053
2054	// RecordApplicationTags: Whether Query Insights will record application
2055	// tags from query when enabled.
2056	RecordApplicationTags bool `json:"recordApplicationTags,omitempty"`
2057
2058	// RecordClientAddress: Whether Query Insights will record client
2059	// address when enabled.
2060	RecordClientAddress bool `json:"recordClientAddress,omitempty"`
2061
2062	// ForceSendFields is a list of field names (e.g.
2063	// "QueryInsightsEnabled") to unconditionally include in API requests.
2064	// By default, fields with empty or default values are omitted from API
2065	// requests. However, any non-pointer, non-interface field appearing in
2066	// ForceSendFields will be sent to the server regardless of whether the
2067	// field is empty or not. This may be used to include empty fields in
2068	// Patch requests.
2069	ForceSendFields []string `json:"-"`
2070
2071	// NullFields is a list of field names (e.g. "QueryInsightsEnabled") to
2072	// include in API requests with the JSON null value. By default, fields
2073	// with empty values are omitted from API requests. However, any field
2074	// with an empty value appearing in NullFields will be sent to the
2075	// server as null. It is an error if a field in this list has a
2076	// non-empty value. This may be used to include null fields in Patch
2077	// requests.
2078	NullFields []string `json:"-"`
2079}
2080
2081func (s *InsightsConfig) MarshalJSON() ([]byte, error) {
2082	type NoMethod InsightsConfig
2083	raw := NoMethod(*s)
2084	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2085}
2086
2087// InstancesCloneRequest: Database instance clone request.
2088type InstancesCloneRequest struct {
2089	// CloneContext: Contains details about the clone operation.
2090	CloneContext *CloneContext `json:"cloneContext,omitempty"`
2091
2092	// ForceSendFields is a list of field names (e.g. "CloneContext") to
2093	// unconditionally include in API requests. By default, fields with
2094	// empty or default values are omitted from API requests. However, any
2095	// non-pointer, non-interface field appearing in ForceSendFields will be
2096	// sent to the server regardless of whether the field is empty or not.
2097	// This may be used to include empty fields in Patch requests.
2098	ForceSendFields []string `json:"-"`
2099
2100	// NullFields is a list of field names (e.g. "CloneContext") to include
2101	// in API requests with the JSON null value. By default, fields with
2102	// empty values are omitted from API requests. However, any field with
2103	// an empty value appearing in NullFields will be sent to the server as
2104	// null. It is an error if a field in this list has a non-empty value.
2105	// This may be used to include null fields in Patch requests.
2106	NullFields []string `json:"-"`
2107}
2108
2109func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) {
2110	type NoMethod InstancesCloneRequest
2111	raw := NoMethod(*s)
2112	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2113}
2114
2115// InstancesDemoteMasterRequest: Database demote primary instance
2116// request.
2117type InstancesDemoteMasterRequest struct {
2118	// DemoteMasterContext: Contains details about the demoteMaster
2119	// operation.
2120	DemoteMasterContext *DemoteMasterContext `json:"demoteMasterContext,omitempty"`
2121
2122	// ForceSendFields is a list of field names (e.g. "DemoteMasterContext")
2123	// to unconditionally include in API requests. By default, fields with
2124	// empty or default values are omitted from API requests. However, any
2125	// non-pointer, non-interface field appearing in ForceSendFields will be
2126	// sent to the server regardless of whether the field is empty or not.
2127	// This may be used to include empty fields in Patch requests.
2128	ForceSendFields []string `json:"-"`
2129
2130	// NullFields is a list of field names (e.g. "DemoteMasterContext") to
2131	// include in API requests with the JSON null value. By default, fields
2132	// with empty values are omitted from API requests. However, any field
2133	// with an empty value appearing in NullFields will be sent to the
2134	// server as null. It is an error if a field in this list has a
2135	// non-empty value. This may be used to include null fields in Patch
2136	// requests.
2137	NullFields []string `json:"-"`
2138}
2139
2140func (s *InstancesDemoteMasterRequest) MarshalJSON() ([]byte, error) {
2141	type NoMethod InstancesDemoteMasterRequest
2142	raw := NoMethod(*s)
2143	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2144}
2145
2146// InstancesExportRequest: Database instance export request.
2147type InstancesExportRequest struct {
2148	// ExportContext: Contains details about the export operation.
2149	ExportContext *ExportContext `json:"exportContext,omitempty"`
2150
2151	// ForceSendFields is a list of field names (e.g. "ExportContext") to
2152	// unconditionally include in API requests. By default, fields with
2153	// empty or default values are omitted from API requests. However, any
2154	// non-pointer, non-interface field appearing in ForceSendFields will be
2155	// sent to the server regardless of whether the field is empty or not.
2156	// This may be used to include empty fields in Patch requests.
2157	ForceSendFields []string `json:"-"`
2158
2159	// NullFields is a list of field names (e.g. "ExportContext") to include
2160	// in API requests with the JSON null value. By default, fields with
2161	// empty values are omitted from API requests. However, any field with
2162	// an empty value appearing in NullFields will be sent to the server as
2163	// null. It is an error if a field in this list has a non-empty value.
2164	// This may be used to include null fields in Patch requests.
2165	NullFields []string `json:"-"`
2166}
2167
2168func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) {
2169	type NoMethod InstancesExportRequest
2170	raw := NoMethod(*s)
2171	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2172}
2173
2174// InstancesFailoverRequest: Instance failover request.
2175type InstancesFailoverRequest struct {
2176	// FailoverContext: Failover Context.
2177	FailoverContext *FailoverContext `json:"failoverContext,omitempty"`
2178
2179	// ForceSendFields is a list of field names (e.g. "FailoverContext") to
2180	// unconditionally include in API requests. By default, fields with
2181	// empty or default values are omitted from API requests. However, any
2182	// non-pointer, non-interface field appearing in ForceSendFields will be
2183	// sent to the server regardless of whether the field is empty or not.
2184	// This may be used to include empty fields in Patch requests.
2185	ForceSendFields []string `json:"-"`
2186
2187	// NullFields is a list of field names (e.g. "FailoverContext") to
2188	// include in API requests with the JSON null value. By default, fields
2189	// with empty values are omitted from API requests. However, any field
2190	// with an empty value appearing in NullFields will be sent to the
2191	// server as null. It is an error if a field in this list has a
2192	// non-empty value. This may be used to include null fields in Patch
2193	// requests.
2194	NullFields []string `json:"-"`
2195}
2196
2197func (s *InstancesFailoverRequest) MarshalJSON() ([]byte, error) {
2198	type NoMethod InstancesFailoverRequest
2199	raw := NoMethod(*s)
2200	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2201}
2202
2203// InstancesImportRequest: Database instance import request.
2204type InstancesImportRequest struct {
2205	// ImportContext: Contains details about the import operation.
2206	ImportContext *ImportContext `json:"importContext,omitempty"`
2207
2208	// ForceSendFields is a list of field names (e.g. "ImportContext") to
2209	// unconditionally include in API requests. By default, fields with
2210	// empty or default values are omitted from API requests. However, any
2211	// non-pointer, non-interface field appearing in ForceSendFields will be
2212	// sent to the server regardless of whether the field is empty or not.
2213	// This may be used to include empty fields in Patch requests.
2214	ForceSendFields []string `json:"-"`
2215
2216	// NullFields is a list of field names (e.g. "ImportContext") to include
2217	// in API requests with the JSON null value. By default, fields with
2218	// empty values are omitted from API requests. However, any field with
2219	// an empty value appearing in NullFields will be sent to the server as
2220	// null. It is an error if a field in this list has a non-empty value.
2221	// This may be used to include null fields in Patch requests.
2222	NullFields []string `json:"-"`
2223}
2224
2225func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) {
2226	type NoMethod InstancesImportRequest
2227	raw := NoMethod(*s)
2228	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2229}
2230
2231// InstancesListResponse: Database instances list response.
2232type InstancesListResponse struct {
2233	// Items: List of database instance resources.
2234	Items []*DatabaseInstance `json:"items,omitempty"`
2235
2236	// Kind: This is always *sql#instancesList*.
2237	Kind string `json:"kind,omitempty"`
2238
2239	// NextPageToken: The continuation token, used to page through large
2240	// result sets. Provide this value in a subsequent request to return the
2241	// next page of results.
2242	NextPageToken string `json:"nextPageToken,omitempty"`
2243
2244	// Warnings: List of warnings that occurred while handling the request.
2245	Warnings []*ApiWarning `json:"warnings,omitempty"`
2246
2247	// ServerResponse contains the HTTP response code and headers from the
2248	// server.
2249	googleapi.ServerResponse `json:"-"`
2250
2251	// ForceSendFields is a list of field names (e.g. "Items") to
2252	// unconditionally include in API requests. By default, fields with
2253	// empty or default values are omitted from API requests. However, any
2254	// non-pointer, non-interface field appearing in ForceSendFields will be
2255	// sent to the server regardless of whether the field is empty or not.
2256	// This may be used to include empty fields in Patch requests.
2257	ForceSendFields []string `json:"-"`
2258
2259	// NullFields is a list of field names (e.g. "Items") to include in API
2260	// requests with the JSON null value. By default, fields with empty
2261	// values are omitted from API requests. However, any field with an
2262	// empty value appearing in NullFields will be sent to the server as
2263	// null. It is an error if a field in this list has a non-empty value.
2264	// This may be used to include null fields in Patch requests.
2265	NullFields []string `json:"-"`
2266}
2267
2268func (s *InstancesListResponse) MarshalJSON() ([]byte, error) {
2269	type NoMethod InstancesListResponse
2270	raw := NoMethod(*s)
2271	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2272}
2273
2274// InstancesListServerCasResponse: Instances ListServerCas response.
2275type InstancesListServerCasResponse struct {
2276	ActiveVersion string `json:"activeVersion,omitempty"`
2277
2278	// Certs: List of server CA certificates for the instance.
2279	Certs []*SslCert `json:"certs,omitempty"`
2280
2281	// Kind: This is always *sql#instancesListServerCas*.
2282	Kind string `json:"kind,omitempty"`
2283
2284	// ServerResponse contains the HTTP response code and headers from the
2285	// server.
2286	googleapi.ServerResponse `json:"-"`
2287
2288	// ForceSendFields is a list of field names (e.g. "ActiveVersion") to
2289	// unconditionally include in API requests. By default, fields with
2290	// empty or default values are omitted from API requests. However, any
2291	// non-pointer, non-interface field appearing in ForceSendFields will be
2292	// sent to the server regardless of whether the field is empty or not.
2293	// This may be used to include empty fields in Patch requests.
2294	ForceSendFields []string `json:"-"`
2295
2296	// NullFields is a list of field names (e.g. "ActiveVersion") to include
2297	// in API requests with the JSON null value. By default, fields with
2298	// empty values are omitted from API requests. However, any field with
2299	// an empty value appearing in NullFields will be sent to the server as
2300	// null. It is an error if a field in this list has a non-empty value.
2301	// This may be used to include null fields in Patch requests.
2302	NullFields []string `json:"-"`
2303}
2304
2305func (s *InstancesListServerCasResponse) MarshalJSON() ([]byte, error) {
2306	type NoMethod InstancesListServerCasResponse
2307	raw := NoMethod(*s)
2308	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2309}
2310
2311// InstancesRestoreBackupRequest: Database instance restore backup
2312// request.
2313type InstancesRestoreBackupRequest struct {
2314	// RestoreBackupContext: Parameters required to perform the restore
2315	// backup operation.
2316	RestoreBackupContext *RestoreBackupContext `json:"restoreBackupContext,omitempty"`
2317
2318	// ForceSendFields is a list of field names (e.g.
2319	// "RestoreBackupContext") to unconditionally include in API requests.
2320	// By default, fields with empty or default values are omitted from API
2321	// requests. However, any non-pointer, non-interface field appearing in
2322	// ForceSendFields will be sent to the server regardless of whether the
2323	// field is empty or not. This may be used to include empty fields in
2324	// Patch requests.
2325	ForceSendFields []string `json:"-"`
2326
2327	// NullFields is a list of field names (e.g. "RestoreBackupContext") to
2328	// include in API requests with the JSON null value. By default, fields
2329	// with empty values are omitted from API requests. However, any field
2330	// with an empty value appearing in NullFields will be sent to the
2331	// server as null. It is an error if a field in this list has a
2332	// non-empty value. This may be used to include null fields in Patch
2333	// requests.
2334	NullFields []string `json:"-"`
2335}
2336
2337func (s *InstancesRestoreBackupRequest) MarshalJSON() ([]byte, error) {
2338	type NoMethod InstancesRestoreBackupRequest
2339	raw := NoMethod(*s)
2340	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2341}
2342
2343// InstancesRotateServerCaRequest: Rotate server CA request.
2344type InstancesRotateServerCaRequest struct {
2345	// RotateServerCaContext: Contains details about the rotate server CA
2346	// operation.
2347	RotateServerCaContext *RotateServerCaContext `json:"rotateServerCaContext,omitempty"`
2348
2349	// ForceSendFields is a list of field names (e.g.
2350	// "RotateServerCaContext") to unconditionally include in API requests.
2351	// By default, fields with empty or default values are omitted from API
2352	// requests. However, any non-pointer, non-interface field appearing in
2353	// ForceSendFields will be sent to the server regardless of whether the
2354	// field is empty or not. This may be used to include empty fields in
2355	// Patch requests.
2356	ForceSendFields []string `json:"-"`
2357
2358	// NullFields is a list of field names (e.g. "RotateServerCaContext") to
2359	// include in API requests with the JSON null value. By default, fields
2360	// with empty values are omitted from API requests. However, any field
2361	// with an empty value appearing in NullFields will be sent to the
2362	// server as null. It is an error if a field in this list has a
2363	// non-empty value. This may be used to include null fields in Patch
2364	// requests.
2365	NullFields []string `json:"-"`
2366}
2367
2368func (s *InstancesRotateServerCaRequest) MarshalJSON() ([]byte, error) {
2369	type NoMethod InstancesRotateServerCaRequest
2370	raw := NoMethod(*s)
2371	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2372}
2373
2374// InstancesTruncateLogRequest: Instance truncate log request.
2375type InstancesTruncateLogRequest struct {
2376	// TruncateLogContext: Contains details about the truncate log
2377	// operation.
2378	TruncateLogContext *TruncateLogContext `json:"truncateLogContext,omitempty"`
2379
2380	// ForceSendFields is a list of field names (e.g. "TruncateLogContext")
2381	// to unconditionally include in API requests. By default, fields with
2382	// empty or default values are omitted from API requests. However, any
2383	// non-pointer, non-interface field appearing in ForceSendFields will be
2384	// sent to the server regardless of whether the field is empty or not.
2385	// This may be used to include empty fields in Patch requests.
2386	ForceSendFields []string `json:"-"`
2387
2388	// NullFields is a list of field names (e.g. "TruncateLogContext") to
2389	// include in API requests with the JSON null value. By default, fields
2390	// with empty values are omitted from API requests. However, any field
2391	// with an empty value appearing in NullFields will be sent to the
2392	// server as null. It is an error if a field in this list has a
2393	// non-empty value. This may be used to include null fields in Patch
2394	// requests.
2395	NullFields []string `json:"-"`
2396}
2397
2398func (s *InstancesTruncateLogRequest) MarshalJSON() ([]byte, error) {
2399	type NoMethod InstancesTruncateLogRequest
2400	raw := NoMethod(*s)
2401	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2402}
2403
2404// IpConfiguration: IP Management configuration.
2405type IpConfiguration struct {
2406	// AllocatedIpRange: The name of the allocated ip range for the private
2407	// ip CloudSQL instance. For example: "google-managed-services-default".
2408	// If set, the instance ip will be created in the allocated range. The
2409	// range name must comply with RFC 1035
2410	// (https://tools.ietf.org/html/rfc1035). Specifically, the name must be
2411	// 1-63 characters long and match the regular expression a-z
2412	// ([-a-z0-9]*[a-z0-9])?. Reserved for future use.
2413	AllocatedIpRange string `json:"allocatedIpRange,omitempty"`
2414
2415	// AuthorizedNetworks: The list of external networks that are allowed to
2416	// connect to the instance using the IP. In 'CIDR' notation, also known
2417	// as 'slash' notation (for example: **192.168.100.0/24**).
2418	AuthorizedNetworks []*AclEntry `json:"authorizedNetworks,omitempty"`
2419
2420	// Ipv4Enabled: Whether the instance is assigned a public IP address or
2421	// not.
2422	Ipv4Enabled bool `json:"ipv4Enabled,omitempty"`
2423
2424	// PrivateNetwork: The resource link for the VPC network from which the
2425	// Cloud SQL instance is accessible for private IP. For example,
2426	// **/projects/myProject/global/networks/default**. This setting can be
2427	// updated, but it cannot be removed after it is set.
2428	PrivateNetwork string `json:"privateNetwork,omitempty"`
2429
2430	// RequireSsl: Whether SSL connections over IP are enforced or not.
2431	RequireSsl bool `json:"requireSsl,omitempty"`
2432
2433	// ForceSendFields is a list of field names (e.g. "AllocatedIpRange") to
2434	// unconditionally include in API requests. By default, fields with
2435	// empty or default values are omitted from API requests. However, any
2436	// non-pointer, non-interface field appearing in ForceSendFields will be
2437	// sent to the server regardless of whether the field is empty or not.
2438	// This may be used to include empty fields in Patch requests.
2439	ForceSendFields []string `json:"-"`
2440
2441	// NullFields is a list of field names (e.g. "AllocatedIpRange") to
2442	// include in API requests with the JSON null value. By default, fields
2443	// with empty values are omitted from API requests. However, any field
2444	// with an empty value appearing in NullFields will be sent to the
2445	// server as null. It is an error if a field in this list has a
2446	// non-empty value. This may be used to include null fields in Patch
2447	// requests.
2448	NullFields []string `json:"-"`
2449}
2450
2451func (s *IpConfiguration) MarshalJSON() ([]byte, error) {
2452	type NoMethod IpConfiguration
2453	raw := NoMethod(*s)
2454	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2455}
2456
2457// IpMapping: Database instance IP Mapping.
2458type IpMapping struct {
2459	// IpAddress: The IP address assigned.
2460	IpAddress string `json:"ipAddress,omitempty"`
2461
2462	// TimeToRetire: The due time for this IP to be retired in RFC 3339
2463	// (https://tools.ietf.org/html/rfc3339) format, for example
2464	// **2012-11-15T16:19:00.094Z**. This field is only available when the
2465	// IP is scheduled to be retired.
2466	TimeToRetire string `json:"timeToRetire,omitempty"`
2467
2468	// Type: The type of this IP address. A **PRIMARY** address is a public
2469	// address that can accept incoming connections. A **PRIVATE** address
2470	// is a private address that can accept incoming connections. An
2471	// **OUTGOING** address is the source address of connections originating
2472	// from the instance, if supported.
2473	//
2474	// Possible values:
2475	//   "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" - This is an unknown IP address
2476	// type.
2477	//   "PRIMARY" - IP address the customer is supposed to connect to.
2478	// Usually this is the load balancer's IP address
2479	//   "OUTGOING" - Source IP address of the connection a read replica
2480	// establishes to its external primary instance. This IP address can be
2481	// allowlisted by the customer in case it has a firewall that filters
2482	// incoming connection to its on premises primary instance.
2483	//   "PRIVATE" - Private IP used when using private IPs and network
2484	// peering.
2485	//   "MIGRATED_1ST_GEN" - V1 IP of a migrated instance. We want the user
2486	// to decommission this IP as soon as the migration is complete. Note:
2487	// V1 instances with V1 ip addresses will be counted as PRIMARY.
2488	Type string `json:"type,omitempty"`
2489
2490	// ForceSendFields is a list of field names (e.g. "IpAddress") to
2491	// unconditionally include in API requests. By default, fields with
2492	// empty or default values are omitted from API requests. However, any
2493	// non-pointer, non-interface field appearing in ForceSendFields will be
2494	// sent to the server regardless of whether the field is empty or not.
2495	// This may be used to include empty fields in Patch requests.
2496	ForceSendFields []string `json:"-"`
2497
2498	// NullFields is a list of field names (e.g. "IpAddress") to include in
2499	// API requests with the JSON null value. By default, fields with empty
2500	// values are omitted from API requests. However, any field with an
2501	// empty value appearing in NullFields will be sent to the server as
2502	// null. It is an error if a field in this list has a non-empty value.
2503	// This may be used to include null fields in Patch requests.
2504	NullFields []string `json:"-"`
2505}
2506
2507func (s *IpMapping) MarshalJSON() ([]byte, error) {
2508	type NoMethod IpMapping
2509	raw := NoMethod(*s)
2510	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2511}
2512
2513// LocationPreference: Preferred location. This specifies where a Cloud
2514// SQL instance is located. Note that if the preferred location is not
2515// available, the instance will be located as close as possible within
2516// the region. Only one location may be specified.
2517type LocationPreference struct {
2518	// FollowGaeApplication: The App Engine application to follow, it must
2519	// be in the same region as the Cloud SQL instance.
2520	FollowGaeApplication string `json:"followGaeApplication,omitempty"`
2521
2522	// Kind: This is always **sql#locationPreference**.
2523	Kind string `json:"kind,omitempty"`
2524
2525	// SecondaryZone: The preferred Compute Engine zone for the
2526	// secondary/failover (for example: us-central1-a, us-central1-b, etc.).
2527	// Reserved for future use.
2528	SecondaryZone string `json:"secondaryZone,omitempty"`
2529
2530	// Zone: The preferred Compute Engine zone (for example: us-central1-a,
2531	// us-central1-b, etc.).
2532	Zone string `json:"zone,omitempty"`
2533
2534	// ForceSendFields is a list of field names (e.g.
2535	// "FollowGaeApplication") to unconditionally include in API requests.
2536	// By default, fields with empty or default values are omitted from API
2537	// requests. However, any non-pointer, non-interface field appearing in
2538	// ForceSendFields will be sent to the server regardless of whether the
2539	// field is empty or not. This may be used to include empty fields in
2540	// Patch requests.
2541	ForceSendFields []string `json:"-"`
2542
2543	// NullFields is a list of field names (e.g. "FollowGaeApplication") to
2544	// include in API requests with the JSON null value. By default, fields
2545	// with empty values are omitted from API requests. However, any field
2546	// with an empty value appearing in NullFields will be sent to the
2547	// server as null. It is an error if a field in this list has a
2548	// non-empty value. This may be used to include null fields in Patch
2549	// requests.
2550	NullFields []string `json:"-"`
2551}
2552
2553func (s *LocationPreference) MarshalJSON() ([]byte, error) {
2554	type NoMethod LocationPreference
2555	raw := NoMethod(*s)
2556	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2557}
2558
2559// MaintenanceWindow: Maintenance window. This specifies when a Cloud
2560// SQL instance is restarted for system maintenance purposes.
2561type MaintenanceWindow struct {
2562	// Day: day of week (1-7), starting on Monday.
2563	Day int64 `json:"day,omitempty"`
2564
2565	// Hour: hour of day - 0 to 23.
2566	Hour int64 `json:"hour,omitempty"`
2567
2568	// Kind: This is always **sql#maintenanceWindow**.
2569	Kind string `json:"kind,omitempty"`
2570
2571	// UpdateTrack: Maintenance timing setting: **canary** (Earlier) or
2572	// **stable** (Later). [Learn more]
2573	// (https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-timing-2ndgen).
2574	//
2575	// Possible values:
2576	//   "SQL_UPDATE_TRACK_UNSPECIFIED" - This is an unknown maintenance
2577	// timing preference.
2578	//   "canary" - For instance update that requires a restart, this update
2579	// track indicates your instance prefer to restart for new version early
2580	// in maintenance window.
2581	//   "stable" - For instance update that requires a restart, this update
2582	// track indicates your instance prefer to let Cloud SQL choose the
2583	// timing of restart (within its Maintenance window, if applicable).
2584	UpdateTrack string `json:"updateTrack,omitempty"`
2585
2586	// ForceSendFields is a list of field names (e.g. "Day") to
2587	// unconditionally include in API requests. By default, fields with
2588	// empty or default values are omitted from API requests. However, any
2589	// non-pointer, non-interface field appearing in ForceSendFields will be
2590	// sent to the server regardless of whether the field is empty or not.
2591	// This may be used to include empty fields in Patch requests.
2592	ForceSendFields []string `json:"-"`
2593
2594	// NullFields is a list of field names (e.g. "Day") to include in API
2595	// requests with the JSON null value. By default, fields with empty
2596	// values are omitted from API requests. However, any field with an
2597	// empty value appearing in NullFields will be sent to the server as
2598	// null. It is an error if a field in this list has a non-empty value.
2599	// This may be used to include null fields in Patch requests.
2600	NullFields []string `json:"-"`
2601}
2602
2603func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
2604	type NoMethod MaintenanceWindow
2605	raw := NoMethod(*s)
2606	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2607}
2608
2609// MySqlReplicaConfiguration: Read-replica configuration specific to
2610// MySQL databases.
2611type MySqlReplicaConfiguration struct {
2612	// CaCertificate: PEM representation of the trusted CA's x509
2613	// certificate.
2614	CaCertificate string `json:"caCertificate,omitempty"`
2615
2616	// ClientCertificate: PEM representation of the replica's x509
2617	// certificate.
2618	ClientCertificate string `json:"clientCertificate,omitempty"`
2619
2620	// ClientKey: PEM representation of the replica's private key. The
2621	// corresponsing public key is encoded in the client's certificate.
2622	ClientKey string `json:"clientKey,omitempty"`
2623
2624	// ConnectRetryInterval: Seconds to wait between connect retries.
2625	// MySQL's default is 60 seconds.
2626	ConnectRetryInterval int64 `json:"connectRetryInterval,omitempty"`
2627
2628	// DumpFilePath: Path to a SQL dump file in Google Cloud Storage from
2629	// which the replica instance is to be created. The URI is in the form
2630	// gs://bucketName/fileName. Compressed gzip files (.gz) are also
2631	// supported. Dumps have the binlog co-ordinates from which replication
2632	// begins. This can be accomplished by setting --master-data to 1 when
2633	// using mysqldump.
2634	DumpFilePath string `json:"dumpFilePath,omitempty"`
2635
2636	// Kind: This is always **sql#mysqlReplicaConfiguration**.
2637	Kind string `json:"kind,omitempty"`
2638
2639	// MasterHeartbeatPeriod: Interval in milliseconds between replication
2640	// heartbeats.
2641	MasterHeartbeatPeriod int64 `json:"masterHeartbeatPeriod,omitempty,string"`
2642
2643	// Password: The password for the replication connection.
2644	Password string `json:"password,omitempty"`
2645
2646	// SslCipher: A list of permissible ciphers to use for SSL encryption.
2647	SslCipher string `json:"sslCipher,omitempty"`
2648
2649	// Username: The username for the replication connection.
2650	Username string `json:"username,omitempty"`
2651
2652	// VerifyServerCertificate: Whether or not to check the primary
2653	// instance's Common Name value in the certificate that it sends during
2654	// the SSL handshake.
2655	VerifyServerCertificate bool `json:"verifyServerCertificate,omitempty"`
2656
2657	// ForceSendFields is a list of field names (e.g. "CaCertificate") to
2658	// unconditionally include in API requests. By default, fields with
2659	// empty or default values are omitted from API requests. However, any
2660	// non-pointer, non-interface field appearing in ForceSendFields will be
2661	// sent to the server regardless of whether the field is empty or not.
2662	// This may be used to include empty fields in Patch requests.
2663	ForceSendFields []string `json:"-"`
2664
2665	// NullFields is a list of field names (e.g. "CaCertificate") to include
2666	// in API requests with the JSON null value. By default, fields with
2667	// empty values are omitted from API requests. However, any field with
2668	// an empty value appearing in NullFields will be sent to the server as
2669	// null. It is an error if a field in this list has a non-empty value.
2670	// This may be used to include null fields in Patch requests.
2671	NullFields []string `json:"-"`
2672}
2673
2674func (s *MySqlReplicaConfiguration) MarshalJSON() ([]byte, error) {
2675	type NoMethod MySqlReplicaConfiguration
2676	raw := NoMethod(*s)
2677	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2678}
2679
2680// MySqlSyncConfig: MySQL-specific external server sync settings.
2681type MySqlSyncConfig struct {
2682}
2683
2684// OnPremisesConfiguration: On-premises instance configuration.
2685type OnPremisesConfiguration struct {
2686	// CaCertificate: PEM representation of the trusted CA's x509
2687	// certificate.
2688	CaCertificate string `json:"caCertificate,omitempty"`
2689
2690	// ClientCertificate: PEM representation of the replica's x509
2691	// certificate.
2692	ClientCertificate string `json:"clientCertificate,omitempty"`
2693
2694	// ClientKey: PEM representation of the replica's private key. The
2695	// corresponsing public key is encoded in the client's certificate.
2696	ClientKey string `json:"clientKey,omitempty"`
2697
2698	// DumpFilePath: The dump file to create the Cloud SQL replica.
2699	DumpFilePath string `json:"dumpFilePath,omitempty"`
2700
2701	// HostPort: The host and port of the on-premises instance in host:port
2702	// format
2703	HostPort string `json:"hostPort,omitempty"`
2704
2705	// Kind: This is always *sql#onPremisesConfiguration*.
2706	Kind string `json:"kind,omitempty"`
2707
2708	// Password: The password for connecting to on-premises instance.
2709	Password string `json:"password,omitempty"`
2710
2711	// Username: The username for connecting to on-premises instance.
2712	Username string `json:"username,omitempty"`
2713
2714	// ForceSendFields is a list of field names (e.g. "CaCertificate") to
2715	// unconditionally include in API requests. By default, fields with
2716	// empty or default values are omitted from API requests. However, any
2717	// non-pointer, non-interface field appearing in ForceSendFields will be
2718	// sent to the server regardless of whether the field is empty or not.
2719	// This may be used to include empty fields in Patch requests.
2720	ForceSendFields []string `json:"-"`
2721
2722	// NullFields is a list of field names (e.g. "CaCertificate") to include
2723	// in API requests with the JSON null value. By default, fields with
2724	// empty values are omitted from API requests. However, any field with
2725	// an empty value appearing in NullFields will be sent to the server as
2726	// null. It is an error if a field in this list has a non-empty value.
2727	// This may be used to include null fields in Patch requests.
2728	NullFields []string `json:"-"`
2729}
2730
2731func (s *OnPremisesConfiguration) MarshalJSON() ([]byte, error) {
2732	type NoMethod OnPremisesConfiguration
2733	raw := NoMethod(*s)
2734	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2735}
2736
2737// Operation: An Operation resource. For successful operations that
2738// return an Operation resource, only the fields relevant to the
2739// operation are populated in the resource.
2740type Operation struct {
2741	// BackupContext: The context for backup operation, if applicable.
2742	BackupContext *BackupContext `json:"backupContext,omitempty"`
2743
2744	// EndTime: The time this operation finished in UTC timezone in RFC 3339
2745	// (https://tools.ietf.org/html/rfc3339) format, for example
2746	// **2012-11-15T16:19:00.094Z**.
2747	EndTime string `json:"endTime,omitempty"`
2748
2749	// Error: If errors occurred during processing of this operation, this
2750	// field will be populated.
2751	Error *OperationErrors `json:"error,omitempty"`
2752
2753	// ExportContext: The context for export operation, if applicable.
2754	ExportContext *ExportContext `json:"exportContext,omitempty"`
2755
2756	// ImportContext: The context for import operation, if applicable.
2757	ImportContext *ImportContext `json:"importContext,omitempty"`
2758
2759	// InsertTime: The time this operation was enqueued in UTC timezone in
2760	// RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example
2761	// **2012-11-15T16:19:00.094Z**.
2762	InsertTime string `json:"insertTime,omitempty"`
2763
2764	// Kind: This is always **sql#operation**.
2765	Kind string `json:"kind,omitempty"`
2766
2767	// Name: An identifier that uniquely identifies the operation. You can
2768	// use this identifier to retrieve the Operations resource that has
2769	// information about the operation.
2770	Name string `json:"name,omitempty"`
2771
2772	// OperationType: The type of the operation. Valid values are:
2773	// **CREATE** **DELETE** **UPDATE** **RESTART** **IMPORT** **EXPORT**
2774	// **BACKUP_VOLUME** **RESTORE_VOLUME** **CREATE_USER** **DELETE_USER**
2775	// **CREATE_DATABASE** **DELETE_DATABASE**
2776	//
2777	// Possible values:
2778	//   "SQL_OPERATION_TYPE_UNSPECIFIED" - Unknown operation type.
2779	//   "IMPORT" - Imports data into a Cloud SQL instance.
2780	//   "EXPORT" - Exports data from a Cloud SQL instance to a Cloud
2781	// Storage bucket.
2782	//   "CREATE" - Creates a new Cloud SQL instance.
2783	//   "UPDATE" - Updates the settings of a Cloud SQL instance.
2784	//   "DELETE" - Deletes a Cloud SQL instance.
2785	//   "RESTART" - Restarts the Cloud SQL instance.
2786	//   "BACKUP"
2787	//   "SNAPSHOT"
2788	//   "BACKUP_VOLUME" - Performs instance backup.
2789	//   "DELETE_VOLUME" - Deletes an instance backup.
2790	//   "RESTORE_VOLUME" - Restores an instance backup.
2791	//   "INJECT_USER" - Injects a privileged user in mysql for MOB
2792	// instances.
2793	//   "CLONE" - Clones a Cloud SQL instance.
2794	//   "STOP_REPLICA" - Stops replication on a Cloud SQL read replica
2795	// instance.
2796	//   "START_REPLICA" - Starts replication on a Cloud SQL read replica
2797	// instance.
2798	//   "PROMOTE_REPLICA" - Promotes a Cloud SQL replica instance.
2799	//   "CREATE_REPLICA" - Creates a Cloud SQL replica instance.
2800	//   "CREATE_USER" - Creates a new user in a Cloud SQL instance.
2801	//   "DELETE_USER" - Deletes a user from a Cloud SQL instance.
2802	//   "UPDATE_USER" - Updates an existing user in a Cloud SQL instance.
2803	//   "CREATE_DATABASE" - Creates a database in the Cloud SQL instance.
2804	//   "DELETE_DATABASE" - Deletes a database in the Cloud SQL instance.
2805	//   "UPDATE_DATABASE" - Updates a database in the Cloud SQL instance.
2806	//   "FAILOVER" - Performs failover of an HA-enabled Cloud SQL failover
2807	// replica.
2808	//   "DELETE_BACKUP" - Deletes the backup taken by a backup run.
2809	//   "RECREATE_REPLICA"
2810	//   "TRUNCATE_LOG" - Truncates a general or slow log table in MySQL.
2811	//   "DEMOTE_MASTER" - Demotes the stand-alone instance to be a Cloud
2812	// SQL read replica for an external database server.
2813	//   "MAINTENANCE" - Indicates that the instance is currently in
2814	// maintenance. Maintenance typically causes the instance to be
2815	// unavailable for 1-3 minutes.
2816	//   "ENABLE_PRIVATE_IP" - This field is deprecated, and will be removed
2817	// in future version of API.
2818	//   "DEFER_MAINTENANCE"
2819	//   "CREATE_CLONE" - Creates clone instance.
2820	//   "RESCHEDULE_MAINTENANCE" - Reschedule maintenance to another time.
2821	//   "START_EXTERNAL_SYNC" - Starts external sync of a Cloud SQL EM
2822	// replica to an external primary instance.
2823	OperationType string `json:"operationType,omitempty"`
2824
2825	// SelfLink: The URI of this resource.
2826	SelfLink string `json:"selfLink,omitempty"`
2827
2828	// StartTime: The time this operation actually started in UTC timezone
2829	// in RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example
2830	// **2012-11-15T16:19:00.094Z**.
2831	StartTime string `json:"startTime,omitempty"`
2832
2833	// Status: The status of an operation. Valid values are: **PENDING**
2834	// **RUNNING** **DONE** **SQL_OPERATION_STATUS_UNSPECIFIED**
2835	//
2836	// Possible values:
2837	//   "SQL_OPERATION_STATUS_UNSPECIFIED" - The state of the operation is
2838	// unknown.
2839	//   "PENDING" - The operation has been queued, but has not started yet.
2840	//   "RUNNING" - The operation is running.
2841	//   "DONE" - The operation completed.
2842	Status string `json:"status,omitempty"`
2843
2844	// TargetId: Name of the database instance related to this operation.
2845	TargetId string `json:"targetId,omitempty"`
2846
2847	TargetLink string `json:"targetLink,omitempty"`
2848
2849	// TargetProject: The project ID of the target instance related to this
2850	// operation.
2851	TargetProject string `json:"targetProject,omitempty"`
2852
2853	// User: The email address of the user who initiated this operation.
2854	User string `json:"user,omitempty"`
2855
2856	// ServerResponse contains the HTTP response code and headers from the
2857	// server.
2858	googleapi.ServerResponse `json:"-"`
2859
2860	// ForceSendFields is a list of field names (e.g. "BackupContext") to
2861	// unconditionally include in API requests. By default, fields with
2862	// empty or default values are omitted from API requests. However, any
2863	// non-pointer, non-interface field appearing in ForceSendFields will be
2864	// sent to the server regardless of whether the field is empty or not.
2865	// This may be used to include empty fields in Patch requests.
2866	ForceSendFields []string `json:"-"`
2867
2868	// NullFields is a list of field names (e.g. "BackupContext") to include
2869	// in API requests with the JSON null value. By default, fields with
2870	// empty values are omitted from API requests. However, any field with
2871	// an empty value appearing in NullFields will be sent to the server as
2872	// null. It is an error if a field in this list has a non-empty value.
2873	// This may be used to include null fields in Patch requests.
2874	NullFields []string `json:"-"`
2875}
2876
2877func (s *Operation) MarshalJSON() ([]byte, error) {
2878	type NoMethod Operation
2879	raw := NoMethod(*s)
2880	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2881}
2882
2883// OperationError: Database instance operation error.
2884type OperationError struct {
2885	// Code: Identifies the specific error that occurred.
2886	Code string `json:"code,omitempty"`
2887
2888	// Kind: This is always **sql#operationError**.
2889	Kind string `json:"kind,omitempty"`
2890
2891	// Message: Additional information about the error encountered.
2892	Message string `json:"message,omitempty"`
2893
2894	// ForceSendFields is a list of field names (e.g. "Code") to
2895	// unconditionally include in API requests. By default, fields with
2896	// empty or default values are omitted from API requests. However, any
2897	// non-pointer, non-interface field appearing in ForceSendFields will be
2898	// sent to the server regardless of whether the field is empty or not.
2899	// This may be used to include empty fields in Patch requests.
2900	ForceSendFields []string `json:"-"`
2901
2902	// NullFields is a list of field names (e.g. "Code") to include in API
2903	// requests with the JSON null value. By default, fields with empty
2904	// values are omitted from API requests. However, any field with an
2905	// empty value appearing in NullFields will be sent to the server as
2906	// null. It is an error if a field in this list has a non-empty value.
2907	// This may be used to include null fields in Patch requests.
2908	NullFields []string `json:"-"`
2909}
2910
2911func (s *OperationError) MarshalJSON() ([]byte, error) {
2912	type NoMethod OperationError
2913	raw := NoMethod(*s)
2914	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2915}
2916
2917// OperationErrors: Database instance operation errors list wrapper.
2918type OperationErrors struct {
2919	// Errors: The list of errors encountered while processing this
2920	// operation.
2921	Errors []*OperationError `json:"errors,omitempty"`
2922
2923	// Kind: This is always **sql#operationErrors**.
2924	Kind string `json:"kind,omitempty"`
2925
2926	// ForceSendFields is a list of field names (e.g. "Errors") to
2927	// unconditionally include in API requests. By default, fields with
2928	// empty or default values are omitted from API requests. However, any
2929	// non-pointer, non-interface field appearing in ForceSendFields will be
2930	// sent to the server regardless of whether the field is empty or not.
2931	// This may be used to include empty fields in Patch requests.
2932	ForceSendFields []string `json:"-"`
2933
2934	// NullFields is a list of field names (e.g. "Errors") to include in API
2935	// requests with the JSON null value. By default, fields with empty
2936	// values are omitted from API requests. However, any field with an
2937	// empty value appearing in NullFields will be sent to the server as
2938	// null. It is an error if a field in this list has a non-empty value.
2939	// This may be used to include null fields in Patch requests.
2940	NullFields []string `json:"-"`
2941}
2942
2943func (s *OperationErrors) MarshalJSON() ([]byte, error) {
2944	type NoMethod OperationErrors
2945	raw := NoMethod(*s)
2946	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2947}
2948
2949// OperationsListResponse: Operations list response.
2950type OperationsListResponse struct {
2951	// Items: List of operation resources.
2952	Items []*Operation `json:"items,omitempty"`
2953
2954	// Kind: This is always *sql#operationsList*.
2955	Kind string `json:"kind,omitempty"`
2956
2957	// NextPageToken: The continuation token, used to page through large
2958	// result sets. Provide this value in a subsequent request to return the
2959	// next page of results.
2960	NextPageToken string `json:"nextPageToken,omitempty"`
2961
2962	// ServerResponse contains the HTTP response code and headers from the
2963	// server.
2964	googleapi.ServerResponse `json:"-"`
2965
2966	// ForceSendFields is a list of field names (e.g. "Items") to
2967	// unconditionally include in API requests. By default, fields with
2968	// empty or default values are omitted from API requests. However, any
2969	// non-pointer, non-interface field appearing in ForceSendFields will be
2970	// sent to the server regardless of whether the field is empty or not.
2971	// This may be used to include empty fields in Patch requests.
2972	ForceSendFields []string `json:"-"`
2973
2974	// NullFields is a list of field names (e.g. "Items") to include in API
2975	// requests with the JSON null value. By default, fields with empty
2976	// values are omitted from API requests. However, any field with an
2977	// empty value appearing in NullFields will be sent to the server as
2978	// null. It is an error if a field in this list has a non-empty value.
2979	// This may be used to include null fields in Patch requests.
2980	NullFields []string `json:"-"`
2981}
2982
2983func (s *OperationsListResponse) MarshalJSON() ([]byte, error) {
2984	type NoMethod OperationsListResponse
2985	raw := NoMethod(*s)
2986	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2987}
2988
2989// ReplicaConfiguration: Read-replica configuration for connecting to
2990// the primary instance.
2991type ReplicaConfiguration struct {
2992	// FailoverTarget: Specifies if the replica is the failover target. If
2993	// the field is set to *true* the replica will be designated as a
2994	// failover replica. In case the primary instance fails, the replica
2995	// instance will be promoted as the new primary instance. Only one
2996	// replica can be specified as failover target, and the replica has to
2997	// be in different zone with the primary instance.
2998	FailoverTarget bool `json:"failoverTarget,omitempty"`
2999
3000	// Kind: This is always *sql#replicaConfiguration*.
3001	Kind string `json:"kind,omitempty"`
3002
3003	// MysqlReplicaConfiguration: MySQL specific configuration when
3004	// replicating from a MySQL on-premises primary instance. Replication
3005	// configuration information such as the username, password,
3006	// certificates, and keys are not stored in the instance metadata.The
3007	// configuration information is used only to set up the replication
3008	// connection and is stored by MySQL in a file named *master.info* in
3009	// the data directory.
3010	MysqlReplicaConfiguration *MySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"`
3011
3012	// ForceSendFields is a list of field names (e.g. "FailoverTarget") to
3013	// unconditionally include in API requests. By default, fields with
3014	// empty or default values are omitted from API requests. However, any
3015	// non-pointer, non-interface field appearing in ForceSendFields will be
3016	// sent to the server regardless of whether the field is empty or not.
3017	// This may be used to include empty fields in Patch requests.
3018	ForceSendFields []string `json:"-"`
3019
3020	// NullFields is a list of field names (e.g. "FailoverTarget") to
3021	// include in API requests with the JSON null value. By default, fields
3022	// with empty values are omitted from API requests. However, any field
3023	// with an empty value appearing in NullFields will be sent to the
3024	// server as null. It is an error if a field in this list has a
3025	// non-empty value. This may be used to include null fields in Patch
3026	// requests.
3027	NullFields []string `json:"-"`
3028}
3029
3030func (s *ReplicaConfiguration) MarshalJSON() ([]byte, error) {
3031	type NoMethod ReplicaConfiguration
3032	raw := NoMethod(*s)
3033	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3034}
3035
3036type Reschedule struct {
3037	// RescheduleType: Required. The type of the reschedule.
3038	//
3039	// Possible values:
3040	//   "RESCHEDULE_TYPE_UNSPECIFIED"
3041	//   "IMMEDIATE" - Reschedules maintenance to happen now (within 5
3042	// minutes).
3043	//   "NEXT_AVAILABLE_WINDOW" - Reschedules maintenance to occur within
3044	// one week from the originally scheduled day and time.
3045	//   "SPECIFIC_TIME" - Reschedules maintenance to a specific time and
3046	// day.
3047	RescheduleType string `json:"rescheduleType,omitempty"`
3048
3049	// ScheduleTime: Optional. Timestamp when the maintenance shall be
3050	// rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format,
3051	// for example *2012-11-15T16:19:00.094Z*.
3052	ScheduleTime string `json:"scheduleTime,omitempty"`
3053
3054	// ForceSendFields is a list of field names (e.g. "RescheduleType") to
3055	// unconditionally include in API requests. By default, fields with
3056	// empty or default values are omitted from API requests. However, any
3057	// non-pointer, non-interface field appearing in ForceSendFields will be
3058	// sent to the server regardless of whether the field is empty or not.
3059	// This may be used to include empty fields in Patch requests.
3060	ForceSendFields []string `json:"-"`
3061
3062	// NullFields is a list of field names (e.g. "RescheduleType") to
3063	// include in API requests with the JSON null value. By default, fields
3064	// with empty values are omitted from API requests. However, any field
3065	// with an empty value appearing in NullFields will be sent to the
3066	// server as null. It is an error if a field in this list has a
3067	// non-empty value. This may be used to include null fields in Patch
3068	// requests.
3069	NullFields []string `json:"-"`
3070}
3071
3072func (s *Reschedule) MarshalJSON() ([]byte, error) {
3073	type NoMethod Reschedule
3074	raw := NoMethod(*s)
3075	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3076}
3077
3078// RestoreBackupContext: Database instance restore from backup context.
3079// Backup context contains source instance id and project id.
3080type RestoreBackupContext struct {
3081	// BackupRunId: The ID of the backup run to restore from.
3082	BackupRunId int64 `json:"backupRunId,omitempty,string"`
3083
3084	// InstanceId: The ID of the instance that the backup was taken from.
3085	InstanceId string `json:"instanceId,omitempty"`
3086
3087	// Kind: This is always *sql#restoreBackupContext*.
3088	Kind string `json:"kind,omitempty"`
3089
3090	// Project: The full project ID of the source instance.
3091	Project string `json:"project,omitempty"`
3092
3093	// ForceSendFields is a list of field names (e.g. "BackupRunId") to
3094	// unconditionally include in API requests. By default, fields with
3095	// empty or default values are omitted from API requests. However, any
3096	// non-pointer, non-interface field appearing in ForceSendFields will be
3097	// sent to the server regardless of whether the field is empty or not.
3098	// This may be used to include empty fields in Patch requests.
3099	ForceSendFields []string `json:"-"`
3100
3101	// NullFields is a list of field names (e.g. "BackupRunId") to include
3102	// in API requests with the JSON null value. By default, fields with
3103	// empty values are omitted from API requests. However, any field with
3104	// an empty value appearing in NullFields will be sent to the server as
3105	// null. It is an error if a field in this list has a non-empty value.
3106	// This may be used to include null fields in Patch requests.
3107	NullFields []string `json:"-"`
3108}
3109
3110func (s *RestoreBackupContext) MarshalJSON() ([]byte, error) {
3111	type NoMethod RestoreBackupContext
3112	raw := NoMethod(*s)
3113	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3114}
3115
3116// RotateServerCaContext: Instance rotate server CA context.
3117type RotateServerCaContext struct {
3118	// Kind: This is always *sql#rotateServerCaContext*.
3119	Kind string `json:"kind,omitempty"`
3120
3121	// NextVersion: The fingerprint of the next version to be rotated to. If
3122	// left unspecified, will be rotated to the most recently added server
3123	// CA version.
3124	NextVersion string `json:"nextVersion,omitempty"`
3125
3126	// ForceSendFields is a list of field names (e.g. "Kind") to
3127	// unconditionally include in API requests. By default, fields with
3128	// empty or default values are omitted from API requests. However, any
3129	// non-pointer, non-interface field appearing in ForceSendFields will be
3130	// sent to the server regardless of whether the field is empty or not.
3131	// This may be used to include empty fields in Patch requests.
3132	ForceSendFields []string `json:"-"`
3133
3134	// NullFields is a list of field names (e.g. "Kind") to include in API
3135	// requests with the JSON null value. By default, fields with empty
3136	// values are omitted from API requests. However, any field with an
3137	// empty value appearing in NullFields will be sent to the server as
3138	// null. It is an error if a field in this list has a non-empty value.
3139	// This may be used to include null fields in Patch requests.
3140	NullFields []string `json:"-"`
3141}
3142
3143func (s *RotateServerCaContext) MarshalJSON() ([]byte, error) {
3144	type NoMethod RotateServerCaContext
3145	raw := NoMethod(*s)
3146	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3147}
3148
3149// Settings: Database instance settings.
3150type Settings struct {
3151	// ActivationPolicy: The activation policy specifies when the instance
3152	// is activated; it is applicable only when the instance state is
3153	// RUNNABLE. Valid values: **ALWAYS**: The instance is on, and remains
3154	// so even in the absence of connection requests. **NEVER**: The
3155	// instance is off; it is not activated, even if a connection request
3156	// arrives.
3157	//
3158	// Possible values:
3159	//   "SQL_ACTIVATION_POLICY_UNSPECIFIED" - Unknown activation plan.
3160	//   "ALWAYS" - The instance is always up and running.
3161	//   "NEVER" - The instance never starts.
3162	//   "ON_DEMAND" - The instance starts upon receiving requests.
3163	ActivationPolicy string `json:"activationPolicy,omitempty"`
3164
3165	// ActiveDirectoryConfig: Active Directory configuration, relevant only
3166	// for Cloud SQL for SQL Server.
3167	ActiveDirectoryConfig *SqlActiveDirectoryConfig `json:"activeDirectoryConfig,omitempty"`
3168
3169	// AuthorizedGaeApplications: The App Engine app IDs that can access
3170	// this instance. (Deprecated) Applied to First Generation instances
3171	// only.
3172	AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"`
3173
3174	// AvailabilityType: Availability type. Potential values: **ZONAL**: The
3175	// instance serves data from only one zone. Outages in that zone affect
3176	// data accessibility. **REGIONAL**: The instance can serve data from
3177	// more than one zone in a region (it is highly available). For more
3178	// information, see Overview of the High Availability Configuration
3179	// (https://cloud.google.com/sql/docs/mysql/high-availability).
3180	//
3181	// Possible values:
3182	//   "SQL_AVAILABILITY_TYPE_UNSPECIFIED" - This is an unknown
3183	// Availability type.
3184	//   "ZONAL" - Zonal available instance.
3185	//   "REGIONAL" - Regional available instance.
3186	AvailabilityType string `json:"availabilityType,omitempty"`
3187
3188	// BackupConfiguration: The daily backup configuration for the instance.
3189	BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"`
3190
3191	// Collation: The name of server Instance collation.
3192	Collation string `json:"collation,omitempty"`
3193
3194	// CrashSafeReplicationEnabled: Configuration specific to read replica
3195	// instances. Indicates whether database flags for crash-safe
3196	// replication are enabled. This property was only applicable to First
3197	// Generation instances.
3198	CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"`
3199
3200	// DataDiskSizeGb: The size of data disk, in GB. The data disk size
3201	// minimum is 10GB.
3202	DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"`
3203
3204	// DataDiskType: The type of data disk: **PD_SSD** (default) or
3205	// **PD_HDD**.
3206	//
3207	// Possible values:
3208	//   "SQL_DATA_DISK_TYPE_UNSPECIFIED" - This is an unknown data disk
3209	// type.
3210	//   "PD_SSD" - An SSD data disk.
3211	//   "PD_HDD" - An HDD data disk.
3212	//   "OBSOLETE_LOCAL_SSD" - This field is deprecated and will be removed
3213	// from a future version of the API.
3214	DataDiskType string `json:"dataDiskType,omitempty"`
3215
3216	// DatabaseFlags: The database flags passed to the instance at startup.
3217	DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"`
3218
3219	// DatabaseReplicationEnabled: Configuration specific to read replica
3220	// instances. Indicates whether replication is enabled or not.
3221	DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"`
3222
3223	// DenyMaintenancePeriods: Deny maintenance periods
3224	DenyMaintenancePeriods []*DenyMaintenancePeriod `json:"denyMaintenancePeriods,omitempty"`
3225
3226	// InsightsConfig: Insights configuration, for now relevant only for
3227	// Postgres.
3228	InsightsConfig *InsightsConfig `json:"insightsConfig,omitempty"`
3229
3230	// IpConfiguration: The settings for IP Management. This allows to
3231	// enable or disable the instance IP and manage which external networks
3232	// can connect to the instance. The IPv4 address cannot be disabled for
3233	// Second Generation instances.
3234	IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"`
3235
3236	// Kind: This is always **sql#settings**.
3237	Kind string `json:"kind,omitempty"`
3238
3239	// LocationPreference: The location preference settings. This allows the
3240	// instance to be located as near as possible to Compute Engine zone for
3241	// better performance.
3242	LocationPreference *LocationPreference `json:"locationPreference,omitempty"`
3243
3244	// MaintenanceWindow: The maintenance window for this instance. This
3245	// specifies when the instance can be restarted for maintenance
3246	// purposes.
3247	MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
3248
3249	// PricingPlan: The pricing plan for this instance. This can be either
3250	// **PER_USE** or **PACKAGE**. Only **PER_USE** is supported for Second
3251	// Generation instances.
3252	//
3253	// Possible values:
3254	//   "SQL_PRICING_PLAN_UNSPECIFIED" - This is an unknown pricing plan
3255	// for this instance.
3256	//   "PACKAGE" - The instance is billed at a monthly flat rate.
3257	//   "PER_USE" - The instance is billed per usage.
3258	PricingPlan string `json:"pricingPlan,omitempty"`
3259
3260	// ReplicationType: The type of replication this instance uses. This can
3261	// be either **ASYNCHRONOUS** or **SYNCHRONOUS**. (Deprecated) This
3262	// property was only applicable to First Generation instances.
3263	//
3264	// Possible values:
3265	//   "SQL_REPLICATION_TYPE_UNSPECIFIED" - This is an unknown replication
3266	// type for a Cloud SQL instance.
3267	//   "SYNCHRONOUS" - The synchronous replication mode for First
3268	// Generation instances. It is the default value.
3269	//   "ASYNCHRONOUS" - The asynchronous replication mode for First
3270	// Generation instances. It provides a slight performance gain, but if
3271	// an outage occurs while this option is set to asynchronous, you can
3272	// lose up to a few seconds of updates to your data.
3273	ReplicationType string `json:"replicationType,omitempty"`
3274
3275	// SettingsVersion: The version of instance settings. This is a required
3276	// field for update method to make sure concurrent updates are handled
3277	// properly. During update, use the most recent settingsVersion value
3278	// for this instance and do not try to update this value.
3279	SettingsVersion int64 `json:"settingsVersion,omitempty,string"`
3280
3281	// StorageAutoResize: Configuration to increase storage size
3282	// automatically. The default value is true.
3283	StorageAutoResize *bool `json:"storageAutoResize,omitempty"`
3284
3285	// StorageAutoResizeLimit: The maximum size to which storage capacity
3286	// can be automatically increased. The default value is 0, which
3287	// specifies that there is no limit.
3288	StorageAutoResizeLimit int64 `json:"storageAutoResizeLimit,omitempty,string"`
3289
3290	// Tier: The tier (or machine type) for this instance, for example
3291	// **db-custom-1-3840**.
3292	Tier string `json:"tier,omitempty"`
3293
3294	// UserLabels: User-provided labels, represented as a dictionary where
3295	// each label is a single key value pair.
3296	UserLabels map[string]string `json:"userLabels,omitempty"`
3297
3298	// ForceSendFields is a list of field names (e.g. "ActivationPolicy") to
3299	// unconditionally include in API requests. By default, fields with
3300	// empty or default values are omitted from API requests. However, any
3301	// non-pointer, non-interface field appearing in ForceSendFields will be
3302	// sent to the server regardless of whether the field is empty or not.
3303	// This may be used to include empty fields in Patch requests.
3304	ForceSendFields []string `json:"-"`
3305
3306	// NullFields is a list of field names (e.g. "ActivationPolicy") to
3307	// include in API requests with the JSON null value. By default, fields
3308	// with empty values are omitted from API requests. However, any field
3309	// with an empty value appearing in NullFields will be sent to the
3310	// server as null. It is an error if a field in this list has a
3311	// non-empty value. This may be used to include null fields in Patch
3312	// requests.
3313	NullFields []string `json:"-"`
3314}
3315
3316func (s *Settings) MarshalJSON() ([]byte, error) {
3317	type NoMethod Settings
3318	raw := NoMethod(*s)
3319	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3320}
3321
3322// SqlActiveDirectoryConfig: Active Directory configuration, relevant
3323// only for Cloud SQL for SQL Server.
3324type SqlActiveDirectoryConfig struct {
3325	// Domain: The name of the domain (e.g., mydomain.com).
3326	Domain string `json:"domain,omitempty"`
3327
3328	// Kind: This is always sql#activeDirectoryConfig.
3329	Kind string `json:"kind,omitempty"`
3330
3331	// ForceSendFields is a list of field names (e.g. "Domain") to
3332	// unconditionally include in API requests. By default, fields with
3333	// empty or default values are omitted from API requests. However, any
3334	// non-pointer, non-interface field appearing in ForceSendFields will be
3335	// sent to the server regardless of whether the field is empty or not.
3336	// This may be used to include empty fields in Patch requests.
3337	ForceSendFields []string `json:"-"`
3338
3339	// NullFields is a list of field names (e.g. "Domain") to include in API
3340	// requests with the JSON null value. By default, fields with empty
3341	// values are omitted from API requests. However, any field with an
3342	// empty value appearing in NullFields will be sent to the server as
3343	// null. It is an error if a field in this list has a non-empty value.
3344	// This may be used to include null fields in Patch requests.
3345	NullFields []string `json:"-"`
3346}
3347
3348func (s *SqlActiveDirectoryConfig) MarshalJSON() ([]byte, error) {
3349	type NoMethod SqlActiveDirectoryConfig
3350	raw := NoMethod(*s)
3351	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3352}
3353
3354// SqlExternalSyncSettingError: External primary instance migration
3355// setting error.
3356type SqlExternalSyncSettingError struct {
3357	// Detail: Additional information about the error encountered.
3358	Detail string `json:"detail,omitempty"`
3359
3360	// Kind: Can be *sql#externalSyncSettingError* or
3361	// *sql#externalSyncSettingWarning*.
3362	Kind string `json:"kind,omitempty"`
3363
3364	// Type: Identifies the specific error that occurred.
3365	//
3366	// Possible values:
3367	//   "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED"
3368	//   "CONNECTION_FAILURE"
3369	//   "BINLOG_NOT_ENABLED"
3370	//   "INCOMPATIBLE_DATABASE_VERSION"
3371	//   "REPLICA_ALREADY_SETUP"
3372	//   "INSUFFICIENT_PRIVILEGE"
3373	//   "UNSUPPORTED_MIGRATION_TYPE" - Unsupported migration type.
3374	//   "NO_PGLOGICAL_INSTALLED" - No pglogical extension installed on
3375	// databases, applicable for postgres.
3376	//   "PGLOGICAL_NODE_ALREADY_EXISTS" - pglogical node already exists on
3377	// databases, applicable for postgres.
3378	//   "INVALID_WAL_LEVEL" - The value of parameter wal_level is not set
3379	// to logical.
3380	//   "INVALID_SHARED_PRELOAD_LIBRARY" - The value of parameter
3381	// shared_preload_libraries does not include pglogical.
3382	//   "INSUFFICIENT_MAX_REPLICATION_SLOTS" - The value of parameter
3383	// max_replication_slots is not sufficient.
3384	//   "INSUFFICIENT_MAX_WAL_SENDERS" - The value of parameter
3385	// max_wal_senders is not sufficient.
3386	//   "INSUFFICIENT_MAX_WORKER_PROCESSES" - The value of parameter
3387	// max_worker_processes is not sufficient.
3388	//   "UNSUPPORTED_EXTENSIONS" - Extensions installed are either not
3389	// supported or having unsupported versions
3390	//   "INVALID_RDS_LOGICAL_REPLICATION" - The value of parameter
3391	// rds.logical_replication is not set to 1.
3392	//   "INVALID_LOGGING_SETUP" - The primary instance logging setup
3393	// doesn't allow EM sync.
3394	//   "INVALID_DB_PARAM" - The primary instance database parameter setup
3395	// doesn't allow EM sync.
3396	//   "UNSUPPORTED_GTID_MODE" - The gtid_mode is not supported,
3397	// applicable for MySQL.
3398	//   "SQLSERVER_AGENT_NOT_RUNNING" - SQL Server Agent is not running.
3399	//   "UNSUPPORTED_TABLE_DEFINITION" - The table definition is not
3400	// support due to missing primary key or replica identity, applicable
3401	// for postgres.
3402	//   "UNSUPPORTED_DEFINER" - The customer has a definer that will break
3403	// EM setup.
3404	//   "SQLSERVER_SERVERNAME_MISMATCH" - SQL Server @@SERVERNAME does not
3405	// match actual host name
3406	//   "PRIMARY_ALREADY_SETUP" - The primary instance has been setup and
3407	// will fail the setup.
3408	Type string `json:"type,omitempty"`
3409
3410	// ForceSendFields is a list of field names (e.g. "Detail") to
3411	// unconditionally include in API requests. By default, fields with
3412	// empty or default values are omitted from API requests. However, any
3413	// non-pointer, non-interface field appearing in ForceSendFields will be
3414	// sent to the server regardless of whether the field is empty or not.
3415	// This may be used to include empty fields in Patch requests.
3416	ForceSendFields []string `json:"-"`
3417
3418	// NullFields is a list of field names (e.g. "Detail") to include in API
3419	// requests with the JSON null value. By default, fields with empty
3420	// values are omitted from API requests. However, any field with an
3421	// empty value appearing in NullFields will be sent to the server as
3422	// null. It is an error if a field in this list has a non-empty value.
3423	// This may be used to include null fields in Patch requests.
3424	NullFields []string `json:"-"`
3425}
3426
3427func (s *SqlExternalSyncSettingError) MarshalJSON() ([]byte, error) {
3428	type NoMethod SqlExternalSyncSettingError
3429	raw := NoMethod(*s)
3430	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3431}
3432
3433// SqlInstancesRescheduleMaintenanceRequestBody: Reschedule options for
3434// maintenance windows.
3435type SqlInstancesRescheduleMaintenanceRequestBody struct {
3436	// Reschedule: Required. The type of the reschedule the user wants.
3437	Reschedule *Reschedule `json:"reschedule,omitempty"`
3438
3439	// ForceSendFields is a list of field names (e.g. "Reschedule") to
3440	// unconditionally include in API requests. By default, fields with
3441	// empty or default values are omitted from API requests. However, any
3442	// non-pointer, non-interface field appearing in ForceSendFields will be
3443	// sent to the server regardless of whether the field is empty or not.
3444	// This may be used to include empty fields in Patch requests.
3445	ForceSendFields []string `json:"-"`
3446
3447	// NullFields is a list of field names (e.g. "Reschedule") to include in
3448	// API requests with the JSON null value. By default, fields with empty
3449	// values are omitted from API requests. However, any field with an
3450	// empty value appearing in NullFields will be sent to the server as
3451	// null. It is an error if a field in this list has a non-empty value.
3452	// This may be used to include null fields in Patch requests.
3453	NullFields []string `json:"-"`
3454}
3455
3456func (s *SqlInstancesRescheduleMaintenanceRequestBody) MarshalJSON() ([]byte, error) {
3457	type NoMethod SqlInstancesRescheduleMaintenanceRequestBody
3458	raw := NoMethod(*s)
3459	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3460}
3461
3462// SqlInstancesStartExternalSyncRequest: Instance start external sync
3463// request.
3464type SqlInstancesStartExternalSyncRequest struct {
3465	// MysqlSyncConfig: MySQL-specific settings for start external sync.
3466	MysqlSyncConfig *MySqlSyncConfig `json:"mysqlSyncConfig,omitempty"`
3467
3468	// SkipVerification: Whether to skip the verification step (VESS).
3469	SkipVerification bool `json:"skipVerification,omitempty"`
3470
3471	// SyncMode: External sync mode.
3472	//
3473	// Possible values:
3474	//   "EXTERNAL_SYNC_MODE_UNSPECIFIED" - Unknown external sync mode, will
3475	// be defaulted to ONLINE mode
3476	//   "ONLINE" - Online external sync will set up replication after
3477	// initial data external sync
3478	//   "OFFLINE" - Offline external sync only dumps and loads a one-time
3479	// snapshot of the primary instance's data
3480	SyncMode string `json:"syncMode,omitempty"`
3481
3482	// ForceSendFields is a list of field names (e.g. "MysqlSyncConfig") to
3483	// unconditionally include in API requests. By default, fields with
3484	// empty or default values are omitted from API requests. However, any
3485	// non-pointer, non-interface field appearing in ForceSendFields will be
3486	// sent to the server regardless of whether the field is empty or not.
3487	// This may be used to include empty fields in Patch requests.
3488	ForceSendFields []string `json:"-"`
3489
3490	// NullFields is a list of field names (e.g. "MysqlSyncConfig") to
3491	// include in API requests with the JSON null value. By default, fields
3492	// with empty values are omitted from API requests. However, any field
3493	// with an empty value appearing in NullFields will be sent to the
3494	// server as null. It is an error if a field in this list has a
3495	// non-empty value. This may be used to include null fields in Patch
3496	// requests.
3497	NullFields []string `json:"-"`
3498}
3499
3500func (s *SqlInstancesStartExternalSyncRequest) MarshalJSON() ([]byte, error) {
3501	type NoMethod SqlInstancesStartExternalSyncRequest
3502	raw := NoMethod(*s)
3503	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3504}
3505
3506// SqlInstancesVerifyExternalSyncSettingsRequest: Instance verify
3507// external sync settings request.
3508type SqlInstancesVerifyExternalSyncSettingsRequest struct {
3509	// MysqlSyncConfig: Optional. MySQL-specific settings for start external
3510	// sync.
3511	MysqlSyncConfig *MySqlSyncConfig `json:"mysqlSyncConfig,omitempty"`
3512
3513	// SyncMode: External sync mode
3514	//
3515	// Possible values:
3516	//   "EXTERNAL_SYNC_MODE_UNSPECIFIED" - Unknown external sync mode, will
3517	// be defaulted to ONLINE mode
3518	//   "ONLINE" - Online external sync will set up replication after
3519	// initial data external sync
3520	//   "OFFLINE" - Offline external sync only dumps and loads a one-time
3521	// snapshot of the primary instance's data
3522	SyncMode string `json:"syncMode,omitempty"`
3523
3524	// VerifyConnectionOnly: Flag to enable verifying connection only
3525	VerifyConnectionOnly bool `json:"verifyConnectionOnly,omitempty"`
3526
3527	// ForceSendFields is a list of field names (e.g. "MysqlSyncConfig") to
3528	// unconditionally include in API requests. By default, fields with
3529	// empty or default values are omitted from API requests. However, any
3530	// non-pointer, non-interface field appearing in ForceSendFields will be
3531	// sent to the server regardless of whether the field is empty or not.
3532	// This may be used to include empty fields in Patch requests.
3533	ForceSendFields []string `json:"-"`
3534
3535	// NullFields is a list of field names (e.g. "MysqlSyncConfig") to
3536	// include in API requests with the JSON null value. By default, fields
3537	// with empty values are omitted from API requests. However, any field
3538	// with an empty value appearing in NullFields will be sent to the
3539	// server as null. It is an error if a field in this list has a
3540	// non-empty value. This may be used to include null fields in Patch
3541	// requests.
3542	NullFields []string `json:"-"`
3543}
3544
3545func (s *SqlInstancesVerifyExternalSyncSettingsRequest) MarshalJSON() ([]byte, error) {
3546	type NoMethod SqlInstancesVerifyExternalSyncSettingsRequest
3547	raw := NoMethod(*s)
3548	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3549}
3550
3551// SqlInstancesVerifyExternalSyncSettingsResponse: Instance verify
3552// external sync settings response.
3553type SqlInstancesVerifyExternalSyncSettingsResponse struct {
3554	// Errors: List of migration violations.
3555	Errors []*SqlExternalSyncSettingError `json:"errors,omitempty"`
3556
3557	// Kind: This is always *sql#migrationSettingErrorList*.
3558	Kind string `json:"kind,omitempty"`
3559
3560	// Warnings: List of migration warnings.
3561	Warnings []*SqlExternalSyncSettingError `json:"warnings,omitempty"`
3562
3563	// ServerResponse contains the HTTP response code and headers from the
3564	// server.
3565	googleapi.ServerResponse `json:"-"`
3566
3567	// ForceSendFields is a list of field names (e.g. "Errors") to
3568	// unconditionally include in API requests. By default, fields with
3569	// empty or default values are omitted from API requests. However, any
3570	// non-pointer, non-interface field appearing in ForceSendFields will be
3571	// sent to the server regardless of whether the field is empty or not.
3572	// This may be used to include empty fields in Patch requests.
3573	ForceSendFields []string `json:"-"`
3574
3575	// NullFields is a list of field names (e.g. "Errors") to include in API
3576	// requests with the JSON null value. By default, fields with empty
3577	// values are omitted from API requests. However, any field with an
3578	// empty value appearing in NullFields will be sent to the server as
3579	// null. It is an error if a field in this list has a non-empty value.
3580	// This may be used to include null fields in Patch requests.
3581	NullFields []string `json:"-"`
3582}
3583
3584func (s *SqlInstancesVerifyExternalSyncSettingsResponse) MarshalJSON() ([]byte, error) {
3585	type NoMethod SqlInstancesVerifyExternalSyncSettingsResponse
3586	raw := NoMethod(*s)
3587	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3588}
3589
3590// SqlOutOfDiskReport: This message wraps up the information written by
3591// out-of-disk detection job.
3592type SqlOutOfDiskReport struct {
3593	// SqlMinRecommendedIncreaseSizeGb: The minimum recommended increase
3594	// size in GigaBytes This field is consumed by the frontend Writers: --
3595	// the proactive database wellness job for OOD. Readers: -- the Pantheon
3596	// frontend
3597	SqlMinRecommendedIncreaseSizeGb int64 `json:"sqlMinRecommendedIncreaseSizeGb,omitempty"`
3598
3599	// SqlOutOfDiskState: This field represents the state generated by the
3600	// proactive database wellness job for OutOfDisk issues. Writers: -- the
3601	// proactive database wellness job for OOD. Readers: -- the Pantheon
3602	// frontend -- the proactive database wellness job
3603	//
3604	// Possible values:
3605	//   "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" - Unspecified state
3606	//   "NORMAL" - The instance has plenty space on data disk
3607	//   "SOFT_SHUTDOWN" - Data disk is almost used up. It is shutdown to
3608	// prevent data corruption.
3609	SqlOutOfDiskState string `json:"sqlOutOfDiskState,omitempty"`
3610
3611	// ForceSendFields is a list of field names (e.g.
3612	// "SqlMinRecommendedIncreaseSizeGb") to unconditionally include in API
3613	// requests. By default, fields with empty or default values are omitted
3614	// from API requests. However, any non-pointer, non-interface field
3615	// appearing in ForceSendFields will be sent to the server regardless of
3616	// whether the field is empty or not. This may be used to include empty
3617	// fields in Patch requests.
3618	ForceSendFields []string `json:"-"`
3619
3620	// NullFields is a list of field names (e.g.
3621	// "SqlMinRecommendedIncreaseSizeGb") to include in API requests with
3622	// the JSON null value. By default, fields with empty values are omitted
3623	// from API requests. However, any field with an empty value appearing
3624	// in NullFields will be sent to the server as null. It is an error if a
3625	// field in this list has a non-empty value. This may be used to include
3626	// null fields in Patch requests.
3627	NullFields []string `json:"-"`
3628}
3629
3630func (s *SqlOutOfDiskReport) MarshalJSON() ([]byte, error) {
3631	type NoMethod SqlOutOfDiskReport
3632	raw := NoMethod(*s)
3633	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3634}
3635
3636// SqlScheduledMaintenance: Any scheduled maintenancce for this
3637// instance.
3638type SqlScheduledMaintenance struct {
3639	CanDefer bool `json:"canDefer,omitempty"`
3640
3641	// CanReschedule: If the scheduled maintenance can be rescheduled.
3642	CanReschedule bool `json:"canReschedule,omitempty"`
3643
3644	// ScheduleDeadlineTime: Maintenance cannot be rescheduled to start
3645	// beyond this deadline.
3646	ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"`
3647
3648	// StartTime: The start time of any upcoming scheduled maintenance for
3649	// this instance.
3650	StartTime string `json:"startTime,omitempty"`
3651
3652	// ForceSendFields is a list of field names (e.g. "CanDefer") to
3653	// unconditionally include in API requests. By default, fields with
3654	// empty or default values are omitted from API requests. However, any
3655	// non-pointer, non-interface field appearing in ForceSendFields will be
3656	// sent to the server regardless of whether the field is empty or not.
3657	// This may be used to include empty fields in Patch requests.
3658	ForceSendFields []string `json:"-"`
3659
3660	// NullFields is a list of field names (e.g. "CanDefer") to include in
3661	// API requests with the JSON null value. By default, fields with empty
3662	// values are omitted from API requests. However, any field with an
3663	// empty value appearing in NullFields will be sent to the server as
3664	// null. It is an error if a field in this list has a non-empty value.
3665	// This may be used to include null fields in Patch requests.
3666	NullFields []string `json:"-"`
3667}
3668
3669func (s *SqlScheduledMaintenance) MarshalJSON() ([]byte, error) {
3670	type NoMethod SqlScheduledMaintenance
3671	raw := NoMethod(*s)
3672	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3673}
3674
3675// SqlServerDatabaseDetails: Represents a Sql Server database on the
3676// Cloud SQL instance.
3677type SqlServerDatabaseDetails struct {
3678	// CompatibilityLevel: The version of SQL Server with which the database
3679	// is to be made compatible
3680	CompatibilityLevel int64 `json:"compatibilityLevel,omitempty"`
3681
3682	// RecoveryModel: The recovery model of a SQL Server database
3683	RecoveryModel string `json:"recoveryModel,omitempty"`
3684
3685	// ForceSendFields is a list of field names (e.g. "CompatibilityLevel")
3686	// to unconditionally include in API requests. By default, fields with
3687	// empty or default values are omitted from API requests. However, any
3688	// non-pointer, non-interface field appearing in ForceSendFields will be
3689	// sent to the server regardless of whether the field is empty or not.
3690	// This may be used to include empty fields in Patch requests.
3691	ForceSendFields []string `json:"-"`
3692
3693	// NullFields is a list of field names (e.g. "CompatibilityLevel") to
3694	// include in API requests with the JSON null value. By default, fields
3695	// with empty values are omitted from API requests. However, any field
3696	// with an empty value appearing in NullFields will be sent to the
3697	// server as null. It is an error if a field in this list has a
3698	// non-empty value. This may be used to include null fields in Patch
3699	// requests.
3700	NullFields []string `json:"-"`
3701}
3702
3703func (s *SqlServerDatabaseDetails) MarshalJSON() ([]byte, error) {
3704	type NoMethod SqlServerDatabaseDetails
3705	raw := NoMethod(*s)
3706	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3707}
3708
3709// SqlServerUserDetails: Represents a Sql Server user on the Cloud SQL
3710// instance.
3711type SqlServerUserDetails struct {
3712	// Disabled: If the user has been disabled
3713	Disabled bool `json:"disabled,omitempty"`
3714
3715	// ServerRoles: The server roles for this user
3716	ServerRoles []string `json:"serverRoles,omitempty"`
3717
3718	// ForceSendFields is a list of field names (e.g. "Disabled") to
3719	// unconditionally include in API requests. By default, fields with
3720	// empty or default values are omitted from API requests. However, any
3721	// non-pointer, non-interface field appearing in ForceSendFields will be
3722	// sent to the server regardless of whether the field is empty or not.
3723	// This may be used to include empty fields in Patch requests.
3724	ForceSendFields []string `json:"-"`
3725
3726	// NullFields is a list of field names (e.g. "Disabled") to include in
3727	// API requests with the JSON null value. By default, fields with empty
3728	// values are omitted from API requests. However, any field with an
3729	// empty value appearing in NullFields will be sent to the server as
3730	// null. It is an error if a field in this list has a non-empty value.
3731	// This may be used to include null fields in Patch requests.
3732	NullFields []string `json:"-"`
3733}
3734
3735func (s *SqlServerUserDetails) MarshalJSON() ([]byte, error) {
3736	type NoMethod SqlServerUserDetails
3737	raw := NoMethod(*s)
3738	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3739}
3740
3741// SslCert: SslCerts Resource
3742type SslCert struct {
3743	// Cert: PEM representation.
3744	Cert string `json:"cert,omitempty"`
3745
3746	// CertSerialNumber: Serial number, as extracted from the certificate.
3747	CertSerialNumber string `json:"certSerialNumber,omitempty"`
3748
3749	// CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+.
3750	CommonName string `json:"commonName,omitempty"`
3751
3752	// CreateTime: The time when the certificate was created in RFC 3339
3753	// (https://tools.ietf.org/html/rfc3339) format, for example
3754	// **2012-11-15T16:19:00.094Z**
3755	CreateTime string `json:"createTime,omitempty"`
3756
3757	// ExpirationTime: The time when the certificate expires in RFC 3339
3758	// (https://tools.ietf.org/html/rfc3339) format, for example
3759	// **2012-11-15T16:19:00.094Z**.
3760	ExpirationTime string `json:"expirationTime,omitempty"`
3761
3762	// Instance: Name of the database instance.
3763	Instance string `json:"instance,omitempty"`
3764
3765	// Kind: This is always sql#sslCert.
3766	Kind string `json:"kind,omitempty"`
3767
3768	// SelfLink: The URI of this resource.
3769	SelfLink string `json:"selfLink,omitempty"`
3770
3771	// Sha1Fingerprint: Sha1 Fingerprint.
3772	Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"`
3773
3774	// ServerResponse contains the HTTP response code and headers from the
3775	// server.
3776	googleapi.ServerResponse `json:"-"`
3777
3778	// ForceSendFields is a list of field names (e.g. "Cert") to
3779	// unconditionally include in API requests. By default, fields with
3780	// empty or default values are omitted from API requests. However, any
3781	// non-pointer, non-interface field appearing in ForceSendFields will be
3782	// sent to the server regardless of whether the field is empty or not.
3783	// This may be used to include empty fields in Patch requests.
3784	ForceSendFields []string `json:"-"`
3785
3786	// NullFields is a list of field names (e.g. "Cert") to include in API
3787	// requests with the JSON null value. By default, fields with empty
3788	// values are omitted from API requests. However, any field with an
3789	// empty value appearing in NullFields will be sent to the server as
3790	// null. It is an error if a field in this list has a non-empty value.
3791	// This may be used to include null fields in Patch requests.
3792	NullFields []string `json:"-"`
3793}
3794
3795func (s *SslCert) MarshalJSON() ([]byte, error) {
3796	type NoMethod SslCert
3797	raw := NoMethod(*s)
3798	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3799}
3800
3801// SslCertDetail: SslCertDetail.
3802type SslCertDetail struct {
3803	// CertInfo: The public information about the cert.
3804	CertInfo *SslCert `json:"certInfo,omitempty"`
3805
3806	// CertPrivateKey: The private key for the client cert, in pem format.
3807	// Keep private in order to protect your security.
3808	CertPrivateKey string `json:"certPrivateKey,omitempty"`
3809
3810	// ForceSendFields is a list of field names (e.g. "CertInfo") to
3811	// unconditionally include in API requests. By default, fields with
3812	// empty or default values are omitted from API requests. However, any
3813	// non-pointer, non-interface field appearing in ForceSendFields will be
3814	// sent to the server regardless of whether the field is empty or not.
3815	// This may be used to include empty fields in Patch requests.
3816	ForceSendFields []string `json:"-"`
3817
3818	// NullFields is a list of field names (e.g. "CertInfo") to include in
3819	// API requests with the JSON null value. By default, fields with empty
3820	// values are omitted from API requests. However, any field with an
3821	// empty value appearing in NullFields will be sent to the server as
3822	// null. It is an error if a field in this list has a non-empty value.
3823	// This may be used to include null fields in Patch requests.
3824	NullFields []string `json:"-"`
3825}
3826
3827func (s *SslCertDetail) MarshalJSON() ([]byte, error) {
3828	type NoMethod SslCertDetail
3829	raw := NoMethod(*s)
3830	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3831}
3832
3833// SslCertsCreateEphemeralRequest: SslCerts create ephemeral certificate
3834// request.
3835type SslCertsCreateEphemeralRequest struct {
3836	// AccessToken: Access token to include in the signed certificate.
3837	AccessToken string `json:"access_token,omitempty"`
3838
3839	// PublicKey: PEM encoded public key to include in the signed
3840	// certificate.
3841	PublicKey string `json:"public_key,omitempty"`
3842
3843	// ForceSendFields is a list of field names (e.g. "AccessToken") to
3844	// unconditionally include in API requests. By default, fields with
3845	// empty or default values are omitted from API requests. However, any
3846	// non-pointer, non-interface field appearing in ForceSendFields will be
3847	// sent to the server regardless of whether the field is empty or not.
3848	// This may be used to include empty fields in Patch requests.
3849	ForceSendFields []string `json:"-"`
3850
3851	// NullFields is a list of field names (e.g. "AccessToken") to include
3852	// in API requests with the JSON null value. By default, fields with
3853	// empty values are omitted from API requests. However, any field with
3854	// an empty value appearing in NullFields will be sent to the server as
3855	// null. It is an error if a field in this list has a non-empty value.
3856	// This may be used to include null fields in Patch requests.
3857	NullFields []string `json:"-"`
3858}
3859
3860func (s *SslCertsCreateEphemeralRequest) MarshalJSON() ([]byte, error) {
3861	type NoMethod SslCertsCreateEphemeralRequest
3862	raw := NoMethod(*s)
3863	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3864}
3865
3866// SslCertsInsertRequest: SslCerts insert request.
3867type SslCertsInsertRequest struct {
3868	// CommonName: User supplied name. Must be a distinct name from the
3869	// other certificates for this instance.
3870	CommonName string `json:"commonName,omitempty"`
3871
3872	// ForceSendFields is a list of field names (e.g. "CommonName") to
3873	// unconditionally include in API requests. By default, fields with
3874	// empty or default values are omitted from API requests. However, any
3875	// non-pointer, non-interface field appearing in ForceSendFields will be
3876	// sent to the server regardless of whether the field is empty or not.
3877	// This may be used to include empty fields in Patch requests.
3878	ForceSendFields []string `json:"-"`
3879
3880	// NullFields is a list of field names (e.g. "CommonName") to include in
3881	// API requests with the JSON null value. By default, fields with empty
3882	// values are omitted from API requests. However, any field with an
3883	// empty value appearing in NullFields will be sent to the server as
3884	// null. It is an error if a field in this list has a non-empty value.
3885	// This may be used to include null fields in Patch requests.
3886	NullFields []string `json:"-"`
3887}
3888
3889func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) {
3890	type NoMethod SslCertsInsertRequest
3891	raw := NoMethod(*s)
3892	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3893}
3894
3895// SslCertsInsertResponse: SslCert insert response.
3896type SslCertsInsertResponse struct {
3897	// ClientCert: The new client certificate and private key.
3898	ClientCert *SslCertDetail `json:"clientCert,omitempty"`
3899
3900	// Kind: This is always *sql#sslCertsInsert*.
3901	Kind string `json:"kind,omitempty"`
3902
3903	// Operation: The operation to track the ssl certs insert request.
3904	Operation *Operation `json:"operation,omitempty"`
3905
3906	// ServerCaCert: The server Certificate Authority's certificate. If this
3907	// is missing you can force a new one to be generated by calling
3908	// resetSslConfig method on instances resource.
3909	ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
3910
3911	// ServerResponse contains the HTTP response code and headers from the
3912	// server.
3913	googleapi.ServerResponse `json:"-"`
3914
3915	// ForceSendFields is a list of field names (e.g. "ClientCert") to
3916	// unconditionally include in API requests. By default, fields with
3917	// empty or default values are omitted from API requests. However, any
3918	// non-pointer, non-interface field appearing in ForceSendFields will be
3919	// sent to the server regardless of whether the field is empty or not.
3920	// This may be used to include empty fields in Patch requests.
3921	ForceSendFields []string `json:"-"`
3922
3923	// NullFields is a list of field names (e.g. "ClientCert") to include in
3924	// API requests with the JSON null value. By default, fields with empty
3925	// values are omitted from API requests. However, any field with an
3926	// empty value appearing in NullFields will be sent to the server as
3927	// null. It is an error if a field in this list has a non-empty value.
3928	// This may be used to include null fields in Patch requests.
3929	NullFields []string `json:"-"`
3930}
3931
3932func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) {
3933	type NoMethod SslCertsInsertResponse
3934	raw := NoMethod(*s)
3935	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3936}
3937
3938// SslCertsListResponse: SslCerts list response.
3939type SslCertsListResponse struct {
3940	// Items: List of client certificates for the instance.
3941	Items []*SslCert `json:"items,omitempty"`
3942
3943	// Kind: This is always *sql#sslCertsList*.
3944	Kind string `json:"kind,omitempty"`
3945
3946	// ServerResponse contains the HTTP response code and headers from the
3947	// server.
3948	googleapi.ServerResponse `json:"-"`
3949
3950	// ForceSendFields is a list of field names (e.g. "Items") to
3951	// unconditionally include in API requests. By default, fields with
3952	// empty or default values are omitted from API requests. However, any
3953	// non-pointer, non-interface field appearing in ForceSendFields will be
3954	// sent to the server regardless of whether the field is empty or not.
3955	// This may be used to include empty fields in Patch requests.
3956	ForceSendFields []string `json:"-"`
3957
3958	// NullFields is a list of field names (e.g. "Items") to include in API
3959	// requests with the JSON null value. By default, fields with empty
3960	// values are omitted from API requests. However, any field with an
3961	// empty value appearing in NullFields will be sent to the server as
3962	// null. It is an error if a field in this list has a non-empty value.
3963	// This may be used to include null fields in Patch requests.
3964	NullFields []string `json:"-"`
3965}
3966
3967func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) {
3968	type NoMethod SslCertsListResponse
3969	raw := NoMethod(*s)
3970	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3971}
3972
3973// Tier: A Google Cloud SQL service tier resource.
3974type Tier struct {
3975	// DiskQuota: The maximum disk size of this tier in bytes.
3976	DiskQuota int64 `json:"DiskQuota,omitempty,string"`
3977
3978	// RAM: The maximum RAM usage of this tier in bytes.
3979	RAM int64 `json:"RAM,omitempty,string"`
3980
3981	// Kind: This is always *sql#tier*.
3982	Kind string `json:"kind,omitempty"`
3983
3984	// Region: The applicable regions for this tier.
3985	Region []string `json:"region,omitempty"`
3986
3987	// Tier: An identifier for the machine type, for example,
3988	// db-custom-1-3840. For related information, see Pricing.
3989	Tier string `json:"tier,omitempty"`
3990
3991	// ForceSendFields is a list of field names (e.g. "DiskQuota") to
3992	// unconditionally include in API requests. By default, fields with
3993	// empty or default values are omitted from API requests. However, any
3994	// non-pointer, non-interface field appearing in ForceSendFields will be
3995	// sent to the server regardless of whether the field is empty or not.
3996	// This may be used to include empty fields in Patch requests.
3997	ForceSendFields []string `json:"-"`
3998
3999	// NullFields is a list of field names (e.g. "DiskQuota") to include in
4000	// API requests with the JSON null value. By default, fields with empty
4001	// values are omitted from API requests. However, any field with an
4002	// empty value appearing in NullFields will be sent to the server as
4003	// null. It is an error if a field in this list has a non-empty value.
4004	// This may be used to include null fields in Patch requests.
4005	NullFields []string `json:"-"`
4006}
4007
4008func (s *Tier) MarshalJSON() ([]byte, error) {
4009	type NoMethod Tier
4010	raw := NoMethod(*s)
4011	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
4012}
4013
4014// TiersListResponse: Tiers list response.
4015type TiersListResponse struct {
4016	// Items: List of tiers.
4017	Items []*Tier `json:"items,omitempty"`
4018
4019	// Kind: This is always *sql#tiersList*.
4020	Kind string `json:"kind,omitempty"`
4021
4022	// ServerResponse contains the HTTP response code and headers from the
4023	// server.
4024	googleapi.ServerResponse `json:"-"`
4025
4026	// ForceSendFields is a list of field names (e.g. "Items") to
4027	// unconditionally include in API requests. By default, fields with
4028	// empty or default values are omitted from API requests. However, any
4029	// non-pointer, non-interface field appearing in ForceSendFields will be
4030	// sent to the server regardless of whether the field is empty or not.
4031	// This may be used to include empty fields in Patch requests.
4032	ForceSendFields []string `json:"-"`
4033
4034	// NullFields is a list of field names (e.g. "Items") to include in API
4035	// requests with the JSON null value. By default, fields with empty
4036	// values are omitted from API requests. However, any field with an
4037	// empty value appearing in NullFields will be sent to the server as
4038	// null. It is an error if a field in this list has a non-empty value.
4039	// This may be used to include null fields in Patch requests.
4040	NullFields []string `json:"-"`
4041}
4042
4043func (s *TiersListResponse) MarshalJSON() ([]byte, error) {
4044	type NoMethod TiersListResponse
4045	raw := NoMethod(*s)
4046	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
4047}
4048
4049// TruncateLogContext: Database Instance truncate log context.
4050type TruncateLogContext struct {
4051	// Kind: This is always *sql#truncateLogContext*.
4052	Kind string `json:"kind,omitempty"`
4053
4054	// LogType: The type of log to truncate. Valid values are
4055	// *MYSQL_GENERAL_TABLE* and *MYSQL_SLOW_TABLE*.
4056	LogType string `json:"logType,omitempty"`
4057
4058	// ForceSendFields is a list of field names (e.g. "Kind") to
4059	// unconditionally include in API requests. By default, fields with
4060	// empty or default values are omitted from API requests. However, any
4061	// non-pointer, non-interface field appearing in ForceSendFields will be
4062	// sent to the server regardless of whether the field is empty or not.
4063	// This may be used to include empty fields in Patch requests.
4064	ForceSendFields []string `json:"-"`
4065
4066	// NullFields is a list of field names (e.g. "Kind") to include in API
4067	// requests with the JSON null value. By default, fields with empty
4068	// values are omitted from API requests. However, any field with an
4069	// empty value appearing in NullFields will be sent to the server as
4070	// null. It is an error if a field in this list has a non-empty value.
4071	// This may be used to include null fields in Patch requests.
4072	NullFields []string `json:"-"`
4073}
4074
4075func (s *TruncateLogContext) MarshalJSON() ([]byte, error) {
4076	type NoMethod TruncateLogContext
4077	raw := NoMethod(*s)
4078	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
4079}
4080
4081// User: A Cloud SQL user resource.
4082type User struct {
4083	// Etag: This field is deprecated and will be removed from a future
4084	// version of the API.
4085	Etag string `json:"etag,omitempty"`
4086
4087	// Host: The host name from which the user can connect. For *insert*
4088	// operations, host defaults to an empty string. For *update*
4089	// operations, host is specified as part of the request URL. The host
4090	// name cannot be updated after insertion.
4091	Host string `json:"host,omitempty"`
4092
4093	// Instance: The name of the Cloud SQL instance. This does not include
4094	// the project ID. Can be omitted for *update* since it is already
4095	// specified on the URL.
4096	Instance string `json:"instance,omitempty"`
4097
4098	// Kind: This is always *sql#user*.
4099	Kind string `json:"kind,omitempty"`
4100
4101	// Name: The name of the user in the Cloud SQL instance. Can be omitted
4102	// for *update* since it is already specified in the URL.
4103	Name string `json:"name,omitempty"`
4104
4105	// Password: The password for the user.
4106	Password string `json:"password,omitempty"`
4107
4108	// Project: The project ID of the project containing the Cloud SQL
4109	// database. The Google apps domain is prefixed if applicable. Can be
4110	// omitted for *update* since it is already specified on the URL.
4111	Project string `json:"project,omitempty"`
4112
4113	SqlserverUserDetails *SqlServerUserDetails `json:"sqlserverUserDetails,omitempty"`
4114
4115	// Type: The user type. It determines the method to authenticate the
4116	// user during login. The default is the database's built-in user type.
4117	//
4118	// Possible values:
4119	//   "BUILT_IN" - The database's built-in user type.
4120	//   "CLOUD_IAM_USER" - Cloud IAM user.
4121	//   "CLOUD_IAM_SERVICE_ACCOUNT" - Cloud IAM service account.
4122	Type string `json:"type,omitempty"`
4123
4124	// ForceSendFields is a list of field names (e.g. "Etag") to
4125	// unconditionally include in API requests. By default, fields with
4126	// empty or default values are omitted from API requests. However, any
4127	// non-pointer, non-interface field appearing in ForceSendFields will be
4128	// sent to the server regardless of whether the field is empty or not.
4129	// This may be used to include empty fields in Patch requests.
4130	ForceSendFields []string `json:"-"`
4131
4132	// NullFields is a list of field names (e.g. "Etag") to include in API
4133	// requests with the JSON null value. By default, fields with empty
4134	// values are omitted from API requests. However, any field with an
4135	// empty value appearing in NullFields will be sent to the server as
4136	// null. It is an error if a field in this list has a non-empty value.
4137	// This may be used to include null fields in Patch requests.
4138	NullFields []string `json:"-"`
4139}
4140
4141func (s *User) MarshalJSON() ([]byte, error) {
4142	type NoMethod User
4143	raw := NoMethod(*s)
4144	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
4145}
4146
4147// UsersListResponse: User list response.
4148type UsersListResponse struct {
4149	// Items: List of user resources in the instance.
4150	Items []*User `json:"items,omitempty"`
4151
4152	// Kind: This is always *sql#usersList*.
4153	Kind string `json:"kind,omitempty"`
4154
4155	// NextPageToken: An identifier that uniquely identifies the operation.
4156	// You can use this identifier to retrieve the Operations resource that
4157	// has information about the operation.
4158	NextPageToken string `json:"nextPageToken,omitempty"`
4159
4160	// ServerResponse contains the HTTP response code and headers from the
4161	// server.
4162	googleapi.ServerResponse `json:"-"`
4163
4164	// ForceSendFields is a list of field names (e.g. "Items") to
4165	// unconditionally include in API requests. By default, fields with
4166	// empty or default values are omitted from API requests. However, any
4167	// non-pointer, non-interface field appearing in ForceSendFields will be
4168	// sent to the server regardless of whether the field is empty or not.
4169	// This may be used to include empty fields in Patch requests.
4170	ForceSendFields []string `json:"-"`
4171
4172	// NullFields is a list of field names (e.g. "Items") to include in API
4173	// requests with the JSON null value. By default, fields with empty
4174	// values are omitted from API requests. However, any field with an
4175	// empty value appearing in NullFields will be sent to the server as
4176	// null. It is an error if a field in this list has a non-empty value.
4177	// This may be used to include null fields in Patch requests.
4178	NullFields []string `json:"-"`
4179}
4180
4181func (s *UsersListResponse) MarshalJSON() ([]byte, error) {
4182	type NoMethod UsersListResponse
4183	raw := NoMethod(*s)
4184	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
4185}
4186
4187// method id "sql.backupRuns.delete":
4188
4189type BackupRunsDeleteCall struct {
4190	s          *Service
4191	project    string
4192	instance   string
4193	id         int64
4194	urlParams_ gensupport.URLParams
4195	ctx_       context.Context
4196	header_    http.Header
4197}
4198
4199// Delete: Deletes the backup taken by a backup run.
4200//
4201// - id: The ID of the backup run to delete. To find a backup run ID,
4202//   use the list method.
4203// - instance: Cloud SQL instance ID. This does not include the project
4204//   ID.
4205// - project: Project ID of the project that contains the instance.
4206func (r *BackupRunsService) Delete(project string, instance string, id int64) *BackupRunsDeleteCall {
4207	c := &BackupRunsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4208	c.project = project
4209	c.instance = instance
4210	c.id = id
4211	return c
4212}
4213
4214// Fields allows partial responses to be retrieved. See
4215// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4216// for more information.
4217func (c *BackupRunsDeleteCall) Fields(s ...googleapi.Field) *BackupRunsDeleteCall {
4218	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4219	return c
4220}
4221
4222// Context sets the context to be used in this call's Do method. Any
4223// pending HTTP request will be aborted if the provided context is
4224// canceled.
4225func (c *BackupRunsDeleteCall) Context(ctx context.Context) *BackupRunsDeleteCall {
4226	c.ctx_ = ctx
4227	return c
4228}
4229
4230// Header returns an http.Header that can be modified by the caller to
4231// add HTTP headers to the request.
4232func (c *BackupRunsDeleteCall) Header() http.Header {
4233	if c.header_ == nil {
4234		c.header_ = make(http.Header)
4235	}
4236	return c.header_
4237}
4238
4239func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) {
4240	reqHeaders := make(http.Header)
4241	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
4242	for k, v := range c.header_ {
4243		reqHeaders[k] = v
4244	}
4245	reqHeaders.Set("User-Agent", c.s.userAgent())
4246	var body io.Reader = nil
4247	c.urlParams_.Set("alt", alt)
4248	c.urlParams_.Set("prettyPrint", "false")
4249	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/backupRuns/{id}")
4250	urls += "?" + c.urlParams_.Encode()
4251	req, err := http.NewRequest("DELETE", urls, body)
4252	if err != nil {
4253		return nil, err
4254	}
4255	req.Header = reqHeaders
4256	googleapi.Expand(req.URL, map[string]string{
4257		"project":  c.project,
4258		"instance": c.instance,
4259		"id":       strconv.FormatInt(c.id, 10),
4260	})
4261	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4262}
4263
4264// Do executes the "sql.backupRuns.delete" call.
4265// Exactly one of *Operation or error will be non-nil. Any non-2xx
4266// status code is an error. Response headers are in either
4267// *Operation.ServerResponse.Header or (if a response was returned at
4268// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4269// to check whether the returned error was because
4270// http.StatusNotModified was returned.
4271func (c *BackupRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4272	gensupport.SetOptions(c.urlParams_, opts...)
4273	res, err := c.doRequest("json")
4274	if res != nil && res.StatusCode == http.StatusNotModified {
4275		if res.Body != nil {
4276			res.Body.Close()
4277		}
4278		return nil, &googleapi.Error{
4279			Code:   res.StatusCode,
4280			Header: res.Header,
4281		}
4282	}
4283	if err != nil {
4284		return nil, err
4285	}
4286	defer googleapi.CloseBody(res)
4287	if err := googleapi.CheckResponse(res); err != nil {
4288		return nil, err
4289	}
4290	ret := &Operation{
4291		ServerResponse: googleapi.ServerResponse{
4292			Header:         res.Header,
4293			HTTPStatusCode: res.StatusCode,
4294		},
4295	}
4296	target := &ret
4297	if err := gensupport.DecodeResponse(target, res); err != nil {
4298		return nil, err
4299	}
4300	return ret, nil
4301	// {
4302	//   "description": "Deletes the backup taken by a backup run.",
4303	//   "flatPath": "v1/projects/{project}/instances/{instance}/backupRuns/{id}",
4304	//   "httpMethod": "DELETE",
4305	//   "id": "sql.backupRuns.delete",
4306	//   "parameterOrder": [
4307	//     "project",
4308	//     "instance",
4309	//     "id"
4310	//   ],
4311	//   "parameters": {
4312	//     "id": {
4313	//       "description": "The ID of the backup run to delete. To find a backup run ID, use the list method.",
4314	//       "format": "int64",
4315	//       "location": "path",
4316	//       "required": true,
4317	//       "type": "string"
4318	//     },
4319	//     "instance": {
4320	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
4321	//       "location": "path",
4322	//       "required": true,
4323	//       "type": "string"
4324	//     },
4325	//     "project": {
4326	//       "description": "Project ID of the project that contains the instance.",
4327	//       "location": "path",
4328	//       "required": true,
4329	//       "type": "string"
4330	//     }
4331	//   },
4332	//   "path": "v1/projects/{project}/instances/{instance}/backupRuns/{id}",
4333	//   "response": {
4334	//     "$ref": "Operation"
4335	//   },
4336	//   "scopes": [
4337	//     "https://www.googleapis.com/auth/cloud-platform",
4338	//     "https://www.googleapis.com/auth/sqlservice.admin"
4339	//   ]
4340	// }
4341
4342}
4343
4344// method id "sql.backupRuns.get":
4345
4346type BackupRunsGetCall struct {
4347	s            *Service
4348	project      string
4349	instance     string
4350	id           int64
4351	urlParams_   gensupport.URLParams
4352	ifNoneMatch_ string
4353	ctx_         context.Context
4354	header_      http.Header
4355}
4356
4357// Get: Retrieves a resource containing information about a backup run.
4358//
4359// - id: The ID of this backup run.
4360// - instance: Cloud SQL instance ID. This does not include the project
4361//   ID.
4362// - project: Project ID of the project that contains the instance.
4363func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall {
4364	c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4365	c.project = project
4366	c.instance = instance
4367	c.id = id
4368	return c
4369}
4370
4371// Fields allows partial responses to be retrieved. See
4372// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4373// for more information.
4374func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall {
4375	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4376	return c
4377}
4378
4379// IfNoneMatch sets the optional parameter which makes the operation
4380// fail if the object's ETag matches the given value. This is useful for
4381// getting updates only after the object has changed since the last
4382// request. Use googleapi.IsNotModified to check whether the response
4383// error from Do is the result of In-None-Match.
4384func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall {
4385	c.ifNoneMatch_ = entityTag
4386	return c
4387}
4388
4389// Context sets the context to be used in this call's Do method. Any
4390// pending HTTP request will be aborted if the provided context is
4391// canceled.
4392func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall {
4393	c.ctx_ = ctx
4394	return c
4395}
4396
4397// Header returns an http.Header that can be modified by the caller to
4398// add HTTP headers to the request.
4399func (c *BackupRunsGetCall) Header() http.Header {
4400	if c.header_ == nil {
4401		c.header_ = make(http.Header)
4402	}
4403	return c.header_
4404}
4405
4406func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) {
4407	reqHeaders := make(http.Header)
4408	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
4409	for k, v := range c.header_ {
4410		reqHeaders[k] = v
4411	}
4412	reqHeaders.Set("User-Agent", c.s.userAgent())
4413	if c.ifNoneMatch_ != "" {
4414		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4415	}
4416	var body io.Reader = nil
4417	c.urlParams_.Set("alt", alt)
4418	c.urlParams_.Set("prettyPrint", "false")
4419	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/backupRuns/{id}")
4420	urls += "?" + c.urlParams_.Encode()
4421	req, err := http.NewRequest("GET", urls, body)
4422	if err != nil {
4423		return nil, err
4424	}
4425	req.Header = reqHeaders
4426	googleapi.Expand(req.URL, map[string]string{
4427		"project":  c.project,
4428		"instance": c.instance,
4429		"id":       strconv.FormatInt(c.id, 10),
4430	})
4431	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4432}
4433
4434// Do executes the "sql.backupRuns.get" call.
4435// Exactly one of *BackupRun or error will be non-nil. Any non-2xx
4436// status code is an error. Response headers are in either
4437// *BackupRun.ServerResponse.Header or (if a response was returned at
4438// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4439// to check whether the returned error was because
4440// http.StatusNotModified was returned.
4441func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) {
4442	gensupport.SetOptions(c.urlParams_, opts...)
4443	res, err := c.doRequest("json")
4444	if res != nil && res.StatusCode == http.StatusNotModified {
4445		if res.Body != nil {
4446			res.Body.Close()
4447		}
4448		return nil, &googleapi.Error{
4449			Code:   res.StatusCode,
4450			Header: res.Header,
4451		}
4452	}
4453	if err != nil {
4454		return nil, err
4455	}
4456	defer googleapi.CloseBody(res)
4457	if err := googleapi.CheckResponse(res); err != nil {
4458		return nil, err
4459	}
4460	ret := &BackupRun{
4461		ServerResponse: googleapi.ServerResponse{
4462			Header:         res.Header,
4463			HTTPStatusCode: res.StatusCode,
4464		},
4465	}
4466	target := &ret
4467	if err := gensupport.DecodeResponse(target, res); err != nil {
4468		return nil, err
4469	}
4470	return ret, nil
4471	// {
4472	//   "description": "Retrieves a resource containing information about a backup run.",
4473	//   "flatPath": "v1/projects/{project}/instances/{instance}/backupRuns/{id}",
4474	//   "httpMethod": "GET",
4475	//   "id": "sql.backupRuns.get",
4476	//   "parameterOrder": [
4477	//     "project",
4478	//     "instance",
4479	//     "id"
4480	//   ],
4481	//   "parameters": {
4482	//     "id": {
4483	//       "description": "The ID of this backup run.",
4484	//       "format": "int64",
4485	//       "location": "path",
4486	//       "required": true,
4487	//       "type": "string"
4488	//     },
4489	//     "instance": {
4490	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
4491	//       "location": "path",
4492	//       "required": true,
4493	//       "type": "string"
4494	//     },
4495	//     "project": {
4496	//       "description": "Project ID of the project that contains the instance.",
4497	//       "location": "path",
4498	//       "required": true,
4499	//       "type": "string"
4500	//     }
4501	//   },
4502	//   "path": "v1/projects/{project}/instances/{instance}/backupRuns/{id}",
4503	//   "response": {
4504	//     "$ref": "BackupRun"
4505	//   },
4506	//   "scopes": [
4507	//     "https://www.googleapis.com/auth/cloud-platform",
4508	//     "https://www.googleapis.com/auth/sqlservice.admin"
4509	//   ]
4510	// }
4511
4512}
4513
4514// method id "sql.backupRuns.insert":
4515
4516type BackupRunsInsertCall struct {
4517	s          *Service
4518	project    string
4519	instance   string
4520	backuprun  *BackupRun
4521	urlParams_ gensupport.URLParams
4522	ctx_       context.Context
4523	header_    http.Header
4524}
4525
4526// Insert: Creates a new backup run on demand.
4527//
4528// - instance: Cloud SQL instance ID. This does not include the project
4529//   ID.
4530// - project: Project ID of the project that contains the instance.
4531func (r *BackupRunsService) Insert(project string, instance string, backuprun *BackupRun) *BackupRunsInsertCall {
4532	c := &BackupRunsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4533	c.project = project
4534	c.instance = instance
4535	c.backuprun = backuprun
4536	return c
4537}
4538
4539// Fields allows partial responses to be retrieved. See
4540// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4541// for more information.
4542func (c *BackupRunsInsertCall) Fields(s ...googleapi.Field) *BackupRunsInsertCall {
4543	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4544	return c
4545}
4546
4547// Context sets the context to be used in this call's Do method. Any
4548// pending HTTP request will be aborted if the provided context is
4549// canceled.
4550func (c *BackupRunsInsertCall) Context(ctx context.Context) *BackupRunsInsertCall {
4551	c.ctx_ = ctx
4552	return c
4553}
4554
4555// Header returns an http.Header that can be modified by the caller to
4556// add HTTP headers to the request.
4557func (c *BackupRunsInsertCall) Header() http.Header {
4558	if c.header_ == nil {
4559		c.header_ = make(http.Header)
4560	}
4561	return c.header_
4562}
4563
4564func (c *BackupRunsInsertCall) doRequest(alt string) (*http.Response, error) {
4565	reqHeaders := make(http.Header)
4566	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
4567	for k, v := range c.header_ {
4568		reqHeaders[k] = v
4569	}
4570	reqHeaders.Set("User-Agent", c.s.userAgent())
4571	var body io.Reader = nil
4572	body, err := googleapi.WithoutDataWrapper.JSONReader(c.backuprun)
4573	if err != nil {
4574		return nil, err
4575	}
4576	reqHeaders.Set("Content-Type", "application/json")
4577	c.urlParams_.Set("alt", alt)
4578	c.urlParams_.Set("prettyPrint", "false")
4579	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/backupRuns")
4580	urls += "?" + c.urlParams_.Encode()
4581	req, err := http.NewRequest("POST", urls, body)
4582	if err != nil {
4583		return nil, err
4584	}
4585	req.Header = reqHeaders
4586	googleapi.Expand(req.URL, map[string]string{
4587		"project":  c.project,
4588		"instance": c.instance,
4589	})
4590	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4591}
4592
4593// Do executes the "sql.backupRuns.insert" call.
4594// Exactly one of *Operation or error will be non-nil. Any non-2xx
4595// status code is an error. Response headers are in either
4596// *Operation.ServerResponse.Header or (if a response was returned at
4597// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4598// to check whether the returned error was because
4599// http.StatusNotModified was returned.
4600func (c *BackupRunsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4601	gensupport.SetOptions(c.urlParams_, opts...)
4602	res, err := c.doRequest("json")
4603	if res != nil && res.StatusCode == http.StatusNotModified {
4604		if res.Body != nil {
4605			res.Body.Close()
4606		}
4607		return nil, &googleapi.Error{
4608			Code:   res.StatusCode,
4609			Header: res.Header,
4610		}
4611	}
4612	if err != nil {
4613		return nil, err
4614	}
4615	defer googleapi.CloseBody(res)
4616	if err := googleapi.CheckResponse(res); err != nil {
4617		return nil, err
4618	}
4619	ret := &Operation{
4620		ServerResponse: googleapi.ServerResponse{
4621			Header:         res.Header,
4622			HTTPStatusCode: res.StatusCode,
4623		},
4624	}
4625	target := &ret
4626	if err := gensupport.DecodeResponse(target, res); err != nil {
4627		return nil, err
4628	}
4629	return ret, nil
4630	// {
4631	//   "description": "Creates a new backup run on demand.",
4632	//   "flatPath": "v1/projects/{project}/instances/{instance}/backupRuns",
4633	//   "httpMethod": "POST",
4634	//   "id": "sql.backupRuns.insert",
4635	//   "parameterOrder": [
4636	//     "project",
4637	//     "instance"
4638	//   ],
4639	//   "parameters": {
4640	//     "instance": {
4641	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
4642	//       "location": "path",
4643	//       "required": true,
4644	//       "type": "string"
4645	//     },
4646	//     "project": {
4647	//       "description": "Project ID of the project that contains the instance.",
4648	//       "location": "path",
4649	//       "required": true,
4650	//       "type": "string"
4651	//     }
4652	//   },
4653	//   "path": "v1/projects/{project}/instances/{instance}/backupRuns",
4654	//   "request": {
4655	//     "$ref": "BackupRun"
4656	//   },
4657	//   "response": {
4658	//     "$ref": "Operation"
4659	//   },
4660	//   "scopes": [
4661	//     "https://www.googleapis.com/auth/cloud-platform",
4662	//     "https://www.googleapis.com/auth/sqlservice.admin"
4663	//   ]
4664	// }
4665
4666}
4667
4668// method id "sql.backupRuns.list":
4669
4670type BackupRunsListCall struct {
4671	s            *Service
4672	project      string
4673	instance     string
4674	urlParams_   gensupport.URLParams
4675	ifNoneMatch_ string
4676	ctx_         context.Context
4677	header_      http.Header
4678}
4679
4680// List: Lists all backup runs associated with the project or a given
4681// instance and configuration in the reverse chronological order of the
4682// backup initiation time.
4683//
4684// - instance: Cloud SQL instance ID, or "-" for all instances. This
4685//   does not include the project ID.
4686// - project: Project ID of the project that contains the instance.
4687func (r *BackupRunsService) List(project string, instance string) *BackupRunsListCall {
4688	c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4689	c.project = project
4690	c.instance = instance
4691	return c
4692}
4693
4694// MaxResults sets the optional parameter "maxResults": Maximum number
4695// of backup runs per response.
4696func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall {
4697	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4698	return c
4699}
4700
4701// PageToken sets the optional parameter "pageToken": A
4702// previously-returned page token representing part of the larger set of
4703// results to view.
4704func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall {
4705	c.urlParams_.Set("pageToken", pageToken)
4706	return c
4707}
4708
4709// Fields allows partial responses to be retrieved. See
4710// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4711// for more information.
4712func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall {
4713	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4714	return c
4715}
4716
4717// IfNoneMatch sets the optional parameter which makes the operation
4718// fail if the object's ETag matches the given value. This is useful for
4719// getting updates only after the object has changed since the last
4720// request. Use googleapi.IsNotModified to check whether the response
4721// error from Do is the result of In-None-Match.
4722func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall {
4723	c.ifNoneMatch_ = entityTag
4724	return c
4725}
4726
4727// Context sets the context to be used in this call's Do method. Any
4728// pending HTTP request will be aborted if the provided context is
4729// canceled.
4730func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall {
4731	c.ctx_ = ctx
4732	return c
4733}
4734
4735// Header returns an http.Header that can be modified by the caller to
4736// add HTTP headers to the request.
4737func (c *BackupRunsListCall) Header() http.Header {
4738	if c.header_ == nil {
4739		c.header_ = make(http.Header)
4740	}
4741	return c.header_
4742}
4743
4744func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) {
4745	reqHeaders := make(http.Header)
4746	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
4747	for k, v := range c.header_ {
4748		reqHeaders[k] = v
4749	}
4750	reqHeaders.Set("User-Agent", c.s.userAgent())
4751	if c.ifNoneMatch_ != "" {
4752		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4753	}
4754	var body io.Reader = nil
4755	c.urlParams_.Set("alt", alt)
4756	c.urlParams_.Set("prettyPrint", "false")
4757	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/backupRuns")
4758	urls += "?" + c.urlParams_.Encode()
4759	req, err := http.NewRequest("GET", urls, body)
4760	if err != nil {
4761		return nil, err
4762	}
4763	req.Header = reqHeaders
4764	googleapi.Expand(req.URL, map[string]string{
4765		"project":  c.project,
4766		"instance": c.instance,
4767	})
4768	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4769}
4770
4771// Do executes the "sql.backupRuns.list" call.
4772// Exactly one of *BackupRunsListResponse or error will be non-nil. Any
4773// non-2xx status code is an error. Response headers are in either
4774// *BackupRunsListResponse.ServerResponse.Header or (if a response was
4775// returned at all) in error.(*googleapi.Error).Header. Use
4776// googleapi.IsNotModified to check whether the returned error was
4777// because http.StatusNotModified was returned.
4778func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) {
4779	gensupport.SetOptions(c.urlParams_, opts...)
4780	res, err := c.doRequest("json")
4781	if res != nil && res.StatusCode == http.StatusNotModified {
4782		if res.Body != nil {
4783			res.Body.Close()
4784		}
4785		return nil, &googleapi.Error{
4786			Code:   res.StatusCode,
4787			Header: res.Header,
4788		}
4789	}
4790	if err != nil {
4791		return nil, err
4792	}
4793	defer googleapi.CloseBody(res)
4794	if err := googleapi.CheckResponse(res); err != nil {
4795		return nil, err
4796	}
4797	ret := &BackupRunsListResponse{
4798		ServerResponse: googleapi.ServerResponse{
4799			Header:         res.Header,
4800			HTTPStatusCode: res.StatusCode,
4801		},
4802	}
4803	target := &ret
4804	if err := gensupport.DecodeResponse(target, res); err != nil {
4805		return nil, err
4806	}
4807	return ret, nil
4808	// {
4809	//   "description": "Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.",
4810	//   "flatPath": "v1/projects/{project}/instances/{instance}/backupRuns",
4811	//   "httpMethod": "GET",
4812	//   "id": "sql.backupRuns.list",
4813	//   "parameterOrder": [
4814	//     "project",
4815	//     "instance"
4816	//   ],
4817	//   "parameters": {
4818	//     "instance": {
4819	//       "description": "Cloud SQL instance ID, or \"-\" for all instances. This does not include the project ID.",
4820	//       "location": "path",
4821	//       "required": true,
4822	//       "type": "string"
4823	//     },
4824	//     "maxResults": {
4825	//       "description": "Maximum number of backup runs per response.",
4826	//       "format": "int32",
4827	//       "location": "query",
4828	//       "type": "integer"
4829	//     },
4830	//     "pageToken": {
4831	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
4832	//       "location": "query",
4833	//       "type": "string"
4834	//     },
4835	//     "project": {
4836	//       "description": "Project ID of the project that contains the instance.",
4837	//       "location": "path",
4838	//       "required": true,
4839	//       "type": "string"
4840	//     }
4841	//   },
4842	//   "path": "v1/projects/{project}/instances/{instance}/backupRuns",
4843	//   "response": {
4844	//     "$ref": "BackupRunsListResponse"
4845	//   },
4846	//   "scopes": [
4847	//     "https://www.googleapis.com/auth/cloud-platform",
4848	//     "https://www.googleapis.com/auth/sqlservice.admin"
4849	//   ]
4850	// }
4851
4852}
4853
4854// Pages invokes f for each page of results.
4855// A non-nil error returned from f will halt the iteration.
4856// The provided context supersedes any context provided to the Context method.
4857func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error {
4858	c.ctx_ = ctx
4859	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
4860	for {
4861		x, err := c.Do()
4862		if err != nil {
4863			return err
4864		}
4865		if err := f(x); err != nil {
4866			return err
4867		}
4868		if x.NextPageToken == "" {
4869			return nil
4870		}
4871		c.PageToken(x.NextPageToken)
4872	}
4873}
4874
4875// method id "sql.connect.generateEphemeral":
4876
4877type ConnectGenerateEphemeralCertCall struct {
4878	s                            *Service
4879	project                      string
4880	instance                     string
4881	generateephemeralcertrequest *GenerateEphemeralCertRequest
4882	urlParams_                   gensupport.URLParams
4883	ctx_                         context.Context
4884	header_                      http.Header
4885}
4886
4887// GenerateEphemeralCert: Generates a short-lived X509 certificate
4888// containing the provided public key and signed by a private key
4889// specific to the target instance. Users may use the certificate to
4890// authenticate as themselves when connecting to the database.
4891//
4892// - instance: Cloud SQL instance ID. This does not include the project
4893//   ID.
4894// - project: Project ID of the project that contains the instance.
4895func (r *ConnectService) GenerateEphemeralCert(project string, instance string, generateephemeralcertrequest *GenerateEphemeralCertRequest) *ConnectGenerateEphemeralCertCall {
4896	c := &ConnectGenerateEphemeralCertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4897	c.project = project
4898	c.instance = instance
4899	c.generateephemeralcertrequest = generateephemeralcertrequest
4900	return c
4901}
4902
4903// Fields allows partial responses to be retrieved. See
4904// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4905// for more information.
4906func (c *ConnectGenerateEphemeralCertCall) Fields(s ...googleapi.Field) *ConnectGenerateEphemeralCertCall {
4907	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4908	return c
4909}
4910
4911// Context sets the context to be used in this call's Do method. Any
4912// pending HTTP request will be aborted if the provided context is
4913// canceled.
4914func (c *ConnectGenerateEphemeralCertCall) Context(ctx context.Context) *ConnectGenerateEphemeralCertCall {
4915	c.ctx_ = ctx
4916	return c
4917}
4918
4919// Header returns an http.Header that can be modified by the caller to
4920// add HTTP headers to the request.
4921func (c *ConnectGenerateEphemeralCertCall) Header() http.Header {
4922	if c.header_ == nil {
4923		c.header_ = make(http.Header)
4924	}
4925	return c.header_
4926}
4927
4928func (c *ConnectGenerateEphemeralCertCall) doRequest(alt string) (*http.Response, error) {
4929	reqHeaders := make(http.Header)
4930	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
4931	for k, v := range c.header_ {
4932		reqHeaders[k] = v
4933	}
4934	reqHeaders.Set("User-Agent", c.s.userAgent())
4935	var body io.Reader = nil
4936	body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateephemeralcertrequest)
4937	if err != nil {
4938		return nil, err
4939	}
4940	reqHeaders.Set("Content-Type", "application/json")
4941	c.urlParams_.Set("alt", alt)
4942	c.urlParams_.Set("prettyPrint", "false")
4943	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}:generateEphemeralCert")
4944	urls += "?" + c.urlParams_.Encode()
4945	req, err := http.NewRequest("POST", urls, body)
4946	if err != nil {
4947		return nil, err
4948	}
4949	req.Header = reqHeaders
4950	googleapi.Expand(req.URL, map[string]string{
4951		"project":  c.project,
4952		"instance": c.instance,
4953	})
4954	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4955}
4956
4957// Do executes the "sql.connect.generateEphemeral" call.
4958// Exactly one of *GenerateEphemeralCertResponse or error will be
4959// non-nil. Any non-2xx status code is an error. Response headers are in
4960// either *GenerateEphemeralCertResponse.ServerResponse.Header or (if a
4961// response was returned at all) in error.(*googleapi.Error).Header. Use
4962// googleapi.IsNotModified to check whether the returned error was
4963// because http.StatusNotModified was returned.
4964func (c *ConnectGenerateEphemeralCertCall) Do(opts ...googleapi.CallOption) (*GenerateEphemeralCertResponse, error) {
4965	gensupport.SetOptions(c.urlParams_, opts...)
4966	res, err := c.doRequest("json")
4967	if res != nil && res.StatusCode == http.StatusNotModified {
4968		if res.Body != nil {
4969			res.Body.Close()
4970		}
4971		return nil, &googleapi.Error{
4972			Code:   res.StatusCode,
4973			Header: res.Header,
4974		}
4975	}
4976	if err != nil {
4977		return nil, err
4978	}
4979	defer googleapi.CloseBody(res)
4980	if err := googleapi.CheckResponse(res); err != nil {
4981		return nil, err
4982	}
4983	ret := &GenerateEphemeralCertResponse{
4984		ServerResponse: googleapi.ServerResponse{
4985			Header:         res.Header,
4986			HTTPStatusCode: res.StatusCode,
4987		},
4988	}
4989	target := &ret
4990	if err := gensupport.DecodeResponse(target, res); err != nil {
4991		return nil, err
4992	}
4993	return ret, nil
4994	// {
4995	//   "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.",
4996	//   "flatPath": "v1/projects/{project}/instances/{instance}:generateEphemeralCert",
4997	//   "httpMethod": "POST",
4998	//   "id": "sql.connect.generateEphemeral",
4999	//   "parameterOrder": [
5000	//     "project",
5001	//     "instance"
5002	//   ],
5003	//   "parameters": {
5004	//     "instance": {
5005	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
5006	//       "location": "path",
5007	//       "required": true,
5008	//       "type": "string"
5009	//     },
5010	//     "project": {
5011	//       "description": "Project ID of the project that contains the instance.",
5012	//       "location": "path",
5013	//       "required": true,
5014	//       "type": "string"
5015	//     }
5016	//   },
5017	//   "path": "v1/projects/{project}/instances/{instance}:generateEphemeralCert",
5018	//   "request": {
5019	//     "$ref": "GenerateEphemeralCertRequest"
5020	//   },
5021	//   "response": {
5022	//     "$ref": "GenerateEphemeralCertResponse"
5023	//   },
5024	//   "scopes": [
5025	//     "https://www.googleapis.com/auth/cloud-platform",
5026	//     "https://www.googleapis.com/auth/sqlservice.admin"
5027	//   ]
5028	// }
5029
5030}
5031
5032// method id "sql.connect.get":
5033
5034type ConnectGetCall struct {
5035	s            *Service
5036	project      string
5037	instance     string
5038	urlParams_   gensupport.URLParams
5039	ifNoneMatch_ string
5040	ctx_         context.Context
5041	header_      http.Header
5042}
5043
5044// Get: Retrieves connect settings about a Cloud SQL instance.
5045//
5046// - instance: Cloud SQL instance ID. This does not include the project
5047//   ID.
5048// - project: Project ID of the project that contains the instance.
5049func (r *ConnectService) Get(project string, instance string) *ConnectGetCall {
5050	c := &ConnectGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5051	c.project = project
5052	c.instance = instance
5053	return c
5054}
5055
5056// ReadTime sets the optional parameter "readTime": Optional snapshot
5057// read timestamp to trade freshness for performance.
5058func (c *ConnectGetCall) ReadTime(readTime string) *ConnectGetCall {
5059	c.urlParams_.Set("readTime", readTime)
5060	return c
5061}
5062
5063// Fields allows partial responses to be retrieved. See
5064// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5065// for more information.
5066func (c *ConnectGetCall) Fields(s ...googleapi.Field) *ConnectGetCall {
5067	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5068	return c
5069}
5070
5071// IfNoneMatch sets the optional parameter which makes the operation
5072// fail if the object's ETag matches the given value. This is useful for
5073// getting updates only after the object has changed since the last
5074// request. Use googleapi.IsNotModified to check whether the response
5075// error from Do is the result of In-None-Match.
5076func (c *ConnectGetCall) IfNoneMatch(entityTag string) *ConnectGetCall {
5077	c.ifNoneMatch_ = entityTag
5078	return c
5079}
5080
5081// Context sets the context to be used in this call's Do method. Any
5082// pending HTTP request will be aborted if the provided context is
5083// canceled.
5084func (c *ConnectGetCall) Context(ctx context.Context) *ConnectGetCall {
5085	c.ctx_ = ctx
5086	return c
5087}
5088
5089// Header returns an http.Header that can be modified by the caller to
5090// add HTTP headers to the request.
5091func (c *ConnectGetCall) Header() http.Header {
5092	if c.header_ == nil {
5093		c.header_ = make(http.Header)
5094	}
5095	return c.header_
5096}
5097
5098func (c *ConnectGetCall) doRequest(alt string) (*http.Response, error) {
5099	reqHeaders := make(http.Header)
5100	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
5101	for k, v := range c.header_ {
5102		reqHeaders[k] = v
5103	}
5104	reqHeaders.Set("User-Agent", c.s.userAgent())
5105	if c.ifNoneMatch_ != "" {
5106		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5107	}
5108	var body io.Reader = nil
5109	c.urlParams_.Set("alt", alt)
5110	c.urlParams_.Set("prettyPrint", "false")
5111	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/connectSettings")
5112	urls += "?" + c.urlParams_.Encode()
5113	req, err := http.NewRequest("GET", urls, body)
5114	if err != nil {
5115		return nil, err
5116	}
5117	req.Header = reqHeaders
5118	googleapi.Expand(req.URL, map[string]string{
5119		"project":  c.project,
5120		"instance": c.instance,
5121	})
5122	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5123}
5124
5125// Do executes the "sql.connect.get" call.
5126// Exactly one of *ConnectSettings or error will be non-nil. Any non-2xx
5127// status code is an error. Response headers are in either
5128// *ConnectSettings.ServerResponse.Header or (if a response was returned
5129// at all) in error.(*googleapi.Error).Header. Use
5130// googleapi.IsNotModified to check whether the returned error was
5131// because http.StatusNotModified was returned.
5132func (c *ConnectGetCall) Do(opts ...googleapi.CallOption) (*ConnectSettings, error) {
5133	gensupport.SetOptions(c.urlParams_, opts...)
5134	res, err := c.doRequest("json")
5135	if res != nil && res.StatusCode == http.StatusNotModified {
5136		if res.Body != nil {
5137			res.Body.Close()
5138		}
5139		return nil, &googleapi.Error{
5140			Code:   res.StatusCode,
5141			Header: res.Header,
5142		}
5143	}
5144	if err != nil {
5145		return nil, err
5146	}
5147	defer googleapi.CloseBody(res)
5148	if err := googleapi.CheckResponse(res); err != nil {
5149		return nil, err
5150	}
5151	ret := &ConnectSettings{
5152		ServerResponse: googleapi.ServerResponse{
5153			Header:         res.Header,
5154			HTTPStatusCode: res.StatusCode,
5155		},
5156	}
5157	target := &ret
5158	if err := gensupport.DecodeResponse(target, res); err != nil {
5159		return nil, err
5160	}
5161	return ret, nil
5162	// {
5163	//   "description": "Retrieves connect settings about a Cloud SQL instance.",
5164	//   "flatPath": "v1/projects/{project}/instances/{instance}/connectSettings",
5165	//   "httpMethod": "GET",
5166	//   "id": "sql.connect.get",
5167	//   "parameterOrder": [
5168	//     "project",
5169	//     "instance"
5170	//   ],
5171	//   "parameters": {
5172	//     "instance": {
5173	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
5174	//       "location": "path",
5175	//       "required": true,
5176	//       "type": "string"
5177	//     },
5178	//     "project": {
5179	//       "description": "Project ID of the project that contains the instance.",
5180	//       "location": "path",
5181	//       "required": true,
5182	//       "type": "string"
5183	//     },
5184	//     "readTime": {
5185	//       "description": "Optional. Optional snapshot read timestamp to trade freshness for performance.",
5186	//       "format": "google-datetime",
5187	//       "location": "query",
5188	//       "type": "string"
5189	//     }
5190	//   },
5191	//   "path": "v1/projects/{project}/instances/{instance}/connectSettings",
5192	//   "response": {
5193	//     "$ref": "ConnectSettings"
5194	//   },
5195	//   "scopes": [
5196	//     "https://www.googleapis.com/auth/cloud-platform",
5197	//     "https://www.googleapis.com/auth/sqlservice.admin"
5198	//   ]
5199	// }
5200
5201}
5202
5203// method id "sql.databases.delete":
5204
5205type DatabasesDeleteCall struct {
5206	s          *Service
5207	project    string
5208	instance   string
5209	database   string
5210	urlParams_ gensupport.URLParams
5211	ctx_       context.Context
5212	header_    http.Header
5213}
5214
5215// Delete: Deletes a database from a Cloud SQL instance.
5216//
5217// - database: Name of the database to be deleted in the instance.
5218// - instance: Database instance ID. This does not include the project
5219//   ID.
5220// - project: Project ID of the project that contains the instance.
5221func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall {
5222	c := &DatabasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5223	c.project = project
5224	c.instance = instance
5225	c.database = database
5226	return c
5227}
5228
5229// Fields allows partial responses to be retrieved. See
5230// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5231// for more information.
5232func (c *DatabasesDeleteCall) Fields(s ...googleapi.Field) *DatabasesDeleteCall {
5233	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5234	return c
5235}
5236
5237// Context sets the context to be used in this call's Do method. Any
5238// pending HTTP request will be aborted if the provided context is
5239// canceled.
5240func (c *DatabasesDeleteCall) Context(ctx context.Context) *DatabasesDeleteCall {
5241	c.ctx_ = ctx
5242	return c
5243}
5244
5245// Header returns an http.Header that can be modified by the caller to
5246// add HTTP headers to the request.
5247func (c *DatabasesDeleteCall) Header() http.Header {
5248	if c.header_ == nil {
5249		c.header_ = make(http.Header)
5250	}
5251	return c.header_
5252}
5253
5254func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) {
5255	reqHeaders := make(http.Header)
5256	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
5257	for k, v := range c.header_ {
5258		reqHeaders[k] = v
5259	}
5260	reqHeaders.Set("User-Agent", c.s.userAgent())
5261	var body io.Reader = nil
5262	c.urlParams_.Set("alt", alt)
5263	c.urlParams_.Set("prettyPrint", "false")
5264	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/databases/{database}")
5265	urls += "?" + c.urlParams_.Encode()
5266	req, err := http.NewRequest("DELETE", urls, body)
5267	if err != nil {
5268		return nil, err
5269	}
5270	req.Header = reqHeaders
5271	googleapi.Expand(req.URL, map[string]string{
5272		"project":  c.project,
5273		"instance": c.instance,
5274		"database": c.database,
5275	})
5276	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5277}
5278
5279// Do executes the "sql.databases.delete" call.
5280// Exactly one of *Operation or error will be non-nil. Any non-2xx
5281// status code is an error. Response headers are in either
5282// *Operation.ServerResponse.Header or (if a response was returned at
5283// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5284// to check whether the returned error was because
5285// http.StatusNotModified was returned.
5286func (c *DatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5287	gensupport.SetOptions(c.urlParams_, opts...)
5288	res, err := c.doRequest("json")
5289	if res != nil && res.StatusCode == http.StatusNotModified {
5290		if res.Body != nil {
5291			res.Body.Close()
5292		}
5293		return nil, &googleapi.Error{
5294			Code:   res.StatusCode,
5295			Header: res.Header,
5296		}
5297	}
5298	if err != nil {
5299		return nil, err
5300	}
5301	defer googleapi.CloseBody(res)
5302	if err := googleapi.CheckResponse(res); err != nil {
5303		return nil, err
5304	}
5305	ret := &Operation{
5306		ServerResponse: googleapi.ServerResponse{
5307			Header:         res.Header,
5308			HTTPStatusCode: res.StatusCode,
5309		},
5310	}
5311	target := &ret
5312	if err := gensupport.DecodeResponse(target, res); err != nil {
5313		return nil, err
5314	}
5315	return ret, nil
5316	// {
5317	//   "description": "Deletes a database from a Cloud SQL instance.",
5318	//   "flatPath": "v1/projects/{project}/instances/{instance}/databases/{database}",
5319	//   "httpMethod": "DELETE",
5320	//   "id": "sql.databases.delete",
5321	//   "parameterOrder": [
5322	//     "project",
5323	//     "instance",
5324	//     "database"
5325	//   ],
5326	//   "parameters": {
5327	//     "database": {
5328	//       "description": "Name of the database to be deleted in the instance.",
5329	//       "location": "path",
5330	//       "required": true,
5331	//       "type": "string"
5332	//     },
5333	//     "instance": {
5334	//       "description": "Database instance ID. This does not include the project ID.",
5335	//       "location": "path",
5336	//       "required": true,
5337	//       "type": "string"
5338	//     },
5339	//     "project": {
5340	//       "description": "Project ID of the project that contains the instance.",
5341	//       "location": "path",
5342	//       "required": true,
5343	//       "type": "string"
5344	//     }
5345	//   },
5346	//   "path": "v1/projects/{project}/instances/{instance}/databases/{database}",
5347	//   "response": {
5348	//     "$ref": "Operation"
5349	//   },
5350	//   "scopes": [
5351	//     "https://www.googleapis.com/auth/cloud-platform",
5352	//     "https://www.googleapis.com/auth/sqlservice.admin"
5353	//   ]
5354	// }
5355
5356}
5357
5358// method id "sql.databases.get":
5359
5360type DatabasesGetCall struct {
5361	s            *Service
5362	project      string
5363	instance     string
5364	database     string
5365	urlParams_   gensupport.URLParams
5366	ifNoneMatch_ string
5367	ctx_         context.Context
5368	header_      http.Header
5369}
5370
5371// Get: Retrieves a resource containing information about a database
5372// inside a Cloud SQL instance.
5373//
5374// - database: Name of the database in the instance.
5375// - instance: Database instance ID. This does not include the project
5376//   ID.
5377// - project: Project ID of the project that contains the instance.
5378func (r *DatabasesService) Get(project string, instance string, database string) *DatabasesGetCall {
5379	c := &DatabasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5380	c.project = project
5381	c.instance = instance
5382	c.database = database
5383	return c
5384}
5385
5386// Fields allows partial responses to be retrieved. See
5387// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5388// for more information.
5389func (c *DatabasesGetCall) Fields(s ...googleapi.Field) *DatabasesGetCall {
5390	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5391	return c
5392}
5393
5394// IfNoneMatch sets the optional parameter which makes the operation
5395// fail if the object's ETag matches the given value. This is useful for
5396// getting updates only after the object has changed since the last
5397// request. Use googleapi.IsNotModified to check whether the response
5398// error from Do is the result of In-None-Match.
5399func (c *DatabasesGetCall) IfNoneMatch(entityTag string) *DatabasesGetCall {
5400	c.ifNoneMatch_ = entityTag
5401	return c
5402}
5403
5404// Context sets the context to be used in this call's Do method. Any
5405// pending HTTP request will be aborted if the provided context is
5406// canceled.
5407func (c *DatabasesGetCall) Context(ctx context.Context) *DatabasesGetCall {
5408	c.ctx_ = ctx
5409	return c
5410}
5411
5412// Header returns an http.Header that can be modified by the caller to
5413// add HTTP headers to the request.
5414func (c *DatabasesGetCall) Header() http.Header {
5415	if c.header_ == nil {
5416		c.header_ = make(http.Header)
5417	}
5418	return c.header_
5419}
5420
5421func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) {
5422	reqHeaders := make(http.Header)
5423	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
5424	for k, v := range c.header_ {
5425		reqHeaders[k] = v
5426	}
5427	reqHeaders.Set("User-Agent", c.s.userAgent())
5428	if c.ifNoneMatch_ != "" {
5429		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5430	}
5431	var body io.Reader = nil
5432	c.urlParams_.Set("alt", alt)
5433	c.urlParams_.Set("prettyPrint", "false")
5434	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/databases/{database}")
5435	urls += "?" + c.urlParams_.Encode()
5436	req, err := http.NewRequest("GET", urls, body)
5437	if err != nil {
5438		return nil, err
5439	}
5440	req.Header = reqHeaders
5441	googleapi.Expand(req.URL, map[string]string{
5442		"project":  c.project,
5443		"instance": c.instance,
5444		"database": c.database,
5445	})
5446	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5447}
5448
5449// Do executes the "sql.databases.get" call.
5450// Exactly one of *Database or error will be non-nil. Any non-2xx status
5451// code is an error. Response headers are in either
5452// *Database.ServerResponse.Header or (if a response was returned at
5453// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5454// to check whether the returned error was because
5455// http.StatusNotModified was returned.
5456func (c *DatabasesGetCall) Do(opts ...googleapi.CallOption) (*Database, error) {
5457	gensupport.SetOptions(c.urlParams_, opts...)
5458	res, err := c.doRequest("json")
5459	if res != nil && res.StatusCode == http.StatusNotModified {
5460		if res.Body != nil {
5461			res.Body.Close()
5462		}
5463		return nil, &googleapi.Error{
5464			Code:   res.StatusCode,
5465			Header: res.Header,
5466		}
5467	}
5468	if err != nil {
5469		return nil, err
5470	}
5471	defer googleapi.CloseBody(res)
5472	if err := googleapi.CheckResponse(res); err != nil {
5473		return nil, err
5474	}
5475	ret := &Database{
5476		ServerResponse: googleapi.ServerResponse{
5477			Header:         res.Header,
5478			HTTPStatusCode: res.StatusCode,
5479		},
5480	}
5481	target := &ret
5482	if err := gensupport.DecodeResponse(target, res); err != nil {
5483		return nil, err
5484	}
5485	return ret, nil
5486	// {
5487	//   "description": "Retrieves a resource containing information about a database inside a Cloud SQL instance.",
5488	//   "flatPath": "v1/projects/{project}/instances/{instance}/databases/{database}",
5489	//   "httpMethod": "GET",
5490	//   "id": "sql.databases.get",
5491	//   "parameterOrder": [
5492	//     "project",
5493	//     "instance",
5494	//     "database"
5495	//   ],
5496	//   "parameters": {
5497	//     "database": {
5498	//       "description": "Name of the database in the instance.",
5499	//       "location": "path",
5500	//       "required": true,
5501	//       "type": "string"
5502	//     },
5503	//     "instance": {
5504	//       "description": "Database instance ID. This does not include the project ID.",
5505	//       "location": "path",
5506	//       "required": true,
5507	//       "type": "string"
5508	//     },
5509	//     "project": {
5510	//       "description": "Project ID of the project that contains the instance.",
5511	//       "location": "path",
5512	//       "required": true,
5513	//       "type": "string"
5514	//     }
5515	//   },
5516	//   "path": "v1/projects/{project}/instances/{instance}/databases/{database}",
5517	//   "response": {
5518	//     "$ref": "Database"
5519	//   },
5520	//   "scopes": [
5521	//     "https://www.googleapis.com/auth/cloud-platform",
5522	//     "https://www.googleapis.com/auth/sqlservice.admin"
5523	//   ]
5524	// }
5525
5526}
5527
5528// method id "sql.databases.insert":
5529
5530type DatabasesInsertCall struct {
5531	s          *Service
5532	project    string
5533	instance   string
5534	database   *Database
5535	urlParams_ gensupport.URLParams
5536	ctx_       context.Context
5537	header_    http.Header
5538}
5539
5540// Insert: Inserts a resource containing information about a database
5541// inside a Cloud SQL instance.
5542//
5543// - instance: Database instance ID. This does not include the project
5544//   ID.
5545// - project: Project ID of the project that contains the instance.
5546func (r *DatabasesService) Insert(project string, instance string, database *Database) *DatabasesInsertCall {
5547	c := &DatabasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5548	c.project = project
5549	c.instance = instance
5550	c.database = database
5551	return c
5552}
5553
5554// Fields allows partial responses to be retrieved. See
5555// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5556// for more information.
5557func (c *DatabasesInsertCall) Fields(s ...googleapi.Field) *DatabasesInsertCall {
5558	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5559	return c
5560}
5561
5562// Context sets the context to be used in this call's Do method. Any
5563// pending HTTP request will be aborted if the provided context is
5564// canceled.
5565func (c *DatabasesInsertCall) Context(ctx context.Context) *DatabasesInsertCall {
5566	c.ctx_ = ctx
5567	return c
5568}
5569
5570// Header returns an http.Header that can be modified by the caller to
5571// add HTTP headers to the request.
5572func (c *DatabasesInsertCall) Header() http.Header {
5573	if c.header_ == nil {
5574		c.header_ = make(http.Header)
5575	}
5576	return c.header_
5577}
5578
5579func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) {
5580	reqHeaders := make(http.Header)
5581	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
5582	for k, v := range c.header_ {
5583		reqHeaders[k] = v
5584	}
5585	reqHeaders.Set("User-Agent", c.s.userAgent())
5586	var body io.Reader = nil
5587	body, err := googleapi.WithoutDataWrapper.JSONReader(c.database)
5588	if err != nil {
5589		return nil, err
5590	}
5591	reqHeaders.Set("Content-Type", "application/json")
5592	c.urlParams_.Set("alt", alt)
5593	c.urlParams_.Set("prettyPrint", "false")
5594	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/databases")
5595	urls += "?" + c.urlParams_.Encode()
5596	req, err := http.NewRequest("POST", urls, body)
5597	if err != nil {
5598		return nil, err
5599	}
5600	req.Header = reqHeaders
5601	googleapi.Expand(req.URL, map[string]string{
5602		"project":  c.project,
5603		"instance": c.instance,
5604	})
5605	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5606}
5607
5608// Do executes the "sql.databases.insert" call.
5609// Exactly one of *Operation or error will be non-nil. Any non-2xx
5610// status code is an error. Response headers are in either
5611// *Operation.ServerResponse.Header or (if a response was returned at
5612// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5613// to check whether the returned error was because
5614// http.StatusNotModified was returned.
5615func (c *DatabasesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5616	gensupport.SetOptions(c.urlParams_, opts...)
5617	res, err := c.doRequest("json")
5618	if res != nil && res.StatusCode == http.StatusNotModified {
5619		if res.Body != nil {
5620			res.Body.Close()
5621		}
5622		return nil, &googleapi.Error{
5623			Code:   res.StatusCode,
5624			Header: res.Header,
5625		}
5626	}
5627	if err != nil {
5628		return nil, err
5629	}
5630	defer googleapi.CloseBody(res)
5631	if err := googleapi.CheckResponse(res); err != nil {
5632		return nil, err
5633	}
5634	ret := &Operation{
5635		ServerResponse: googleapi.ServerResponse{
5636			Header:         res.Header,
5637			HTTPStatusCode: res.StatusCode,
5638		},
5639	}
5640	target := &ret
5641	if err := gensupport.DecodeResponse(target, res); err != nil {
5642		return nil, err
5643	}
5644	return ret, nil
5645	// {
5646	//   "description": "Inserts a resource containing information about a database inside a Cloud SQL instance.",
5647	//   "flatPath": "v1/projects/{project}/instances/{instance}/databases",
5648	//   "httpMethod": "POST",
5649	//   "id": "sql.databases.insert",
5650	//   "parameterOrder": [
5651	//     "project",
5652	//     "instance"
5653	//   ],
5654	//   "parameters": {
5655	//     "instance": {
5656	//       "description": "Database instance ID. This does not include the project ID.",
5657	//       "location": "path",
5658	//       "required": true,
5659	//       "type": "string"
5660	//     },
5661	//     "project": {
5662	//       "description": "Project ID of the project that contains the instance.",
5663	//       "location": "path",
5664	//       "required": true,
5665	//       "type": "string"
5666	//     }
5667	//   },
5668	//   "path": "v1/projects/{project}/instances/{instance}/databases",
5669	//   "request": {
5670	//     "$ref": "Database"
5671	//   },
5672	//   "response": {
5673	//     "$ref": "Operation"
5674	//   },
5675	//   "scopes": [
5676	//     "https://www.googleapis.com/auth/cloud-platform",
5677	//     "https://www.googleapis.com/auth/sqlservice.admin"
5678	//   ]
5679	// }
5680
5681}
5682
5683// method id "sql.databases.list":
5684
5685type DatabasesListCall struct {
5686	s            *Service
5687	project      string
5688	instance     string
5689	urlParams_   gensupport.URLParams
5690	ifNoneMatch_ string
5691	ctx_         context.Context
5692	header_      http.Header
5693}
5694
5695// List: Lists databases in the specified Cloud SQL instance.
5696//
5697// - instance: Cloud SQL instance ID. This does not include the project
5698//   ID.
5699// - project: Project ID of the project that contains the instance.
5700func (r *DatabasesService) List(project string, instance string) *DatabasesListCall {
5701	c := &DatabasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5702	c.project = project
5703	c.instance = instance
5704	return c
5705}
5706
5707// Fields allows partial responses to be retrieved. See
5708// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5709// for more information.
5710func (c *DatabasesListCall) Fields(s ...googleapi.Field) *DatabasesListCall {
5711	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5712	return c
5713}
5714
5715// IfNoneMatch sets the optional parameter which makes the operation
5716// fail if the object's ETag matches the given value. This is useful for
5717// getting updates only after the object has changed since the last
5718// request. Use googleapi.IsNotModified to check whether the response
5719// error from Do is the result of In-None-Match.
5720func (c *DatabasesListCall) IfNoneMatch(entityTag string) *DatabasesListCall {
5721	c.ifNoneMatch_ = entityTag
5722	return c
5723}
5724
5725// Context sets the context to be used in this call's Do method. Any
5726// pending HTTP request will be aborted if the provided context is
5727// canceled.
5728func (c *DatabasesListCall) Context(ctx context.Context) *DatabasesListCall {
5729	c.ctx_ = ctx
5730	return c
5731}
5732
5733// Header returns an http.Header that can be modified by the caller to
5734// add HTTP headers to the request.
5735func (c *DatabasesListCall) Header() http.Header {
5736	if c.header_ == nil {
5737		c.header_ = make(http.Header)
5738	}
5739	return c.header_
5740}
5741
5742func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) {
5743	reqHeaders := make(http.Header)
5744	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
5745	for k, v := range c.header_ {
5746		reqHeaders[k] = v
5747	}
5748	reqHeaders.Set("User-Agent", c.s.userAgent())
5749	if c.ifNoneMatch_ != "" {
5750		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5751	}
5752	var body io.Reader = nil
5753	c.urlParams_.Set("alt", alt)
5754	c.urlParams_.Set("prettyPrint", "false")
5755	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/databases")
5756	urls += "?" + c.urlParams_.Encode()
5757	req, err := http.NewRequest("GET", urls, body)
5758	if err != nil {
5759		return nil, err
5760	}
5761	req.Header = reqHeaders
5762	googleapi.Expand(req.URL, map[string]string{
5763		"project":  c.project,
5764		"instance": c.instance,
5765	})
5766	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5767}
5768
5769// Do executes the "sql.databases.list" call.
5770// Exactly one of *DatabasesListResponse or error will be non-nil. Any
5771// non-2xx status code is an error. Response headers are in either
5772// *DatabasesListResponse.ServerResponse.Header or (if a response was
5773// returned at all) in error.(*googleapi.Error).Header. Use
5774// googleapi.IsNotModified to check whether the returned error was
5775// because http.StatusNotModified was returned.
5776func (c *DatabasesListCall) Do(opts ...googleapi.CallOption) (*DatabasesListResponse, error) {
5777	gensupport.SetOptions(c.urlParams_, opts...)
5778	res, err := c.doRequest("json")
5779	if res != nil && res.StatusCode == http.StatusNotModified {
5780		if res.Body != nil {
5781			res.Body.Close()
5782		}
5783		return nil, &googleapi.Error{
5784			Code:   res.StatusCode,
5785			Header: res.Header,
5786		}
5787	}
5788	if err != nil {
5789		return nil, err
5790	}
5791	defer googleapi.CloseBody(res)
5792	if err := googleapi.CheckResponse(res); err != nil {
5793		return nil, err
5794	}
5795	ret := &DatabasesListResponse{
5796		ServerResponse: googleapi.ServerResponse{
5797			Header:         res.Header,
5798			HTTPStatusCode: res.StatusCode,
5799		},
5800	}
5801	target := &ret
5802	if err := gensupport.DecodeResponse(target, res); err != nil {
5803		return nil, err
5804	}
5805	return ret, nil
5806	// {
5807	//   "description": "Lists databases in the specified Cloud SQL instance.",
5808	//   "flatPath": "v1/projects/{project}/instances/{instance}/databases",
5809	//   "httpMethod": "GET",
5810	//   "id": "sql.databases.list",
5811	//   "parameterOrder": [
5812	//     "project",
5813	//     "instance"
5814	//   ],
5815	//   "parameters": {
5816	//     "instance": {
5817	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
5818	//       "location": "path",
5819	//       "required": true,
5820	//       "type": "string"
5821	//     },
5822	//     "project": {
5823	//       "description": "Project ID of the project that contains the instance.",
5824	//       "location": "path",
5825	//       "required": true,
5826	//       "type": "string"
5827	//     }
5828	//   },
5829	//   "path": "v1/projects/{project}/instances/{instance}/databases",
5830	//   "response": {
5831	//     "$ref": "DatabasesListResponse"
5832	//   },
5833	//   "scopes": [
5834	//     "https://www.googleapis.com/auth/cloud-platform",
5835	//     "https://www.googleapis.com/auth/sqlservice.admin"
5836	//   ]
5837	// }
5838
5839}
5840
5841// method id "sql.databases.patch":
5842
5843type DatabasesPatchCall struct {
5844	s          *Service
5845	project    string
5846	instance   string
5847	database   string
5848	database2  *Database
5849	urlParams_ gensupport.URLParams
5850	ctx_       context.Context
5851	header_    http.Header
5852}
5853
5854// Patch: Partially updates a resource containing information about a
5855// database inside a Cloud SQL instance. This method supports patch
5856// semantics.
5857//
5858// - database: Name of the database to be updated in the instance.
5859// - instance: Database instance ID. This does not include the project
5860//   ID.
5861// - project: Project ID of the project that contains the instance.
5862func (r *DatabasesService) Patch(project string, instance string, database string, database2 *Database) *DatabasesPatchCall {
5863	c := &DatabasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5864	c.project = project
5865	c.instance = instance
5866	c.database = database
5867	c.database2 = database2
5868	return c
5869}
5870
5871// Fields allows partial responses to be retrieved. See
5872// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5873// for more information.
5874func (c *DatabasesPatchCall) Fields(s ...googleapi.Field) *DatabasesPatchCall {
5875	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5876	return c
5877}
5878
5879// Context sets the context to be used in this call's Do method. Any
5880// pending HTTP request will be aborted if the provided context is
5881// canceled.
5882func (c *DatabasesPatchCall) Context(ctx context.Context) *DatabasesPatchCall {
5883	c.ctx_ = ctx
5884	return c
5885}
5886
5887// Header returns an http.Header that can be modified by the caller to
5888// add HTTP headers to the request.
5889func (c *DatabasesPatchCall) Header() http.Header {
5890	if c.header_ == nil {
5891		c.header_ = make(http.Header)
5892	}
5893	return c.header_
5894}
5895
5896func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) {
5897	reqHeaders := make(http.Header)
5898	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
5899	for k, v := range c.header_ {
5900		reqHeaders[k] = v
5901	}
5902	reqHeaders.Set("User-Agent", c.s.userAgent())
5903	var body io.Reader = nil
5904	body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2)
5905	if err != nil {
5906		return nil, err
5907	}
5908	reqHeaders.Set("Content-Type", "application/json")
5909	c.urlParams_.Set("alt", alt)
5910	c.urlParams_.Set("prettyPrint", "false")
5911	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/databases/{database}")
5912	urls += "?" + c.urlParams_.Encode()
5913	req, err := http.NewRequest("PATCH", urls, body)
5914	if err != nil {
5915		return nil, err
5916	}
5917	req.Header = reqHeaders
5918	googleapi.Expand(req.URL, map[string]string{
5919		"project":  c.project,
5920		"instance": c.instance,
5921		"database": c.database,
5922	})
5923	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5924}
5925
5926// Do executes the "sql.databases.patch" call.
5927// Exactly one of *Operation or error will be non-nil. Any non-2xx
5928// status code is an error. Response headers are in either
5929// *Operation.ServerResponse.Header or (if a response was returned at
5930// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5931// to check whether the returned error was because
5932// http.StatusNotModified was returned.
5933func (c *DatabasesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5934	gensupport.SetOptions(c.urlParams_, opts...)
5935	res, err := c.doRequest("json")
5936	if res != nil && res.StatusCode == http.StatusNotModified {
5937		if res.Body != nil {
5938			res.Body.Close()
5939		}
5940		return nil, &googleapi.Error{
5941			Code:   res.StatusCode,
5942			Header: res.Header,
5943		}
5944	}
5945	if err != nil {
5946		return nil, err
5947	}
5948	defer googleapi.CloseBody(res)
5949	if err := googleapi.CheckResponse(res); err != nil {
5950		return nil, err
5951	}
5952	ret := &Operation{
5953		ServerResponse: googleapi.ServerResponse{
5954			Header:         res.Header,
5955			HTTPStatusCode: res.StatusCode,
5956		},
5957	}
5958	target := &ret
5959	if err := gensupport.DecodeResponse(target, res); err != nil {
5960		return nil, err
5961	}
5962	return ret, nil
5963	// {
5964	//   "description": "Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.",
5965	//   "flatPath": "v1/projects/{project}/instances/{instance}/databases/{database}",
5966	//   "httpMethod": "PATCH",
5967	//   "id": "sql.databases.patch",
5968	//   "parameterOrder": [
5969	//     "project",
5970	//     "instance",
5971	//     "database"
5972	//   ],
5973	//   "parameters": {
5974	//     "database": {
5975	//       "description": "Name of the database to be updated in the instance.",
5976	//       "location": "path",
5977	//       "required": true,
5978	//       "type": "string"
5979	//     },
5980	//     "instance": {
5981	//       "description": "Database instance ID. This does not include the project ID.",
5982	//       "location": "path",
5983	//       "required": true,
5984	//       "type": "string"
5985	//     },
5986	//     "project": {
5987	//       "description": "Project ID of the project that contains the instance.",
5988	//       "location": "path",
5989	//       "required": true,
5990	//       "type": "string"
5991	//     }
5992	//   },
5993	//   "path": "v1/projects/{project}/instances/{instance}/databases/{database}",
5994	//   "request": {
5995	//     "$ref": "Database"
5996	//   },
5997	//   "response": {
5998	//     "$ref": "Operation"
5999	//   },
6000	//   "scopes": [
6001	//     "https://www.googleapis.com/auth/cloud-platform",
6002	//     "https://www.googleapis.com/auth/sqlservice.admin"
6003	//   ]
6004	// }
6005
6006}
6007
6008// method id "sql.databases.update":
6009
6010type DatabasesUpdateCall struct {
6011	s          *Service
6012	project    string
6013	instance   string
6014	database   string
6015	database2  *Database
6016	urlParams_ gensupport.URLParams
6017	ctx_       context.Context
6018	header_    http.Header
6019}
6020
6021// Update: Updates a resource containing information about a database
6022// inside a Cloud SQL instance.
6023//
6024// - database: Name of the database to be updated in the instance.
6025// - instance: Database instance ID. This does not include the project
6026//   ID.
6027// - project: Project ID of the project that contains the instance.
6028func (r *DatabasesService) Update(project string, instance string, database string, database2 *Database) *DatabasesUpdateCall {
6029	c := &DatabasesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6030	c.project = project
6031	c.instance = instance
6032	c.database = database
6033	c.database2 = database2
6034	return c
6035}
6036
6037// Fields allows partial responses to be retrieved. See
6038// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6039// for more information.
6040func (c *DatabasesUpdateCall) Fields(s ...googleapi.Field) *DatabasesUpdateCall {
6041	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6042	return c
6043}
6044
6045// Context sets the context to be used in this call's Do method. Any
6046// pending HTTP request will be aborted if the provided context is
6047// canceled.
6048func (c *DatabasesUpdateCall) Context(ctx context.Context) *DatabasesUpdateCall {
6049	c.ctx_ = ctx
6050	return c
6051}
6052
6053// Header returns an http.Header that can be modified by the caller to
6054// add HTTP headers to the request.
6055func (c *DatabasesUpdateCall) Header() http.Header {
6056	if c.header_ == nil {
6057		c.header_ = make(http.Header)
6058	}
6059	return c.header_
6060}
6061
6062func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) {
6063	reqHeaders := make(http.Header)
6064	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
6065	for k, v := range c.header_ {
6066		reqHeaders[k] = v
6067	}
6068	reqHeaders.Set("User-Agent", c.s.userAgent())
6069	var body io.Reader = nil
6070	body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2)
6071	if err != nil {
6072		return nil, err
6073	}
6074	reqHeaders.Set("Content-Type", "application/json")
6075	c.urlParams_.Set("alt", alt)
6076	c.urlParams_.Set("prettyPrint", "false")
6077	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/databases/{database}")
6078	urls += "?" + c.urlParams_.Encode()
6079	req, err := http.NewRequest("PUT", urls, body)
6080	if err != nil {
6081		return nil, err
6082	}
6083	req.Header = reqHeaders
6084	googleapi.Expand(req.URL, map[string]string{
6085		"project":  c.project,
6086		"instance": c.instance,
6087		"database": c.database,
6088	})
6089	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6090}
6091
6092// Do executes the "sql.databases.update" call.
6093// Exactly one of *Operation or error will be non-nil. Any non-2xx
6094// status code is an error. Response headers are in either
6095// *Operation.ServerResponse.Header or (if a response was returned at
6096// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6097// to check whether the returned error was because
6098// http.StatusNotModified was returned.
6099func (c *DatabasesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6100	gensupport.SetOptions(c.urlParams_, opts...)
6101	res, err := c.doRequest("json")
6102	if res != nil && res.StatusCode == http.StatusNotModified {
6103		if res.Body != nil {
6104			res.Body.Close()
6105		}
6106		return nil, &googleapi.Error{
6107			Code:   res.StatusCode,
6108			Header: res.Header,
6109		}
6110	}
6111	if err != nil {
6112		return nil, err
6113	}
6114	defer googleapi.CloseBody(res)
6115	if err := googleapi.CheckResponse(res); err != nil {
6116		return nil, err
6117	}
6118	ret := &Operation{
6119		ServerResponse: googleapi.ServerResponse{
6120			Header:         res.Header,
6121			HTTPStatusCode: res.StatusCode,
6122		},
6123	}
6124	target := &ret
6125	if err := gensupport.DecodeResponse(target, res); err != nil {
6126		return nil, err
6127	}
6128	return ret, nil
6129	// {
6130	//   "description": "Updates a resource containing information about a database inside a Cloud SQL instance.",
6131	//   "flatPath": "v1/projects/{project}/instances/{instance}/databases/{database}",
6132	//   "httpMethod": "PUT",
6133	//   "id": "sql.databases.update",
6134	//   "parameterOrder": [
6135	//     "project",
6136	//     "instance",
6137	//     "database"
6138	//   ],
6139	//   "parameters": {
6140	//     "database": {
6141	//       "description": "Name of the database to be updated in the instance.",
6142	//       "location": "path",
6143	//       "required": true,
6144	//       "type": "string"
6145	//     },
6146	//     "instance": {
6147	//       "description": "Database instance ID. This does not include the project ID.",
6148	//       "location": "path",
6149	//       "required": true,
6150	//       "type": "string"
6151	//     },
6152	//     "project": {
6153	//       "description": "Project ID of the project that contains the instance.",
6154	//       "location": "path",
6155	//       "required": true,
6156	//       "type": "string"
6157	//     }
6158	//   },
6159	//   "path": "v1/projects/{project}/instances/{instance}/databases/{database}",
6160	//   "request": {
6161	//     "$ref": "Database"
6162	//   },
6163	//   "response": {
6164	//     "$ref": "Operation"
6165	//   },
6166	//   "scopes": [
6167	//     "https://www.googleapis.com/auth/cloud-platform",
6168	//     "https://www.googleapis.com/auth/sqlservice.admin"
6169	//   ]
6170	// }
6171
6172}
6173
6174// method id "sql.flags.list":
6175
6176type FlagsListCall struct {
6177	s            *Service
6178	urlParams_   gensupport.URLParams
6179	ifNoneMatch_ string
6180	ctx_         context.Context
6181	header_      http.Header
6182}
6183
6184// List: Lists all available database flags for Cloud SQL instances.
6185func (r *FlagsService) List() *FlagsListCall {
6186	c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6187	return c
6188}
6189
6190// DatabaseVersion sets the optional parameter "databaseVersion":
6191// Database type and version you want to retrieve flags for. By default,
6192// this method returns flags for all database types and versions.
6193func (c *FlagsListCall) DatabaseVersion(databaseVersion string) *FlagsListCall {
6194	c.urlParams_.Set("databaseVersion", databaseVersion)
6195	return c
6196}
6197
6198// Fields allows partial responses to be retrieved. See
6199// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6200// for more information.
6201func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall {
6202	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6203	return c
6204}
6205
6206// IfNoneMatch sets the optional parameter which makes the operation
6207// fail if the object's ETag matches the given value. This is useful for
6208// getting updates only after the object has changed since the last
6209// request. Use googleapi.IsNotModified to check whether the response
6210// error from Do is the result of In-None-Match.
6211func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall {
6212	c.ifNoneMatch_ = entityTag
6213	return c
6214}
6215
6216// Context sets the context to be used in this call's Do method. Any
6217// pending HTTP request will be aborted if the provided context is
6218// canceled.
6219func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall {
6220	c.ctx_ = ctx
6221	return c
6222}
6223
6224// Header returns an http.Header that can be modified by the caller to
6225// add HTTP headers to the request.
6226func (c *FlagsListCall) Header() http.Header {
6227	if c.header_ == nil {
6228		c.header_ = make(http.Header)
6229	}
6230	return c.header_
6231}
6232
6233func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) {
6234	reqHeaders := make(http.Header)
6235	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
6236	for k, v := range c.header_ {
6237		reqHeaders[k] = v
6238	}
6239	reqHeaders.Set("User-Agent", c.s.userAgent())
6240	if c.ifNoneMatch_ != "" {
6241		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6242	}
6243	var body io.Reader = nil
6244	c.urlParams_.Set("alt", alt)
6245	c.urlParams_.Set("prettyPrint", "false")
6246	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/flags")
6247	urls += "?" + c.urlParams_.Encode()
6248	req, err := http.NewRequest("GET", urls, body)
6249	if err != nil {
6250		return nil, err
6251	}
6252	req.Header = reqHeaders
6253	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6254}
6255
6256// Do executes the "sql.flags.list" call.
6257// Exactly one of *FlagsListResponse or error will be non-nil. Any
6258// non-2xx status code is an error. Response headers are in either
6259// *FlagsListResponse.ServerResponse.Header or (if a response was
6260// returned at all) in error.(*googleapi.Error).Header. Use
6261// googleapi.IsNotModified to check whether the returned error was
6262// because http.StatusNotModified was returned.
6263func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) {
6264	gensupport.SetOptions(c.urlParams_, opts...)
6265	res, err := c.doRequest("json")
6266	if res != nil && res.StatusCode == http.StatusNotModified {
6267		if res.Body != nil {
6268			res.Body.Close()
6269		}
6270		return nil, &googleapi.Error{
6271			Code:   res.StatusCode,
6272			Header: res.Header,
6273		}
6274	}
6275	if err != nil {
6276		return nil, err
6277	}
6278	defer googleapi.CloseBody(res)
6279	if err := googleapi.CheckResponse(res); err != nil {
6280		return nil, err
6281	}
6282	ret := &FlagsListResponse{
6283		ServerResponse: googleapi.ServerResponse{
6284			Header:         res.Header,
6285			HTTPStatusCode: res.StatusCode,
6286		},
6287	}
6288	target := &ret
6289	if err := gensupport.DecodeResponse(target, res); err != nil {
6290		return nil, err
6291	}
6292	return ret, nil
6293	// {
6294	//   "description": "Lists all available database flags for Cloud SQL instances.",
6295	//   "flatPath": "v1/flags",
6296	//   "httpMethod": "GET",
6297	//   "id": "sql.flags.list",
6298	//   "parameterOrder": [],
6299	//   "parameters": {
6300	//     "databaseVersion": {
6301	//       "description": "Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions.",
6302	//       "location": "query",
6303	//       "type": "string"
6304	//     }
6305	//   },
6306	//   "path": "v1/flags",
6307	//   "response": {
6308	//     "$ref": "FlagsListResponse"
6309	//   },
6310	//   "scopes": [
6311	//     "https://www.googleapis.com/auth/cloud-platform",
6312	//     "https://www.googleapis.com/auth/sqlservice.admin"
6313	//   ]
6314	// }
6315
6316}
6317
6318// method id "sql.instances.addServerCa":
6319
6320type InstancesAddServerCaCall struct {
6321	s          *Service
6322	project    string
6323	instance   string
6324	urlParams_ gensupport.URLParams
6325	ctx_       context.Context
6326	header_    http.Header
6327}
6328
6329// AddServerCa: Adds a new trusted Certificate Authority (CA) version
6330// for the specified instance. Required to prepare for a certificate
6331// rotation. If a CA version was previously added but never used in a
6332// certificate rotation, this operation replaces that version. There
6333// cannot be more than one CA version waiting to be rotated in.
6334//
6335// - instance: Cloud SQL instance ID. This does not include the project
6336//   ID.
6337// - project: Project ID of the project that contains the instance.
6338func (r *InstancesService) AddServerCa(project string, instance string) *InstancesAddServerCaCall {
6339	c := &InstancesAddServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6340	c.project = project
6341	c.instance = instance
6342	return c
6343}
6344
6345// Fields allows partial responses to be retrieved. See
6346// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6347// for more information.
6348func (c *InstancesAddServerCaCall) Fields(s ...googleapi.Field) *InstancesAddServerCaCall {
6349	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6350	return c
6351}
6352
6353// Context sets the context to be used in this call's Do method. Any
6354// pending HTTP request will be aborted if the provided context is
6355// canceled.
6356func (c *InstancesAddServerCaCall) Context(ctx context.Context) *InstancesAddServerCaCall {
6357	c.ctx_ = ctx
6358	return c
6359}
6360
6361// Header returns an http.Header that can be modified by the caller to
6362// add HTTP headers to the request.
6363func (c *InstancesAddServerCaCall) Header() http.Header {
6364	if c.header_ == nil {
6365		c.header_ = make(http.Header)
6366	}
6367	return c.header_
6368}
6369
6370func (c *InstancesAddServerCaCall) doRequest(alt string) (*http.Response, error) {
6371	reqHeaders := make(http.Header)
6372	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
6373	for k, v := range c.header_ {
6374		reqHeaders[k] = v
6375	}
6376	reqHeaders.Set("User-Agent", c.s.userAgent())
6377	var body io.Reader = nil
6378	c.urlParams_.Set("alt", alt)
6379	c.urlParams_.Set("prettyPrint", "false")
6380	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/addServerCa")
6381	urls += "?" + c.urlParams_.Encode()
6382	req, err := http.NewRequest("POST", urls, body)
6383	if err != nil {
6384		return nil, err
6385	}
6386	req.Header = reqHeaders
6387	googleapi.Expand(req.URL, map[string]string{
6388		"project":  c.project,
6389		"instance": c.instance,
6390	})
6391	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6392}
6393
6394// Do executes the "sql.instances.addServerCa" call.
6395// Exactly one of *Operation or error will be non-nil. Any non-2xx
6396// status code is an error. Response headers are in either
6397// *Operation.ServerResponse.Header or (if a response was returned at
6398// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6399// to check whether the returned error was because
6400// http.StatusNotModified was returned.
6401func (c *InstancesAddServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6402	gensupport.SetOptions(c.urlParams_, opts...)
6403	res, err := c.doRequest("json")
6404	if res != nil && res.StatusCode == http.StatusNotModified {
6405		if res.Body != nil {
6406			res.Body.Close()
6407		}
6408		return nil, &googleapi.Error{
6409			Code:   res.StatusCode,
6410			Header: res.Header,
6411		}
6412	}
6413	if err != nil {
6414		return nil, err
6415	}
6416	defer googleapi.CloseBody(res)
6417	if err := googleapi.CheckResponse(res); err != nil {
6418		return nil, err
6419	}
6420	ret := &Operation{
6421		ServerResponse: googleapi.ServerResponse{
6422			Header:         res.Header,
6423			HTTPStatusCode: res.StatusCode,
6424		},
6425	}
6426	target := &ret
6427	if err := gensupport.DecodeResponse(target, res); err != nil {
6428		return nil, err
6429	}
6430	return ret, nil
6431	// {
6432	//   "description": "Adds 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.",
6433	//   "flatPath": "v1/projects/{project}/instances/{instance}/addServerCa",
6434	//   "httpMethod": "POST",
6435	//   "id": "sql.instances.addServerCa",
6436	//   "parameterOrder": [
6437	//     "project",
6438	//     "instance"
6439	//   ],
6440	//   "parameters": {
6441	//     "instance": {
6442	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
6443	//       "location": "path",
6444	//       "required": true,
6445	//       "type": "string"
6446	//     },
6447	//     "project": {
6448	//       "description": "Project ID of the project that contains the instance.",
6449	//       "location": "path",
6450	//       "required": true,
6451	//       "type": "string"
6452	//     }
6453	//   },
6454	//   "path": "v1/projects/{project}/instances/{instance}/addServerCa",
6455	//   "response": {
6456	//     "$ref": "Operation"
6457	//   },
6458	//   "scopes": [
6459	//     "https://www.googleapis.com/auth/cloud-platform",
6460	//     "https://www.googleapis.com/auth/sqlservice.admin"
6461	//   ]
6462	// }
6463
6464}
6465
6466// method id "sql.instances.clone":
6467
6468type InstancesCloneCall struct {
6469	s                     *Service
6470	project               string
6471	instance              string
6472	instancesclonerequest *InstancesCloneRequest
6473	urlParams_            gensupport.URLParams
6474	ctx_                  context.Context
6475	header_               http.Header
6476}
6477
6478// Clone: Creates a Cloud SQL instance as a clone of the source
6479// instance. Using this operation might cause your instance to restart.
6480//
6481// - instance: The ID of the Cloud SQL instance to be cloned (source).
6482//   This does not include the project ID.
6483// - project: Project ID of the source as well as the clone Cloud SQL
6484//   instance.
6485func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall {
6486	c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6487	c.project = project
6488	c.instance = instance
6489	c.instancesclonerequest = instancesclonerequest
6490	return c
6491}
6492
6493// Fields allows partial responses to be retrieved. See
6494// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6495// for more information.
6496func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall {
6497	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6498	return c
6499}
6500
6501// Context sets the context to be used in this call's Do method. Any
6502// pending HTTP request will be aborted if the provided context is
6503// canceled.
6504func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall {
6505	c.ctx_ = ctx
6506	return c
6507}
6508
6509// Header returns an http.Header that can be modified by the caller to
6510// add HTTP headers to the request.
6511func (c *InstancesCloneCall) Header() http.Header {
6512	if c.header_ == nil {
6513		c.header_ = make(http.Header)
6514	}
6515	return c.header_
6516}
6517
6518func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) {
6519	reqHeaders := make(http.Header)
6520	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
6521	for k, v := range c.header_ {
6522		reqHeaders[k] = v
6523	}
6524	reqHeaders.Set("User-Agent", c.s.userAgent())
6525	var body io.Reader = nil
6526	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest)
6527	if err != nil {
6528		return nil, err
6529	}
6530	reqHeaders.Set("Content-Type", "application/json")
6531	c.urlParams_.Set("alt", alt)
6532	c.urlParams_.Set("prettyPrint", "false")
6533	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/clone")
6534	urls += "?" + c.urlParams_.Encode()
6535	req, err := http.NewRequest("POST", urls, body)
6536	if err != nil {
6537		return nil, err
6538	}
6539	req.Header = reqHeaders
6540	googleapi.Expand(req.URL, map[string]string{
6541		"project":  c.project,
6542		"instance": c.instance,
6543	})
6544	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6545}
6546
6547// Do executes the "sql.instances.clone" call.
6548// Exactly one of *Operation or error will be non-nil. Any non-2xx
6549// status code is an error. Response headers are in either
6550// *Operation.ServerResponse.Header or (if a response was returned at
6551// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6552// to check whether the returned error was because
6553// http.StatusNotModified was returned.
6554func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6555	gensupport.SetOptions(c.urlParams_, opts...)
6556	res, err := c.doRequest("json")
6557	if res != nil && res.StatusCode == http.StatusNotModified {
6558		if res.Body != nil {
6559			res.Body.Close()
6560		}
6561		return nil, &googleapi.Error{
6562			Code:   res.StatusCode,
6563			Header: res.Header,
6564		}
6565	}
6566	if err != nil {
6567		return nil, err
6568	}
6569	defer googleapi.CloseBody(res)
6570	if err := googleapi.CheckResponse(res); err != nil {
6571		return nil, err
6572	}
6573	ret := &Operation{
6574		ServerResponse: googleapi.ServerResponse{
6575			Header:         res.Header,
6576			HTTPStatusCode: res.StatusCode,
6577		},
6578	}
6579	target := &ret
6580	if err := gensupport.DecodeResponse(target, res); err != nil {
6581		return nil, err
6582	}
6583	return ret, nil
6584	// {
6585	//   "description": "Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.",
6586	//   "flatPath": "v1/projects/{project}/instances/{instance}/clone",
6587	//   "httpMethod": "POST",
6588	//   "id": "sql.instances.clone",
6589	//   "parameterOrder": [
6590	//     "project",
6591	//     "instance"
6592	//   ],
6593	//   "parameters": {
6594	//     "instance": {
6595	//       "description": "The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.",
6596	//       "location": "path",
6597	//       "required": true,
6598	//       "type": "string"
6599	//     },
6600	//     "project": {
6601	//       "description": "Project ID of the source as well as the clone Cloud SQL instance.",
6602	//       "location": "path",
6603	//       "required": true,
6604	//       "type": "string"
6605	//     }
6606	//   },
6607	//   "path": "v1/projects/{project}/instances/{instance}/clone",
6608	//   "request": {
6609	//     "$ref": "InstancesCloneRequest"
6610	//   },
6611	//   "response": {
6612	//     "$ref": "Operation"
6613	//   },
6614	//   "scopes": [
6615	//     "https://www.googleapis.com/auth/cloud-platform",
6616	//     "https://www.googleapis.com/auth/sqlservice.admin"
6617	//   ]
6618	// }
6619
6620}
6621
6622// method id "sql.instances.delete":
6623
6624type InstancesDeleteCall struct {
6625	s          *Service
6626	project    string
6627	instance   string
6628	urlParams_ gensupport.URLParams
6629	ctx_       context.Context
6630	header_    http.Header
6631}
6632
6633// Delete: Deletes a Cloud SQL instance.
6634//
6635// - instance: Cloud SQL instance ID. This does not include the project
6636//   ID.
6637// - project: Project ID of the project that contains the instance to be
6638//   deleted.
6639func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall {
6640	c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6641	c.project = project
6642	c.instance = instance
6643	return c
6644}
6645
6646// Fields allows partial responses to be retrieved. See
6647// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6648// for more information.
6649func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
6650	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6651	return c
6652}
6653
6654// Context sets the context to be used in this call's Do method. Any
6655// pending HTTP request will be aborted if the provided context is
6656// canceled.
6657func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
6658	c.ctx_ = ctx
6659	return c
6660}
6661
6662// Header returns an http.Header that can be modified by the caller to
6663// add HTTP headers to the request.
6664func (c *InstancesDeleteCall) Header() http.Header {
6665	if c.header_ == nil {
6666		c.header_ = make(http.Header)
6667	}
6668	return c.header_
6669}
6670
6671func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
6672	reqHeaders := make(http.Header)
6673	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
6674	for k, v := range c.header_ {
6675		reqHeaders[k] = v
6676	}
6677	reqHeaders.Set("User-Agent", c.s.userAgent())
6678	var body io.Reader = nil
6679	c.urlParams_.Set("alt", alt)
6680	c.urlParams_.Set("prettyPrint", "false")
6681	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}")
6682	urls += "?" + c.urlParams_.Encode()
6683	req, err := http.NewRequest("DELETE", urls, body)
6684	if err != nil {
6685		return nil, err
6686	}
6687	req.Header = reqHeaders
6688	googleapi.Expand(req.URL, map[string]string{
6689		"project":  c.project,
6690		"instance": c.instance,
6691	})
6692	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6693}
6694
6695// Do executes the "sql.instances.delete" call.
6696// Exactly one of *Operation or error will be non-nil. Any non-2xx
6697// status code is an error. Response headers are in either
6698// *Operation.ServerResponse.Header or (if a response was returned at
6699// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6700// to check whether the returned error was because
6701// http.StatusNotModified was returned.
6702func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6703	gensupport.SetOptions(c.urlParams_, opts...)
6704	res, err := c.doRequest("json")
6705	if res != nil && res.StatusCode == http.StatusNotModified {
6706		if res.Body != nil {
6707			res.Body.Close()
6708		}
6709		return nil, &googleapi.Error{
6710			Code:   res.StatusCode,
6711			Header: res.Header,
6712		}
6713	}
6714	if err != nil {
6715		return nil, err
6716	}
6717	defer googleapi.CloseBody(res)
6718	if err := googleapi.CheckResponse(res); err != nil {
6719		return nil, err
6720	}
6721	ret := &Operation{
6722		ServerResponse: googleapi.ServerResponse{
6723			Header:         res.Header,
6724			HTTPStatusCode: res.StatusCode,
6725		},
6726	}
6727	target := &ret
6728	if err := gensupport.DecodeResponse(target, res); err != nil {
6729		return nil, err
6730	}
6731	return ret, nil
6732	// {
6733	//   "description": "Deletes a Cloud SQL instance.",
6734	//   "flatPath": "v1/projects/{project}/instances/{instance}",
6735	//   "httpMethod": "DELETE",
6736	//   "id": "sql.instances.delete",
6737	//   "parameterOrder": [
6738	//     "project",
6739	//     "instance"
6740	//   ],
6741	//   "parameters": {
6742	//     "instance": {
6743	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
6744	//       "location": "path",
6745	//       "required": true,
6746	//       "type": "string"
6747	//     },
6748	//     "project": {
6749	//       "description": "Project ID of the project that contains the instance to be deleted.",
6750	//       "location": "path",
6751	//       "required": true,
6752	//       "type": "string"
6753	//     }
6754	//   },
6755	//   "path": "v1/projects/{project}/instances/{instance}",
6756	//   "response": {
6757	//     "$ref": "Operation"
6758	//   },
6759	//   "scopes": [
6760	//     "https://www.googleapis.com/auth/cloud-platform",
6761	//     "https://www.googleapis.com/auth/sqlservice.admin"
6762	//   ]
6763	// }
6764
6765}
6766
6767// method id "sql.instances.demoteMaster":
6768
6769type InstancesDemoteMasterCall struct {
6770	s                            *Service
6771	project                      string
6772	instance                     string
6773	instancesdemotemasterrequest *InstancesDemoteMasterRequest
6774	urlParams_                   gensupport.URLParams
6775	ctx_                         context.Context
6776	header_                      http.Header
6777}
6778
6779// DemoteMaster: Demotes the stand-alone instance to be a Cloud SQL read
6780// replica for an external database server.
6781//
6782// - instance: Cloud SQL instance name.
6783// - project: ID of the project that contains the instance.
6784func (r *InstancesService) DemoteMaster(project string, instance string, instancesdemotemasterrequest *InstancesDemoteMasterRequest) *InstancesDemoteMasterCall {
6785	c := &InstancesDemoteMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6786	c.project = project
6787	c.instance = instance
6788	c.instancesdemotemasterrequest = instancesdemotemasterrequest
6789	return c
6790}
6791
6792// Fields allows partial responses to be retrieved. See
6793// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6794// for more information.
6795func (c *InstancesDemoteMasterCall) Fields(s ...googleapi.Field) *InstancesDemoteMasterCall {
6796	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6797	return c
6798}
6799
6800// Context sets the context to be used in this call's Do method. Any
6801// pending HTTP request will be aborted if the provided context is
6802// canceled.
6803func (c *InstancesDemoteMasterCall) Context(ctx context.Context) *InstancesDemoteMasterCall {
6804	c.ctx_ = ctx
6805	return c
6806}
6807
6808// Header returns an http.Header that can be modified by the caller to
6809// add HTTP headers to the request.
6810func (c *InstancesDemoteMasterCall) Header() http.Header {
6811	if c.header_ == nil {
6812		c.header_ = make(http.Header)
6813	}
6814	return c.header_
6815}
6816
6817func (c *InstancesDemoteMasterCall) doRequest(alt string) (*http.Response, error) {
6818	reqHeaders := make(http.Header)
6819	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
6820	for k, v := range c.header_ {
6821		reqHeaders[k] = v
6822	}
6823	reqHeaders.Set("User-Agent", c.s.userAgent())
6824	var body io.Reader = nil
6825	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemotemasterrequest)
6826	if err != nil {
6827		return nil, err
6828	}
6829	reqHeaders.Set("Content-Type", "application/json")
6830	c.urlParams_.Set("alt", alt)
6831	c.urlParams_.Set("prettyPrint", "false")
6832	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/demoteMaster")
6833	urls += "?" + c.urlParams_.Encode()
6834	req, err := http.NewRequest("POST", urls, body)
6835	if err != nil {
6836		return nil, err
6837	}
6838	req.Header = reqHeaders
6839	googleapi.Expand(req.URL, map[string]string{
6840		"project":  c.project,
6841		"instance": c.instance,
6842	})
6843	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6844}
6845
6846// Do executes the "sql.instances.demoteMaster" call.
6847// Exactly one of *Operation or error will be non-nil. Any non-2xx
6848// status code is an error. Response headers are in either
6849// *Operation.ServerResponse.Header or (if a response was returned at
6850// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6851// to check whether the returned error was because
6852// http.StatusNotModified was returned.
6853func (c *InstancesDemoteMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6854	gensupport.SetOptions(c.urlParams_, opts...)
6855	res, err := c.doRequest("json")
6856	if res != nil && res.StatusCode == http.StatusNotModified {
6857		if res.Body != nil {
6858			res.Body.Close()
6859		}
6860		return nil, &googleapi.Error{
6861			Code:   res.StatusCode,
6862			Header: res.Header,
6863		}
6864	}
6865	if err != nil {
6866		return nil, err
6867	}
6868	defer googleapi.CloseBody(res)
6869	if err := googleapi.CheckResponse(res); err != nil {
6870		return nil, err
6871	}
6872	ret := &Operation{
6873		ServerResponse: googleapi.ServerResponse{
6874			Header:         res.Header,
6875			HTTPStatusCode: res.StatusCode,
6876		},
6877	}
6878	target := &ret
6879	if err := gensupport.DecodeResponse(target, res); err != nil {
6880		return nil, err
6881	}
6882	return ret, nil
6883	// {
6884	//   "description": "Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.",
6885	//   "flatPath": "v1/projects/{project}/instances/{instance}/demoteMaster",
6886	//   "httpMethod": "POST",
6887	//   "id": "sql.instances.demoteMaster",
6888	//   "parameterOrder": [
6889	//     "project",
6890	//     "instance"
6891	//   ],
6892	//   "parameters": {
6893	//     "instance": {
6894	//       "description": "Cloud SQL instance name.",
6895	//       "location": "path",
6896	//       "required": true,
6897	//       "type": "string"
6898	//     },
6899	//     "project": {
6900	//       "description": "ID of the project that contains the instance.",
6901	//       "location": "path",
6902	//       "required": true,
6903	//       "type": "string"
6904	//     }
6905	//   },
6906	//   "path": "v1/projects/{project}/instances/{instance}/demoteMaster",
6907	//   "request": {
6908	//     "$ref": "InstancesDemoteMasterRequest"
6909	//   },
6910	//   "response": {
6911	//     "$ref": "Operation"
6912	//   },
6913	//   "scopes": [
6914	//     "https://www.googleapis.com/auth/cloud-platform",
6915	//     "https://www.googleapis.com/auth/sqlservice.admin"
6916	//   ]
6917	// }
6918
6919}
6920
6921// method id "sql.instances.export":
6922
6923type InstancesExportCall struct {
6924	s                      *Service
6925	project                string
6926	instance               string
6927	instancesexportrequest *InstancesExportRequest
6928	urlParams_             gensupport.URLParams
6929	ctx_                   context.Context
6930	header_                http.Header
6931}
6932
6933// Export: Exports data from a Cloud SQL instance to a Cloud Storage
6934// bucket as a SQL dump or CSV file.
6935//
6936// - instance: Cloud SQL instance ID. This does not include the project
6937//   ID.
6938// - project: Project ID of the project that contains the instance to be
6939//   exported.
6940func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall {
6941	c := &InstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6942	c.project = project
6943	c.instance = instance
6944	c.instancesexportrequest = instancesexportrequest
6945	return c
6946}
6947
6948// Fields allows partial responses to be retrieved. See
6949// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6950// for more information.
6951func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall {
6952	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6953	return c
6954}
6955
6956// Context sets the context to be used in this call's Do method. Any
6957// pending HTTP request will be aborted if the provided context is
6958// canceled.
6959func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall {
6960	c.ctx_ = ctx
6961	return c
6962}
6963
6964// Header returns an http.Header that can be modified by the caller to
6965// add HTTP headers to the request.
6966func (c *InstancesExportCall) Header() http.Header {
6967	if c.header_ == nil {
6968		c.header_ = make(http.Header)
6969	}
6970	return c.header_
6971}
6972
6973func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) {
6974	reqHeaders := make(http.Header)
6975	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
6976	for k, v := range c.header_ {
6977		reqHeaders[k] = v
6978	}
6979	reqHeaders.Set("User-Agent", c.s.userAgent())
6980	var body io.Reader = nil
6981	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest)
6982	if err != nil {
6983		return nil, err
6984	}
6985	reqHeaders.Set("Content-Type", "application/json")
6986	c.urlParams_.Set("alt", alt)
6987	c.urlParams_.Set("prettyPrint", "false")
6988	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/export")
6989	urls += "?" + c.urlParams_.Encode()
6990	req, err := http.NewRequest("POST", urls, body)
6991	if err != nil {
6992		return nil, err
6993	}
6994	req.Header = reqHeaders
6995	googleapi.Expand(req.URL, map[string]string{
6996		"project":  c.project,
6997		"instance": c.instance,
6998	})
6999	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7000}
7001
7002// Do executes the "sql.instances.export" call.
7003// Exactly one of *Operation or error will be non-nil. Any non-2xx
7004// status code is an error. Response headers are in either
7005// *Operation.ServerResponse.Header or (if a response was returned at
7006// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7007// to check whether the returned error was because
7008// http.StatusNotModified was returned.
7009func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7010	gensupport.SetOptions(c.urlParams_, opts...)
7011	res, err := c.doRequest("json")
7012	if res != nil && res.StatusCode == http.StatusNotModified {
7013		if res.Body != nil {
7014			res.Body.Close()
7015		}
7016		return nil, &googleapi.Error{
7017			Code:   res.StatusCode,
7018			Header: res.Header,
7019		}
7020	}
7021	if err != nil {
7022		return nil, err
7023	}
7024	defer googleapi.CloseBody(res)
7025	if err := googleapi.CheckResponse(res); err != nil {
7026		return nil, err
7027	}
7028	ret := &Operation{
7029		ServerResponse: googleapi.ServerResponse{
7030			Header:         res.Header,
7031			HTTPStatusCode: res.StatusCode,
7032		},
7033	}
7034	target := &ret
7035	if err := gensupport.DecodeResponse(target, res); err != nil {
7036		return nil, err
7037	}
7038	return ret, nil
7039	// {
7040	//   "description": "Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.",
7041	//   "flatPath": "v1/projects/{project}/instances/{instance}/export",
7042	//   "httpMethod": "POST",
7043	//   "id": "sql.instances.export",
7044	//   "parameterOrder": [
7045	//     "project",
7046	//     "instance"
7047	//   ],
7048	//   "parameters": {
7049	//     "instance": {
7050	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
7051	//       "location": "path",
7052	//       "required": true,
7053	//       "type": "string"
7054	//     },
7055	//     "project": {
7056	//       "description": "Project ID of the project that contains the instance to be exported.",
7057	//       "location": "path",
7058	//       "required": true,
7059	//       "type": "string"
7060	//     }
7061	//   },
7062	//   "path": "v1/projects/{project}/instances/{instance}/export",
7063	//   "request": {
7064	//     "$ref": "InstancesExportRequest"
7065	//   },
7066	//   "response": {
7067	//     "$ref": "Operation"
7068	//   },
7069	//   "scopes": [
7070	//     "https://www.googleapis.com/auth/cloud-platform"
7071	//   ]
7072	// }
7073
7074}
7075
7076// method id "sql.instances.failover":
7077
7078type InstancesFailoverCall struct {
7079	s                        *Service
7080	project                  string
7081	instance                 string
7082	instancesfailoverrequest *InstancesFailoverRequest
7083	urlParams_               gensupport.URLParams
7084	ctx_                     context.Context
7085	header_                  http.Header
7086}
7087
7088// Failover: Initiates a manual failover of a high availability (HA)
7089// primary instance to a standby instance, which becomes the primary
7090// instance. Users are then rerouted to the new primary. For more
7091// information, see the Overview of high availability page in the Cloud
7092// SQL documentation. If using Legacy HA (MySQL only), this causes the
7093// instance to failover to its failover replica instance.
7094//
7095// - instance: Cloud SQL instance ID. This does not include the project
7096//   ID.
7097// - project: ID of the project that contains the read replica.
7098func (r *InstancesService) Failover(project string, instance string, instancesfailoverrequest *InstancesFailoverRequest) *InstancesFailoverCall {
7099	c := &InstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7100	c.project = project
7101	c.instance = instance
7102	c.instancesfailoverrequest = instancesfailoverrequest
7103	return c
7104}
7105
7106// Fields allows partial responses to be retrieved. See
7107// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7108// for more information.
7109func (c *InstancesFailoverCall) Fields(s ...googleapi.Field) *InstancesFailoverCall {
7110	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7111	return c
7112}
7113
7114// Context sets the context to be used in this call's Do method. Any
7115// pending HTTP request will be aborted if the provided context is
7116// canceled.
7117func (c *InstancesFailoverCall) Context(ctx context.Context) *InstancesFailoverCall {
7118	c.ctx_ = ctx
7119	return c
7120}
7121
7122// Header returns an http.Header that can be modified by the caller to
7123// add HTTP headers to the request.
7124func (c *InstancesFailoverCall) Header() http.Header {
7125	if c.header_ == nil {
7126		c.header_ = make(http.Header)
7127	}
7128	return c.header_
7129}
7130
7131func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) {
7132	reqHeaders := make(http.Header)
7133	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
7134	for k, v := range c.header_ {
7135		reqHeaders[k] = v
7136	}
7137	reqHeaders.Set("User-Agent", c.s.userAgent())
7138	var body io.Reader = nil
7139	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest)
7140	if err != nil {
7141		return nil, err
7142	}
7143	reqHeaders.Set("Content-Type", "application/json")
7144	c.urlParams_.Set("alt", alt)
7145	c.urlParams_.Set("prettyPrint", "false")
7146	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/failover")
7147	urls += "?" + c.urlParams_.Encode()
7148	req, err := http.NewRequest("POST", urls, body)
7149	if err != nil {
7150		return nil, err
7151	}
7152	req.Header = reqHeaders
7153	googleapi.Expand(req.URL, map[string]string{
7154		"project":  c.project,
7155		"instance": c.instance,
7156	})
7157	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7158}
7159
7160// Do executes the "sql.instances.failover" call.
7161// Exactly one of *Operation or error will be non-nil. Any non-2xx
7162// status code is an error. Response headers are in either
7163// *Operation.ServerResponse.Header or (if a response was returned at
7164// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7165// to check whether the returned error was because
7166// http.StatusNotModified was returned.
7167func (c *InstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7168	gensupport.SetOptions(c.urlParams_, opts...)
7169	res, err := c.doRequest("json")
7170	if res != nil && res.StatusCode == http.StatusNotModified {
7171		if res.Body != nil {
7172			res.Body.Close()
7173		}
7174		return nil, &googleapi.Error{
7175			Code:   res.StatusCode,
7176			Header: res.Header,
7177		}
7178	}
7179	if err != nil {
7180		return nil, err
7181	}
7182	defer googleapi.CloseBody(res)
7183	if err := googleapi.CheckResponse(res); err != nil {
7184		return nil, err
7185	}
7186	ret := &Operation{
7187		ServerResponse: googleapi.ServerResponse{
7188			Header:         res.Header,
7189			HTTPStatusCode: res.StatusCode,
7190		},
7191	}
7192	target := &ret
7193	if err := gensupport.DecodeResponse(target, res); err != nil {
7194		return nil, err
7195	}
7196	return ret, nil
7197	// {
7198	//   "description": "Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the Overview of high availability page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.",
7199	//   "flatPath": "v1/projects/{project}/instances/{instance}/failover",
7200	//   "httpMethod": "POST",
7201	//   "id": "sql.instances.failover",
7202	//   "parameterOrder": [
7203	//     "project",
7204	//     "instance"
7205	//   ],
7206	//   "parameters": {
7207	//     "instance": {
7208	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
7209	//       "location": "path",
7210	//       "required": true,
7211	//       "type": "string"
7212	//     },
7213	//     "project": {
7214	//       "description": "ID of the project that contains the read replica.",
7215	//       "location": "path",
7216	//       "required": true,
7217	//       "type": "string"
7218	//     }
7219	//   },
7220	//   "path": "v1/projects/{project}/instances/{instance}/failover",
7221	//   "request": {
7222	//     "$ref": "InstancesFailoverRequest"
7223	//   },
7224	//   "response": {
7225	//     "$ref": "Operation"
7226	//   },
7227	//   "scopes": [
7228	//     "https://www.googleapis.com/auth/cloud-platform",
7229	//     "https://www.googleapis.com/auth/sqlservice.admin"
7230	//   ]
7231	// }
7232
7233}
7234
7235// method id "sql.instances.get":
7236
7237type InstancesGetCall struct {
7238	s            *Service
7239	project      string
7240	instance     string
7241	urlParams_   gensupport.URLParams
7242	ifNoneMatch_ string
7243	ctx_         context.Context
7244	header_      http.Header
7245}
7246
7247// Get: Retrieves a resource containing information about a Cloud SQL
7248// instance.
7249//
7250// - instance: Database instance ID. This does not include the project
7251//   ID.
7252// - project: Project ID of the project that contains the instance.
7253func (r *InstancesService) Get(project string, instance string) *InstancesGetCall {
7254	c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7255	c.project = project
7256	c.instance = instance
7257	return c
7258}
7259
7260// Fields allows partial responses to be retrieved. See
7261// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7262// for more information.
7263func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
7264	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7265	return c
7266}
7267
7268// IfNoneMatch sets the optional parameter which makes the operation
7269// fail if the object's ETag matches the given value. This is useful for
7270// getting updates only after the object has changed since the last
7271// request. Use googleapi.IsNotModified to check whether the response
7272// error from Do is the result of In-None-Match.
7273func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
7274	c.ifNoneMatch_ = entityTag
7275	return c
7276}
7277
7278// Context sets the context to be used in this call's Do method. Any
7279// pending HTTP request will be aborted if the provided context is
7280// canceled.
7281func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
7282	c.ctx_ = ctx
7283	return c
7284}
7285
7286// Header returns an http.Header that can be modified by the caller to
7287// add HTTP headers to the request.
7288func (c *InstancesGetCall) Header() http.Header {
7289	if c.header_ == nil {
7290		c.header_ = make(http.Header)
7291	}
7292	return c.header_
7293}
7294
7295func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
7296	reqHeaders := make(http.Header)
7297	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
7298	for k, v := range c.header_ {
7299		reqHeaders[k] = v
7300	}
7301	reqHeaders.Set("User-Agent", c.s.userAgent())
7302	if c.ifNoneMatch_ != "" {
7303		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7304	}
7305	var body io.Reader = nil
7306	c.urlParams_.Set("alt", alt)
7307	c.urlParams_.Set("prettyPrint", "false")
7308	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}")
7309	urls += "?" + c.urlParams_.Encode()
7310	req, err := http.NewRequest("GET", urls, body)
7311	if err != nil {
7312		return nil, err
7313	}
7314	req.Header = reqHeaders
7315	googleapi.Expand(req.URL, map[string]string{
7316		"project":  c.project,
7317		"instance": c.instance,
7318	})
7319	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7320}
7321
7322// Do executes the "sql.instances.get" call.
7323// Exactly one of *DatabaseInstance or error will be non-nil. Any
7324// non-2xx status code is an error. Response headers are in either
7325// *DatabaseInstance.ServerResponse.Header or (if a response was
7326// returned at all) in error.(*googleapi.Error).Header. Use
7327// googleapi.IsNotModified to check whether the returned error was
7328// because http.StatusNotModified was returned.
7329func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) {
7330	gensupport.SetOptions(c.urlParams_, opts...)
7331	res, err := c.doRequest("json")
7332	if res != nil && res.StatusCode == http.StatusNotModified {
7333		if res.Body != nil {
7334			res.Body.Close()
7335		}
7336		return nil, &googleapi.Error{
7337			Code:   res.StatusCode,
7338			Header: res.Header,
7339		}
7340	}
7341	if err != nil {
7342		return nil, err
7343	}
7344	defer googleapi.CloseBody(res)
7345	if err := googleapi.CheckResponse(res); err != nil {
7346		return nil, err
7347	}
7348	ret := &DatabaseInstance{
7349		ServerResponse: googleapi.ServerResponse{
7350			Header:         res.Header,
7351			HTTPStatusCode: res.StatusCode,
7352		},
7353	}
7354	target := &ret
7355	if err := gensupport.DecodeResponse(target, res); err != nil {
7356		return nil, err
7357	}
7358	return ret, nil
7359	// {
7360	//   "description": "Retrieves a resource containing information about a Cloud SQL instance.",
7361	//   "flatPath": "v1/projects/{project}/instances/{instance}",
7362	//   "httpMethod": "GET",
7363	//   "id": "sql.instances.get",
7364	//   "parameterOrder": [
7365	//     "project",
7366	//     "instance"
7367	//   ],
7368	//   "parameters": {
7369	//     "instance": {
7370	//       "description": "Database instance ID. This does not include the project ID.",
7371	//       "location": "path",
7372	//       "required": true,
7373	//       "type": "string"
7374	//     },
7375	//     "project": {
7376	//       "description": "Project ID of the project that contains the instance.",
7377	//       "location": "path",
7378	//       "required": true,
7379	//       "type": "string"
7380	//     }
7381	//   },
7382	//   "path": "v1/projects/{project}/instances/{instance}",
7383	//   "response": {
7384	//     "$ref": "DatabaseInstance"
7385	//   },
7386	//   "scopes": [
7387	//     "https://www.googleapis.com/auth/cloud-platform",
7388	//     "https://www.googleapis.com/auth/sqlservice.admin"
7389	//   ]
7390	// }
7391
7392}
7393
7394// method id "sql.instances.import":
7395
7396type InstancesImportCall struct {
7397	s                      *Service
7398	project                string
7399	instance               string
7400	instancesimportrequest *InstancesImportRequest
7401	urlParams_             gensupport.URLParams
7402	ctx_                   context.Context
7403	header_                http.Header
7404}
7405
7406// Import: Imports data into a Cloud SQL instance from a SQL dump or CSV
7407// file in Cloud Storage.
7408//
7409// - instance: Cloud SQL instance ID. This does not include the project
7410//   ID.
7411// - project: Project ID of the project that contains the instance.
7412func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall {
7413	c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7414	c.project = project
7415	c.instance = instance
7416	c.instancesimportrequest = instancesimportrequest
7417	return c
7418}
7419
7420// Fields allows partial responses to be retrieved. See
7421// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7422// for more information.
7423func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall {
7424	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7425	return c
7426}
7427
7428// Context sets the context to be used in this call's Do method. Any
7429// pending HTTP request will be aborted if the provided context is
7430// canceled.
7431func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall {
7432	c.ctx_ = ctx
7433	return c
7434}
7435
7436// Header returns an http.Header that can be modified by the caller to
7437// add HTTP headers to the request.
7438func (c *InstancesImportCall) Header() http.Header {
7439	if c.header_ == nil {
7440		c.header_ = make(http.Header)
7441	}
7442	return c.header_
7443}
7444
7445func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) {
7446	reqHeaders := make(http.Header)
7447	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
7448	for k, v := range c.header_ {
7449		reqHeaders[k] = v
7450	}
7451	reqHeaders.Set("User-Agent", c.s.userAgent())
7452	var body io.Reader = nil
7453	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest)
7454	if err != nil {
7455		return nil, err
7456	}
7457	reqHeaders.Set("Content-Type", "application/json")
7458	c.urlParams_.Set("alt", alt)
7459	c.urlParams_.Set("prettyPrint", "false")
7460	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/import")
7461	urls += "?" + c.urlParams_.Encode()
7462	req, err := http.NewRequest("POST", urls, body)
7463	if err != nil {
7464		return nil, err
7465	}
7466	req.Header = reqHeaders
7467	googleapi.Expand(req.URL, map[string]string{
7468		"project":  c.project,
7469		"instance": c.instance,
7470	})
7471	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7472}
7473
7474// Do executes the "sql.instances.import" call.
7475// Exactly one of *Operation or error will be non-nil. Any non-2xx
7476// status code is an error. Response headers are in either
7477// *Operation.ServerResponse.Header or (if a response was returned at
7478// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7479// to check whether the returned error was because
7480// http.StatusNotModified was returned.
7481func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7482	gensupport.SetOptions(c.urlParams_, opts...)
7483	res, err := c.doRequest("json")
7484	if res != nil && res.StatusCode == http.StatusNotModified {
7485		if res.Body != nil {
7486			res.Body.Close()
7487		}
7488		return nil, &googleapi.Error{
7489			Code:   res.StatusCode,
7490			Header: res.Header,
7491		}
7492	}
7493	if err != nil {
7494		return nil, err
7495	}
7496	defer googleapi.CloseBody(res)
7497	if err := googleapi.CheckResponse(res); err != nil {
7498		return nil, err
7499	}
7500	ret := &Operation{
7501		ServerResponse: googleapi.ServerResponse{
7502			Header:         res.Header,
7503			HTTPStatusCode: res.StatusCode,
7504		},
7505	}
7506	target := &ret
7507	if err := gensupport.DecodeResponse(target, res); err != nil {
7508		return nil, err
7509	}
7510	return ret, nil
7511	// {
7512	//   "description": "Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.",
7513	//   "flatPath": "v1/projects/{project}/instances/{instance}/import",
7514	//   "httpMethod": "POST",
7515	//   "id": "sql.instances.import",
7516	//   "parameterOrder": [
7517	//     "project",
7518	//     "instance"
7519	//   ],
7520	//   "parameters": {
7521	//     "instance": {
7522	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
7523	//       "location": "path",
7524	//       "required": true,
7525	//       "type": "string"
7526	//     },
7527	//     "project": {
7528	//       "description": "Project ID of the project that contains the instance.",
7529	//       "location": "path",
7530	//       "required": true,
7531	//       "type": "string"
7532	//     }
7533	//   },
7534	//   "path": "v1/projects/{project}/instances/{instance}/import",
7535	//   "request": {
7536	//     "$ref": "InstancesImportRequest"
7537	//   },
7538	//   "response": {
7539	//     "$ref": "Operation"
7540	//   },
7541	//   "scopes": [
7542	//     "https://www.googleapis.com/auth/cloud-platform"
7543	//   ]
7544	// }
7545
7546}
7547
7548// method id "sql.instances.insert":
7549
7550type InstancesInsertCall struct {
7551	s                *Service
7552	project          string
7553	databaseinstance *DatabaseInstance
7554	urlParams_       gensupport.URLParams
7555	ctx_             context.Context
7556	header_          http.Header
7557}
7558
7559// Insert: Creates a new Cloud SQL instance.
7560//
7561// - project: Project ID of the project to which the newly created Cloud
7562//   SQL instances should belong.
7563func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall {
7564	c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7565	c.project = project
7566	c.databaseinstance = databaseinstance
7567	return c
7568}
7569
7570// Fields allows partial responses to be retrieved. See
7571// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7572// for more information.
7573func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
7574	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7575	return c
7576}
7577
7578// Context sets the context to be used in this call's Do method. Any
7579// pending HTTP request will be aborted if the provided context is
7580// canceled.
7581func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
7582	c.ctx_ = ctx
7583	return c
7584}
7585
7586// Header returns an http.Header that can be modified by the caller to
7587// add HTTP headers to the request.
7588func (c *InstancesInsertCall) Header() http.Header {
7589	if c.header_ == nil {
7590		c.header_ = make(http.Header)
7591	}
7592	return c.header_
7593}
7594
7595func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
7596	reqHeaders := make(http.Header)
7597	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
7598	for k, v := range c.header_ {
7599		reqHeaders[k] = v
7600	}
7601	reqHeaders.Set("User-Agent", c.s.userAgent())
7602	var body io.Reader = nil
7603	body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
7604	if err != nil {
7605		return nil, err
7606	}
7607	reqHeaders.Set("Content-Type", "application/json")
7608	c.urlParams_.Set("alt", alt)
7609	c.urlParams_.Set("prettyPrint", "false")
7610	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances")
7611	urls += "?" + c.urlParams_.Encode()
7612	req, err := http.NewRequest("POST", urls, body)
7613	if err != nil {
7614		return nil, err
7615	}
7616	req.Header = reqHeaders
7617	googleapi.Expand(req.URL, map[string]string{
7618		"project": c.project,
7619	})
7620	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7621}
7622
7623// Do executes the "sql.instances.insert" call.
7624// Exactly one of *Operation or error will be non-nil. Any non-2xx
7625// status code is an error. Response headers are in either
7626// *Operation.ServerResponse.Header or (if a response was returned at
7627// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7628// to check whether the returned error was because
7629// http.StatusNotModified was returned.
7630func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7631	gensupport.SetOptions(c.urlParams_, opts...)
7632	res, err := c.doRequest("json")
7633	if res != nil && res.StatusCode == http.StatusNotModified {
7634		if res.Body != nil {
7635			res.Body.Close()
7636		}
7637		return nil, &googleapi.Error{
7638			Code:   res.StatusCode,
7639			Header: res.Header,
7640		}
7641	}
7642	if err != nil {
7643		return nil, err
7644	}
7645	defer googleapi.CloseBody(res)
7646	if err := googleapi.CheckResponse(res); err != nil {
7647		return nil, err
7648	}
7649	ret := &Operation{
7650		ServerResponse: googleapi.ServerResponse{
7651			Header:         res.Header,
7652			HTTPStatusCode: res.StatusCode,
7653		},
7654	}
7655	target := &ret
7656	if err := gensupport.DecodeResponse(target, res); err != nil {
7657		return nil, err
7658	}
7659	return ret, nil
7660	// {
7661	//   "description": "Creates a new Cloud SQL instance.",
7662	//   "flatPath": "v1/projects/{project}/instances",
7663	//   "httpMethod": "POST",
7664	//   "id": "sql.instances.insert",
7665	//   "parameterOrder": [
7666	//     "project"
7667	//   ],
7668	//   "parameters": {
7669	//     "project": {
7670	//       "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.",
7671	//       "location": "path",
7672	//       "required": true,
7673	//       "type": "string"
7674	//     }
7675	//   },
7676	//   "path": "v1/projects/{project}/instances",
7677	//   "request": {
7678	//     "$ref": "DatabaseInstance"
7679	//   },
7680	//   "response": {
7681	//     "$ref": "Operation"
7682	//   },
7683	//   "scopes": [
7684	//     "https://www.googleapis.com/auth/cloud-platform",
7685	//     "https://www.googleapis.com/auth/sqlservice.admin"
7686	//   ]
7687	// }
7688
7689}
7690
7691// method id "sql.instances.list":
7692
7693type InstancesListCall struct {
7694	s            *Service
7695	project      string
7696	urlParams_   gensupport.URLParams
7697	ifNoneMatch_ string
7698	ctx_         context.Context
7699	header_      http.Header
7700}
7701
7702// List: Lists instances under a given project.
7703//
7704// - project: Project ID of the project for which to list Cloud SQL
7705//   instances.
7706func (r *InstancesService) List(project string) *InstancesListCall {
7707	c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7708	c.project = project
7709	return c
7710}
7711
7712// Filter sets the optional parameter "filter": A filter expression that
7713// filters resources listed in the response. The expression is in the
7714// form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'.
7715// Fields can be nested as needed as per their JSON representation, such
7716// as 'settings.userLabels.auto_start:true'. Multiple filter queries are
7717// space-separated. For example. 'state:RUNNABLE
7718// instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an
7719// AND expression. However, you can include AND and OR expressions
7720// explicitly.
7721func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
7722	c.urlParams_.Set("filter", filter)
7723	return c
7724}
7725
7726// MaxResults sets the optional parameter "maxResults": The maximum
7727// number of results to return per response.
7728func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
7729	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
7730	return c
7731}
7732
7733// PageToken sets the optional parameter "pageToken": A
7734// previously-returned page token representing part of the larger set of
7735// results to view.
7736func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
7737	c.urlParams_.Set("pageToken", pageToken)
7738	return c
7739}
7740
7741// Fields allows partial responses to be retrieved. See
7742// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7743// for more information.
7744func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
7745	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7746	return c
7747}
7748
7749// IfNoneMatch sets the optional parameter which makes the operation
7750// fail if the object's ETag matches the given value. This is useful for
7751// getting updates only after the object has changed since the last
7752// request. Use googleapi.IsNotModified to check whether the response
7753// error from Do is the result of In-None-Match.
7754func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
7755	c.ifNoneMatch_ = entityTag
7756	return c
7757}
7758
7759// Context sets the context to be used in this call's Do method. Any
7760// pending HTTP request will be aborted if the provided context is
7761// canceled.
7762func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
7763	c.ctx_ = ctx
7764	return c
7765}
7766
7767// Header returns an http.Header that can be modified by the caller to
7768// add HTTP headers to the request.
7769func (c *InstancesListCall) Header() http.Header {
7770	if c.header_ == nil {
7771		c.header_ = make(http.Header)
7772	}
7773	return c.header_
7774}
7775
7776func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
7777	reqHeaders := make(http.Header)
7778	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
7779	for k, v := range c.header_ {
7780		reqHeaders[k] = v
7781	}
7782	reqHeaders.Set("User-Agent", c.s.userAgent())
7783	if c.ifNoneMatch_ != "" {
7784		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7785	}
7786	var body io.Reader = nil
7787	c.urlParams_.Set("alt", alt)
7788	c.urlParams_.Set("prettyPrint", "false")
7789	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances")
7790	urls += "?" + c.urlParams_.Encode()
7791	req, err := http.NewRequest("GET", urls, body)
7792	if err != nil {
7793		return nil, err
7794	}
7795	req.Header = reqHeaders
7796	googleapi.Expand(req.URL, map[string]string{
7797		"project": c.project,
7798	})
7799	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7800}
7801
7802// Do executes the "sql.instances.list" call.
7803// Exactly one of *InstancesListResponse or error will be non-nil. Any
7804// non-2xx status code is an error. Response headers are in either
7805// *InstancesListResponse.ServerResponse.Header or (if a response was
7806// returned at all) in error.(*googleapi.Error).Header. Use
7807// googleapi.IsNotModified to check whether the returned error was
7808// because http.StatusNotModified was returned.
7809func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) {
7810	gensupport.SetOptions(c.urlParams_, opts...)
7811	res, err := c.doRequest("json")
7812	if res != nil && res.StatusCode == http.StatusNotModified {
7813		if res.Body != nil {
7814			res.Body.Close()
7815		}
7816		return nil, &googleapi.Error{
7817			Code:   res.StatusCode,
7818			Header: res.Header,
7819		}
7820	}
7821	if err != nil {
7822		return nil, err
7823	}
7824	defer googleapi.CloseBody(res)
7825	if err := googleapi.CheckResponse(res); err != nil {
7826		return nil, err
7827	}
7828	ret := &InstancesListResponse{
7829		ServerResponse: googleapi.ServerResponse{
7830			Header:         res.Header,
7831			HTTPStatusCode: res.StatusCode,
7832		},
7833	}
7834	target := &ret
7835	if err := gensupport.DecodeResponse(target, res); err != nil {
7836		return nil, err
7837	}
7838	return ret, nil
7839	// {
7840	//   "description": "Lists instances under a given project.",
7841	//   "flatPath": "v1/projects/{project}/instances",
7842	//   "httpMethod": "GET",
7843	//   "id": "sql.instances.list",
7844	//   "parameterOrder": [
7845	//     "project"
7846	//   ],
7847	//   "parameters": {
7848	//     "filter": {
7849	//       "description": "A filter expression that filters resources listed in the response. The expression is in the form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON representation, such as 'settings.userLabels.auto_start:true'. Multiple filter queries are space-separated. For example. 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly.",
7850	//       "location": "query",
7851	//       "type": "string"
7852	//     },
7853	//     "maxResults": {
7854	//       "description": "The maximum number of results to return per response.",
7855	//       "format": "uint32",
7856	//       "location": "query",
7857	//       "type": "integer"
7858	//     },
7859	//     "pageToken": {
7860	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
7861	//       "location": "query",
7862	//       "type": "string"
7863	//     },
7864	//     "project": {
7865	//       "description": "Project ID of the project for which to list Cloud SQL instances.",
7866	//       "location": "path",
7867	//       "required": true,
7868	//       "type": "string"
7869	//     }
7870	//   },
7871	//   "path": "v1/projects/{project}/instances",
7872	//   "response": {
7873	//     "$ref": "InstancesListResponse"
7874	//   },
7875	//   "scopes": [
7876	//     "https://www.googleapis.com/auth/cloud-platform",
7877	//     "https://www.googleapis.com/auth/sqlservice.admin"
7878	//   ]
7879	// }
7880
7881}
7882
7883// Pages invokes f for each page of results.
7884// A non-nil error returned from f will halt the iteration.
7885// The provided context supersedes any context provided to the Context method.
7886func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error {
7887	c.ctx_ = ctx
7888	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
7889	for {
7890		x, err := c.Do()
7891		if err != nil {
7892			return err
7893		}
7894		if err := f(x); err != nil {
7895			return err
7896		}
7897		if x.NextPageToken == "" {
7898			return nil
7899		}
7900		c.PageToken(x.NextPageToken)
7901	}
7902}
7903
7904// method id "sql.instances.listServerCas":
7905
7906type InstancesListServerCasCall struct {
7907	s            *Service
7908	project      string
7909	instance     string
7910	urlParams_   gensupport.URLParams
7911	ifNoneMatch_ string
7912	ctx_         context.Context
7913	header_      http.Header
7914}
7915
7916// ListServerCas: Lists all of the trusted Certificate Authorities (CAs)
7917// for the specified instance. There can be up to three CAs listed: the
7918// CA that was used to sign the certificate that is currently in use, a
7919// CA that has been added but not yet used to sign a certificate, and a
7920// CA used to sign a certificate that has previously rotated out.
7921//
7922// - instance: Cloud SQL instance ID. This does not include the project
7923//   ID.
7924// - project: Project ID of the project that contains the instance.
7925func (r *InstancesService) ListServerCas(project string, instance string) *InstancesListServerCasCall {
7926	c := &InstancesListServerCasCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7927	c.project = project
7928	c.instance = instance
7929	return c
7930}
7931
7932// Fields allows partial responses to be retrieved. See
7933// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7934// for more information.
7935func (c *InstancesListServerCasCall) Fields(s ...googleapi.Field) *InstancesListServerCasCall {
7936	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7937	return c
7938}
7939
7940// IfNoneMatch sets the optional parameter which makes the operation
7941// fail if the object's ETag matches the given value. This is useful for
7942// getting updates only after the object has changed since the last
7943// request. Use googleapi.IsNotModified to check whether the response
7944// error from Do is the result of In-None-Match.
7945func (c *InstancesListServerCasCall) IfNoneMatch(entityTag string) *InstancesListServerCasCall {
7946	c.ifNoneMatch_ = entityTag
7947	return c
7948}
7949
7950// Context sets the context to be used in this call's Do method. Any
7951// pending HTTP request will be aborted if the provided context is
7952// canceled.
7953func (c *InstancesListServerCasCall) Context(ctx context.Context) *InstancesListServerCasCall {
7954	c.ctx_ = ctx
7955	return c
7956}
7957
7958// Header returns an http.Header that can be modified by the caller to
7959// add HTTP headers to the request.
7960func (c *InstancesListServerCasCall) Header() http.Header {
7961	if c.header_ == nil {
7962		c.header_ = make(http.Header)
7963	}
7964	return c.header_
7965}
7966
7967func (c *InstancesListServerCasCall) doRequest(alt string) (*http.Response, error) {
7968	reqHeaders := make(http.Header)
7969	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
7970	for k, v := range c.header_ {
7971		reqHeaders[k] = v
7972	}
7973	reqHeaders.Set("User-Agent", c.s.userAgent())
7974	if c.ifNoneMatch_ != "" {
7975		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7976	}
7977	var body io.Reader = nil
7978	c.urlParams_.Set("alt", alt)
7979	c.urlParams_.Set("prettyPrint", "false")
7980	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/listServerCas")
7981	urls += "?" + c.urlParams_.Encode()
7982	req, err := http.NewRequest("GET", urls, body)
7983	if err != nil {
7984		return nil, err
7985	}
7986	req.Header = reqHeaders
7987	googleapi.Expand(req.URL, map[string]string{
7988		"project":  c.project,
7989		"instance": c.instance,
7990	})
7991	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7992}
7993
7994// Do executes the "sql.instances.listServerCas" call.
7995// Exactly one of *InstancesListServerCasResponse or error will be
7996// non-nil. Any non-2xx status code is an error. Response headers are in
7997// either *InstancesListServerCasResponse.ServerResponse.Header or (if a
7998// response was returned at all) in error.(*googleapi.Error).Header. Use
7999// googleapi.IsNotModified to check whether the returned error was
8000// because http.StatusNotModified was returned.
8001func (c *InstancesListServerCasCall) Do(opts ...googleapi.CallOption) (*InstancesListServerCasResponse, error) {
8002	gensupport.SetOptions(c.urlParams_, opts...)
8003	res, err := c.doRequest("json")
8004	if res != nil && res.StatusCode == http.StatusNotModified {
8005		if res.Body != nil {
8006			res.Body.Close()
8007		}
8008		return nil, &googleapi.Error{
8009			Code:   res.StatusCode,
8010			Header: res.Header,
8011		}
8012	}
8013	if err != nil {
8014		return nil, err
8015	}
8016	defer googleapi.CloseBody(res)
8017	if err := googleapi.CheckResponse(res); err != nil {
8018		return nil, err
8019	}
8020	ret := &InstancesListServerCasResponse{
8021		ServerResponse: googleapi.ServerResponse{
8022			Header:         res.Header,
8023			HTTPStatusCode: res.StatusCode,
8024		},
8025	}
8026	target := &ret
8027	if err := gensupport.DecodeResponse(target, res); err != nil {
8028		return nil, err
8029	}
8030	return ret, nil
8031	// {
8032	//   "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.",
8033	//   "flatPath": "v1/projects/{project}/instances/{instance}/listServerCas",
8034	//   "httpMethod": "GET",
8035	//   "id": "sql.instances.listServerCas",
8036	//   "parameterOrder": [
8037	//     "project",
8038	//     "instance"
8039	//   ],
8040	//   "parameters": {
8041	//     "instance": {
8042	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8043	//       "location": "path",
8044	//       "required": true,
8045	//       "type": "string"
8046	//     },
8047	//     "project": {
8048	//       "description": "Project ID of the project that contains the instance.",
8049	//       "location": "path",
8050	//       "required": true,
8051	//       "type": "string"
8052	//     }
8053	//   },
8054	//   "path": "v1/projects/{project}/instances/{instance}/listServerCas",
8055	//   "response": {
8056	//     "$ref": "InstancesListServerCasResponse"
8057	//   },
8058	//   "scopes": [
8059	//     "https://www.googleapis.com/auth/cloud-platform",
8060	//     "https://www.googleapis.com/auth/sqlservice.admin"
8061	//   ]
8062	// }
8063
8064}
8065
8066// method id "sql.instances.patch":
8067
8068type InstancesPatchCall struct {
8069	s                *Service
8070	project          string
8071	instance         string
8072	databaseinstance *DatabaseInstance
8073	urlParams_       gensupport.URLParams
8074	ctx_             context.Context
8075	header_          http.Header
8076}
8077
8078// Patch: Updates settings of a Cloud SQL instance. This method supports
8079// patch semantics.
8080//
8081// - instance: Cloud SQL instance ID. This does not include the project
8082//   ID.
8083// - project: Project ID of the project that contains the instance.
8084func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall {
8085	c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8086	c.project = project
8087	c.instance = instance
8088	c.databaseinstance = databaseinstance
8089	return c
8090}
8091
8092// Fields allows partial responses to be retrieved. See
8093// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8094// for more information.
8095func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall {
8096	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8097	return c
8098}
8099
8100// Context sets the context to be used in this call's Do method. Any
8101// pending HTTP request will be aborted if the provided context is
8102// canceled.
8103func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall {
8104	c.ctx_ = ctx
8105	return c
8106}
8107
8108// Header returns an http.Header that can be modified by the caller to
8109// add HTTP headers to the request.
8110func (c *InstancesPatchCall) Header() http.Header {
8111	if c.header_ == nil {
8112		c.header_ = make(http.Header)
8113	}
8114	return c.header_
8115}
8116
8117func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) {
8118	reqHeaders := make(http.Header)
8119	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
8120	for k, v := range c.header_ {
8121		reqHeaders[k] = v
8122	}
8123	reqHeaders.Set("User-Agent", c.s.userAgent())
8124	var body io.Reader = nil
8125	body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
8126	if err != nil {
8127		return nil, err
8128	}
8129	reqHeaders.Set("Content-Type", "application/json")
8130	c.urlParams_.Set("alt", alt)
8131	c.urlParams_.Set("prettyPrint", "false")
8132	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}")
8133	urls += "?" + c.urlParams_.Encode()
8134	req, err := http.NewRequest("PATCH", urls, body)
8135	if err != nil {
8136		return nil, err
8137	}
8138	req.Header = reqHeaders
8139	googleapi.Expand(req.URL, map[string]string{
8140		"project":  c.project,
8141		"instance": c.instance,
8142	})
8143	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8144}
8145
8146// Do executes the "sql.instances.patch" call.
8147// Exactly one of *Operation or error will be non-nil. Any non-2xx
8148// status code is an error. Response headers are in either
8149// *Operation.ServerResponse.Header or (if a response was returned at
8150// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8151// to check whether the returned error was because
8152// http.StatusNotModified was returned.
8153func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8154	gensupport.SetOptions(c.urlParams_, opts...)
8155	res, err := c.doRequest("json")
8156	if res != nil && res.StatusCode == http.StatusNotModified {
8157		if res.Body != nil {
8158			res.Body.Close()
8159		}
8160		return nil, &googleapi.Error{
8161			Code:   res.StatusCode,
8162			Header: res.Header,
8163		}
8164	}
8165	if err != nil {
8166		return nil, err
8167	}
8168	defer googleapi.CloseBody(res)
8169	if err := googleapi.CheckResponse(res); err != nil {
8170		return nil, err
8171	}
8172	ret := &Operation{
8173		ServerResponse: googleapi.ServerResponse{
8174			Header:         res.Header,
8175			HTTPStatusCode: res.StatusCode,
8176		},
8177	}
8178	target := &ret
8179	if err := gensupport.DecodeResponse(target, res); err != nil {
8180		return nil, err
8181	}
8182	return ret, nil
8183	// {
8184	//   "description": "Updates settings of a Cloud SQL instance. This method supports patch semantics.",
8185	//   "flatPath": "v1/projects/{project}/instances/{instance}",
8186	//   "httpMethod": "PATCH",
8187	//   "id": "sql.instances.patch",
8188	//   "parameterOrder": [
8189	//     "project",
8190	//     "instance"
8191	//   ],
8192	//   "parameters": {
8193	//     "instance": {
8194	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8195	//       "location": "path",
8196	//       "required": true,
8197	//       "type": "string"
8198	//     },
8199	//     "project": {
8200	//       "description": "Project ID of the project that contains the instance.",
8201	//       "location": "path",
8202	//       "required": true,
8203	//       "type": "string"
8204	//     }
8205	//   },
8206	//   "path": "v1/projects/{project}/instances/{instance}",
8207	//   "request": {
8208	//     "$ref": "DatabaseInstance"
8209	//   },
8210	//   "response": {
8211	//     "$ref": "Operation"
8212	//   },
8213	//   "scopes": [
8214	//     "https://www.googleapis.com/auth/cloud-platform",
8215	//     "https://www.googleapis.com/auth/sqlservice.admin"
8216	//   ]
8217	// }
8218
8219}
8220
8221// method id "sql.instances.promoteReplica":
8222
8223type InstancesPromoteReplicaCall struct {
8224	s          *Service
8225	project    string
8226	instance   string
8227	urlParams_ gensupport.URLParams
8228	ctx_       context.Context
8229	header_    http.Header
8230}
8231
8232// PromoteReplica: Promotes the read replica instance to be a
8233// stand-alone Cloud SQL instance. Using this operation might cause your
8234// instance to restart.
8235//
8236// - instance: Cloud SQL read replica instance name.
8237// - project: ID of the project that contains the read replica.
8238func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall {
8239	c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8240	c.project = project
8241	c.instance = instance
8242	return c
8243}
8244
8245// Fields allows partial responses to be retrieved. See
8246// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8247// for more information.
8248func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall {
8249	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8250	return c
8251}
8252
8253// Context sets the context to be used in this call's Do method. Any
8254// pending HTTP request will be aborted if the provided context is
8255// canceled.
8256func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall {
8257	c.ctx_ = ctx
8258	return c
8259}
8260
8261// Header returns an http.Header that can be modified by the caller to
8262// add HTTP headers to the request.
8263func (c *InstancesPromoteReplicaCall) Header() http.Header {
8264	if c.header_ == nil {
8265		c.header_ = make(http.Header)
8266	}
8267	return c.header_
8268}
8269
8270func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) {
8271	reqHeaders := make(http.Header)
8272	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
8273	for k, v := range c.header_ {
8274		reqHeaders[k] = v
8275	}
8276	reqHeaders.Set("User-Agent", c.s.userAgent())
8277	var body io.Reader = nil
8278	c.urlParams_.Set("alt", alt)
8279	c.urlParams_.Set("prettyPrint", "false")
8280	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/promoteReplica")
8281	urls += "?" + c.urlParams_.Encode()
8282	req, err := http.NewRequest("POST", urls, body)
8283	if err != nil {
8284		return nil, err
8285	}
8286	req.Header = reqHeaders
8287	googleapi.Expand(req.URL, map[string]string{
8288		"project":  c.project,
8289		"instance": c.instance,
8290	})
8291	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8292}
8293
8294// Do executes the "sql.instances.promoteReplica" call.
8295// Exactly one of *Operation or error will be non-nil. Any non-2xx
8296// status code is an error. Response headers are in either
8297// *Operation.ServerResponse.Header or (if a response was returned at
8298// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8299// to check whether the returned error was because
8300// http.StatusNotModified was returned.
8301func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8302	gensupport.SetOptions(c.urlParams_, opts...)
8303	res, err := c.doRequest("json")
8304	if res != nil && res.StatusCode == http.StatusNotModified {
8305		if res.Body != nil {
8306			res.Body.Close()
8307		}
8308		return nil, &googleapi.Error{
8309			Code:   res.StatusCode,
8310			Header: res.Header,
8311		}
8312	}
8313	if err != nil {
8314		return nil, err
8315	}
8316	defer googleapi.CloseBody(res)
8317	if err := googleapi.CheckResponse(res); err != nil {
8318		return nil, err
8319	}
8320	ret := &Operation{
8321		ServerResponse: googleapi.ServerResponse{
8322			Header:         res.Header,
8323			HTTPStatusCode: res.StatusCode,
8324		},
8325	}
8326	target := &ret
8327	if err := gensupport.DecodeResponse(target, res); err != nil {
8328		return nil, err
8329	}
8330	return ret, nil
8331	// {
8332	//   "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart.",
8333	//   "flatPath": "v1/projects/{project}/instances/{instance}/promoteReplica",
8334	//   "httpMethod": "POST",
8335	//   "id": "sql.instances.promoteReplica",
8336	//   "parameterOrder": [
8337	//     "project",
8338	//     "instance"
8339	//   ],
8340	//   "parameters": {
8341	//     "instance": {
8342	//       "description": "Cloud SQL read replica instance name.",
8343	//       "location": "path",
8344	//       "required": true,
8345	//       "type": "string"
8346	//     },
8347	//     "project": {
8348	//       "description": "ID of the project that contains the read replica.",
8349	//       "location": "path",
8350	//       "required": true,
8351	//       "type": "string"
8352	//     }
8353	//   },
8354	//   "path": "v1/projects/{project}/instances/{instance}/promoteReplica",
8355	//   "response": {
8356	//     "$ref": "Operation"
8357	//   },
8358	//   "scopes": [
8359	//     "https://www.googleapis.com/auth/cloud-platform",
8360	//     "https://www.googleapis.com/auth/sqlservice.admin"
8361	//   ]
8362	// }
8363
8364}
8365
8366// method id "sql.instances.resetSslConfig":
8367
8368type InstancesResetSslConfigCall struct {
8369	s          *Service
8370	project    string
8371	instance   string
8372	urlParams_ gensupport.URLParams
8373	ctx_       context.Context
8374	header_    http.Header
8375}
8376
8377// ResetSslConfig: Deletes all client certificates and generates a new
8378// server SSL certificate for the instance.
8379//
8380// - instance: Cloud SQL instance ID. This does not include the project
8381//   ID.
8382// - project: Project ID of the project that contains the instance.
8383func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall {
8384	c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8385	c.project = project
8386	c.instance = instance
8387	return c
8388}
8389
8390// Fields allows partial responses to be retrieved. See
8391// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8392// for more information.
8393func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall {
8394	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8395	return c
8396}
8397
8398// Context sets the context to be used in this call's Do method. Any
8399// pending HTTP request will be aborted if the provided context is
8400// canceled.
8401func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall {
8402	c.ctx_ = ctx
8403	return c
8404}
8405
8406// Header returns an http.Header that can be modified by the caller to
8407// add HTTP headers to the request.
8408func (c *InstancesResetSslConfigCall) Header() http.Header {
8409	if c.header_ == nil {
8410		c.header_ = make(http.Header)
8411	}
8412	return c.header_
8413}
8414
8415func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) {
8416	reqHeaders := make(http.Header)
8417	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
8418	for k, v := range c.header_ {
8419		reqHeaders[k] = v
8420	}
8421	reqHeaders.Set("User-Agent", c.s.userAgent())
8422	var body io.Reader = nil
8423	c.urlParams_.Set("alt", alt)
8424	c.urlParams_.Set("prettyPrint", "false")
8425	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/resetSslConfig")
8426	urls += "?" + c.urlParams_.Encode()
8427	req, err := http.NewRequest("POST", urls, body)
8428	if err != nil {
8429		return nil, err
8430	}
8431	req.Header = reqHeaders
8432	googleapi.Expand(req.URL, map[string]string{
8433		"project":  c.project,
8434		"instance": c.instance,
8435	})
8436	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8437}
8438
8439// Do executes the "sql.instances.resetSslConfig" call.
8440// Exactly one of *Operation or error will be non-nil. Any non-2xx
8441// status code is an error. Response headers are in either
8442// *Operation.ServerResponse.Header or (if a response was returned at
8443// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8444// to check whether the returned error was because
8445// http.StatusNotModified was returned.
8446func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8447	gensupport.SetOptions(c.urlParams_, opts...)
8448	res, err := c.doRequest("json")
8449	if res != nil && res.StatusCode == http.StatusNotModified {
8450		if res.Body != nil {
8451			res.Body.Close()
8452		}
8453		return nil, &googleapi.Error{
8454			Code:   res.StatusCode,
8455			Header: res.Header,
8456		}
8457	}
8458	if err != nil {
8459		return nil, err
8460	}
8461	defer googleapi.CloseBody(res)
8462	if err := googleapi.CheckResponse(res); err != nil {
8463		return nil, err
8464	}
8465	ret := &Operation{
8466		ServerResponse: googleapi.ServerResponse{
8467			Header:         res.Header,
8468			HTTPStatusCode: res.StatusCode,
8469		},
8470	}
8471	target := &ret
8472	if err := gensupport.DecodeResponse(target, res); err != nil {
8473		return nil, err
8474	}
8475	return ret, nil
8476	// {
8477	//   "description": "Deletes all client certificates and generates a new server SSL certificate for the instance.",
8478	//   "flatPath": "v1/projects/{project}/instances/{instance}/resetSslConfig",
8479	//   "httpMethod": "POST",
8480	//   "id": "sql.instances.resetSslConfig",
8481	//   "parameterOrder": [
8482	//     "project",
8483	//     "instance"
8484	//   ],
8485	//   "parameters": {
8486	//     "instance": {
8487	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8488	//       "location": "path",
8489	//       "required": true,
8490	//       "type": "string"
8491	//     },
8492	//     "project": {
8493	//       "description": "Project ID of the project that contains the instance.",
8494	//       "location": "path",
8495	//       "required": true,
8496	//       "type": "string"
8497	//     }
8498	//   },
8499	//   "path": "v1/projects/{project}/instances/{instance}/resetSslConfig",
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.instances.restart":
8512
8513type InstancesRestartCall struct {
8514	s          *Service
8515	project    string
8516	instance   string
8517	urlParams_ gensupport.URLParams
8518	ctx_       context.Context
8519	header_    http.Header
8520}
8521
8522// Restart: Restarts a Cloud SQL instance.
8523//
8524// - instance: Cloud SQL instance ID. This does not include the project
8525//   ID.
8526// - project: Project ID of the project that contains the instance to be
8527//   restarted.
8528func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall {
8529	c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8530	c.project = project
8531	c.instance = instance
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 *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall {
8539	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8540	return c
8541}
8542
8543// Context sets the context to be used in this call's Do method. Any
8544// pending HTTP request will be aborted if the provided context is
8545// canceled.
8546func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall {
8547	c.ctx_ = ctx
8548	return c
8549}
8550
8551// Header returns an http.Header that can be modified by the caller to
8552// add HTTP headers to the request.
8553func (c *InstancesRestartCall) Header() http.Header {
8554	if c.header_ == nil {
8555		c.header_ = make(http.Header)
8556	}
8557	return c.header_
8558}
8559
8560func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) {
8561	reqHeaders := make(http.Header)
8562	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
8563	for k, v := range c.header_ {
8564		reqHeaders[k] = v
8565	}
8566	reqHeaders.Set("User-Agent", c.s.userAgent())
8567	var body io.Reader = nil
8568	c.urlParams_.Set("alt", alt)
8569	c.urlParams_.Set("prettyPrint", "false")
8570	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/restart")
8571	urls += "?" + c.urlParams_.Encode()
8572	req, err := http.NewRequest("POST", urls, body)
8573	if err != nil {
8574		return nil, err
8575	}
8576	req.Header = reqHeaders
8577	googleapi.Expand(req.URL, map[string]string{
8578		"project":  c.project,
8579		"instance": c.instance,
8580	})
8581	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8582}
8583
8584// Do executes the "sql.instances.restart" call.
8585// Exactly one of *Operation or error will be non-nil. Any non-2xx
8586// status code is an error. Response headers are in either
8587// *Operation.ServerResponse.Header or (if a response was returned at
8588// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8589// to check whether the returned error was because
8590// http.StatusNotModified was returned.
8591func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8592	gensupport.SetOptions(c.urlParams_, opts...)
8593	res, err := c.doRequest("json")
8594	if res != nil && res.StatusCode == http.StatusNotModified {
8595		if res.Body != nil {
8596			res.Body.Close()
8597		}
8598		return nil, &googleapi.Error{
8599			Code:   res.StatusCode,
8600			Header: res.Header,
8601		}
8602	}
8603	if err != nil {
8604		return nil, err
8605	}
8606	defer googleapi.CloseBody(res)
8607	if err := googleapi.CheckResponse(res); err != nil {
8608		return nil, err
8609	}
8610	ret := &Operation{
8611		ServerResponse: googleapi.ServerResponse{
8612			Header:         res.Header,
8613			HTTPStatusCode: res.StatusCode,
8614		},
8615	}
8616	target := &ret
8617	if err := gensupport.DecodeResponse(target, res); err != nil {
8618		return nil, err
8619	}
8620	return ret, nil
8621	// {
8622	//   "description": "Restarts a Cloud SQL instance.",
8623	//   "flatPath": "v1/projects/{project}/instances/{instance}/restart",
8624	//   "httpMethod": "POST",
8625	//   "id": "sql.instances.restart",
8626	//   "parameterOrder": [
8627	//     "project",
8628	//     "instance"
8629	//   ],
8630	//   "parameters": {
8631	//     "instance": {
8632	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8633	//       "location": "path",
8634	//       "required": true,
8635	//       "type": "string"
8636	//     },
8637	//     "project": {
8638	//       "description": "Project ID of the project that contains the instance to be restarted.",
8639	//       "location": "path",
8640	//       "required": true,
8641	//       "type": "string"
8642	//     }
8643	//   },
8644	//   "path": "v1/projects/{project}/instances/{instance}/restart",
8645	//   "response": {
8646	//     "$ref": "Operation"
8647	//   },
8648	//   "scopes": [
8649	//     "https://www.googleapis.com/auth/cloud-platform",
8650	//     "https://www.googleapis.com/auth/sqlservice.admin"
8651	//   ]
8652	// }
8653
8654}
8655
8656// method id "sql.instances.restoreBackup":
8657
8658type InstancesRestoreBackupCall struct {
8659	s                             *Service
8660	project                       string
8661	instance                      string
8662	instancesrestorebackuprequest *InstancesRestoreBackupRequest
8663	urlParams_                    gensupport.URLParams
8664	ctx_                          context.Context
8665	header_                       http.Header
8666}
8667
8668// RestoreBackup: Restores a backup of a Cloud SQL instance. Using this
8669// operation might cause your instance to restart.
8670//
8671// - instance: Cloud SQL instance ID. This does not include the project
8672//   ID.
8673// - project: Project ID of the project that contains the instance.
8674func (r *InstancesService) RestoreBackup(project string, instance string, instancesrestorebackuprequest *InstancesRestoreBackupRequest) *InstancesRestoreBackupCall {
8675	c := &InstancesRestoreBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8676	c.project = project
8677	c.instance = instance
8678	c.instancesrestorebackuprequest = instancesrestorebackuprequest
8679	return c
8680}
8681
8682// Fields allows partial responses to be retrieved. See
8683// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8684// for more information.
8685func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall {
8686	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8687	return c
8688}
8689
8690// Context sets the context to be used in this call's Do method. Any
8691// pending HTTP request will be aborted if the provided context is
8692// canceled.
8693func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall {
8694	c.ctx_ = ctx
8695	return c
8696}
8697
8698// Header returns an http.Header that can be modified by the caller to
8699// add HTTP headers to the request.
8700func (c *InstancesRestoreBackupCall) Header() http.Header {
8701	if c.header_ == nil {
8702		c.header_ = make(http.Header)
8703	}
8704	return c.header_
8705}
8706
8707func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) {
8708	reqHeaders := make(http.Header)
8709	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
8710	for k, v := range c.header_ {
8711		reqHeaders[k] = v
8712	}
8713	reqHeaders.Set("User-Agent", c.s.userAgent())
8714	var body io.Reader = nil
8715	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest)
8716	if err != nil {
8717		return nil, err
8718	}
8719	reqHeaders.Set("Content-Type", "application/json")
8720	c.urlParams_.Set("alt", alt)
8721	c.urlParams_.Set("prettyPrint", "false")
8722	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/restoreBackup")
8723	urls += "?" + c.urlParams_.Encode()
8724	req, err := http.NewRequest("POST", urls, body)
8725	if err != nil {
8726		return nil, err
8727	}
8728	req.Header = reqHeaders
8729	googleapi.Expand(req.URL, map[string]string{
8730		"project":  c.project,
8731		"instance": c.instance,
8732	})
8733	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8734}
8735
8736// Do executes the "sql.instances.restoreBackup" call.
8737// Exactly one of *Operation or error will be non-nil. Any non-2xx
8738// status code is an error. Response headers are in either
8739// *Operation.ServerResponse.Header or (if a response was returned at
8740// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8741// to check whether the returned error was because
8742// http.StatusNotModified was returned.
8743func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8744	gensupport.SetOptions(c.urlParams_, opts...)
8745	res, err := c.doRequest("json")
8746	if res != nil && res.StatusCode == http.StatusNotModified {
8747		if res.Body != nil {
8748			res.Body.Close()
8749		}
8750		return nil, &googleapi.Error{
8751			Code:   res.StatusCode,
8752			Header: res.Header,
8753		}
8754	}
8755	if err != nil {
8756		return nil, err
8757	}
8758	defer googleapi.CloseBody(res)
8759	if err := googleapi.CheckResponse(res); err != nil {
8760		return nil, err
8761	}
8762	ret := &Operation{
8763		ServerResponse: googleapi.ServerResponse{
8764			Header:         res.Header,
8765			HTTPStatusCode: res.StatusCode,
8766		},
8767	}
8768	target := &ret
8769	if err := gensupport.DecodeResponse(target, res); err != nil {
8770		return nil, err
8771	}
8772	return ret, nil
8773	// {
8774	//   "description": "Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.",
8775	//   "flatPath": "v1/projects/{project}/instances/{instance}/restoreBackup",
8776	//   "httpMethod": "POST",
8777	//   "id": "sql.instances.restoreBackup",
8778	//   "parameterOrder": [
8779	//     "project",
8780	//     "instance"
8781	//   ],
8782	//   "parameters": {
8783	//     "instance": {
8784	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8785	//       "location": "path",
8786	//       "required": true,
8787	//       "type": "string"
8788	//     },
8789	//     "project": {
8790	//       "description": "Project ID of the project that contains the instance.",
8791	//       "location": "path",
8792	//       "required": true,
8793	//       "type": "string"
8794	//     }
8795	//   },
8796	//   "path": "v1/projects/{project}/instances/{instance}/restoreBackup",
8797	//   "request": {
8798	//     "$ref": "InstancesRestoreBackupRequest"
8799	//   },
8800	//   "response": {
8801	//     "$ref": "Operation"
8802	//   },
8803	//   "scopes": [
8804	//     "https://www.googleapis.com/auth/cloud-platform",
8805	//     "https://www.googleapis.com/auth/sqlservice.admin"
8806	//   ]
8807	// }
8808
8809}
8810
8811// method id "sql.instances.rotateServerCa":
8812
8813type InstancesRotateServerCaCall struct {
8814	s                              *Service
8815	project                        string
8816	instance                       string
8817	instancesrotateservercarequest *InstancesRotateServerCaRequest
8818	urlParams_                     gensupport.URLParams
8819	ctx_                           context.Context
8820	header_                        http.Header
8821}
8822
8823// RotateServerCa: Rotates the server certificate to one signed by the
8824// Certificate Authority (CA) version previously added with the
8825// addServerCA method.
8826//
8827// - instance: Cloud SQL instance ID. This does not include the project
8828//   ID.
8829// - project: Project ID of the project that contains the instance.
8830func (r *InstancesService) RotateServerCa(project string, instance string, instancesrotateservercarequest *InstancesRotateServerCaRequest) *InstancesRotateServerCaCall {
8831	c := &InstancesRotateServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8832	c.project = project
8833	c.instance = instance
8834	c.instancesrotateservercarequest = instancesrotateservercarequest
8835	return c
8836}
8837
8838// Fields allows partial responses to be retrieved. See
8839// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8840// for more information.
8841func (c *InstancesRotateServerCaCall) Fields(s ...googleapi.Field) *InstancesRotateServerCaCall {
8842	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8843	return c
8844}
8845
8846// Context sets the context to be used in this call's Do method. Any
8847// pending HTTP request will be aborted if the provided context is
8848// canceled.
8849func (c *InstancesRotateServerCaCall) Context(ctx context.Context) *InstancesRotateServerCaCall {
8850	c.ctx_ = ctx
8851	return c
8852}
8853
8854// Header returns an http.Header that can be modified by the caller to
8855// add HTTP headers to the request.
8856func (c *InstancesRotateServerCaCall) Header() http.Header {
8857	if c.header_ == nil {
8858		c.header_ = make(http.Header)
8859	}
8860	return c.header_
8861}
8862
8863func (c *InstancesRotateServerCaCall) doRequest(alt string) (*http.Response, error) {
8864	reqHeaders := make(http.Header)
8865	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
8866	for k, v := range c.header_ {
8867		reqHeaders[k] = v
8868	}
8869	reqHeaders.Set("User-Agent", c.s.userAgent())
8870	var body io.Reader = nil
8871	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercarequest)
8872	if err != nil {
8873		return nil, err
8874	}
8875	reqHeaders.Set("Content-Type", "application/json")
8876	c.urlParams_.Set("alt", alt)
8877	c.urlParams_.Set("prettyPrint", "false")
8878	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/rotateServerCa")
8879	urls += "?" + c.urlParams_.Encode()
8880	req, err := http.NewRequest("POST", urls, body)
8881	if err != nil {
8882		return nil, err
8883	}
8884	req.Header = reqHeaders
8885	googleapi.Expand(req.URL, map[string]string{
8886		"project":  c.project,
8887		"instance": c.instance,
8888	})
8889	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8890}
8891
8892// Do executes the "sql.instances.rotateServerCa" call.
8893// Exactly one of *Operation or error will be non-nil. Any non-2xx
8894// status code is an error. Response headers are in either
8895// *Operation.ServerResponse.Header or (if a response was returned at
8896// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8897// to check whether the returned error was because
8898// http.StatusNotModified was returned.
8899func (c *InstancesRotateServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8900	gensupport.SetOptions(c.urlParams_, opts...)
8901	res, err := c.doRequest("json")
8902	if res != nil && res.StatusCode == http.StatusNotModified {
8903		if res.Body != nil {
8904			res.Body.Close()
8905		}
8906		return nil, &googleapi.Error{
8907			Code:   res.StatusCode,
8908			Header: res.Header,
8909		}
8910	}
8911	if err != nil {
8912		return nil, err
8913	}
8914	defer googleapi.CloseBody(res)
8915	if err := googleapi.CheckResponse(res); err != nil {
8916		return nil, err
8917	}
8918	ret := &Operation{
8919		ServerResponse: googleapi.ServerResponse{
8920			Header:         res.Header,
8921			HTTPStatusCode: res.StatusCode,
8922		},
8923	}
8924	target := &ret
8925	if err := gensupport.DecodeResponse(target, res); err != nil {
8926		return nil, err
8927	}
8928	return ret, nil
8929	// {
8930	//   "description": "Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.",
8931	//   "flatPath": "v1/projects/{project}/instances/{instance}/rotateServerCa",
8932	//   "httpMethod": "POST",
8933	//   "id": "sql.instances.rotateServerCa",
8934	//   "parameterOrder": [
8935	//     "project",
8936	//     "instance"
8937	//   ],
8938	//   "parameters": {
8939	//     "instance": {
8940	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
8941	//       "location": "path",
8942	//       "required": true,
8943	//       "type": "string"
8944	//     },
8945	//     "project": {
8946	//       "description": "Project ID of the project that contains the instance.",
8947	//       "location": "path",
8948	//       "required": true,
8949	//       "type": "string"
8950	//     }
8951	//   },
8952	//   "path": "v1/projects/{project}/instances/{instance}/rotateServerCa",
8953	//   "request": {
8954	//     "$ref": "InstancesRotateServerCaRequest"
8955	//   },
8956	//   "response": {
8957	//     "$ref": "Operation"
8958	//   },
8959	//   "scopes": [
8960	//     "https://www.googleapis.com/auth/cloud-platform",
8961	//     "https://www.googleapis.com/auth/sqlservice.admin"
8962	//   ]
8963	// }
8964
8965}
8966
8967// method id "sql.instances.startReplica":
8968
8969type InstancesStartReplicaCall struct {
8970	s          *Service
8971	project    string
8972	instance   string
8973	urlParams_ gensupport.URLParams
8974	ctx_       context.Context
8975	header_    http.Header
8976}
8977
8978// StartReplica: Starts the replication in the read replica instance.
8979//
8980// - instance: Cloud SQL read replica instance name.
8981// - project: ID of the project that contains the read replica.
8982func (r *InstancesService) StartReplica(project string, instance string) *InstancesStartReplicaCall {
8983	c := &InstancesStartReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8984	c.project = project
8985	c.instance = instance
8986	return c
8987}
8988
8989// Fields allows partial responses to be retrieved. See
8990// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8991// for more information.
8992func (c *InstancesStartReplicaCall) Fields(s ...googleapi.Field) *InstancesStartReplicaCall {
8993	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8994	return c
8995}
8996
8997// Context sets the context to be used in this call's Do method. Any
8998// pending HTTP request will be aborted if the provided context is
8999// canceled.
9000func (c *InstancesStartReplicaCall) Context(ctx context.Context) *InstancesStartReplicaCall {
9001	c.ctx_ = ctx
9002	return c
9003}
9004
9005// Header returns an http.Header that can be modified by the caller to
9006// add HTTP headers to the request.
9007func (c *InstancesStartReplicaCall) Header() http.Header {
9008	if c.header_ == nil {
9009		c.header_ = make(http.Header)
9010	}
9011	return c.header_
9012}
9013
9014func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) {
9015	reqHeaders := make(http.Header)
9016	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
9017	for k, v := range c.header_ {
9018		reqHeaders[k] = v
9019	}
9020	reqHeaders.Set("User-Agent", c.s.userAgent())
9021	var body io.Reader = nil
9022	c.urlParams_.Set("alt", alt)
9023	c.urlParams_.Set("prettyPrint", "false")
9024	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/startReplica")
9025	urls += "?" + c.urlParams_.Encode()
9026	req, err := http.NewRequest("POST", urls, body)
9027	if err != nil {
9028		return nil, err
9029	}
9030	req.Header = reqHeaders
9031	googleapi.Expand(req.URL, map[string]string{
9032		"project":  c.project,
9033		"instance": c.instance,
9034	})
9035	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9036}
9037
9038// Do executes the "sql.instances.startReplica" call.
9039// Exactly one of *Operation or error will be non-nil. Any non-2xx
9040// status code is an error. Response headers are in either
9041// *Operation.ServerResponse.Header or (if a response was returned at
9042// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9043// to check whether the returned error was because
9044// http.StatusNotModified was returned.
9045func (c *InstancesStartReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9046	gensupport.SetOptions(c.urlParams_, opts...)
9047	res, err := c.doRequest("json")
9048	if res != nil && res.StatusCode == http.StatusNotModified {
9049		if res.Body != nil {
9050			res.Body.Close()
9051		}
9052		return nil, &googleapi.Error{
9053			Code:   res.StatusCode,
9054			Header: res.Header,
9055		}
9056	}
9057	if err != nil {
9058		return nil, err
9059	}
9060	defer googleapi.CloseBody(res)
9061	if err := googleapi.CheckResponse(res); err != nil {
9062		return nil, err
9063	}
9064	ret := &Operation{
9065		ServerResponse: googleapi.ServerResponse{
9066			Header:         res.Header,
9067			HTTPStatusCode: res.StatusCode,
9068		},
9069	}
9070	target := &ret
9071	if err := gensupport.DecodeResponse(target, res); err != nil {
9072		return nil, err
9073	}
9074	return ret, nil
9075	// {
9076	//   "description": "Starts the replication in the read replica instance.",
9077	//   "flatPath": "v1/projects/{project}/instances/{instance}/startReplica",
9078	//   "httpMethod": "POST",
9079	//   "id": "sql.instances.startReplica",
9080	//   "parameterOrder": [
9081	//     "project",
9082	//     "instance"
9083	//   ],
9084	//   "parameters": {
9085	//     "instance": {
9086	//       "description": "Cloud SQL read replica instance name.",
9087	//       "location": "path",
9088	//       "required": true,
9089	//       "type": "string"
9090	//     },
9091	//     "project": {
9092	//       "description": "ID of the project that contains the read replica.",
9093	//       "location": "path",
9094	//       "required": true,
9095	//       "type": "string"
9096	//     }
9097	//   },
9098	//   "path": "v1/projects/{project}/instances/{instance}/startReplica",
9099	//   "response": {
9100	//     "$ref": "Operation"
9101	//   },
9102	//   "scopes": [
9103	//     "https://www.googleapis.com/auth/cloud-platform",
9104	//     "https://www.googleapis.com/auth/sqlservice.admin"
9105	//   ]
9106	// }
9107
9108}
9109
9110// method id "sql.instances.stopReplica":
9111
9112type InstancesStopReplicaCall struct {
9113	s          *Service
9114	project    string
9115	instance   string
9116	urlParams_ gensupport.URLParams
9117	ctx_       context.Context
9118	header_    http.Header
9119}
9120
9121// StopReplica: Stops the replication in the read replica instance.
9122//
9123// - instance: Cloud SQL read replica instance name.
9124// - project: ID of the project that contains the read replica.
9125func (r *InstancesService) StopReplica(project string, instance string) *InstancesStopReplicaCall {
9126	c := &InstancesStopReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9127	c.project = project
9128	c.instance = instance
9129	return c
9130}
9131
9132// Fields allows partial responses to be retrieved. See
9133// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9134// for more information.
9135func (c *InstancesStopReplicaCall) Fields(s ...googleapi.Field) *InstancesStopReplicaCall {
9136	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9137	return c
9138}
9139
9140// Context sets the context to be used in this call's Do method. Any
9141// pending HTTP request will be aborted if the provided context is
9142// canceled.
9143func (c *InstancesStopReplicaCall) Context(ctx context.Context) *InstancesStopReplicaCall {
9144	c.ctx_ = ctx
9145	return c
9146}
9147
9148// Header returns an http.Header that can be modified by the caller to
9149// add HTTP headers to the request.
9150func (c *InstancesStopReplicaCall) Header() http.Header {
9151	if c.header_ == nil {
9152		c.header_ = make(http.Header)
9153	}
9154	return c.header_
9155}
9156
9157func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) {
9158	reqHeaders := make(http.Header)
9159	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
9160	for k, v := range c.header_ {
9161		reqHeaders[k] = v
9162	}
9163	reqHeaders.Set("User-Agent", c.s.userAgent())
9164	var body io.Reader = nil
9165	c.urlParams_.Set("alt", alt)
9166	c.urlParams_.Set("prettyPrint", "false")
9167	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/stopReplica")
9168	urls += "?" + c.urlParams_.Encode()
9169	req, err := http.NewRequest("POST", urls, body)
9170	if err != nil {
9171		return nil, err
9172	}
9173	req.Header = reqHeaders
9174	googleapi.Expand(req.URL, map[string]string{
9175		"project":  c.project,
9176		"instance": c.instance,
9177	})
9178	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9179}
9180
9181// Do executes the "sql.instances.stopReplica" call.
9182// Exactly one of *Operation or error will be non-nil. Any non-2xx
9183// status code is an error. Response headers are in either
9184// *Operation.ServerResponse.Header or (if a response was returned at
9185// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9186// to check whether the returned error was because
9187// http.StatusNotModified was returned.
9188func (c *InstancesStopReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9189	gensupport.SetOptions(c.urlParams_, opts...)
9190	res, err := c.doRequest("json")
9191	if res != nil && res.StatusCode == http.StatusNotModified {
9192		if res.Body != nil {
9193			res.Body.Close()
9194		}
9195		return nil, &googleapi.Error{
9196			Code:   res.StatusCode,
9197			Header: res.Header,
9198		}
9199	}
9200	if err != nil {
9201		return nil, err
9202	}
9203	defer googleapi.CloseBody(res)
9204	if err := googleapi.CheckResponse(res); err != nil {
9205		return nil, err
9206	}
9207	ret := &Operation{
9208		ServerResponse: googleapi.ServerResponse{
9209			Header:         res.Header,
9210			HTTPStatusCode: res.StatusCode,
9211		},
9212	}
9213	target := &ret
9214	if err := gensupport.DecodeResponse(target, res); err != nil {
9215		return nil, err
9216	}
9217	return ret, nil
9218	// {
9219	//   "description": "Stops the replication in the read replica instance.",
9220	//   "flatPath": "v1/projects/{project}/instances/{instance}/stopReplica",
9221	//   "httpMethod": "POST",
9222	//   "id": "sql.instances.stopReplica",
9223	//   "parameterOrder": [
9224	//     "project",
9225	//     "instance"
9226	//   ],
9227	//   "parameters": {
9228	//     "instance": {
9229	//       "description": "Cloud SQL read replica instance name.",
9230	//       "location": "path",
9231	//       "required": true,
9232	//       "type": "string"
9233	//     },
9234	//     "project": {
9235	//       "description": "ID of the project that contains the read replica.",
9236	//       "location": "path",
9237	//       "required": true,
9238	//       "type": "string"
9239	//     }
9240	//   },
9241	//   "path": "v1/projects/{project}/instances/{instance}/stopReplica",
9242	//   "response": {
9243	//     "$ref": "Operation"
9244	//   },
9245	//   "scopes": [
9246	//     "https://www.googleapis.com/auth/cloud-platform",
9247	//     "https://www.googleapis.com/auth/sqlservice.admin"
9248	//   ]
9249	// }
9250
9251}
9252
9253// method id "sql.instances.truncateLog":
9254
9255type InstancesTruncateLogCall struct {
9256	s                           *Service
9257	project                     string
9258	instance                    string
9259	instancestruncatelogrequest *InstancesTruncateLogRequest
9260	urlParams_                  gensupport.URLParams
9261	ctx_                        context.Context
9262	header_                     http.Header
9263}
9264
9265// TruncateLog: Truncate MySQL general and slow query log tables MySQL
9266// only.
9267//
9268// - instance: Cloud SQL instance ID. This does not include the project
9269//   ID.
9270// - project: Project ID of the Cloud SQL project.
9271func (r *InstancesService) TruncateLog(project string, instance string, instancestruncatelogrequest *InstancesTruncateLogRequest) *InstancesTruncateLogCall {
9272	c := &InstancesTruncateLogCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9273	c.project = project
9274	c.instance = instance
9275	c.instancestruncatelogrequest = instancestruncatelogrequest
9276	return c
9277}
9278
9279// Fields allows partial responses to be retrieved. See
9280// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9281// for more information.
9282func (c *InstancesTruncateLogCall) Fields(s ...googleapi.Field) *InstancesTruncateLogCall {
9283	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9284	return c
9285}
9286
9287// Context sets the context to be used in this call's Do method. Any
9288// pending HTTP request will be aborted if the provided context is
9289// canceled.
9290func (c *InstancesTruncateLogCall) Context(ctx context.Context) *InstancesTruncateLogCall {
9291	c.ctx_ = ctx
9292	return c
9293}
9294
9295// Header returns an http.Header that can be modified by the caller to
9296// add HTTP headers to the request.
9297func (c *InstancesTruncateLogCall) Header() http.Header {
9298	if c.header_ == nil {
9299		c.header_ = make(http.Header)
9300	}
9301	return c.header_
9302}
9303
9304func (c *InstancesTruncateLogCall) doRequest(alt string) (*http.Response, error) {
9305	reqHeaders := make(http.Header)
9306	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
9307	for k, v := range c.header_ {
9308		reqHeaders[k] = v
9309	}
9310	reqHeaders.Set("User-Agent", c.s.userAgent())
9311	var body io.Reader = nil
9312	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancestruncatelogrequest)
9313	if err != nil {
9314		return nil, err
9315	}
9316	reqHeaders.Set("Content-Type", "application/json")
9317	c.urlParams_.Set("alt", alt)
9318	c.urlParams_.Set("prettyPrint", "false")
9319	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/truncateLog")
9320	urls += "?" + c.urlParams_.Encode()
9321	req, err := http.NewRequest("POST", urls, body)
9322	if err != nil {
9323		return nil, err
9324	}
9325	req.Header = reqHeaders
9326	googleapi.Expand(req.URL, map[string]string{
9327		"project":  c.project,
9328		"instance": c.instance,
9329	})
9330	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9331}
9332
9333// Do executes the "sql.instances.truncateLog" call.
9334// Exactly one of *Operation or error will be non-nil. Any non-2xx
9335// status code is an error. Response headers are in either
9336// *Operation.ServerResponse.Header or (if a response was returned at
9337// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9338// to check whether the returned error was because
9339// http.StatusNotModified was returned.
9340func (c *InstancesTruncateLogCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9341	gensupport.SetOptions(c.urlParams_, opts...)
9342	res, err := c.doRequest("json")
9343	if res != nil && res.StatusCode == http.StatusNotModified {
9344		if res.Body != nil {
9345			res.Body.Close()
9346		}
9347		return nil, &googleapi.Error{
9348			Code:   res.StatusCode,
9349			Header: res.Header,
9350		}
9351	}
9352	if err != nil {
9353		return nil, err
9354	}
9355	defer googleapi.CloseBody(res)
9356	if err := googleapi.CheckResponse(res); err != nil {
9357		return nil, err
9358	}
9359	ret := &Operation{
9360		ServerResponse: googleapi.ServerResponse{
9361			Header:         res.Header,
9362			HTTPStatusCode: res.StatusCode,
9363		},
9364	}
9365	target := &ret
9366	if err := gensupport.DecodeResponse(target, res); err != nil {
9367		return nil, err
9368	}
9369	return ret, nil
9370	// {
9371	//   "description": "Truncate MySQL general and slow query log tables MySQL only.",
9372	//   "flatPath": "v1/projects/{project}/instances/{instance}/truncateLog",
9373	//   "httpMethod": "POST",
9374	//   "id": "sql.instances.truncateLog",
9375	//   "parameterOrder": [
9376	//     "project",
9377	//     "instance"
9378	//   ],
9379	//   "parameters": {
9380	//     "instance": {
9381	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
9382	//       "location": "path",
9383	//       "required": true,
9384	//       "type": "string"
9385	//     },
9386	//     "project": {
9387	//       "description": "Project ID of the Cloud SQL project.",
9388	//       "location": "path",
9389	//       "required": true,
9390	//       "type": "string"
9391	//     }
9392	//   },
9393	//   "path": "v1/projects/{project}/instances/{instance}/truncateLog",
9394	//   "request": {
9395	//     "$ref": "InstancesTruncateLogRequest"
9396	//   },
9397	//   "response": {
9398	//     "$ref": "Operation"
9399	//   },
9400	//   "scopes": [
9401	//     "https://www.googleapis.com/auth/cloud-platform",
9402	//     "https://www.googleapis.com/auth/sqlservice.admin"
9403	//   ]
9404	// }
9405
9406}
9407
9408// method id "sql.instances.update":
9409
9410type InstancesUpdateCall struct {
9411	s                *Service
9412	project          string
9413	instance         string
9414	databaseinstance *DatabaseInstance
9415	urlParams_       gensupport.URLParams
9416	ctx_             context.Context
9417	header_          http.Header
9418}
9419
9420// Update: Updates settings of a Cloud SQL instance. Using this
9421// operation might cause your instance to restart.
9422//
9423// - instance: Cloud SQL instance ID. This does not include the project
9424//   ID.
9425// - project: Project ID of the project that contains the instance.
9426func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall {
9427	c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9428	c.project = project
9429	c.instance = instance
9430	c.databaseinstance = databaseinstance
9431	return c
9432}
9433
9434// Fields allows partial responses to be retrieved. See
9435// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9436// for more information.
9437func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall {
9438	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9439	return c
9440}
9441
9442// Context sets the context to be used in this call's Do method. Any
9443// pending HTTP request will be aborted if the provided context is
9444// canceled.
9445func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall {
9446	c.ctx_ = ctx
9447	return c
9448}
9449
9450// Header returns an http.Header that can be modified by the caller to
9451// add HTTP headers to the request.
9452func (c *InstancesUpdateCall) Header() http.Header {
9453	if c.header_ == nil {
9454		c.header_ = make(http.Header)
9455	}
9456	return c.header_
9457}
9458
9459func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) {
9460	reqHeaders := make(http.Header)
9461	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
9462	for k, v := range c.header_ {
9463		reqHeaders[k] = v
9464	}
9465	reqHeaders.Set("User-Agent", c.s.userAgent())
9466	var body io.Reader = nil
9467	body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
9468	if err != nil {
9469		return nil, err
9470	}
9471	reqHeaders.Set("Content-Type", "application/json")
9472	c.urlParams_.Set("alt", alt)
9473	c.urlParams_.Set("prettyPrint", "false")
9474	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}")
9475	urls += "?" + c.urlParams_.Encode()
9476	req, err := http.NewRequest("PUT", urls, body)
9477	if err != nil {
9478		return nil, err
9479	}
9480	req.Header = reqHeaders
9481	googleapi.Expand(req.URL, map[string]string{
9482		"project":  c.project,
9483		"instance": c.instance,
9484	})
9485	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9486}
9487
9488// Do executes the "sql.instances.update" call.
9489// Exactly one of *Operation or error will be non-nil. Any non-2xx
9490// status code is an error. Response headers are in either
9491// *Operation.ServerResponse.Header or (if a response was returned at
9492// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9493// to check whether the returned error was because
9494// http.StatusNotModified was returned.
9495func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9496	gensupport.SetOptions(c.urlParams_, opts...)
9497	res, err := c.doRequest("json")
9498	if res != nil && res.StatusCode == http.StatusNotModified {
9499		if res.Body != nil {
9500			res.Body.Close()
9501		}
9502		return nil, &googleapi.Error{
9503			Code:   res.StatusCode,
9504			Header: res.Header,
9505		}
9506	}
9507	if err != nil {
9508		return nil, err
9509	}
9510	defer googleapi.CloseBody(res)
9511	if err := googleapi.CheckResponse(res); err != nil {
9512		return nil, err
9513	}
9514	ret := &Operation{
9515		ServerResponse: googleapi.ServerResponse{
9516			Header:         res.Header,
9517			HTTPStatusCode: res.StatusCode,
9518		},
9519	}
9520	target := &ret
9521	if err := gensupport.DecodeResponse(target, res); err != nil {
9522		return nil, err
9523	}
9524	return ret, nil
9525	// {
9526	//   "description": "Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.",
9527	//   "flatPath": "v1/projects/{project}/instances/{instance}",
9528	//   "httpMethod": "PUT",
9529	//   "id": "sql.instances.update",
9530	//   "parameterOrder": [
9531	//     "project",
9532	//     "instance"
9533	//   ],
9534	//   "parameters": {
9535	//     "instance": {
9536	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
9537	//       "location": "path",
9538	//       "required": true,
9539	//       "type": "string"
9540	//     },
9541	//     "project": {
9542	//       "description": "Project ID of the project that contains the instance.",
9543	//       "location": "path",
9544	//       "required": true,
9545	//       "type": "string"
9546	//     }
9547	//   },
9548	//   "path": "v1/projects/{project}/instances/{instance}",
9549	//   "request": {
9550	//     "$ref": "DatabaseInstance"
9551	//   },
9552	//   "response": {
9553	//     "$ref": "Operation"
9554	//   },
9555	//   "scopes": [
9556	//     "https://www.googleapis.com/auth/cloud-platform",
9557	//     "https://www.googleapis.com/auth/sqlservice.admin"
9558	//   ]
9559	// }
9560
9561}
9562
9563// method id "sql.operations.get":
9564
9565type OperationsGetCall struct {
9566	s            *Service
9567	project      string
9568	operation    string
9569	urlParams_   gensupport.URLParams
9570	ifNoneMatch_ string
9571	ctx_         context.Context
9572	header_      http.Header
9573}
9574
9575// Get: Retrieves an instance operation that has been performed on an
9576// instance.
9577//
9578// - operation: Instance operation ID.
9579// - project: Project ID of the project that contains the instance.
9580func (r *OperationsService) Get(project string, operation string) *OperationsGetCall {
9581	c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9582	c.project = project
9583	c.operation = operation
9584	return c
9585}
9586
9587// Fields allows partial responses to be retrieved. See
9588// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9589// for more information.
9590func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
9591	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9592	return c
9593}
9594
9595// IfNoneMatch sets the optional parameter which makes the operation
9596// fail if the object's ETag matches the given value. This is useful for
9597// getting updates only after the object has changed since the last
9598// request. Use googleapi.IsNotModified to check whether the response
9599// error from Do is the result of In-None-Match.
9600func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
9601	c.ifNoneMatch_ = entityTag
9602	return c
9603}
9604
9605// Context sets the context to be used in this call's Do method. Any
9606// pending HTTP request will be aborted if the provided context is
9607// canceled.
9608func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
9609	c.ctx_ = ctx
9610	return c
9611}
9612
9613// Header returns an http.Header that can be modified by the caller to
9614// add HTTP headers to the request.
9615func (c *OperationsGetCall) Header() http.Header {
9616	if c.header_ == nil {
9617		c.header_ = make(http.Header)
9618	}
9619	return c.header_
9620}
9621
9622func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
9623	reqHeaders := make(http.Header)
9624	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
9625	for k, v := range c.header_ {
9626		reqHeaders[k] = v
9627	}
9628	reqHeaders.Set("User-Agent", c.s.userAgent())
9629	if c.ifNoneMatch_ != "" {
9630		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9631	}
9632	var body io.Reader = nil
9633	c.urlParams_.Set("alt", alt)
9634	c.urlParams_.Set("prettyPrint", "false")
9635	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/operations/{operation}")
9636	urls += "?" + c.urlParams_.Encode()
9637	req, err := http.NewRequest("GET", urls, body)
9638	if err != nil {
9639		return nil, err
9640	}
9641	req.Header = reqHeaders
9642	googleapi.Expand(req.URL, map[string]string{
9643		"project":   c.project,
9644		"operation": c.operation,
9645	})
9646	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9647}
9648
9649// Do executes the "sql.operations.get" call.
9650// Exactly one of *Operation or error will be non-nil. Any non-2xx
9651// status code is an error. Response headers are in either
9652// *Operation.ServerResponse.Header or (if a response was returned at
9653// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9654// to check whether the returned error was because
9655// http.StatusNotModified was returned.
9656func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9657	gensupport.SetOptions(c.urlParams_, opts...)
9658	res, err := c.doRequest("json")
9659	if res != nil && res.StatusCode == http.StatusNotModified {
9660		if res.Body != nil {
9661			res.Body.Close()
9662		}
9663		return nil, &googleapi.Error{
9664			Code:   res.StatusCode,
9665			Header: res.Header,
9666		}
9667	}
9668	if err != nil {
9669		return nil, err
9670	}
9671	defer googleapi.CloseBody(res)
9672	if err := googleapi.CheckResponse(res); err != nil {
9673		return nil, err
9674	}
9675	ret := &Operation{
9676		ServerResponse: googleapi.ServerResponse{
9677			Header:         res.Header,
9678			HTTPStatusCode: res.StatusCode,
9679		},
9680	}
9681	target := &ret
9682	if err := gensupport.DecodeResponse(target, res); err != nil {
9683		return nil, err
9684	}
9685	return ret, nil
9686	// {
9687	//   "description": "Retrieves an instance operation that has been performed on an instance.",
9688	//   "flatPath": "v1/projects/{project}/operations/{operation}",
9689	//   "httpMethod": "GET",
9690	//   "id": "sql.operations.get",
9691	//   "parameterOrder": [
9692	//     "project",
9693	//     "operation"
9694	//   ],
9695	//   "parameters": {
9696	//     "operation": {
9697	//       "description": "Instance operation ID.",
9698	//       "location": "path",
9699	//       "required": true,
9700	//       "type": "string"
9701	//     },
9702	//     "project": {
9703	//       "description": "Project ID of the project that contains the instance.",
9704	//       "location": "path",
9705	//       "required": true,
9706	//       "type": "string"
9707	//     }
9708	//   },
9709	//   "path": "v1/projects/{project}/operations/{operation}",
9710	//   "response": {
9711	//     "$ref": "Operation"
9712	//   },
9713	//   "scopes": [
9714	//     "https://www.googleapis.com/auth/cloud-platform",
9715	//     "https://www.googleapis.com/auth/sqlservice.admin"
9716	//   ]
9717	// }
9718
9719}
9720
9721// method id "sql.operations.list":
9722
9723type OperationsListCall struct {
9724	s            *Service
9725	project      string
9726	urlParams_   gensupport.URLParams
9727	ifNoneMatch_ string
9728	ctx_         context.Context
9729	header_      http.Header
9730}
9731
9732// List: Lists all instance operations that have been performed on the
9733// given Cloud SQL instance in the reverse chronological order of the
9734// start time.
9735//
9736// - project: Project ID of the project that contains the instance.
9737func (r *OperationsService) List(project string) *OperationsListCall {
9738	c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9739	c.project = project
9740	return c
9741}
9742
9743// Instance sets the optional parameter "instance": Cloud SQL instance
9744// ID. This does not include the project ID.
9745func (c *OperationsListCall) Instance(instance string) *OperationsListCall {
9746	c.urlParams_.Set("instance", instance)
9747	return c
9748}
9749
9750// MaxResults sets the optional parameter "maxResults": Maximum number
9751// of operations per response.
9752func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall {
9753	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
9754	return c
9755}
9756
9757// PageToken sets the optional parameter "pageToken": A
9758// previously-returned page token representing part of the larger set of
9759// results to view.
9760func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
9761	c.urlParams_.Set("pageToken", pageToken)
9762	return c
9763}
9764
9765// Fields allows partial responses to be retrieved. See
9766// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9767// for more information.
9768func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
9769	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9770	return c
9771}
9772
9773// IfNoneMatch sets the optional parameter which makes the operation
9774// fail if the object's ETag matches the given value. This is useful for
9775// getting updates only after the object has changed since the last
9776// request. Use googleapi.IsNotModified to check whether the response
9777// error from Do is the result of In-None-Match.
9778func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
9779	c.ifNoneMatch_ = entityTag
9780	return c
9781}
9782
9783// Context sets the context to be used in this call's Do method. Any
9784// pending HTTP request will be aborted if the provided context is
9785// canceled.
9786func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
9787	c.ctx_ = ctx
9788	return c
9789}
9790
9791// Header returns an http.Header that can be modified by the caller to
9792// add HTTP headers to the request.
9793func (c *OperationsListCall) Header() http.Header {
9794	if c.header_ == nil {
9795		c.header_ = make(http.Header)
9796	}
9797	return c.header_
9798}
9799
9800func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
9801	reqHeaders := make(http.Header)
9802	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
9803	for k, v := range c.header_ {
9804		reqHeaders[k] = v
9805	}
9806	reqHeaders.Set("User-Agent", c.s.userAgent())
9807	if c.ifNoneMatch_ != "" {
9808		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9809	}
9810	var body io.Reader = nil
9811	c.urlParams_.Set("alt", alt)
9812	c.urlParams_.Set("prettyPrint", "false")
9813	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/operations")
9814	urls += "?" + c.urlParams_.Encode()
9815	req, err := http.NewRequest("GET", urls, body)
9816	if err != nil {
9817		return nil, err
9818	}
9819	req.Header = reqHeaders
9820	googleapi.Expand(req.URL, map[string]string{
9821		"project": c.project,
9822	})
9823	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9824}
9825
9826// Do executes the "sql.operations.list" call.
9827// Exactly one of *OperationsListResponse or error will be non-nil. Any
9828// non-2xx status code is an error. Response headers are in either
9829// *OperationsListResponse.ServerResponse.Header or (if a response was
9830// returned at all) in error.(*googleapi.Error).Header. Use
9831// googleapi.IsNotModified to check whether the returned error was
9832// because http.StatusNotModified was returned.
9833func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) {
9834	gensupport.SetOptions(c.urlParams_, opts...)
9835	res, err := c.doRequest("json")
9836	if res != nil && res.StatusCode == http.StatusNotModified {
9837		if res.Body != nil {
9838			res.Body.Close()
9839		}
9840		return nil, &googleapi.Error{
9841			Code:   res.StatusCode,
9842			Header: res.Header,
9843		}
9844	}
9845	if err != nil {
9846		return nil, err
9847	}
9848	defer googleapi.CloseBody(res)
9849	if err := googleapi.CheckResponse(res); err != nil {
9850		return nil, err
9851	}
9852	ret := &OperationsListResponse{
9853		ServerResponse: googleapi.ServerResponse{
9854			Header:         res.Header,
9855			HTTPStatusCode: res.StatusCode,
9856		},
9857	}
9858	target := &ret
9859	if err := gensupport.DecodeResponse(target, res); err != nil {
9860		return nil, err
9861	}
9862	return ret, nil
9863	// {
9864	//   "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.",
9865	//   "flatPath": "v1/projects/{project}/operations",
9866	//   "httpMethod": "GET",
9867	//   "id": "sql.operations.list",
9868	//   "parameterOrder": [
9869	//     "project"
9870	//   ],
9871	//   "parameters": {
9872	//     "instance": {
9873	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
9874	//       "location": "query",
9875	//       "type": "string"
9876	//     },
9877	//     "maxResults": {
9878	//       "description": "Maximum number of operations per response.",
9879	//       "format": "uint32",
9880	//       "location": "query",
9881	//       "type": "integer"
9882	//     },
9883	//     "pageToken": {
9884	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
9885	//       "location": "query",
9886	//       "type": "string"
9887	//     },
9888	//     "project": {
9889	//       "description": "Project ID of the project that contains the instance.",
9890	//       "location": "path",
9891	//       "required": true,
9892	//       "type": "string"
9893	//     }
9894	//   },
9895	//   "path": "v1/projects/{project}/operations",
9896	//   "response": {
9897	//     "$ref": "OperationsListResponse"
9898	//   },
9899	//   "scopes": [
9900	//     "https://www.googleapis.com/auth/cloud-platform",
9901	//     "https://www.googleapis.com/auth/sqlservice.admin"
9902	//   ]
9903	// }
9904
9905}
9906
9907// Pages invokes f for each page of results.
9908// A non-nil error returned from f will halt the iteration.
9909// The provided context supersedes any context provided to the Context method.
9910func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error {
9911	c.ctx_ = ctx
9912	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
9913	for {
9914		x, err := c.Do()
9915		if err != nil {
9916			return err
9917		}
9918		if err := f(x); err != nil {
9919			return err
9920		}
9921		if x.NextPageToken == "" {
9922			return nil
9923		}
9924		c.PageToken(x.NextPageToken)
9925	}
9926}
9927
9928// method id "sql.projects.instances.rescheduleMaintenance":
9929
9930type ProjectsInstancesRescheduleMaintenanceCall struct {
9931	s                                            *Service
9932	project                                      string
9933	instance                                     string
9934	sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody
9935	urlParams_                                   gensupport.URLParams
9936	ctx_                                         context.Context
9937	header_                                      http.Header
9938}
9939
9940// RescheduleMaintenance: Reschedules the maintenance on the given
9941// instance.
9942//
9943// - instance: Cloud SQL instance ID. This does not include the project
9944//   ID.
9945// - project: ID of the project that contains the instance.
9946func (r *ProjectsInstancesService) RescheduleMaintenance(project string, instance string, sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody) *ProjectsInstancesRescheduleMaintenanceCall {
9947	c := &ProjectsInstancesRescheduleMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9948	c.project = project
9949	c.instance = instance
9950	c.sqlinstancesreschedulemaintenancerequestbody = sqlinstancesreschedulemaintenancerequestbody
9951	return c
9952}
9953
9954// Fields allows partial responses to be retrieved. See
9955// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9956// for more information.
9957func (c *ProjectsInstancesRescheduleMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsInstancesRescheduleMaintenanceCall {
9958	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9959	return c
9960}
9961
9962// Context sets the context to be used in this call's Do method. Any
9963// pending HTTP request will be aborted if the provided context is
9964// canceled.
9965func (c *ProjectsInstancesRescheduleMaintenanceCall) Context(ctx context.Context) *ProjectsInstancesRescheduleMaintenanceCall {
9966	c.ctx_ = ctx
9967	return c
9968}
9969
9970// Header returns an http.Header that can be modified by the caller to
9971// add HTTP headers to the request.
9972func (c *ProjectsInstancesRescheduleMaintenanceCall) Header() http.Header {
9973	if c.header_ == nil {
9974		c.header_ = make(http.Header)
9975	}
9976	return c.header_
9977}
9978
9979func (c *ProjectsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) {
9980	reqHeaders := make(http.Header)
9981	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
9982	for k, v := range c.header_ {
9983		reqHeaders[k] = v
9984	}
9985	reqHeaders.Set("User-Agent", c.s.userAgent())
9986	var body io.Reader = nil
9987	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesreschedulemaintenancerequestbody)
9988	if err != nil {
9989		return nil, err
9990	}
9991	reqHeaders.Set("Content-Type", "application/json")
9992	c.urlParams_.Set("alt", alt)
9993	c.urlParams_.Set("prettyPrint", "false")
9994	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/rescheduleMaintenance")
9995	urls += "?" + c.urlParams_.Encode()
9996	req, err := http.NewRequest("POST", urls, body)
9997	if err != nil {
9998		return nil, err
9999	}
10000	req.Header = reqHeaders
10001	googleapi.Expand(req.URL, map[string]string{
10002		"project":  c.project,
10003		"instance": c.instance,
10004	})
10005	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10006}
10007
10008// Do executes the "sql.projects.instances.rescheduleMaintenance" call.
10009// Exactly one of *Operation or error will be non-nil. Any non-2xx
10010// status code is an error. Response headers are in either
10011// *Operation.ServerResponse.Header or (if a response was returned at
10012// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10013// to check whether the returned error was because
10014// http.StatusNotModified was returned.
10015func (c *ProjectsInstancesRescheduleMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10016	gensupport.SetOptions(c.urlParams_, opts...)
10017	res, err := c.doRequest("json")
10018	if res != nil && res.StatusCode == http.StatusNotModified {
10019		if res.Body != nil {
10020			res.Body.Close()
10021		}
10022		return nil, &googleapi.Error{
10023			Code:   res.StatusCode,
10024			Header: res.Header,
10025		}
10026	}
10027	if err != nil {
10028		return nil, err
10029	}
10030	defer googleapi.CloseBody(res)
10031	if err := googleapi.CheckResponse(res); err != nil {
10032		return nil, err
10033	}
10034	ret := &Operation{
10035		ServerResponse: googleapi.ServerResponse{
10036			Header:         res.Header,
10037			HTTPStatusCode: res.StatusCode,
10038		},
10039	}
10040	target := &ret
10041	if err := gensupport.DecodeResponse(target, res); err != nil {
10042		return nil, err
10043	}
10044	return ret, nil
10045	// {
10046	//   "description": "Reschedules the maintenance on the given instance.",
10047	//   "flatPath": "v1/projects/{project}/instances/{instance}/rescheduleMaintenance",
10048	//   "httpMethod": "POST",
10049	//   "id": "sql.projects.instances.rescheduleMaintenance",
10050	//   "parameterOrder": [
10051	//     "project",
10052	//     "instance"
10053	//   ],
10054	//   "parameters": {
10055	//     "instance": {
10056	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
10057	//       "location": "path",
10058	//       "required": true,
10059	//       "type": "string"
10060	//     },
10061	//     "project": {
10062	//       "description": "ID of the project that contains the instance.",
10063	//       "location": "path",
10064	//       "required": true,
10065	//       "type": "string"
10066	//     }
10067	//   },
10068	//   "path": "v1/projects/{project}/instances/{instance}/rescheduleMaintenance",
10069	//   "request": {
10070	//     "$ref": "SqlInstancesRescheduleMaintenanceRequestBody"
10071	//   },
10072	//   "response": {
10073	//     "$ref": "Operation"
10074	//   },
10075	//   "scopes": [
10076	//     "https://www.googleapis.com/auth/cloud-platform",
10077	//     "https://www.googleapis.com/auth/sqlservice.admin"
10078	//   ]
10079	// }
10080
10081}
10082
10083// method id "sql.projects.instances.startExternalSync":
10084
10085type ProjectsInstancesStartExternalSyncCall struct {
10086	s                                    *Service
10087	project                              string
10088	instance                             string
10089	sqlinstancesstartexternalsyncrequest *SqlInstancesStartExternalSyncRequest
10090	urlParams_                           gensupport.URLParams
10091	ctx_                                 context.Context
10092	header_                              http.Header
10093}
10094
10095// StartExternalSync: Start External primary instance migration.
10096//
10097// - instance: Cloud SQL instance ID. This does not include the project
10098//   ID.
10099// - project: ID of the project that contains the instance.
10100func (r *ProjectsInstancesService) StartExternalSync(project string, instance string, sqlinstancesstartexternalsyncrequest *SqlInstancesStartExternalSyncRequest) *ProjectsInstancesStartExternalSyncCall {
10101	c := &ProjectsInstancesStartExternalSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10102	c.project = project
10103	c.instance = instance
10104	c.sqlinstancesstartexternalsyncrequest = sqlinstancesstartexternalsyncrequest
10105	return c
10106}
10107
10108// Fields allows partial responses to be retrieved. See
10109// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10110// for more information.
10111func (c *ProjectsInstancesStartExternalSyncCall) Fields(s ...googleapi.Field) *ProjectsInstancesStartExternalSyncCall {
10112	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10113	return c
10114}
10115
10116// Context sets the context to be used in this call's Do method. Any
10117// pending HTTP request will be aborted if the provided context is
10118// canceled.
10119func (c *ProjectsInstancesStartExternalSyncCall) Context(ctx context.Context) *ProjectsInstancesStartExternalSyncCall {
10120	c.ctx_ = ctx
10121	return c
10122}
10123
10124// Header returns an http.Header that can be modified by the caller to
10125// add HTTP headers to the request.
10126func (c *ProjectsInstancesStartExternalSyncCall) Header() http.Header {
10127	if c.header_ == nil {
10128		c.header_ = make(http.Header)
10129	}
10130	return c.header_
10131}
10132
10133func (c *ProjectsInstancesStartExternalSyncCall) doRequest(alt string) (*http.Response, error) {
10134	reqHeaders := make(http.Header)
10135	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
10136	for k, v := range c.header_ {
10137		reqHeaders[k] = v
10138	}
10139	reqHeaders.Set("User-Agent", c.s.userAgent())
10140	var body io.Reader = nil
10141	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesstartexternalsyncrequest)
10142	if err != nil {
10143		return nil, err
10144	}
10145	reqHeaders.Set("Content-Type", "application/json")
10146	c.urlParams_.Set("alt", alt)
10147	c.urlParams_.Set("prettyPrint", "false")
10148	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/startExternalSync")
10149	urls += "?" + c.urlParams_.Encode()
10150	req, err := http.NewRequest("POST", urls, body)
10151	if err != nil {
10152		return nil, err
10153	}
10154	req.Header = reqHeaders
10155	googleapi.Expand(req.URL, map[string]string{
10156		"project":  c.project,
10157		"instance": c.instance,
10158	})
10159	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10160}
10161
10162// Do executes the "sql.projects.instances.startExternalSync" call.
10163// Exactly one of *Operation or error will be non-nil. Any non-2xx
10164// status code is an error. Response headers are in either
10165// *Operation.ServerResponse.Header or (if a response was returned at
10166// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10167// to check whether the returned error was because
10168// http.StatusNotModified was returned.
10169func (c *ProjectsInstancesStartExternalSyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10170	gensupport.SetOptions(c.urlParams_, opts...)
10171	res, err := c.doRequest("json")
10172	if res != nil && res.StatusCode == http.StatusNotModified {
10173		if res.Body != nil {
10174			res.Body.Close()
10175		}
10176		return nil, &googleapi.Error{
10177			Code:   res.StatusCode,
10178			Header: res.Header,
10179		}
10180	}
10181	if err != nil {
10182		return nil, err
10183	}
10184	defer googleapi.CloseBody(res)
10185	if err := googleapi.CheckResponse(res); err != nil {
10186		return nil, err
10187	}
10188	ret := &Operation{
10189		ServerResponse: googleapi.ServerResponse{
10190			Header:         res.Header,
10191			HTTPStatusCode: res.StatusCode,
10192		},
10193	}
10194	target := &ret
10195	if err := gensupport.DecodeResponse(target, res); err != nil {
10196		return nil, err
10197	}
10198	return ret, nil
10199	// {
10200	//   "description": "Start External primary instance migration.",
10201	//   "flatPath": "v1/projects/{project}/instances/{instance}/startExternalSync",
10202	//   "httpMethod": "POST",
10203	//   "id": "sql.projects.instances.startExternalSync",
10204	//   "parameterOrder": [
10205	//     "project",
10206	//     "instance"
10207	//   ],
10208	//   "parameters": {
10209	//     "instance": {
10210	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
10211	//       "location": "path",
10212	//       "required": true,
10213	//       "type": "string"
10214	//     },
10215	//     "project": {
10216	//       "description": "ID of the project that contains the instance.",
10217	//       "location": "path",
10218	//       "required": true,
10219	//       "type": "string"
10220	//     }
10221	//   },
10222	//   "path": "v1/projects/{project}/instances/{instance}/startExternalSync",
10223	//   "request": {
10224	//     "$ref": "SqlInstancesStartExternalSyncRequest"
10225	//   },
10226	//   "response": {
10227	//     "$ref": "Operation"
10228	//   },
10229	//   "scopes": [
10230	//     "https://www.googleapis.com/auth/cloud-platform",
10231	//     "https://www.googleapis.com/auth/sqlservice.admin"
10232	//   ]
10233	// }
10234
10235}
10236
10237// method id "sql.projects.instances.verifyExternalSyncSettings":
10238
10239type ProjectsInstancesVerifyExternalSyncSettingsCall struct {
10240	s                                             *Service
10241	project                                       string
10242	instance                                      string
10243	sqlinstancesverifyexternalsyncsettingsrequest *SqlInstancesVerifyExternalSyncSettingsRequest
10244	urlParams_                                    gensupport.URLParams
10245	ctx_                                          context.Context
10246	header_                                       http.Header
10247}
10248
10249// VerifyExternalSyncSettings: Verify External primary instance external
10250// sync settings.
10251//
10252// - instance: Cloud SQL instance ID. This does not include the project
10253//   ID.
10254// - project: Project ID of the project that contains the instance.
10255func (r *ProjectsInstancesService) VerifyExternalSyncSettings(project string, instance string, sqlinstancesverifyexternalsyncsettingsrequest *SqlInstancesVerifyExternalSyncSettingsRequest) *ProjectsInstancesVerifyExternalSyncSettingsCall {
10256	c := &ProjectsInstancesVerifyExternalSyncSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10257	c.project = project
10258	c.instance = instance
10259	c.sqlinstancesverifyexternalsyncsettingsrequest = sqlinstancesverifyexternalsyncsettingsrequest
10260	return c
10261}
10262
10263// Fields allows partial responses to be retrieved. See
10264// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10265// for more information.
10266func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Fields(s ...googleapi.Field) *ProjectsInstancesVerifyExternalSyncSettingsCall {
10267	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10268	return c
10269}
10270
10271// Context sets the context to be used in this call's Do method. Any
10272// pending HTTP request will be aborted if the provided context is
10273// canceled.
10274func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Context(ctx context.Context) *ProjectsInstancesVerifyExternalSyncSettingsCall {
10275	c.ctx_ = ctx
10276	return c
10277}
10278
10279// Header returns an http.Header that can be modified by the caller to
10280// add HTTP headers to the request.
10281func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Header() http.Header {
10282	if c.header_ == nil {
10283		c.header_ = make(http.Header)
10284	}
10285	return c.header_
10286}
10287
10288func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) doRequest(alt string) (*http.Response, error) {
10289	reqHeaders := make(http.Header)
10290	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
10291	for k, v := range c.header_ {
10292		reqHeaders[k] = v
10293	}
10294	reqHeaders.Set("User-Agent", c.s.userAgent())
10295	var body io.Reader = nil
10296	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesverifyexternalsyncsettingsrequest)
10297	if err != nil {
10298		return nil, err
10299	}
10300	reqHeaders.Set("Content-Type", "application/json")
10301	c.urlParams_.Set("alt", alt)
10302	c.urlParams_.Set("prettyPrint", "false")
10303	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/verifyExternalSyncSettings")
10304	urls += "?" + c.urlParams_.Encode()
10305	req, err := http.NewRequest("POST", urls, body)
10306	if err != nil {
10307		return nil, err
10308	}
10309	req.Header = reqHeaders
10310	googleapi.Expand(req.URL, map[string]string{
10311		"project":  c.project,
10312		"instance": c.instance,
10313	})
10314	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10315}
10316
10317// Do executes the "sql.projects.instances.verifyExternalSyncSettings" call.
10318// Exactly one of *SqlInstancesVerifyExternalSyncSettingsResponse or
10319// error will be non-nil. Any non-2xx status code is an error. Response
10320// headers are in either
10321// *SqlInstancesVerifyExternalSyncSettingsResponse.ServerResponse.Header
10322// or (if a response was returned at all) in
10323// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10324// whether the returned error was because http.StatusNotModified was
10325// returned.
10326func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Do(opts ...googleapi.CallOption) (*SqlInstancesVerifyExternalSyncSettingsResponse, error) {
10327	gensupport.SetOptions(c.urlParams_, opts...)
10328	res, err := c.doRequest("json")
10329	if res != nil && res.StatusCode == http.StatusNotModified {
10330		if res.Body != nil {
10331			res.Body.Close()
10332		}
10333		return nil, &googleapi.Error{
10334			Code:   res.StatusCode,
10335			Header: res.Header,
10336		}
10337	}
10338	if err != nil {
10339		return nil, err
10340	}
10341	defer googleapi.CloseBody(res)
10342	if err := googleapi.CheckResponse(res); err != nil {
10343		return nil, err
10344	}
10345	ret := &SqlInstancesVerifyExternalSyncSettingsResponse{
10346		ServerResponse: googleapi.ServerResponse{
10347			Header:         res.Header,
10348			HTTPStatusCode: res.StatusCode,
10349		},
10350	}
10351	target := &ret
10352	if err := gensupport.DecodeResponse(target, res); err != nil {
10353		return nil, err
10354	}
10355	return ret, nil
10356	// {
10357	//   "description": "Verify External primary instance external sync settings.",
10358	//   "flatPath": "v1/projects/{project}/instances/{instance}/verifyExternalSyncSettings",
10359	//   "httpMethod": "POST",
10360	//   "id": "sql.projects.instances.verifyExternalSyncSettings",
10361	//   "parameterOrder": [
10362	//     "project",
10363	//     "instance"
10364	//   ],
10365	//   "parameters": {
10366	//     "instance": {
10367	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
10368	//       "location": "path",
10369	//       "required": true,
10370	//       "type": "string"
10371	//     },
10372	//     "project": {
10373	//       "description": "Project ID of the project that contains the instance.",
10374	//       "location": "path",
10375	//       "required": true,
10376	//       "type": "string"
10377	//     }
10378	//   },
10379	//   "path": "v1/projects/{project}/instances/{instance}/verifyExternalSyncSettings",
10380	//   "request": {
10381	//     "$ref": "SqlInstancesVerifyExternalSyncSettingsRequest"
10382	//   },
10383	//   "response": {
10384	//     "$ref": "SqlInstancesVerifyExternalSyncSettingsResponse"
10385	//   },
10386	//   "scopes": [
10387	//     "https://www.googleapis.com/auth/cloud-platform",
10388	//     "https://www.googleapis.com/auth/sqlservice.admin"
10389	//   ]
10390	// }
10391
10392}
10393
10394// method id "sql.sslCerts.createEphemeral":
10395
10396type SslCertsCreateEphemeralCall struct {
10397	s                              *Service
10398	project                        string
10399	instance                       string
10400	sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest
10401	urlParams_                     gensupport.URLParams
10402	ctx_                           context.Context
10403	header_                        http.Header
10404}
10405
10406// CreateEphemeral: Generates a short-lived X509 certificate containing
10407// the provided public key and signed by a private key specific to the
10408// target instance. Users may use the certificate to authenticate as
10409// themselves when connecting to the database.
10410//
10411// - instance: Cloud SQL instance ID. This does not include the project
10412//   ID.
10413// - project: Project ID of the Cloud SQL project.
10414func (r *SslCertsService) CreateEphemeral(project string, instance string, sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest) *SslCertsCreateEphemeralCall {
10415	c := &SslCertsCreateEphemeralCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10416	c.project = project
10417	c.instance = instance
10418	c.sslcertscreateephemeralrequest = sslcertscreateephemeralrequest
10419	return c
10420}
10421
10422// Fields allows partial responses to be retrieved. See
10423// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10424// for more information.
10425func (c *SslCertsCreateEphemeralCall) Fields(s ...googleapi.Field) *SslCertsCreateEphemeralCall {
10426	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10427	return c
10428}
10429
10430// Context sets the context to be used in this call's Do method. Any
10431// pending HTTP request will be aborted if the provided context is
10432// canceled.
10433func (c *SslCertsCreateEphemeralCall) Context(ctx context.Context) *SslCertsCreateEphemeralCall {
10434	c.ctx_ = ctx
10435	return c
10436}
10437
10438// Header returns an http.Header that can be modified by the caller to
10439// add HTTP headers to the request.
10440func (c *SslCertsCreateEphemeralCall) Header() http.Header {
10441	if c.header_ == nil {
10442		c.header_ = make(http.Header)
10443	}
10444	return c.header_
10445}
10446
10447func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) {
10448	reqHeaders := make(http.Header)
10449	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
10450	for k, v := range c.header_ {
10451		reqHeaders[k] = v
10452	}
10453	reqHeaders.Set("User-Agent", c.s.userAgent())
10454	var body io.Reader = nil
10455	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest)
10456	if err != nil {
10457		return nil, err
10458	}
10459	reqHeaders.Set("Content-Type", "application/json")
10460	c.urlParams_.Set("alt", alt)
10461	c.urlParams_.Set("prettyPrint", "false")
10462	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/createEphemeral")
10463	urls += "?" + c.urlParams_.Encode()
10464	req, err := http.NewRequest("POST", urls, body)
10465	if err != nil {
10466		return nil, err
10467	}
10468	req.Header = reqHeaders
10469	googleapi.Expand(req.URL, map[string]string{
10470		"project":  c.project,
10471		"instance": c.instance,
10472	})
10473	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10474}
10475
10476// Do executes the "sql.sslCerts.createEphemeral" call.
10477// Exactly one of *SslCert or error will be non-nil. Any non-2xx status
10478// code is an error. Response headers are in either
10479// *SslCert.ServerResponse.Header or (if a response was returned at all)
10480// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10481// check whether the returned error was because http.StatusNotModified
10482// was returned.
10483func (c *SslCertsCreateEphemeralCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
10484	gensupport.SetOptions(c.urlParams_, opts...)
10485	res, err := c.doRequest("json")
10486	if res != nil && res.StatusCode == http.StatusNotModified {
10487		if res.Body != nil {
10488			res.Body.Close()
10489		}
10490		return nil, &googleapi.Error{
10491			Code:   res.StatusCode,
10492			Header: res.Header,
10493		}
10494	}
10495	if err != nil {
10496		return nil, err
10497	}
10498	defer googleapi.CloseBody(res)
10499	if err := googleapi.CheckResponse(res); err != nil {
10500		return nil, err
10501	}
10502	ret := &SslCert{
10503		ServerResponse: googleapi.ServerResponse{
10504			Header:         res.Header,
10505			HTTPStatusCode: res.StatusCode,
10506		},
10507	}
10508	target := &ret
10509	if err := gensupport.DecodeResponse(target, res); err != nil {
10510		return nil, err
10511	}
10512	return ret, nil
10513	// {
10514	//   "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.",
10515	//   "flatPath": "v1/projects/{project}/instances/{instance}/createEphemeral",
10516	//   "httpMethod": "POST",
10517	//   "id": "sql.sslCerts.createEphemeral",
10518	//   "parameterOrder": [
10519	//     "project",
10520	//     "instance"
10521	//   ],
10522	//   "parameters": {
10523	//     "instance": {
10524	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
10525	//       "location": "path",
10526	//       "required": true,
10527	//       "type": "string"
10528	//     },
10529	//     "project": {
10530	//       "description": "Project ID of the Cloud SQL project.",
10531	//       "location": "path",
10532	//       "required": true,
10533	//       "type": "string"
10534	//     }
10535	//   },
10536	//   "path": "v1/projects/{project}/instances/{instance}/createEphemeral",
10537	//   "request": {
10538	//     "$ref": "SslCertsCreateEphemeralRequest"
10539	//   },
10540	//   "response": {
10541	//     "$ref": "SslCert"
10542	//   },
10543	//   "scopes": [
10544	//     "https://www.googleapis.com/auth/cloud-platform",
10545	//     "https://www.googleapis.com/auth/sqlservice.admin"
10546	//   ]
10547	// }
10548
10549}
10550
10551// method id "sql.sslCerts.delete":
10552
10553type SslCertsDeleteCall struct {
10554	s               *Service
10555	project         string
10556	instance        string
10557	sha1Fingerprint string
10558	urlParams_      gensupport.URLParams
10559	ctx_            context.Context
10560	header_         http.Header
10561}
10562
10563// Delete: Deletes the SSL certificate. For First Generation instances,
10564// the certificate remains valid until the instance is restarted.
10565//
10566// - instance: Cloud SQL instance ID. This does not include the project
10567//   ID.
10568// - project: Project ID of the project that contains the instance.
10569// - sha1Fingerprint: Sha1 FingerPrint.
10570func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall {
10571	c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10572	c.project = project
10573	c.instance = instance
10574	c.sha1Fingerprint = sha1Fingerprint
10575	return c
10576}
10577
10578// Fields allows partial responses to be retrieved. See
10579// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10580// for more information.
10581func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall {
10582	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10583	return c
10584}
10585
10586// Context sets the context to be used in this call's Do method. Any
10587// pending HTTP request will be aborted if the provided context is
10588// canceled.
10589func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall {
10590	c.ctx_ = ctx
10591	return c
10592}
10593
10594// Header returns an http.Header that can be modified by the caller to
10595// add HTTP headers to the request.
10596func (c *SslCertsDeleteCall) Header() http.Header {
10597	if c.header_ == nil {
10598		c.header_ = make(http.Header)
10599	}
10600	return c.header_
10601}
10602
10603func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) {
10604	reqHeaders := make(http.Header)
10605	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
10606	for k, v := range c.header_ {
10607		reqHeaders[k] = v
10608	}
10609	reqHeaders.Set("User-Agent", c.s.userAgent())
10610	var body io.Reader = nil
10611	c.urlParams_.Set("alt", alt)
10612	c.urlParams_.Set("prettyPrint", "false")
10613	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
10614	urls += "?" + c.urlParams_.Encode()
10615	req, err := http.NewRequest("DELETE", urls, body)
10616	if err != nil {
10617		return nil, err
10618	}
10619	req.Header = reqHeaders
10620	googleapi.Expand(req.URL, map[string]string{
10621		"project":         c.project,
10622		"instance":        c.instance,
10623		"sha1Fingerprint": c.sha1Fingerprint,
10624	})
10625	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10626}
10627
10628// Do executes the "sql.sslCerts.delete" call.
10629// Exactly one of *Operation or error will be non-nil. Any non-2xx
10630// status code is an error. Response headers are in either
10631// *Operation.ServerResponse.Header or (if a response was returned at
10632// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10633// to check whether the returned error was because
10634// http.StatusNotModified was returned.
10635func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10636	gensupport.SetOptions(c.urlParams_, opts...)
10637	res, err := c.doRequest("json")
10638	if res != nil && res.StatusCode == http.StatusNotModified {
10639		if res.Body != nil {
10640			res.Body.Close()
10641		}
10642		return nil, &googleapi.Error{
10643			Code:   res.StatusCode,
10644			Header: res.Header,
10645		}
10646	}
10647	if err != nil {
10648		return nil, err
10649	}
10650	defer googleapi.CloseBody(res)
10651	if err := googleapi.CheckResponse(res); err != nil {
10652		return nil, err
10653	}
10654	ret := &Operation{
10655		ServerResponse: googleapi.ServerResponse{
10656			Header:         res.Header,
10657			HTTPStatusCode: res.StatusCode,
10658		},
10659	}
10660	target := &ret
10661	if err := gensupport.DecodeResponse(target, res); err != nil {
10662		return nil, err
10663	}
10664	return ret, nil
10665	// {
10666	//   "description": "Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.",
10667	//   "flatPath": "v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
10668	//   "httpMethod": "DELETE",
10669	//   "id": "sql.sslCerts.delete",
10670	//   "parameterOrder": [
10671	//     "project",
10672	//     "instance",
10673	//     "sha1Fingerprint"
10674	//   ],
10675	//   "parameters": {
10676	//     "instance": {
10677	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
10678	//       "location": "path",
10679	//       "required": true,
10680	//       "type": "string"
10681	//     },
10682	//     "project": {
10683	//       "description": "Project ID of the project that contains the instance.",
10684	//       "location": "path",
10685	//       "required": true,
10686	//       "type": "string"
10687	//     },
10688	//     "sha1Fingerprint": {
10689	//       "description": "Sha1 FingerPrint.",
10690	//       "location": "path",
10691	//       "required": true,
10692	//       "type": "string"
10693	//     }
10694	//   },
10695	//   "path": "v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
10696	//   "response": {
10697	//     "$ref": "Operation"
10698	//   },
10699	//   "scopes": [
10700	//     "https://www.googleapis.com/auth/cloud-platform",
10701	//     "https://www.googleapis.com/auth/sqlservice.admin"
10702	//   ]
10703	// }
10704
10705}
10706
10707// method id "sql.sslCerts.get":
10708
10709type SslCertsGetCall struct {
10710	s               *Service
10711	project         string
10712	instance        string
10713	sha1Fingerprint string
10714	urlParams_      gensupport.URLParams
10715	ifNoneMatch_    string
10716	ctx_            context.Context
10717	header_         http.Header
10718}
10719
10720// Get: Retrieves a particular SSL certificate. Does not include the
10721// private key (required for usage). The private key must be saved from
10722// the response to initial creation.
10723//
10724// - instance: Cloud SQL instance ID. This does not include the project
10725//   ID.
10726// - project: Project ID of the project that contains the instance.
10727// - sha1Fingerprint: Sha1 FingerPrint.
10728func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall {
10729	c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10730	c.project = project
10731	c.instance = instance
10732	c.sha1Fingerprint = sha1Fingerprint
10733	return c
10734}
10735
10736// Fields allows partial responses to be retrieved. See
10737// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10738// for more information.
10739func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall {
10740	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10741	return c
10742}
10743
10744// IfNoneMatch sets the optional parameter which makes the operation
10745// fail if the object's ETag matches the given value. This is useful for
10746// getting updates only after the object has changed since the last
10747// request. Use googleapi.IsNotModified to check whether the response
10748// error from Do is the result of In-None-Match.
10749func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall {
10750	c.ifNoneMatch_ = entityTag
10751	return c
10752}
10753
10754// Context sets the context to be used in this call's Do method. Any
10755// pending HTTP request will be aborted if the provided context is
10756// canceled.
10757func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall {
10758	c.ctx_ = ctx
10759	return c
10760}
10761
10762// Header returns an http.Header that can be modified by the caller to
10763// add HTTP headers to the request.
10764func (c *SslCertsGetCall) Header() http.Header {
10765	if c.header_ == nil {
10766		c.header_ = make(http.Header)
10767	}
10768	return c.header_
10769}
10770
10771func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) {
10772	reqHeaders := make(http.Header)
10773	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
10774	for k, v := range c.header_ {
10775		reqHeaders[k] = v
10776	}
10777	reqHeaders.Set("User-Agent", c.s.userAgent())
10778	if c.ifNoneMatch_ != "" {
10779		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10780	}
10781	var body io.Reader = nil
10782	c.urlParams_.Set("alt", alt)
10783	c.urlParams_.Set("prettyPrint", "false")
10784	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
10785	urls += "?" + c.urlParams_.Encode()
10786	req, err := http.NewRequest("GET", urls, body)
10787	if err != nil {
10788		return nil, err
10789	}
10790	req.Header = reqHeaders
10791	googleapi.Expand(req.URL, map[string]string{
10792		"project":         c.project,
10793		"instance":        c.instance,
10794		"sha1Fingerprint": c.sha1Fingerprint,
10795	})
10796	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10797}
10798
10799// Do executes the "sql.sslCerts.get" call.
10800// Exactly one of *SslCert or error will be non-nil. Any non-2xx status
10801// code is an error. Response headers are in either
10802// *SslCert.ServerResponse.Header or (if a response was returned at all)
10803// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10804// check whether the returned error was because http.StatusNotModified
10805// was returned.
10806func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
10807	gensupport.SetOptions(c.urlParams_, opts...)
10808	res, err := c.doRequest("json")
10809	if res != nil && res.StatusCode == http.StatusNotModified {
10810		if res.Body != nil {
10811			res.Body.Close()
10812		}
10813		return nil, &googleapi.Error{
10814			Code:   res.StatusCode,
10815			Header: res.Header,
10816		}
10817	}
10818	if err != nil {
10819		return nil, err
10820	}
10821	defer googleapi.CloseBody(res)
10822	if err := googleapi.CheckResponse(res); err != nil {
10823		return nil, err
10824	}
10825	ret := &SslCert{
10826		ServerResponse: googleapi.ServerResponse{
10827			Header:         res.Header,
10828			HTTPStatusCode: res.StatusCode,
10829		},
10830	}
10831	target := &ret
10832	if err := gensupport.DecodeResponse(target, res); err != nil {
10833		return nil, err
10834	}
10835	return ret, nil
10836	// {
10837	//   "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.",
10838	//   "flatPath": "v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
10839	//   "httpMethod": "GET",
10840	//   "id": "sql.sslCerts.get",
10841	//   "parameterOrder": [
10842	//     "project",
10843	//     "instance",
10844	//     "sha1Fingerprint"
10845	//   ],
10846	//   "parameters": {
10847	//     "instance": {
10848	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
10849	//       "location": "path",
10850	//       "required": true,
10851	//       "type": "string"
10852	//     },
10853	//     "project": {
10854	//       "description": "Project ID of the project that contains the instance.",
10855	//       "location": "path",
10856	//       "required": true,
10857	//       "type": "string"
10858	//     },
10859	//     "sha1Fingerprint": {
10860	//       "description": "Sha1 FingerPrint.",
10861	//       "location": "path",
10862	//       "required": true,
10863	//       "type": "string"
10864	//     }
10865	//   },
10866	//   "path": "v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}",
10867	//   "response": {
10868	//     "$ref": "SslCert"
10869	//   },
10870	//   "scopes": [
10871	//     "https://www.googleapis.com/auth/cloud-platform",
10872	//     "https://www.googleapis.com/auth/sqlservice.admin"
10873	//   ]
10874	// }
10875
10876}
10877
10878// method id "sql.sslCerts.insert":
10879
10880type SslCertsInsertCall struct {
10881	s                     *Service
10882	project               string
10883	instance              string
10884	sslcertsinsertrequest *SslCertsInsertRequest
10885	urlParams_            gensupport.URLParams
10886	ctx_                  context.Context
10887	header_               http.Header
10888}
10889
10890// Insert: Creates an SSL certificate and returns it along with the
10891// private key and server certificate authority. The new certificate
10892// will not be usable until the instance is restarted.
10893//
10894// - instance: Cloud SQL instance ID. This does not include the project
10895//   ID.
10896// - project: Project ID of the project that contains the instance.
10897func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall {
10898	c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10899	c.project = project
10900	c.instance = instance
10901	c.sslcertsinsertrequest = sslcertsinsertrequest
10902	return c
10903}
10904
10905// Fields allows partial responses to be retrieved. See
10906// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10907// for more information.
10908func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall {
10909	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10910	return c
10911}
10912
10913// Context sets the context to be used in this call's Do method. Any
10914// pending HTTP request will be aborted if the provided context is
10915// canceled.
10916func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall {
10917	c.ctx_ = ctx
10918	return c
10919}
10920
10921// Header returns an http.Header that can be modified by the caller to
10922// add HTTP headers to the request.
10923func (c *SslCertsInsertCall) Header() http.Header {
10924	if c.header_ == nil {
10925		c.header_ = make(http.Header)
10926	}
10927	return c.header_
10928}
10929
10930func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) {
10931	reqHeaders := make(http.Header)
10932	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
10933	for k, v := range c.header_ {
10934		reqHeaders[k] = v
10935	}
10936	reqHeaders.Set("User-Agent", c.s.userAgent())
10937	var body io.Reader = nil
10938	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest)
10939	if err != nil {
10940		return nil, err
10941	}
10942	reqHeaders.Set("Content-Type", "application/json")
10943	c.urlParams_.Set("alt", alt)
10944	c.urlParams_.Set("prettyPrint", "false")
10945	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/sslCerts")
10946	urls += "?" + c.urlParams_.Encode()
10947	req, err := http.NewRequest("POST", urls, body)
10948	if err != nil {
10949		return nil, err
10950	}
10951	req.Header = reqHeaders
10952	googleapi.Expand(req.URL, map[string]string{
10953		"project":  c.project,
10954		"instance": c.instance,
10955	})
10956	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10957}
10958
10959// Do executes the "sql.sslCerts.insert" call.
10960// Exactly one of *SslCertsInsertResponse or error will be non-nil. Any
10961// non-2xx status code is an error. Response headers are in either
10962// *SslCertsInsertResponse.ServerResponse.Header or (if a response was
10963// returned at all) in error.(*googleapi.Error).Header. Use
10964// googleapi.IsNotModified to check whether the returned error was
10965// because http.StatusNotModified was returned.
10966func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) {
10967	gensupport.SetOptions(c.urlParams_, opts...)
10968	res, err := c.doRequest("json")
10969	if res != nil && res.StatusCode == http.StatusNotModified {
10970		if res.Body != nil {
10971			res.Body.Close()
10972		}
10973		return nil, &googleapi.Error{
10974			Code:   res.StatusCode,
10975			Header: res.Header,
10976		}
10977	}
10978	if err != nil {
10979		return nil, err
10980	}
10981	defer googleapi.CloseBody(res)
10982	if err := googleapi.CheckResponse(res); err != nil {
10983		return nil, err
10984	}
10985	ret := &SslCertsInsertResponse{
10986		ServerResponse: googleapi.ServerResponse{
10987			Header:         res.Header,
10988			HTTPStatusCode: res.StatusCode,
10989		},
10990	}
10991	target := &ret
10992	if err := gensupport.DecodeResponse(target, res); err != nil {
10993		return nil, err
10994	}
10995	return ret, nil
10996	// {
10997	//   "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.",
10998	//   "flatPath": "v1/projects/{project}/instances/{instance}/sslCerts",
10999	//   "httpMethod": "POST",
11000	//   "id": "sql.sslCerts.insert",
11001	//   "parameterOrder": [
11002	//     "project",
11003	//     "instance"
11004	//   ],
11005	//   "parameters": {
11006	//     "instance": {
11007	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
11008	//       "location": "path",
11009	//       "required": true,
11010	//       "type": "string"
11011	//     },
11012	//     "project": {
11013	//       "description": "Project ID of the project that contains the instance.",
11014	//       "location": "path",
11015	//       "required": true,
11016	//       "type": "string"
11017	//     }
11018	//   },
11019	//   "path": "v1/projects/{project}/instances/{instance}/sslCerts",
11020	//   "request": {
11021	//     "$ref": "SslCertsInsertRequest"
11022	//   },
11023	//   "response": {
11024	//     "$ref": "SslCertsInsertResponse"
11025	//   },
11026	//   "scopes": [
11027	//     "https://www.googleapis.com/auth/cloud-platform",
11028	//     "https://www.googleapis.com/auth/sqlservice.admin"
11029	//   ]
11030	// }
11031
11032}
11033
11034// method id "sql.sslCerts.list":
11035
11036type SslCertsListCall struct {
11037	s            *Service
11038	project      string
11039	instance     string
11040	urlParams_   gensupport.URLParams
11041	ifNoneMatch_ string
11042	ctx_         context.Context
11043	header_      http.Header
11044}
11045
11046// List: Lists all of the current SSL certificates for the instance.
11047//
11048// - instance: Cloud SQL instance ID. This does not include the project
11049//   ID.
11050// - project: Project ID of the project that contains the instance.
11051func (r *SslCertsService) List(project string, instance string) *SslCertsListCall {
11052	c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11053	c.project = project
11054	c.instance = instance
11055	return c
11056}
11057
11058// Fields allows partial responses to be retrieved. See
11059// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11060// for more information.
11061func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall {
11062	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11063	return c
11064}
11065
11066// IfNoneMatch sets the optional parameter which makes the operation
11067// fail if the object's ETag matches the given value. This is useful for
11068// getting updates only after the object has changed since the last
11069// request. Use googleapi.IsNotModified to check whether the response
11070// error from Do is the result of In-None-Match.
11071func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall {
11072	c.ifNoneMatch_ = entityTag
11073	return c
11074}
11075
11076// Context sets the context to be used in this call's Do method. Any
11077// pending HTTP request will be aborted if the provided context is
11078// canceled.
11079func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall {
11080	c.ctx_ = ctx
11081	return c
11082}
11083
11084// Header returns an http.Header that can be modified by the caller to
11085// add HTTP headers to the request.
11086func (c *SslCertsListCall) Header() http.Header {
11087	if c.header_ == nil {
11088		c.header_ = make(http.Header)
11089	}
11090	return c.header_
11091}
11092
11093func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) {
11094	reqHeaders := make(http.Header)
11095	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
11096	for k, v := range c.header_ {
11097		reqHeaders[k] = v
11098	}
11099	reqHeaders.Set("User-Agent", c.s.userAgent())
11100	if c.ifNoneMatch_ != "" {
11101		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11102	}
11103	var body io.Reader = nil
11104	c.urlParams_.Set("alt", alt)
11105	c.urlParams_.Set("prettyPrint", "false")
11106	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/sslCerts")
11107	urls += "?" + c.urlParams_.Encode()
11108	req, err := http.NewRequest("GET", urls, body)
11109	if err != nil {
11110		return nil, err
11111	}
11112	req.Header = reqHeaders
11113	googleapi.Expand(req.URL, map[string]string{
11114		"project":  c.project,
11115		"instance": c.instance,
11116	})
11117	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11118}
11119
11120// Do executes the "sql.sslCerts.list" call.
11121// Exactly one of *SslCertsListResponse or error will be non-nil. Any
11122// non-2xx status code is an error. Response headers are in either
11123// *SslCertsListResponse.ServerResponse.Header or (if a response was
11124// returned at all) in error.(*googleapi.Error).Header. Use
11125// googleapi.IsNotModified to check whether the returned error was
11126// because http.StatusNotModified was returned.
11127func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) {
11128	gensupport.SetOptions(c.urlParams_, opts...)
11129	res, err := c.doRequest("json")
11130	if res != nil && res.StatusCode == http.StatusNotModified {
11131		if res.Body != nil {
11132			res.Body.Close()
11133		}
11134		return nil, &googleapi.Error{
11135			Code:   res.StatusCode,
11136			Header: res.Header,
11137		}
11138	}
11139	if err != nil {
11140		return nil, err
11141	}
11142	defer googleapi.CloseBody(res)
11143	if err := googleapi.CheckResponse(res); err != nil {
11144		return nil, err
11145	}
11146	ret := &SslCertsListResponse{
11147		ServerResponse: googleapi.ServerResponse{
11148			Header:         res.Header,
11149			HTTPStatusCode: res.StatusCode,
11150		},
11151	}
11152	target := &ret
11153	if err := gensupport.DecodeResponse(target, res); err != nil {
11154		return nil, err
11155	}
11156	return ret, nil
11157	// {
11158	//   "description": "Lists all of the current SSL certificates for the instance.",
11159	//   "flatPath": "v1/projects/{project}/instances/{instance}/sslCerts",
11160	//   "httpMethod": "GET",
11161	//   "id": "sql.sslCerts.list",
11162	//   "parameterOrder": [
11163	//     "project",
11164	//     "instance"
11165	//   ],
11166	//   "parameters": {
11167	//     "instance": {
11168	//       "description": "Cloud SQL instance ID. This does not include the project ID.",
11169	//       "location": "path",
11170	//       "required": true,
11171	//       "type": "string"
11172	//     },
11173	//     "project": {
11174	//       "description": "Project ID of the project that contains the instance.",
11175	//       "location": "path",
11176	//       "required": true,
11177	//       "type": "string"
11178	//     }
11179	//   },
11180	//   "path": "v1/projects/{project}/instances/{instance}/sslCerts",
11181	//   "response": {
11182	//     "$ref": "SslCertsListResponse"
11183	//   },
11184	//   "scopes": [
11185	//     "https://www.googleapis.com/auth/cloud-platform",
11186	//     "https://www.googleapis.com/auth/sqlservice.admin"
11187	//   ]
11188	// }
11189
11190}
11191
11192// method id "sql.tiers.list":
11193
11194type TiersListCall struct {
11195	s            *Service
11196	project      string
11197	urlParams_   gensupport.URLParams
11198	ifNoneMatch_ string
11199	ctx_         context.Context
11200	header_      http.Header
11201}
11202
11203// List: Lists all available machine types (tiers) for Cloud SQL, for
11204// example, db-custom-1-3840. For more information, see
11205// https://cloud.google.com/sql/pricing.
11206//
11207// - project: Project ID of the project for which to list tiers.
11208func (r *TiersService) List(project string) *TiersListCall {
11209	c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11210	c.project = project
11211	return c
11212}
11213
11214// Fields allows partial responses to be retrieved. See
11215// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11216// for more information.
11217func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall {
11218	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11219	return c
11220}
11221
11222// IfNoneMatch sets the optional parameter which makes the operation
11223// fail if the object's ETag matches the given value. This is useful for
11224// getting updates only after the object has changed since the last
11225// request. Use googleapi.IsNotModified to check whether the response
11226// error from Do is the result of In-None-Match.
11227func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall {
11228	c.ifNoneMatch_ = entityTag
11229	return c
11230}
11231
11232// Context sets the context to be used in this call's Do method. Any
11233// pending HTTP request will be aborted if the provided context is
11234// canceled.
11235func (c *TiersListCall) Context(ctx context.Context) *TiersListCall {
11236	c.ctx_ = ctx
11237	return c
11238}
11239
11240// Header returns an http.Header that can be modified by the caller to
11241// add HTTP headers to the request.
11242func (c *TiersListCall) Header() http.Header {
11243	if c.header_ == nil {
11244		c.header_ = make(http.Header)
11245	}
11246	return c.header_
11247}
11248
11249func (c *TiersListCall) doRequest(alt string) (*http.Response, error) {
11250	reqHeaders := make(http.Header)
11251	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
11252	for k, v := range c.header_ {
11253		reqHeaders[k] = v
11254	}
11255	reqHeaders.Set("User-Agent", c.s.userAgent())
11256	if c.ifNoneMatch_ != "" {
11257		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11258	}
11259	var body io.Reader = nil
11260	c.urlParams_.Set("alt", alt)
11261	c.urlParams_.Set("prettyPrint", "false")
11262	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/tiers")
11263	urls += "?" + c.urlParams_.Encode()
11264	req, err := http.NewRequest("GET", urls, body)
11265	if err != nil {
11266		return nil, err
11267	}
11268	req.Header = reqHeaders
11269	googleapi.Expand(req.URL, map[string]string{
11270		"project": c.project,
11271	})
11272	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11273}
11274
11275// Do executes the "sql.tiers.list" call.
11276// Exactly one of *TiersListResponse or error will be non-nil. Any
11277// non-2xx status code is an error. Response headers are in either
11278// *TiersListResponse.ServerResponse.Header or (if a response was
11279// returned at all) in error.(*googleapi.Error).Header. Use
11280// googleapi.IsNotModified to check whether the returned error was
11281// because http.StatusNotModified was returned.
11282func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) {
11283	gensupport.SetOptions(c.urlParams_, opts...)
11284	res, err := c.doRequest("json")
11285	if res != nil && res.StatusCode == http.StatusNotModified {
11286		if res.Body != nil {
11287			res.Body.Close()
11288		}
11289		return nil, &googleapi.Error{
11290			Code:   res.StatusCode,
11291			Header: res.Header,
11292		}
11293	}
11294	if err != nil {
11295		return nil, err
11296	}
11297	defer googleapi.CloseBody(res)
11298	if err := googleapi.CheckResponse(res); err != nil {
11299		return nil, err
11300	}
11301	ret := &TiersListResponse{
11302		ServerResponse: googleapi.ServerResponse{
11303			Header:         res.Header,
11304			HTTPStatusCode: res.StatusCode,
11305		},
11306	}
11307	target := &ret
11308	if err := gensupport.DecodeResponse(target, res); err != nil {
11309		return nil, err
11310	}
11311	return ret, nil
11312	// {
11313	//   "description": "Lists all available machine types (tiers) for Cloud SQL, for example, db-custom-1-3840. For more information, see https://cloud.google.com/sql/pricing.",
11314	//   "flatPath": "v1/projects/{project}/tiers",
11315	//   "httpMethod": "GET",
11316	//   "id": "sql.tiers.list",
11317	//   "parameterOrder": [
11318	//     "project"
11319	//   ],
11320	//   "parameters": {
11321	//     "project": {
11322	//       "description": "Project ID of the project for which to list tiers.",
11323	//       "location": "path",
11324	//       "required": true,
11325	//       "type": "string"
11326	//     }
11327	//   },
11328	//   "path": "v1/projects/{project}/tiers",
11329	//   "response": {
11330	//     "$ref": "TiersListResponse"
11331	//   },
11332	//   "scopes": [
11333	//     "https://www.googleapis.com/auth/cloud-platform",
11334	//     "https://www.googleapis.com/auth/sqlservice.admin"
11335	//   ]
11336	// }
11337
11338}
11339
11340// method id "sql.users.delete":
11341
11342type UsersDeleteCall struct {
11343	s          *Service
11344	project    string
11345	instance   string
11346	urlParams_ gensupport.URLParams
11347	ctx_       context.Context
11348	header_    http.Header
11349}
11350
11351// Delete: Deletes a user from a Cloud SQL instance.
11352//
11353// - instance: Database instance ID. This does not include the project
11354//   ID.
11355// - project: Project ID of the project that contains the instance.
11356func (r *UsersService) Delete(project string, instance string) *UsersDeleteCall {
11357	c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11358	c.project = project
11359	c.instance = instance
11360	return c
11361}
11362
11363// Host sets the optional parameter "host": Host of the user in the
11364// instance.
11365func (c *UsersDeleteCall) Host(host string) *UsersDeleteCall {
11366	c.urlParams_.Set("host", host)
11367	return c
11368}
11369
11370// Name sets the optional parameter "name": Name of the user in the
11371// instance.
11372func (c *UsersDeleteCall) Name(name string) *UsersDeleteCall {
11373	c.urlParams_.Set("name", name)
11374	return c
11375}
11376
11377// Fields allows partial responses to be retrieved. See
11378// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11379// for more information.
11380func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall {
11381	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11382	return c
11383}
11384
11385// Context sets the context to be used in this call's Do method. Any
11386// pending HTTP request will be aborted if the provided context is
11387// canceled.
11388func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall {
11389	c.ctx_ = ctx
11390	return c
11391}
11392
11393// Header returns an http.Header that can be modified by the caller to
11394// add HTTP headers to the request.
11395func (c *UsersDeleteCall) Header() http.Header {
11396	if c.header_ == nil {
11397		c.header_ = make(http.Header)
11398	}
11399	return c.header_
11400}
11401
11402func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) {
11403	reqHeaders := make(http.Header)
11404	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
11405	for k, v := range c.header_ {
11406		reqHeaders[k] = v
11407	}
11408	reqHeaders.Set("User-Agent", c.s.userAgent())
11409	var body io.Reader = nil
11410	c.urlParams_.Set("alt", alt)
11411	c.urlParams_.Set("prettyPrint", "false")
11412	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/users")
11413	urls += "?" + c.urlParams_.Encode()
11414	req, err := http.NewRequest("DELETE", urls, body)
11415	if err != nil {
11416		return nil, err
11417	}
11418	req.Header = reqHeaders
11419	googleapi.Expand(req.URL, map[string]string{
11420		"project":  c.project,
11421		"instance": c.instance,
11422	})
11423	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11424}
11425
11426// Do executes the "sql.users.delete" call.
11427// Exactly one of *Operation or error will be non-nil. Any non-2xx
11428// status code is an error. Response headers are in either
11429// *Operation.ServerResponse.Header or (if a response was returned at
11430// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
11431// to check whether the returned error was because
11432// http.StatusNotModified was returned.
11433func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11434	gensupport.SetOptions(c.urlParams_, opts...)
11435	res, err := c.doRequest("json")
11436	if res != nil && res.StatusCode == http.StatusNotModified {
11437		if res.Body != nil {
11438			res.Body.Close()
11439		}
11440		return nil, &googleapi.Error{
11441			Code:   res.StatusCode,
11442			Header: res.Header,
11443		}
11444	}
11445	if err != nil {
11446		return nil, err
11447	}
11448	defer googleapi.CloseBody(res)
11449	if err := googleapi.CheckResponse(res); err != nil {
11450		return nil, err
11451	}
11452	ret := &Operation{
11453		ServerResponse: googleapi.ServerResponse{
11454			Header:         res.Header,
11455			HTTPStatusCode: res.StatusCode,
11456		},
11457	}
11458	target := &ret
11459	if err := gensupport.DecodeResponse(target, res); err != nil {
11460		return nil, err
11461	}
11462	return ret, nil
11463	// {
11464	//   "description": "Deletes a user from a Cloud SQL instance.",
11465	//   "flatPath": "v1/projects/{project}/instances/{instance}/users",
11466	//   "httpMethod": "DELETE",
11467	//   "id": "sql.users.delete",
11468	//   "parameterOrder": [
11469	//     "project",
11470	//     "instance"
11471	//   ],
11472	//   "parameters": {
11473	//     "host": {
11474	//       "description": "Host of the user in the instance.",
11475	//       "location": "query",
11476	//       "type": "string"
11477	//     },
11478	//     "instance": {
11479	//       "description": "Database instance ID. This does not include the project ID.",
11480	//       "location": "path",
11481	//       "required": true,
11482	//       "type": "string"
11483	//     },
11484	//     "name": {
11485	//       "description": "Name of the user in the instance.",
11486	//       "location": "query",
11487	//       "type": "string"
11488	//     },
11489	//     "project": {
11490	//       "description": "Project ID of the project that contains the instance.",
11491	//       "location": "path",
11492	//       "required": true,
11493	//       "type": "string"
11494	//     }
11495	//   },
11496	//   "path": "v1/projects/{project}/instances/{instance}/users",
11497	//   "response": {
11498	//     "$ref": "Operation"
11499	//   },
11500	//   "scopes": [
11501	//     "https://www.googleapis.com/auth/cloud-platform",
11502	//     "https://www.googleapis.com/auth/sqlservice.admin"
11503	//   ]
11504	// }
11505
11506}
11507
11508// method id "sql.users.insert":
11509
11510type UsersInsertCall struct {
11511	s          *Service
11512	project    string
11513	instance   string
11514	user       *User
11515	urlParams_ gensupport.URLParams
11516	ctx_       context.Context
11517	header_    http.Header
11518}
11519
11520// Insert: Creates a new user in a Cloud SQL instance.
11521//
11522// - instance: Database instance ID. This does not include the project
11523//   ID.
11524// - project: Project ID of the project that contains the instance.
11525func (r *UsersService) Insert(project string, instance string, user *User) *UsersInsertCall {
11526	c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11527	c.project = project
11528	c.instance = instance
11529	c.user = user
11530	return c
11531}
11532
11533// Fields allows partial responses to be retrieved. See
11534// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11535// for more information.
11536func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall {
11537	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11538	return c
11539}
11540
11541// Context sets the context to be used in this call's Do method. Any
11542// pending HTTP request will be aborted if the provided context is
11543// canceled.
11544func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall {
11545	c.ctx_ = ctx
11546	return c
11547}
11548
11549// Header returns an http.Header that can be modified by the caller to
11550// add HTTP headers to the request.
11551func (c *UsersInsertCall) Header() http.Header {
11552	if c.header_ == nil {
11553		c.header_ = make(http.Header)
11554	}
11555	return c.header_
11556}
11557
11558func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) {
11559	reqHeaders := make(http.Header)
11560	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
11561	for k, v := range c.header_ {
11562		reqHeaders[k] = v
11563	}
11564	reqHeaders.Set("User-Agent", c.s.userAgent())
11565	var body io.Reader = nil
11566	body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
11567	if err != nil {
11568		return nil, err
11569	}
11570	reqHeaders.Set("Content-Type", "application/json")
11571	c.urlParams_.Set("alt", alt)
11572	c.urlParams_.Set("prettyPrint", "false")
11573	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/users")
11574	urls += "?" + c.urlParams_.Encode()
11575	req, err := http.NewRequest("POST", urls, body)
11576	if err != nil {
11577		return nil, err
11578	}
11579	req.Header = reqHeaders
11580	googleapi.Expand(req.URL, map[string]string{
11581		"project":  c.project,
11582		"instance": c.instance,
11583	})
11584	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11585}
11586
11587// Do executes the "sql.users.insert" call.
11588// Exactly one of *Operation or error will be non-nil. Any non-2xx
11589// status code is an error. Response headers are in either
11590// *Operation.ServerResponse.Header or (if a response was returned at
11591// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
11592// to check whether the returned error was because
11593// http.StatusNotModified was returned.
11594func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11595	gensupport.SetOptions(c.urlParams_, opts...)
11596	res, err := c.doRequest("json")
11597	if res != nil && res.StatusCode == http.StatusNotModified {
11598		if res.Body != nil {
11599			res.Body.Close()
11600		}
11601		return nil, &googleapi.Error{
11602			Code:   res.StatusCode,
11603			Header: res.Header,
11604		}
11605	}
11606	if err != nil {
11607		return nil, err
11608	}
11609	defer googleapi.CloseBody(res)
11610	if err := googleapi.CheckResponse(res); err != nil {
11611		return nil, err
11612	}
11613	ret := &Operation{
11614		ServerResponse: googleapi.ServerResponse{
11615			Header:         res.Header,
11616			HTTPStatusCode: res.StatusCode,
11617		},
11618	}
11619	target := &ret
11620	if err := gensupport.DecodeResponse(target, res); err != nil {
11621		return nil, err
11622	}
11623	return ret, nil
11624	// {
11625	//   "description": "Creates a new user in a Cloud SQL instance.",
11626	//   "flatPath": "v1/projects/{project}/instances/{instance}/users",
11627	//   "httpMethod": "POST",
11628	//   "id": "sql.users.insert",
11629	//   "parameterOrder": [
11630	//     "project",
11631	//     "instance"
11632	//   ],
11633	//   "parameters": {
11634	//     "instance": {
11635	//       "description": "Database instance ID. This does not include the project ID.",
11636	//       "location": "path",
11637	//       "required": true,
11638	//       "type": "string"
11639	//     },
11640	//     "project": {
11641	//       "description": "Project ID of the project that contains the instance.",
11642	//       "location": "path",
11643	//       "required": true,
11644	//       "type": "string"
11645	//     }
11646	//   },
11647	//   "path": "v1/projects/{project}/instances/{instance}/users",
11648	//   "request": {
11649	//     "$ref": "User"
11650	//   },
11651	//   "response": {
11652	//     "$ref": "Operation"
11653	//   },
11654	//   "scopes": [
11655	//     "https://www.googleapis.com/auth/cloud-platform",
11656	//     "https://www.googleapis.com/auth/sqlservice.admin"
11657	//   ]
11658	// }
11659
11660}
11661
11662// method id "sql.users.list":
11663
11664type UsersListCall struct {
11665	s            *Service
11666	project      string
11667	instance     string
11668	urlParams_   gensupport.URLParams
11669	ifNoneMatch_ string
11670	ctx_         context.Context
11671	header_      http.Header
11672}
11673
11674// List: Lists users in the specified Cloud SQL instance.
11675//
11676// - instance: Database instance ID. This does not include the project
11677//   ID.
11678// - project: Project ID of the project that contains the instance.
11679func (r *UsersService) List(project string, instance string) *UsersListCall {
11680	c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11681	c.project = project
11682	c.instance = instance
11683	return c
11684}
11685
11686// Fields allows partial responses to be retrieved. See
11687// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11688// for more information.
11689func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall {
11690	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11691	return c
11692}
11693
11694// IfNoneMatch sets the optional parameter which makes the operation
11695// fail if the object's ETag matches the given value. This is useful for
11696// getting updates only after the object has changed since the last
11697// request. Use googleapi.IsNotModified to check whether the response
11698// error from Do is the result of In-None-Match.
11699func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall {
11700	c.ifNoneMatch_ = entityTag
11701	return c
11702}
11703
11704// Context sets the context to be used in this call's Do method. Any
11705// pending HTTP request will be aborted if the provided context is
11706// canceled.
11707func (c *UsersListCall) Context(ctx context.Context) *UsersListCall {
11708	c.ctx_ = ctx
11709	return c
11710}
11711
11712// Header returns an http.Header that can be modified by the caller to
11713// add HTTP headers to the request.
11714func (c *UsersListCall) Header() http.Header {
11715	if c.header_ == nil {
11716		c.header_ = make(http.Header)
11717	}
11718	return c.header_
11719}
11720
11721func (c *UsersListCall) doRequest(alt string) (*http.Response, error) {
11722	reqHeaders := make(http.Header)
11723	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
11724	for k, v := range c.header_ {
11725		reqHeaders[k] = v
11726	}
11727	reqHeaders.Set("User-Agent", c.s.userAgent())
11728	if c.ifNoneMatch_ != "" {
11729		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11730	}
11731	var body io.Reader = nil
11732	c.urlParams_.Set("alt", alt)
11733	c.urlParams_.Set("prettyPrint", "false")
11734	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/users")
11735	urls += "?" + c.urlParams_.Encode()
11736	req, err := http.NewRequest("GET", urls, body)
11737	if err != nil {
11738		return nil, err
11739	}
11740	req.Header = reqHeaders
11741	googleapi.Expand(req.URL, map[string]string{
11742		"project":  c.project,
11743		"instance": c.instance,
11744	})
11745	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11746}
11747
11748// Do executes the "sql.users.list" call.
11749// Exactly one of *UsersListResponse or error will be non-nil. Any
11750// non-2xx status code is an error. Response headers are in either
11751// *UsersListResponse.ServerResponse.Header or (if a response was
11752// returned at all) in error.(*googleapi.Error).Header. Use
11753// googleapi.IsNotModified to check whether the returned error was
11754// because http.StatusNotModified was returned.
11755func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) {
11756	gensupport.SetOptions(c.urlParams_, opts...)
11757	res, err := c.doRequest("json")
11758	if res != nil && res.StatusCode == http.StatusNotModified {
11759		if res.Body != nil {
11760			res.Body.Close()
11761		}
11762		return nil, &googleapi.Error{
11763			Code:   res.StatusCode,
11764			Header: res.Header,
11765		}
11766	}
11767	if err != nil {
11768		return nil, err
11769	}
11770	defer googleapi.CloseBody(res)
11771	if err := googleapi.CheckResponse(res); err != nil {
11772		return nil, err
11773	}
11774	ret := &UsersListResponse{
11775		ServerResponse: googleapi.ServerResponse{
11776			Header:         res.Header,
11777			HTTPStatusCode: res.StatusCode,
11778		},
11779	}
11780	target := &ret
11781	if err := gensupport.DecodeResponse(target, res); err != nil {
11782		return nil, err
11783	}
11784	return ret, nil
11785	// {
11786	//   "description": "Lists users in the specified Cloud SQL instance.",
11787	//   "flatPath": "v1/projects/{project}/instances/{instance}/users",
11788	//   "httpMethod": "GET",
11789	//   "id": "sql.users.list",
11790	//   "parameterOrder": [
11791	//     "project",
11792	//     "instance"
11793	//   ],
11794	//   "parameters": {
11795	//     "instance": {
11796	//       "description": "Database instance ID. This does not include the project ID.",
11797	//       "location": "path",
11798	//       "required": true,
11799	//       "type": "string"
11800	//     },
11801	//     "project": {
11802	//       "description": "Project ID of the project that contains the instance.",
11803	//       "location": "path",
11804	//       "required": true,
11805	//       "type": "string"
11806	//     }
11807	//   },
11808	//   "path": "v1/projects/{project}/instances/{instance}/users",
11809	//   "response": {
11810	//     "$ref": "UsersListResponse"
11811	//   },
11812	//   "scopes": [
11813	//     "https://www.googleapis.com/auth/cloud-platform",
11814	//     "https://www.googleapis.com/auth/sqlservice.admin"
11815	//   ]
11816	// }
11817
11818}
11819
11820// method id "sql.users.update":
11821
11822type UsersUpdateCall struct {
11823	s          *Service
11824	project    string
11825	instance   string
11826	user       *User
11827	urlParams_ gensupport.URLParams
11828	ctx_       context.Context
11829	header_    http.Header
11830}
11831
11832// Update: Updates an existing user in a Cloud SQL instance.
11833//
11834// - instance: Database instance ID. This does not include the project
11835//   ID.
11836// - project: Project ID of the project that contains the instance.
11837func (r *UsersService) Update(project string, instance string, user *User) *UsersUpdateCall {
11838	c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11839	c.project = project
11840	c.instance = instance
11841	c.user = user
11842	return c
11843}
11844
11845// Host sets the optional parameter "host": Host of the user in the
11846// instance.
11847func (c *UsersUpdateCall) Host(host string) *UsersUpdateCall {
11848	c.urlParams_.Set("host", host)
11849	return c
11850}
11851
11852// Name sets the optional parameter "name": Name of the user in the
11853// instance.
11854func (c *UsersUpdateCall) Name(name string) *UsersUpdateCall {
11855	c.urlParams_.Set("name", name)
11856	return c
11857}
11858
11859// Fields allows partial responses to be retrieved. See
11860// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11861// for more information.
11862func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall {
11863	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11864	return c
11865}
11866
11867// Context sets the context to be used in this call's Do method. Any
11868// pending HTTP request will be aborted if the provided context is
11869// canceled.
11870func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall {
11871	c.ctx_ = ctx
11872	return c
11873}
11874
11875// Header returns an http.Header that can be modified by the caller to
11876// add HTTP headers to the request.
11877func (c *UsersUpdateCall) Header() http.Header {
11878	if c.header_ == nil {
11879		c.header_ = make(http.Header)
11880	}
11881	return c.header_
11882}
11883
11884func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) {
11885	reqHeaders := make(http.Header)
11886	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812")
11887	for k, v := range c.header_ {
11888		reqHeaders[k] = v
11889	}
11890	reqHeaders.Set("User-Agent", c.s.userAgent())
11891	var body io.Reader = nil
11892	body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
11893	if err != nil {
11894		return nil, err
11895	}
11896	reqHeaders.Set("Content-Type", "application/json")
11897	c.urlParams_.Set("alt", alt)
11898	c.urlParams_.Set("prettyPrint", "false")
11899	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{project}/instances/{instance}/users")
11900	urls += "?" + c.urlParams_.Encode()
11901	req, err := http.NewRequest("PUT", urls, body)
11902	if err != nil {
11903		return nil, err
11904	}
11905	req.Header = reqHeaders
11906	googleapi.Expand(req.URL, map[string]string{
11907		"project":  c.project,
11908		"instance": c.instance,
11909	})
11910	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11911}
11912
11913// Do executes the "sql.users.update" call.
11914// Exactly one of *Operation or error will be non-nil. Any non-2xx
11915// status code is an error. Response headers are in either
11916// *Operation.ServerResponse.Header or (if a response was returned at
11917// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
11918// to check whether the returned error was because
11919// http.StatusNotModified was returned.
11920func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11921	gensupport.SetOptions(c.urlParams_, opts...)
11922	res, err := c.doRequest("json")
11923	if res != nil && res.StatusCode == http.StatusNotModified {
11924		if res.Body != nil {
11925			res.Body.Close()
11926		}
11927		return nil, &googleapi.Error{
11928			Code:   res.StatusCode,
11929			Header: res.Header,
11930		}
11931	}
11932	if err != nil {
11933		return nil, err
11934	}
11935	defer googleapi.CloseBody(res)
11936	if err := googleapi.CheckResponse(res); err != nil {
11937		return nil, err
11938	}
11939	ret := &Operation{
11940		ServerResponse: googleapi.ServerResponse{
11941			Header:         res.Header,
11942			HTTPStatusCode: res.StatusCode,
11943		},
11944	}
11945	target := &ret
11946	if err := gensupport.DecodeResponse(target, res); err != nil {
11947		return nil, err
11948	}
11949	return ret, nil
11950	// {
11951	//   "description": "Updates an existing user in a Cloud SQL instance.",
11952	//   "flatPath": "v1/projects/{project}/instances/{instance}/users",
11953	//   "httpMethod": "PUT",
11954	//   "id": "sql.users.update",
11955	//   "parameterOrder": [
11956	//     "project",
11957	//     "instance"
11958	//   ],
11959	//   "parameters": {
11960	//     "host": {
11961	//       "description": "Optional. Host of the user in the instance.",
11962	//       "location": "query",
11963	//       "type": "string"
11964	//     },
11965	//     "instance": {
11966	//       "description": "Database instance ID. This does not include the project ID.",
11967	//       "location": "path",
11968	//       "required": true,
11969	//       "type": "string"
11970	//     },
11971	//     "name": {
11972	//       "description": "Name of the user in the instance.",
11973	//       "location": "query",
11974	//       "type": "string"
11975	//     },
11976	//     "project": {
11977	//       "description": "Project ID of the project that contains the instance.",
11978	//       "location": "path",
11979	//       "required": true,
11980	//       "type": "string"
11981	//     }
11982	//   },
11983	//   "path": "v1/projects/{project}/instances/{instance}/users",
11984	//   "request": {
11985	//     "$ref": "User"
11986	//   },
11987	//   "response": {
11988	//     "$ref": "Operation"
11989	//   },
11990	//   "scopes": [
11991	//     "https://www.googleapis.com/auth/cloud-platform",
11992	//     "https://www.googleapis.com/auth/sqlservice.admin"
11993	//   ]
11994	// }
11995
11996}
11997