1// Copyright 2019 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package file provides access to the Cloud Filestore API. 8// 9// For product documentation, see: https://cloud.google.com/filestore/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/file/v1beta1" 16// ... 17// ctx := context.Background() 18// fileService, err := file.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// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// fileService, err := file.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// fileService, err := file.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package file // import "google.golang.org/api/file/v1beta1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 htransport "google.golang.org/api/transport/http" 56) 57 58// Always reference these packages, just in case the auto-generated code 59// below doesn't. 60var _ = bytes.NewBuffer 61var _ = strconv.Itoa 62var _ = fmt.Sprintf 63var _ = json.NewDecoder 64var _ = io.Copy 65var _ = url.Parse 66var _ = gensupport.MarshalJSON 67var _ = googleapi.Version 68var _ = errors.New 69var _ = strings.Replace 70var _ = context.Canceled 71 72const apiId = "file:v1beta1" 73const apiName = "file" 74const apiVersion = "v1beta1" 75const basePath = "https://file.googleapis.com/" 76 77// OAuth2 scopes used by this API. 78const ( 79 // View and manage your data across Google Cloud Platform services 80 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 81) 82 83// NewService creates a new Service. 84func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 85 scopesOption := option.WithScopes( 86 "https://www.googleapis.com/auth/cloud-platform", 87 ) 88 // NOTE: prepend, so we don't override user-specified scopes. 89 opts = append([]option.ClientOption{scopesOption}, opts...) 90 client, endpoint, err := htransport.NewClient(ctx, opts...) 91 if err != nil { 92 return nil, err 93 } 94 s, err := New(client) 95 if err != nil { 96 return nil, err 97 } 98 if endpoint != "" { 99 s.BasePath = endpoint 100 } 101 return s, nil 102} 103 104// New creates a new Service. It uses the provided http.Client for requests. 105// 106// Deprecated: please use NewService instead. 107// To provide a custom HTTP client, use option.WithHTTPClient. 108// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 109func New(client *http.Client) (*Service, error) { 110 if client == nil { 111 return nil, errors.New("client is nil") 112 } 113 s := &Service{client: client, BasePath: basePath} 114 s.Projects = NewProjectsService(s) 115 return s, nil 116} 117 118type Service struct { 119 client *http.Client 120 BasePath string // API endpoint base URL 121 UserAgent string // optional additional User-Agent fragment 122 123 Projects *ProjectsService 124} 125 126func (s *Service) userAgent() string { 127 if s.UserAgent == "" { 128 return googleapi.UserAgent 129 } 130 return googleapi.UserAgent + " " + s.UserAgent 131} 132 133func NewProjectsService(s *Service) *ProjectsService { 134 rs := &ProjectsService{s: s} 135 rs.Locations = NewProjectsLocationsService(s) 136 return rs 137} 138 139type ProjectsService struct { 140 s *Service 141 142 Locations *ProjectsLocationsService 143} 144 145func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 146 rs := &ProjectsLocationsService{s: s} 147 rs.Instances = NewProjectsLocationsInstancesService(s) 148 rs.Operations = NewProjectsLocationsOperationsService(s) 149 return rs 150} 151 152type ProjectsLocationsService struct { 153 s *Service 154 155 Instances *ProjectsLocationsInstancesService 156 157 Operations *ProjectsLocationsOperationsService 158} 159 160func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService { 161 rs := &ProjectsLocationsInstancesService{s: s} 162 return rs 163} 164 165type ProjectsLocationsInstancesService struct { 166 s *Service 167} 168 169func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 170 rs := &ProjectsLocationsOperationsService{s: s} 171 return rs 172} 173 174type ProjectsLocationsOperationsService struct { 175 s *Service 176} 177 178// CancelOperationRequest: The request message for 179// Operations.CancelOperation. 180type CancelOperationRequest struct { 181} 182 183// Empty: A generic empty message that you can re-use to avoid defining 184// duplicated 185// empty messages in your APIs. A typical example is to use it as the 186// request 187// or the response type of an API method. For instance: 188// 189// service Foo { 190// rpc Bar(google.protobuf.Empty) returns 191// (google.protobuf.Empty); 192// } 193// 194// The JSON representation for `Empty` is empty JSON object `{}`. 195type Empty struct { 196 // ServerResponse contains the HTTP response code and headers from the 197 // server. 198 googleapi.ServerResponse `json:"-"` 199} 200 201// FileShareConfig: File share configuration for the instance. 202type FileShareConfig struct { 203 // CapacityGb: File share capacity in gigabytes (GB). 204 // Cloud Filestore defines 1 GB as 1024^3 bytes. 205 CapacityGb int64 `json:"capacityGb,omitempty,string"` 206 207 // Name: The name of the file share (must be 16 characters or less). 208 Name string `json:"name,omitempty"` 209 210 // ForceSendFields is a list of field names (e.g. "CapacityGb") to 211 // unconditionally include in API requests. By default, fields with 212 // empty values are omitted from API requests. However, any non-pointer, 213 // non-interface field appearing in ForceSendFields will be sent to the 214 // server regardless of whether the field is empty or not. This may be 215 // used to include empty fields in Patch requests. 216 ForceSendFields []string `json:"-"` 217 218 // NullFields is a list of field names (e.g. "CapacityGb") to include in 219 // API requests with the JSON null value. By default, fields with empty 220 // values are omitted from API requests. However, any field with an 221 // empty value appearing in NullFields will be sent to the server as 222 // null. It is an error if a field in this list has a non-empty value. 223 // This may be used to include null fields in Patch requests. 224 NullFields []string `json:"-"` 225} 226 227func (s *FileShareConfig) MarshalJSON() ([]byte, error) { 228 type NoMethod FileShareConfig 229 raw := NoMethod(*s) 230 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 231} 232 233// GoogleCloudSaasacceleratorManagementProvidersV1Instance: Instance 234// represents the interface for SLM services to actuate the state 235// of control plane resources. 236// 237// Example Instance in JSON, where 238// consumer-project=snapchat, 239// producer-project=cloud-sql: 240// 241// ```json 242// Instance: 243// { 244// "name": 245// "projects/snapchat/locations/us-east1/instances/prod-instance", 246// "create_time": { 247// "seconds": 1526406431, 248// }, 249// "labels": { 250// "env": "prod", 251// "foo": "bar" 252// }, 253// "state": READY, 254// "software_versions": { 255// "software_update": "cloud-sql-09-28-2018", 256// }, 257// "maintenance_policy_names": { 258// "UpdatePolicy": 259// 260// "projects/snapchat/locations/us-east1/maintenancePolicies/prod-update- 261// policy", 262// } 263// "rollout_metadata": { 264// 265// "projects/cloud-sql/locations/global/rolloutTypes/software_update": 266// { 267// "release": 268// 269// "projects/cloud-sql/locations/global/releases/cloud-sql-09-28-2018", 270// "rollout": 271// 272// "projects/cloud-sql/locations/us-east1/rollouts/cloud-sql-09-28-2018-c 273// anary", 274// }, 275// 276// "projects/cloud-sql/locations/global/rolloutTypes/instance_restart": 277// { 278// "release": 279// 280// "projects/cloud-sql/locations/global/releases/cloud-sql-09-20-repair", 281// 282// "rollout": 283// 284// "projects/cloud-sql/locations/us-east1/rollouts/cloud-sql-09-20-repair 285// -100-percent", 286// } 287// } 288// "tenant_project_id": "cloud-sql-test-tenant", 289// "producer_metadata": { 290// "cloud-sql-tier": "basic", 291// "cloud-sql-instance-size": "1G", 292// }, 293// "provisioned_resources": [ 294// { 295// "resource-type": "compute-instance", 296// "resource-url": 297// 298// "https://www.googleapis.com/compute/v1/projects/cloud-sql/zones/us-eas 299// t1-b/instances/vm-1", 300// } 301// ], 302// "maintenance_schedules": { 303// "csa_rollout": { 304// "start_time": { 305// "seconds": 1526406431, 306// }, 307// "end_time": { 308// "seconds": 1535406431, 309// }, 310// }, 311// "ncsa_rollout": { 312// "start_time": { 313// "seconds": 1526406431, 314// }, 315// "end_time": { 316// "seconds": 1535406431, 317// }, 318// } 319// }, 320// "consumer_defined_name": "my-sql-instance1", 321// } 322// ``` 323type GoogleCloudSaasacceleratorManagementProvidersV1Instance struct { 324 // ConsumerDefinedName: consumer_defined_name is the name that is set by 325 // the consumer. On the other 326 // hand Name field represents system-assigned id of an instance so 327 // consumers 328 // are not necessarily aware of it. 329 // consumer_defined_name is used for notification/UI purposes for 330 // consumer to 331 // recognize their instances. 332 ConsumerDefinedName string `json:"consumerDefinedName,omitempty"` 333 334 // CreateTime: Output only. Timestamp when the resource was created. 335 CreateTime string `json:"createTime,omitempty"` 336 337 // Labels: Optional. Resource labels to represent user provided 338 // metadata. Each label 339 // is a key-value pair, where both the key and the value are arbitrary 340 // strings 341 // provided by the user. 342 Labels map[string]string `json:"labels,omitempty"` 343 344 // MaintenancePolicyNames: The MaintenancePolicies that have been 345 // attached to the instance. 346 // The key must be of the type name of the oneof policy name defined 347 // in 348 // MaintenancePolicy, and the referenced policy must define the same 349 // policy 350 // type. For complete details of MaintenancePolicy, please refer 351 // to 352 // go/cloud-saas-mw-ug. 353 MaintenancePolicyNames map[string]string `json:"maintenancePolicyNames,omitempty"` 354 355 // MaintenanceSchedules: The MaintenanceSchedule contains the scheduling 356 // information of published 357 // maintenance schedule. 358 MaintenanceSchedules map[string]GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule `json:"maintenanceSchedules,omitempty"` 359 360 // Name: Unique name of the resource. It uses the form: 361 // 362 // `projects/{project_id}/locations/{location_id}/instances/{instance_id} 363 // ` 364 Name string `json:"name,omitempty"` 365 366 // ProducerMetadata: Output only. Custom string attributes used 367 // primarily to expose 368 // producer-specific information in monitoring dashboards. 369 // See go/get-instance-metadata. 370 ProducerMetadata map[string]string `json:"producerMetadata,omitempty"` 371 372 // ProvisionedResources: Output only. The list of data plane resources 373 // provisioned for this 374 // instance, e.g. compute VMs. See go/get-instance-metadata. 375 ProvisionedResources []*GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource `json:"provisionedResources,omitempty"` 376 377 // RolloutMetadata: The map between RolloutType and the corresponding 378 // RolloutMetadata. 379 // This is only mutated by rollout service. For actuation 380 // implementation, 381 // this information is pass-through for Rollout management. Producer 382 // shall 383 // not modify by itself. 384 // For update of a single entry in this map, the update field mask 385 // shall 386 // follow this sementics: go/advanced-field-masks 387 RolloutMetadata map[string]GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata `json:"rolloutMetadata,omitempty"` 388 389 // SloMetadata: Output only. SLO metadata for instance classification in 390 // the 391 // Standardized dataplane SLO platform. 392 // See go/cloud-ssa-standard-slo for feature description. 393 SloMetadata *GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata `json:"sloMetadata,omitempty"` 394 395 // SoftwareVersions: Software versions that are used to deploy this 396 // instance. This can be 397 // mutated by rollout services. 398 SoftwareVersions map[string]string `json:"softwareVersions,omitempty"` 399 400 // State: Output only. Current lifecycle state of the resource (e.g. if 401 // it's being 402 // created or ready to use). 403 // 404 // Possible values: 405 // "STATE_UNSPECIFIED" - Unspecified state. 406 // "CREATING" - Instance is being created. 407 // "READY" - Instance has been created and is ready to use. 408 // "UPDATING" - Instance is being updated. 409 // "REPAIRING" - Instance is unheathy and under repair. 410 // "DELETING" - Instance is being deleted. 411 State string `json:"state,omitempty"` 412 413 // TenantProjectId: Output only. ID of the associated GCP tenant 414 // project. 415 // See go/get-instance-metadata. 416 TenantProjectId string `json:"tenantProjectId,omitempty"` 417 418 // UpdateTime: Output only. Timestamp when the resource was last 419 // modified. 420 UpdateTime string `json:"updateTime,omitempty"` 421 422 // ForceSendFields is a list of field names (e.g. "ConsumerDefinedName") 423 // to unconditionally include in API requests. By default, fields with 424 // empty values are omitted from API requests. However, any non-pointer, 425 // non-interface field appearing in ForceSendFields will be sent to the 426 // server regardless of whether the field is empty or not. This may be 427 // used to include empty fields in Patch requests. 428 ForceSendFields []string `json:"-"` 429 430 // NullFields is a list of field names (e.g. "ConsumerDefinedName") to 431 // include in API requests with the JSON null value. By default, fields 432 // with empty values are omitted from API requests. However, any field 433 // with an empty value appearing in NullFields will be sent to the 434 // server as null. It is an error if a field in this list has a 435 // non-empty value. This may be used to include null fields in Patch 436 // requests. 437 NullFields []string `json:"-"` 438} 439 440func (s *GoogleCloudSaasacceleratorManagementProvidersV1Instance) MarshalJSON() ([]byte, error) { 441 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1Instance 442 raw := NoMethod(*s) 443 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 444} 445 446// GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule: 447// Maintenance schedule which is exposed to customer and potentially end 448// user, 449// indicating published upcoming future maintenance schedule 450type GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule struct { 451 // CanReschedule: Can this scheduled update be rescheduled? 452 // By default, it's true and API needs to do explicitly check whether 453 // it's 454 // set, if it's set as false explicitly, it's false 455 CanReschedule bool `json:"canReschedule,omitempty"` 456 457 // EndTime: The scheduled end time for the maintenance. 458 EndTime string `json:"endTime,omitempty"` 459 460 // RolloutManagementPolicy: The rollout management policy this 461 // maintenance schedule is associated 462 // with. When doing reschedule update request, the reschedule should 463 // be 464 // against this given policy. 465 RolloutManagementPolicy string `json:"rolloutManagementPolicy,omitempty"` 466 467 // StartTime: The scheduled start time for the maintenance. 468 StartTime string `json:"startTime,omitempty"` 469 470 // ForceSendFields is a list of field names (e.g. "CanReschedule") to 471 // unconditionally include in API requests. By default, fields with 472 // empty values are omitted from API requests. However, any non-pointer, 473 // non-interface field appearing in ForceSendFields will be sent to the 474 // server regardless of whether the field is empty or not. This may be 475 // used to include empty fields in Patch requests. 476 ForceSendFields []string `json:"-"` 477 478 // NullFields is a list of field names (e.g. "CanReschedule") to include 479 // in API requests with the JSON null value. By default, fields with 480 // empty values are omitted from API requests. However, any field with 481 // an empty value appearing in NullFields will be sent to the server as 482 // null. It is an error if a field in this list has a non-empty value. 483 // This may be used to include null fields in Patch requests. 484 NullFields []string `json:"-"` 485} 486 487func (s *GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule) MarshalJSON() ([]byte, error) { 488 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSchedule 489 raw := NoMethod(*s) 490 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 491} 492 493// GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata: Node 494// information for custom per-node SLO implementations. 495// SSA does not support per-node SLO, but producers can populate 496// per-node 497// information in SloMetadata for custom precomputations. 498// SSA Eligibility Exporter will emit per-node metric based on this 499// information. 500type GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata struct { 501 // Exclusions: By default node is eligible if instance is eligible. 502 // But individual node might be excluded from SLO by adding entry 503 // here. 504 // For semantic see SloMetadata.exclusions. 505 // If both instance and node level exclusions are present for time 506 // period, 507 // the node level's reason will be reported by Eligibility Exporter. 508 Exclusions []*GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion `json:"exclusions,omitempty"` 509 510 // Location: The location of the node, if different from instance 511 // location. 512 Location string `json:"location,omitempty"` 513 514 // NodeId: The id of the node. 515 // This should be equal to SaasInstanceNode.node_id. 516 NodeId string `json:"nodeId,omitempty"` 517 518 // ForceSendFields is a list of field names (e.g. "Exclusions") to 519 // unconditionally include in API requests. By default, fields with 520 // empty values are omitted from API requests. However, any non-pointer, 521 // non-interface field appearing in ForceSendFields will be sent to the 522 // server regardless of whether the field is empty or not. This may be 523 // used to include empty fields in Patch requests. 524 ForceSendFields []string `json:"-"` 525 526 // NullFields is a list of field names (e.g. "Exclusions") to include in 527 // API requests with the JSON null value. By default, fields with empty 528 // values are omitted from API requests. However, any field with an 529 // empty value appearing in NullFields will be sent to the server as 530 // null. It is an error if a field in this list has a non-empty value. 531 // This may be used to include null fields in Patch requests. 532 NullFields []string `json:"-"` 533} 534 535func (s *GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata) MarshalJSON() ([]byte, error) { 536 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata 537 raw := NoMethod(*s) 538 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 539} 540 541// GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata: 542// NotificationMetadata is the notification state for an instance. 543type GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata struct { 544 // Rescheduled: Whether the instance update has been rescheduled. 545 Rescheduled bool `json:"rescheduled,omitempty"` 546 547 // ScheduledEndTime: The scheduled end time for the maintenance window 548 // during which update 549 // can be performed on the instance. 550 ScheduledEndTime string `json:"scheduledEndTime,omitempty"` 551 552 // ScheduledStartTime: The scheduled start time for the maintenance 553 // window during which 554 // update can be performed on the instance. 555 ScheduledStartTime string `json:"scheduledStartTime,omitempty"` 556 557 // TargetRelease: The target release to be applied to the instance. 558 TargetRelease string `json:"targetRelease,omitempty"` 559 560 // ForceSendFields is a list of field names (e.g. "Rescheduled") to 561 // unconditionally include in API requests. By default, fields with 562 // empty values are omitted from API requests. However, any non-pointer, 563 // non-interface field appearing in ForceSendFields will be sent to the 564 // server regardless of whether the field is empty or not. This may be 565 // used to include empty fields in Patch requests. 566 ForceSendFields []string `json:"-"` 567 568 // NullFields is a list of field names (e.g. "Rescheduled") to include 569 // in API requests with the JSON null value. By default, fields with 570 // empty values are omitted from API requests. However, any field with 571 // an empty value appearing in NullFields will be sent to the server as 572 // null. It is an error if a field in this list has a non-empty value. 573 // This may be used to include null fields in Patch requests. 574 NullFields []string `json:"-"` 575} 576 577func (s *GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata) MarshalJSON() ([]byte, error) { 578 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata 579 raw := NoMethod(*s) 580 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 581} 582 583// GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource: 584// Describes provisioned dataplane resources. 585type GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource struct { 586 // ResourceType: Type of the resource. This can be either a GCP resource 587 // or a custom one 588 // (e.g. another cloud provider's VM). For GCP compute resources use 589 // singular 590 // form of the names listed in GCP compute API 591 // documentation 592 // (https://cloud.google.com/compute/docs/reference/rest/v1 593 // /), prefixed with 594 // 'compute-', for example: 'compute-instance', 595 // 'compute-disk', 596 // 'compute-autoscaler'. 597 ResourceType string `json:"resourceType,omitempty"` 598 599 // ResourceUrl: URL identifying the resource, 600 // e.g. 601 // "https://www.googleapis.com/compute/v1/projects/...)". 602 ResourceUrl string `json:"resourceUrl,omitempty"` 603 604 // ForceSendFields is a list of field names (e.g. "ResourceType") to 605 // unconditionally include in API requests. By default, fields with 606 // empty values are omitted from API requests. However, any non-pointer, 607 // non-interface field appearing in ForceSendFields will be sent to the 608 // server regardless of whether the field is empty or not. This may be 609 // used to include empty fields in Patch requests. 610 ForceSendFields []string `json:"-"` 611 612 // NullFields is a list of field names (e.g. "ResourceType") to include 613 // in API requests with the JSON null value. By default, fields with 614 // empty values are omitted from API requests. However, any field with 615 // an empty value appearing in NullFields will be sent to the server as 616 // null. It is an error if a field in this list has a non-empty value. 617 // This may be used to include null fields in Patch requests. 618 NullFields []string `json:"-"` 619} 620 621func (s *GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource) MarshalJSON() ([]byte, error) { 622 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1ProvisionedResource 623 raw := NoMethod(*s) 624 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 625} 626 627// GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata: 628// RolloutMetadata for an actuation instance. It maps to a single 629// RolloutType. 630type GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata struct { 631 // Notification: Instance level notification metadata. 632 Notification *GoogleCloudSaasacceleratorManagementProvidersV1NotificationMetadata `json:"notification,omitempty"` 633 634 // ReleaseName: The last Release that has been applied to the instance. 635 ReleaseName string `json:"releaseName,omitempty"` 636 637 // RolloutName: The last rollout that has been applied to the instance. 638 RolloutName string `json:"rolloutName,omitempty"` 639 640 // ForceSendFields is a list of field names (e.g. "Notification") to 641 // unconditionally include in API requests. By default, fields with 642 // empty values are omitted from API requests. However, any non-pointer, 643 // non-interface field appearing in ForceSendFields will be sent to the 644 // server regardless of whether the field is empty or not. This may be 645 // used to include empty fields in Patch requests. 646 ForceSendFields []string `json:"-"` 647 648 // NullFields is a list of field names (e.g. "Notification") to include 649 // in API requests with the JSON null value. By default, fields with 650 // empty values are omitted from API requests. However, any field with 651 // an empty value appearing in NullFields will be sent to the server as 652 // null. It is an error if a field in this list has a non-empty value. 653 // This may be used to include null fields in Patch requests. 654 NullFields []string `json:"-"` 655} 656 657func (s *GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata) MarshalJSON() ([]byte, error) { 658 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1RolloutMetadata 659 raw := NoMethod(*s) 660 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 661} 662 663// GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion: 664// SloExclusion represents an excusion in SLI calculation applies to all 665// SLOs. 666type GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion struct { 667 // ExclusionDuration: Exclusion duration. No restrictions on the 668 // possible values. 669 // 670 // When an ongoing operation is taking longer than initially 671 // expected, 672 // an existing entry in the exclusion list can be updated by extending 673 // the 674 // duration. This is supported by the subsystem exporting eligibility 675 // data 676 // as long as such extension is committed at least 10 minutes before 677 // the 678 // original exclusion expiration - otherwise it is possible that there 679 // will 680 // be "gaps" in the exclusion application in the exported timeseries. 681 ExclusionDuration string `json:"exclusionDuration,omitempty"` 682 683 // ExclusionStartTime: Start time of the exclusion. No alignment (e.g. 684 // to a full minute) needed. 685 ExclusionStartTime string `json:"exclusionStartTime,omitempty"` 686 687 // Reason: Human-readable reason for the exclusion. 688 // This should be a static string (e.g. "Disruptive update in 689 // progress") 690 // and should not contain dynamically generated data (e.g. instance 691 // name). 692 // Can be left empty. 693 Reason string `json:"reason,omitempty"` 694 695 // SliName: Name of an SLI that this exclusion applies to. Can be left 696 // empty, 697 // signaling that the instance should be excluded from all SLIs 698 // defined 699 // in the service SLO configuration. 700 SliName string `json:"sliName,omitempty"` 701 702 // ForceSendFields is a list of field names (e.g. "ExclusionDuration") 703 // to unconditionally include in API requests. By default, fields with 704 // empty values are omitted from API requests. However, any non-pointer, 705 // non-interface field appearing in ForceSendFields will be sent to the 706 // server regardless of whether the field is empty or not. This may be 707 // used to include empty fields in Patch requests. 708 ForceSendFields []string `json:"-"` 709 710 // NullFields is a list of field names (e.g. "ExclusionDuration") to 711 // include in API requests with the JSON null value. By default, fields 712 // with empty values are omitted from API requests. However, any field 713 // with an empty value appearing in NullFields will be sent to the 714 // server as null. It is an error if a field in this list has a 715 // non-empty value. This may be used to include null fields in Patch 716 // requests. 717 NullFields []string `json:"-"` 718} 719 720func (s *GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion) MarshalJSON() ([]byte, error) { 721 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion 722 raw := NoMethod(*s) 723 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 724} 725 726// GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata: 727// SloMetadata contains resources required for proper SLO classification 728// of the 729// instance. 730type GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata struct { 731 // Exclusions: List of SLO exclusion windows. When multiple entries in 732 // the list match 733 // (matching the exclusion time-window against current time point) 734 // the exclusion reason used in the first matching entry will be 735 // published. 736 // 737 // It is not needed to include expired exclusion in this list, as only 738 // the 739 // currently applicable exclusions are taken into account by the 740 // eligibility 741 // exporting subsystem (the historical state of exclusions will be 742 // reflected 743 // in the historically produced timeseries regardless of the current 744 // state). 745 // 746 // This field can be used to mark the instance as temporary 747 // ineligible 748 // for the purpose of SLO calculation. For permanent instance SLO 749 // exclusion, 750 // a dedicated tier name can be used that does not have targets 751 // specified 752 // in the service SLO configuration. 753 Exclusions []*GoogleCloudSaasacceleratorManagementProvidersV1SloExclusion `json:"exclusions,omitempty"` 754 755 // Nodes: Optional: list of nodes. 756 // Some producers need to use per-node metadata to calculate SLO. 757 // This field allows such producers to publish per-node SLO meta 758 // data, 759 // which will be consumed by SSA Eligibility Exporter and published in 760 // the 761 // form of per node metric to Monarch. 762 Nodes []*GoogleCloudSaasacceleratorManagementProvidersV1NodeSloMetadata `json:"nodes,omitempty"` 763 764 // Tier: Name of the SLO tier the Instance belongs to. This name will be 765 // expected to 766 // match the tiers specified in the service SLO configuration. 767 // 768 // Field is mandatory and must not be empty. 769 Tier string `json:"tier,omitempty"` 770 771 // ForceSendFields is a list of field names (e.g. "Exclusions") to 772 // unconditionally include in API requests. By default, fields with 773 // empty values are omitted from API requests. However, any non-pointer, 774 // non-interface field appearing in ForceSendFields will be sent to the 775 // server regardless of whether the field is empty or not. This may be 776 // used to include empty fields in Patch requests. 777 ForceSendFields []string `json:"-"` 778 779 // NullFields is a list of field names (e.g. "Exclusions") to include in 780 // API requests with the JSON null value. By default, fields with empty 781 // values are omitted from API requests. However, any field with an 782 // empty value appearing in NullFields will be sent to the server as 783 // null. It is an error if a field in this list has a non-empty value. 784 // This may be used to include null fields in Patch requests. 785 NullFields []string `json:"-"` 786} 787 788func (s *GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata) MarshalJSON() ([]byte, error) { 789 type NoMethod GoogleCloudSaasacceleratorManagementProvidersV1SloMetadata 790 raw := NoMethod(*s) 791 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 792} 793 794// Instance: A Cloud Filestore instance. 795type Instance struct { 796 // CreateTime: Output only. The time when the instance was created. 797 CreateTime string `json:"createTime,omitempty"` 798 799 // Description: Optional. A description of the instance (2048 characters 800 // or less). 801 Description string `json:"description,omitempty"` 802 803 // Etag: Server-specified ETag for the instance resource to prevent 804 // simultaneous 805 // updates from overwriting each other. 806 Etag string `json:"etag,omitempty"` 807 808 // FileShares: File system shares on the instance. 809 // For this version, only a single file share is supported. 810 FileShares []*FileShareConfig `json:"fileShares,omitempty"` 811 812 // Labels: Resource labels to represent user provided metadata. 813 Labels map[string]string `json:"labels,omitempty"` 814 815 // Name: Output only. The resource name of the instance, in the 816 // format 817 // projects/{project_id}/locations/{location_id}/instances/{instan 818 // ce_id}. 819 Name string `json:"name,omitempty"` 820 821 // Networks: VPC networks to which the instance is connected. 822 // For this version, only a single network is supported. 823 Networks []*NetworkConfig `json:"networks,omitempty"` 824 825 // State: Output only. The instance state. 826 // 827 // Possible values: 828 // "STATE_UNSPECIFIED" - State not set. 829 // "CREATING" - The instance is being created. 830 // "READY" - The instance is available for use. 831 // "REPAIRING" - Work is being done on the instance. You can get 832 // further details from the 833 // `statusMessage` field of the `Instance` resource. 834 // "DELETING" - The instance is shutting down. 835 // "ERROR" - The instance is experiencing an issue and might be 836 // unusable. You can get 837 // further details from the `statusMessage` field of the 838 // `Instance` 839 // resource. 840 State string `json:"state,omitempty"` 841 842 // StatusMessage: Output only. Additional information about the instance 843 // state, if available. 844 StatusMessage string `json:"statusMessage,omitempty"` 845 846 // Tier: The service tier of the instance. 847 // 848 // Possible values: 849 // "TIER_UNSPECIFIED" - Not set. 850 // "STANDARD" - STANDARD tier. 851 // "PREMIUM" - PREMIUM tier. 852 Tier string `json:"tier,omitempty"` 853 854 // ServerResponse contains the HTTP response code and headers from the 855 // server. 856 googleapi.ServerResponse `json:"-"` 857 858 // ForceSendFields is a list of field names (e.g. "CreateTime") to 859 // unconditionally include in API requests. By default, fields with 860 // empty values are omitted from API requests. However, any non-pointer, 861 // non-interface field appearing in ForceSendFields will be sent to the 862 // server regardless of whether the field is empty or not. This may be 863 // used to include empty fields in Patch requests. 864 ForceSendFields []string `json:"-"` 865 866 // NullFields is a list of field names (e.g. "CreateTime") to include in 867 // API requests with the JSON null value. By default, fields with empty 868 // values are omitted from API requests. However, any field with an 869 // empty value appearing in NullFields will be sent to the server as 870 // null. It is an error if a field in this list has a non-empty value. 871 // This may be used to include null fields in Patch requests. 872 NullFields []string `json:"-"` 873} 874 875func (s *Instance) MarshalJSON() ([]byte, error) { 876 type NoMethod Instance 877 raw := NoMethod(*s) 878 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 879} 880 881// ListInstancesResponse: ListInstancesResponse is the result of 882// ListInstancesRequest. 883type ListInstancesResponse struct { 884 // Instances: A list of instances in the project for the specified 885 // location. 886 // 887 // If the {location} value in the request is "-", the response contains 888 // a list 889 // of instances from all locations. If any location is unreachable, 890 // the 891 // response will only return instances in reachable locations and 892 // the 893 // "unreachable" field will be populated with a list of unreachable 894 // locations. 895 Instances []*Instance `json:"instances,omitempty"` 896 897 // NextPageToken: The token you can use to retrieve the next page of 898 // results. Not returned 899 // if there are no more results in the list. 900 NextPageToken string `json:"nextPageToken,omitempty"` 901 902 // Unreachable: Locations that could not be reached. 903 Unreachable []string `json:"unreachable,omitempty"` 904 905 // ServerResponse contains the HTTP response code and headers from the 906 // server. 907 googleapi.ServerResponse `json:"-"` 908 909 // ForceSendFields is a list of field names (e.g. "Instances") to 910 // unconditionally include in API requests. By default, fields with 911 // empty values are omitted from API requests. However, any non-pointer, 912 // non-interface field appearing in ForceSendFields will be sent to the 913 // server regardless of whether the field is empty or not. This may be 914 // used to include empty fields in Patch requests. 915 ForceSendFields []string `json:"-"` 916 917 // NullFields is a list of field names (e.g. "Instances") to include in 918 // API requests with the JSON null value. By default, fields with empty 919 // values are omitted from API requests. However, any field with an 920 // empty value appearing in NullFields will be sent to the server as 921 // null. It is an error if a field in this list has a non-empty value. 922 // This may be used to include null fields in Patch requests. 923 NullFields []string `json:"-"` 924} 925 926func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) { 927 type NoMethod ListInstancesResponse 928 raw := NoMethod(*s) 929 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 930} 931 932// ListLocationsResponse: The response message for 933// Locations.ListLocations. 934type ListLocationsResponse struct { 935 // Locations: A list of locations that matches the specified filter in 936 // the request. 937 Locations []*Location `json:"locations,omitempty"` 938 939 // NextPageToken: The standard List next-page token. 940 NextPageToken string `json:"nextPageToken,omitempty"` 941 942 // ServerResponse contains the HTTP response code and headers from the 943 // server. 944 googleapi.ServerResponse `json:"-"` 945 946 // ForceSendFields is a list of field names (e.g. "Locations") to 947 // unconditionally include in API requests. By default, fields with 948 // empty values are omitted from API requests. However, any non-pointer, 949 // non-interface field appearing in ForceSendFields will be sent to the 950 // server regardless of whether the field is empty or not. This may be 951 // used to include empty fields in Patch requests. 952 ForceSendFields []string `json:"-"` 953 954 // NullFields is a list of field names (e.g. "Locations") to include in 955 // API requests with the JSON null value. By default, fields with empty 956 // values are omitted from API requests. However, any field with an 957 // empty value appearing in NullFields will be sent to the server as 958 // null. It is an error if a field in this list has a non-empty value. 959 // This may be used to include null fields in Patch requests. 960 NullFields []string `json:"-"` 961} 962 963func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) { 964 type NoMethod ListLocationsResponse 965 raw := NoMethod(*s) 966 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 967} 968 969// ListOperationsResponse: The response message for 970// Operations.ListOperations. 971type ListOperationsResponse struct { 972 // NextPageToken: The standard List next-page token. 973 NextPageToken string `json:"nextPageToken,omitempty"` 974 975 // Operations: A list of operations that matches the specified filter in 976 // the request. 977 Operations []*Operation `json:"operations,omitempty"` 978 979 // ServerResponse contains the HTTP response code and headers from the 980 // server. 981 googleapi.ServerResponse `json:"-"` 982 983 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 984 // unconditionally include in API requests. By default, fields with 985 // empty values are omitted from API requests. However, any non-pointer, 986 // non-interface field appearing in ForceSendFields will be sent to the 987 // server regardless of whether the field is empty or not. This may be 988 // used to include empty fields in Patch requests. 989 ForceSendFields []string `json:"-"` 990 991 // NullFields is a list of field names (e.g. "NextPageToken") to include 992 // in API requests with the JSON null value. By default, fields with 993 // empty values are omitted from API requests. However, any field with 994 // an empty value appearing in NullFields will be sent to the server as 995 // null. It is an error if a field in this list has a non-empty value. 996 // This may be used to include null fields in Patch requests. 997 NullFields []string `json:"-"` 998} 999 1000func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 1001 type NoMethod ListOperationsResponse 1002 raw := NoMethod(*s) 1003 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1004} 1005 1006// Location: A resource that represents Google Cloud Platform location. 1007type Location struct { 1008 // DisplayName: The friendly name for this location, typically a nearby 1009 // city name. 1010 // For example, "Tokyo". 1011 DisplayName string `json:"displayName,omitempty"` 1012 1013 // Labels: Cross-service attributes for the location. For example 1014 // 1015 // {"cloud.googleapis.com/region": "us-east1"} 1016 Labels map[string]string `json:"labels,omitempty"` 1017 1018 // LocationId: The canonical id for this location. For example: 1019 // "us-east1". 1020 LocationId string `json:"locationId,omitempty"` 1021 1022 // Metadata: Service-specific metadata. For example the available 1023 // capacity at the given 1024 // location. 1025 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1026 1027 // Name: Resource name for the location, which may vary between 1028 // implementations. 1029 // For example: "projects/example-project/locations/us-east1" 1030 Name string `json:"name,omitempty"` 1031 1032 // ServerResponse contains the HTTP response code and headers from the 1033 // server. 1034 googleapi.ServerResponse `json:"-"` 1035 1036 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1037 // unconditionally include in API requests. By default, fields with 1038 // empty values are omitted from API requests. However, any non-pointer, 1039 // non-interface field appearing in ForceSendFields will be sent to the 1040 // server regardless of whether the field is empty or not. This may be 1041 // used to include empty fields in Patch requests. 1042 ForceSendFields []string `json:"-"` 1043 1044 // NullFields is a list of field names (e.g. "DisplayName") to include 1045 // in API requests with the JSON null value. By default, fields with 1046 // empty values are omitted from API requests. However, any field with 1047 // an empty value appearing in NullFields will be sent to the server as 1048 // null. It is an error if a field in this list has a non-empty value. 1049 // This may be used to include null fields in Patch requests. 1050 NullFields []string `json:"-"` 1051} 1052 1053func (s *Location) MarshalJSON() ([]byte, error) { 1054 type NoMethod Location 1055 raw := NoMethod(*s) 1056 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1057} 1058 1059// NetworkConfig: Network configuration for the instance. 1060type NetworkConfig struct { 1061 // IpAddresses: Output only. IPv4 addresses in the format 1062 // {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the 1063 // format 1064 // {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 1065 // 6}:{block 1066 // 7}:{block 8}. 1067 IpAddresses []string `json:"ipAddresses,omitempty"` 1068 1069 // Modes: Internet protocol versions for which the instance has IP 1070 // addresses 1071 // assigned. For this version, only MODE_IPV4 is supported. 1072 // 1073 // Possible values: 1074 // "ADDRESS_MODE_UNSPECIFIED" - Internet protocol not set. 1075 // "MODE_IPV4" - Use the IPv4 internet protocol. 1076 Modes []string `json:"modes,omitempty"` 1077 1078 // Network: The name of the Google Compute Engine 1079 // [VPC network](/compute/docs/networks-and-firewalls#networks) to which 1080 // the 1081 // instance is connected. 1082 Network string `json:"network,omitempty"` 1083 1084 // ReservedIpRange: A /29 CIDR block in one of the 1085 // [internal IP 1086 // address 1087 // ranges](https://www.arin.net/knowledge/address_filters.html) 1088 // that 1089 // identifies the range of IP addresses reserved for this instance. 1090 // For 1091 // example, 10.0.0.0/29 or 192.168.0.0/29. The range you specify can't 1092 // overlap 1093 // with either existing subnets or assigned IP address ranges for other 1094 // Cloud 1095 // Filestore instances in the selected VPC network. 1096 ReservedIpRange string `json:"reservedIpRange,omitempty"` 1097 1098 // ForceSendFields is a list of field names (e.g. "IpAddresses") to 1099 // unconditionally include in API requests. By default, fields with 1100 // empty values are omitted from API requests. However, any non-pointer, 1101 // non-interface field appearing in ForceSendFields will be sent to the 1102 // server regardless of whether the field is empty or not. This may be 1103 // used to include empty fields in Patch requests. 1104 ForceSendFields []string `json:"-"` 1105 1106 // NullFields is a list of field names (e.g. "IpAddresses") to include 1107 // in API requests with the JSON null value. By default, fields with 1108 // empty values are omitted from API requests. However, any field with 1109 // an empty value appearing in NullFields will be sent to the server as 1110 // null. It is an error if a field in this list has a non-empty value. 1111 // This may be used to include null fields in Patch requests. 1112 NullFields []string `json:"-"` 1113} 1114 1115func (s *NetworkConfig) MarshalJSON() ([]byte, error) { 1116 type NoMethod NetworkConfig 1117 raw := NoMethod(*s) 1118 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1119} 1120 1121// Operation: This resource represents a long-running operation that is 1122// the result of a 1123// network API call. 1124type Operation struct { 1125 // Done: If the value is `false`, it means the operation is still in 1126 // progress. 1127 // If `true`, the operation is completed, and either `error` or 1128 // `response` is 1129 // available. 1130 Done bool `json:"done,omitempty"` 1131 1132 // Error: The error result of the operation in case of failure or 1133 // cancellation. 1134 Error *Status `json:"error,omitempty"` 1135 1136 // Metadata: Service-specific metadata associated with the operation. 1137 // It typically 1138 // contains progress information and common metadata such as create 1139 // time. 1140 // Some services might not provide such metadata. Any method that 1141 // returns a 1142 // long-running operation should document the metadata type, if any. 1143 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1144 1145 // Name: The server-assigned name, which is only unique within the same 1146 // service that 1147 // originally returns it. If you use the default HTTP mapping, 1148 // the 1149 // `name` should be a resource name ending with 1150 // `operations/{unique_id}`. 1151 Name string `json:"name,omitempty"` 1152 1153 // Response: The normal response of the operation in case of success. 1154 // If the original 1155 // method returns no data on success, such as `Delete`, the response 1156 // is 1157 // `google.protobuf.Empty`. If the original method is 1158 // standard 1159 // `Get`/`Create`/`Update`, the response should be the resource. For 1160 // other 1161 // methods, the response should have the type `XxxResponse`, where 1162 // `Xxx` 1163 // is the original method name. For example, if the original method 1164 // name 1165 // is `TakeSnapshot()`, the inferred response type 1166 // is 1167 // `TakeSnapshotResponse`. 1168 Response googleapi.RawMessage `json:"response,omitempty"` 1169 1170 // ServerResponse contains the HTTP response code and headers from the 1171 // server. 1172 googleapi.ServerResponse `json:"-"` 1173 1174 // ForceSendFields is a list of field names (e.g. "Done") to 1175 // unconditionally include in API requests. By default, fields with 1176 // empty values are omitted from API requests. However, any non-pointer, 1177 // non-interface field appearing in ForceSendFields will be sent to the 1178 // server regardless of whether the field is empty or not. This may be 1179 // used to include empty fields in Patch requests. 1180 ForceSendFields []string `json:"-"` 1181 1182 // NullFields is a list of field names (e.g. "Done") to include in API 1183 // requests with the JSON null value. By default, fields with empty 1184 // values are omitted from API requests. However, any field with an 1185 // empty value appearing in NullFields will be sent to the server as 1186 // null. It is an error if a field in this list has a non-empty value. 1187 // This may be used to include null fields in Patch requests. 1188 NullFields []string `json:"-"` 1189} 1190 1191func (s *Operation) MarshalJSON() ([]byte, error) { 1192 type NoMethod Operation 1193 raw := NoMethod(*s) 1194 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1195} 1196 1197// OperationMetadata: Represents the metadata of the long-running 1198// operation. 1199type OperationMetadata struct { 1200 // ApiVersion: [Output only] API version used to start the operation. 1201 ApiVersion string `json:"apiVersion,omitempty"` 1202 1203 // CancelRequested: [Output only] Identifies whether the user has 1204 // requested cancellation 1205 // of the operation. Operations that have successfully been 1206 // cancelled 1207 // have Operation.error value with a google.rpc.Status.code of 1208 // 1, 1209 // corresponding to `Code.CANCELLED`. 1210 CancelRequested bool `json:"cancelRequested,omitempty"` 1211 1212 // CreateTime: [Output only] The time the operation was created. 1213 CreateTime string `json:"createTime,omitempty"` 1214 1215 // EndTime: [Output only] The time the operation finished running. 1216 EndTime string `json:"endTime,omitempty"` 1217 1218 // StatusDetail: [Output only] Human-readable status of the operation, 1219 // if any. 1220 StatusDetail string `json:"statusDetail,omitempty"` 1221 1222 // Target: [Output only] Server-defined resource path for the target of 1223 // the operation. 1224 Target string `json:"target,omitempty"` 1225 1226 // Verb: [Output only] Name of the verb executed by the operation. 1227 Verb string `json:"verb,omitempty"` 1228 1229 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1230 // unconditionally include in API requests. By default, fields with 1231 // empty values are omitted from API requests. However, any non-pointer, 1232 // non-interface field appearing in ForceSendFields will be sent to the 1233 // server regardless of whether the field is empty or not. This may be 1234 // used to include empty fields in Patch requests. 1235 ForceSendFields []string `json:"-"` 1236 1237 // NullFields is a list of field names (e.g. "ApiVersion") to include in 1238 // API requests with the JSON null value. By default, fields with empty 1239 // values are omitted from API requests. However, any field with an 1240 // empty value appearing in NullFields will be sent to the server as 1241 // null. It is an error if a field in this list has a non-empty value. 1242 // This may be used to include null fields in Patch requests. 1243 NullFields []string `json:"-"` 1244} 1245 1246func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 1247 type NoMethod OperationMetadata 1248 raw := NoMethod(*s) 1249 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1250} 1251 1252// Status: The `Status` type defines a logical error model that is 1253// suitable for 1254// different programming environments, including REST APIs and RPC APIs. 1255// It is 1256// used by [gRPC](https://github.com/grpc). Each `Status` message 1257// contains 1258// three pieces of data: error code, error message, and error 1259// details. 1260// 1261// You can find out more about this error model and how to work with it 1262// in the 1263// [API Design Guide](https://cloud.google.com/apis/design/errors). 1264type Status struct { 1265 // Code: The status code, which should be an enum value of 1266 // google.rpc.Code. 1267 Code int64 `json:"code,omitempty"` 1268 1269 // Details: A list of messages that carry the error details. There is a 1270 // common set of 1271 // message types for APIs to use. 1272 Details []googleapi.RawMessage `json:"details,omitempty"` 1273 1274 // Message: A developer-facing error message, which should be in 1275 // English. Any 1276 // user-facing error message should be localized and sent in 1277 // the 1278 // google.rpc.Status.details field, or localized by the client. 1279 Message string `json:"message,omitempty"` 1280 1281 // ForceSendFields is a list of field names (e.g. "Code") to 1282 // unconditionally include in API requests. By default, fields with 1283 // empty values are omitted from API requests. However, any non-pointer, 1284 // non-interface field appearing in ForceSendFields will be sent to the 1285 // server regardless of whether the field is empty or not. This may be 1286 // used to include empty fields in Patch requests. 1287 ForceSendFields []string `json:"-"` 1288 1289 // NullFields is a list of field names (e.g. "Code") to include in API 1290 // requests with the JSON null value. By default, fields with empty 1291 // values are omitted from API requests. However, any field with an 1292 // empty value appearing in NullFields will be sent to the server as 1293 // null. It is an error if a field in this list has a non-empty value. 1294 // This may be used to include null fields in Patch requests. 1295 NullFields []string `json:"-"` 1296} 1297 1298func (s *Status) MarshalJSON() ([]byte, error) { 1299 type NoMethod Status 1300 raw := NoMethod(*s) 1301 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1302} 1303 1304// method id "file.projects.locations.get": 1305 1306type ProjectsLocationsGetCall struct { 1307 s *Service 1308 name string 1309 urlParams_ gensupport.URLParams 1310 ifNoneMatch_ string 1311 ctx_ context.Context 1312 header_ http.Header 1313} 1314 1315// Get: Gets information about a location. 1316func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { 1317 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1318 c.name = name 1319 return c 1320} 1321 1322// Fields allows partial responses to be retrieved. See 1323// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1324// for more information. 1325func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { 1326 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1327 return c 1328} 1329 1330// IfNoneMatch sets the optional parameter which makes the operation 1331// fail if the object's ETag matches the given value. This is useful for 1332// getting updates only after the object has changed since the last 1333// request. Use googleapi.IsNotModified to check whether the response 1334// error from Do is the result of In-None-Match. 1335func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { 1336 c.ifNoneMatch_ = entityTag 1337 return c 1338} 1339 1340// Context sets the context to be used in this call's Do method. Any 1341// pending HTTP request will be aborted if the provided context is 1342// canceled. 1343func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { 1344 c.ctx_ = ctx 1345 return c 1346} 1347 1348// Header returns an http.Header that can be modified by the caller to 1349// add HTTP headers to the request. 1350func (c *ProjectsLocationsGetCall) Header() http.Header { 1351 if c.header_ == nil { 1352 c.header_ = make(http.Header) 1353 } 1354 return c.header_ 1355} 1356 1357func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { 1358 reqHeaders := make(http.Header) 1359 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 1360 for k, v := range c.header_ { 1361 reqHeaders[k] = v 1362 } 1363 reqHeaders.Set("User-Agent", c.s.userAgent()) 1364 if c.ifNoneMatch_ != "" { 1365 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1366 } 1367 var body io.Reader = nil 1368 c.urlParams_.Set("alt", alt) 1369 c.urlParams_.Set("prettyPrint", "false") 1370 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 1371 urls += "?" + c.urlParams_.Encode() 1372 req, err := http.NewRequest("GET", urls, body) 1373 if err != nil { 1374 return nil, err 1375 } 1376 req.Header = reqHeaders 1377 googleapi.Expand(req.URL, map[string]string{ 1378 "name": c.name, 1379 }) 1380 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1381} 1382 1383// Do executes the "file.projects.locations.get" call. 1384// Exactly one of *Location or error will be non-nil. Any non-2xx status 1385// code is an error. Response headers are in either 1386// *Location.ServerResponse.Header or (if a response was returned at 1387// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1388// to check whether the returned error was because 1389// http.StatusNotModified was returned. 1390func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { 1391 gensupport.SetOptions(c.urlParams_, opts...) 1392 res, err := c.doRequest("json") 1393 if res != nil && res.StatusCode == http.StatusNotModified { 1394 if res.Body != nil { 1395 res.Body.Close() 1396 } 1397 return nil, &googleapi.Error{ 1398 Code: res.StatusCode, 1399 Header: res.Header, 1400 } 1401 } 1402 if err != nil { 1403 return nil, err 1404 } 1405 defer googleapi.CloseBody(res) 1406 if err := googleapi.CheckResponse(res); err != nil { 1407 return nil, err 1408 } 1409 ret := &Location{ 1410 ServerResponse: googleapi.ServerResponse{ 1411 Header: res.Header, 1412 HTTPStatusCode: res.StatusCode, 1413 }, 1414 } 1415 target := &ret 1416 if err := gensupport.DecodeResponse(target, res); err != nil { 1417 return nil, err 1418 } 1419 return ret, nil 1420 // { 1421 // "description": "Gets information about a location.", 1422 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}", 1423 // "httpMethod": "GET", 1424 // "id": "file.projects.locations.get", 1425 // "parameterOrder": [ 1426 // "name" 1427 // ], 1428 // "parameters": { 1429 // "name": { 1430 // "description": "Resource name for the location.", 1431 // "location": "path", 1432 // "pattern": "^projects/[^/]+/locations/[^/]+$", 1433 // "required": true, 1434 // "type": "string" 1435 // } 1436 // }, 1437 // "path": "v1beta1/{+name}", 1438 // "response": { 1439 // "$ref": "Location" 1440 // }, 1441 // "scopes": [ 1442 // "https://www.googleapis.com/auth/cloud-platform" 1443 // ] 1444 // } 1445 1446} 1447 1448// method id "file.projects.locations.list": 1449 1450type ProjectsLocationsListCall struct { 1451 s *Service 1452 name string 1453 urlParams_ gensupport.URLParams 1454 ifNoneMatch_ string 1455 ctx_ context.Context 1456 header_ http.Header 1457} 1458 1459// List: Lists information about the supported locations for this 1460// service. 1461func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { 1462 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1463 c.name = name 1464 return c 1465} 1466 1467// Filter sets the optional parameter "filter": The standard list 1468// filter. 1469func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { 1470 c.urlParams_.Set("filter", filter) 1471 return c 1472} 1473 1474// PageSize sets the optional parameter "pageSize": The standard list 1475// page size. 1476func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { 1477 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1478 return c 1479} 1480 1481// PageToken sets the optional parameter "pageToken": The standard list 1482// page token. 1483func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { 1484 c.urlParams_.Set("pageToken", pageToken) 1485 return c 1486} 1487 1488// Fields allows partial responses to be retrieved. See 1489// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1490// for more information. 1491func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { 1492 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1493 return c 1494} 1495 1496// IfNoneMatch sets the optional parameter which makes the operation 1497// fail if the object's ETag matches the given value. This is useful for 1498// getting updates only after the object has changed since the last 1499// request. Use googleapi.IsNotModified to check whether the response 1500// error from Do is the result of In-None-Match. 1501func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { 1502 c.ifNoneMatch_ = entityTag 1503 return c 1504} 1505 1506// Context sets the context to be used in this call's Do method. Any 1507// pending HTTP request will be aborted if the provided context is 1508// canceled. 1509func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { 1510 c.ctx_ = ctx 1511 return c 1512} 1513 1514// Header returns an http.Header that can be modified by the caller to 1515// add HTTP headers to the request. 1516func (c *ProjectsLocationsListCall) Header() http.Header { 1517 if c.header_ == nil { 1518 c.header_ = make(http.Header) 1519 } 1520 return c.header_ 1521} 1522 1523func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { 1524 reqHeaders := make(http.Header) 1525 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 1526 for k, v := range c.header_ { 1527 reqHeaders[k] = v 1528 } 1529 reqHeaders.Set("User-Agent", c.s.userAgent()) 1530 if c.ifNoneMatch_ != "" { 1531 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1532 } 1533 var body io.Reader = nil 1534 c.urlParams_.Set("alt", alt) 1535 c.urlParams_.Set("prettyPrint", "false") 1536 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") 1537 urls += "?" + c.urlParams_.Encode() 1538 req, err := http.NewRequest("GET", urls, body) 1539 if err != nil { 1540 return nil, err 1541 } 1542 req.Header = reqHeaders 1543 googleapi.Expand(req.URL, map[string]string{ 1544 "name": c.name, 1545 }) 1546 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1547} 1548 1549// Do executes the "file.projects.locations.list" call. 1550// Exactly one of *ListLocationsResponse or error will be non-nil. Any 1551// non-2xx status code is an error. Response headers are in either 1552// *ListLocationsResponse.ServerResponse.Header or (if a response was 1553// returned at all) in error.(*googleapi.Error).Header. Use 1554// googleapi.IsNotModified to check whether the returned error was 1555// because http.StatusNotModified was returned. 1556func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { 1557 gensupport.SetOptions(c.urlParams_, opts...) 1558 res, err := c.doRequest("json") 1559 if res != nil && res.StatusCode == http.StatusNotModified { 1560 if res.Body != nil { 1561 res.Body.Close() 1562 } 1563 return nil, &googleapi.Error{ 1564 Code: res.StatusCode, 1565 Header: res.Header, 1566 } 1567 } 1568 if err != nil { 1569 return nil, err 1570 } 1571 defer googleapi.CloseBody(res) 1572 if err := googleapi.CheckResponse(res); err != nil { 1573 return nil, err 1574 } 1575 ret := &ListLocationsResponse{ 1576 ServerResponse: googleapi.ServerResponse{ 1577 Header: res.Header, 1578 HTTPStatusCode: res.StatusCode, 1579 }, 1580 } 1581 target := &ret 1582 if err := gensupport.DecodeResponse(target, res); err != nil { 1583 return nil, err 1584 } 1585 return ret, nil 1586 // { 1587 // "description": "Lists information about the supported locations for this service.", 1588 // "flatPath": "v1beta1/projects/{projectsId}/locations", 1589 // "httpMethod": "GET", 1590 // "id": "file.projects.locations.list", 1591 // "parameterOrder": [ 1592 // "name" 1593 // ], 1594 // "parameters": { 1595 // "filter": { 1596 // "description": "The standard list filter.", 1597 // "location": "query", 1598 // "type": "string" 1599 // }, 1600 // "name": { 1601 // "description": "The resource that owns the locations collection, if applicable.", 1602 // "location": "path", 1603 // "pattern": "^projects/[^/]+$", 1604 // "required": true, 1605 // "type": "string" 1606 // }, 1607 // "pageSize": { 1608 // "description": "The standard list page size.", 1609 // "format": "int32", 1610 // "location": "query", 1611 // "type": "integer" 1612 // }, 1613 // "pageToken": { 1614 // "description": "The standard list page token.", 1615 // "location": "query", 1616 // "type": "string" 1617 // } 1618 // }, 1619 // "path": "v1beta1/{+name}/locations", 1620 // "response": { 1621 // "$ref": "ListLocationsResponse" 1622 // }, 1623 // "scopes": [ 1624 // "https://www.googleapis.com/auth/cloud-platform" 1625 // ] 1626 // } 1627 1628} 1629 1630// Pages invokes f for each page of results. 1631// A non-nil error returned from f will halt the iteration. 1632// The provided context supersedes any context provided to the Context method. 1633func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { 1634 c.ctx_ = ctx 1635 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1636 for { 1637 x, err := c.Do() 1638 if err != nil { 1639 return err 1640 } 1641 if err := f(x); err != nil { 1642 return err 1643 } 1644 if x.NextPageToken == "" { 1645 return nil 1646 } 1647 c.PageToken(x.NextPageToken) 1648 } 1649} 1650 1651// method id "file.projects.locations.instances.create": 1652 1653type ProjectsLocationsInstancesCreateCall struct { 1654 s *Service 1655 parent string 1656 instance *Instance 1657 urlParams_ gensupport.URLParams 1658 ctx_ context.Context 1659 header_ http.Header 1660} 1661 1662// Create: Creates an instance. 1663func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall { 1664 c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1665 c.parent = parent 1666 c.instance = instance 1667 return c 1668} 1669 1670// InstanceId sets the optional parameter "instanceId": The name of the 1671// instance to create. 1672// The name must be unique for the specified project and location. 1673func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall { 1674 c.urlParams_.Set("instanceId", instanceId) 1675 return c 1676} 1677 1678// Fields allows partial responses to be retrieved. See 1679// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1680// for more information. 1681func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall { 1682 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1683 return c 1684} 1685 1686// Context sets the context to be used in this call's Do method. Any 1687// pending HTTP request will be aborted if the provided context is 1688// canceled. 1689func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall { 1690 c.ctx_ = ctx 1691 return c 1692} 1693 1694// Header returns an http.Header that can be modified by the caller to 1695// add HTTP headers to the request. 1696func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { 1697 if c.header_ == nil { 1698 c.header_ = make(http.Header) 1699 } 1700 return c.header_ 1701} 1702 1703func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { 1704 reqHeaders := make(http.Header) 1705 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 1706 for k, v := range c.header_ { 1707 reqHeaders[k] = v 1708 } 1709 reqHeaders.Set("User-Agent", c.s.userAgent()) 1710 var body io.Reader = nil 1711 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) 1712 if err != nil { 1713 return nil, err 1714 } 1715 reqHeaders.Set("Content-Type", "application/json") 1716 c.urlParams_.Set("alt", alt) 1717 c.urlParams_.Set("prettyPrint", "false") 1718 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instances") 1719 urls += "?" + c.urlParams_.Encode() 1720 req, err := http.NewRequest("POST", urls, body) 1721 if err != nil { 1722 return nil, err 1723 } 1724 req.Header = reqHeaders 1725 googleapi.Expand(req.URL, map[string]string{ 1726 "parent": c.parent, 1727 }) 1728 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1729} 1730 1731// Do executes the "file.projects.locations.instances.create" call. 1732// Exactly one of *Operation or error will be non-nil. Any non-2xx 1733// status code is an error. Response headers are in either 1734// *Operation.ServerResponse.Header or (if a response was returned at 1735// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1736// to check whether the returned error was because 1737// http.StatusNotModified was returned. 1738func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1739 gensupport.SetOptions(c.urlParams_, opts...) 1740 res, err := c.doRequest("json") 1741 if res != nil && res.StatusCode == http.StatusNotModified { 1742 if res.Body != nil { 1743 res.Body.Close() 1744 } 1745 return nil, &googleapi.Error{ 1746 Code: res.StatusCode, 1747 Header: res.Header, 1748 } 1749 } 1750 if err != nil { 1751 return nil, err 1752 } 1753 defer googleapi.CloseBody(res) 1754 if err := googleapi.CheckResponse(res); err != nil { 1755 return nil, err 1756 } 1757 ret := &Operation{ 1758 ServerResponse: googleapi.ServerResponse{ 1759 Header: res.Header, 1760 HTTPStatusCode: res.StatusCode, 1761 }, 1762 } 1763 target := &ret 1764 if err := gensupport.DecodeResponse(target, res); err != nil { 1765 return nil, err 1766 } 1767 return ret, nil 1768 // { 1769 // "description": "Creates an instance.", 1770 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances", 1771 // "httpMethod": "POST", 1772 // "id": "file.projects.locations.instances.create", 1773 // "parameterOrder": [ 1774 // "parent" 1775 // ], 1776 // "parameters": { 1777 // "instanceId": { 1778 // "description": "The name of the instance to create.\nThe name must be unique for the specified project and location.", 1779 // "location": "query", 1780 // "type": "string" 1781 // }, 1782 // "parent": { 1783 // "description": "The instance's project and location, in the format\nprojects/{project_id}/locations/{location}. In Cloud Filestore,\nlocations map to GCP zones, for example **us-west1-b**.", 1784 // "location": "path", 1785 // "pattern": "^projects/[^/]+/locations/[^/]+$", 1786 // "required": true, 1787 // "type": "string" 1788 // } 1789 // }, 1790 // "path": "v1beta1/{+parent}/instances", 1791 // "request": { 1792 // "$ref": "Instance" 1793 // }, 1794 // "response": { 1795 // "$ref": "Operation" 1796 // }, 1797 // "scopes": [ 1798 // "https://www.googleapis.com/auth/cloud-platform" 1799 // ] 1800 // } 1801 1802} 1803 1804// method id "file.projects.locations.instances.delete": 1805 1806type ProjectsLocationsInstancesDeleteCall struct { 1807 s *Service 1808 name string 1809 urlParams_ gensupport.URLParams 1810 ctx_ context.Context 1811 header_ http.Header 1812} 1813 1814// Delete: Deletes an instance. 1815func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall { 1816 c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1817 c.name = name 1818 return c 1819} 1820 1821// Fields allows partial responses to be retrieved. See 1822// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1823// for more information. 1824func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall { 1825 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1826 return c 1827} 1828 1829// Context sets the context to be used in this call's Do method. Any 1830// pending HTTP request will be aborted if the provided context is 1831// canceled. 1832func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall { 1833 c.ctx_ = ctx 1834 return c 1835} 1836 1837// Header returns an http.Header that can be modified by the caller to 1838// add HTTP headers to the request. 1839func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { 1840 if c.header_ == nil { 1841 c.header_ = make(http.Header) 1842 } 1843 return c.header_ 1844} 1845 1846func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { 1847 reqHeaders := make(http.Header) 1848 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 1849 for k, v := range c.header_ { 1850 reqHeaders[k] = v 1851 } 1852 reqHeaders.Set("User-Agent", c.s.userAgent()) 1853 var body io.Reader = nil 1854 c.urlParams_.Set("alt", alt) 1855 c.urlParams_.Set("prettyPrint", "false") 1856 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 1857 urls += "?" + c.urlParams_.Encode() 1858 req, err := http.NewRequest("DELETE", urls, body) 1859 if err != nil { 1860 return nil, err 1861 } 1862 req.Header = reqHeaders 1863 googleapi.Expand(req.URL, map[string]string{ 1864 "name": c.name, 1865 }) 1866 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1867} 1868 1869// Do executes the "file.projects.locations.instances.delete" call. 1870// Exactly one of *Operation or error will be non-nil. Any non-2xx 1871// status code is an error. Response headers are in either 1872// *Operation.ServerResponse.Header or (if a response was returned at 1873// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1874// to check whether the returned error was because 1875// http.StatusNotModified was returned. 1876func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1877 gensupport.SetOptions(c.urlParams_, opts...) 1878 res, err := c.doRequest("json") 1879 if res != nil && res.StatusCode == http.StatusNotModified { 1880 if res.Body != nil { 1881 res.Body.Close() 1882 } 1883 return nil, &googleapi.Error{ 1884 Code: res.StatusCode, 1885 Header: res.Header, 1886 } 1887 } 1888 if err != nil { 1889 return nil, err 1890 } 1891 defer googleapi.CloseBody(res) 1892 if err := googleapi.CheckResponse(res); err != nil { 1893 return nil, err 1894 } 1895 ret := &Operation{ 1896 ServerResponse: googleapi.ServerResponse{ 1897 Header: res.Header, 1898 HTTPStatusCode: res.StatusCode, 1899 }, 1900 } 1901 target := &ret 1902 if err := gensupport.DecodeResponse(target, res); err != nil { 1903 return nil, err 1904 } 1905 return ret, nil 1906 // { 1907 // "description": "Deletes an instance.", 1908 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}", 1909 // "httpMethod": "DELETE", 1910 // "id": "file.projects.locations.instances.delete", 1911 // "parameterOrder": [ 1912 // "name" 1913 // ], 1914 // "parameters": { 1915 // "name": { 1916 // "description": "The instance resource name, in the format\nprojects/{project_id}/locations/{location}/instances/{instance_id}", 1917 // "location": "path", 1918 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 1919 // "required": true, 1920 // "type": "string" 1921 // } 1922 // }, 1923 // "path": "v1beta1/{+name}", 1924 // "response": { 1925 // "$ref": "Operation" 1926 // }, 1927 // "scopes": [ 1928 // "https://www.googleapis.com/auth/cloud-platform" 1929 // ] 1930 // } 1931 1932} 1933 1934// method id "file.projects.locations.instances.get": 1935 1936type ProjectsLocationsInstancesGetCall struct { 1937 s *Service 1938 name string 1939 urlParams_ gensupport.URLParams 1940 ifNoneMatch_ string 1941 ctx_ context.Context 1942 header_ http.Header 1943} 1944 1945// Get: Gets the details of a specific instance. 1946func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall { 1947 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1948 c.name = name 1949 return c 1950} 1951 1952// Fields allows partial responses to be retrieved. See 1953// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1954// for more information. 1955func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall { 1956 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1957 return c 1958} 1959 1960// IfNoneMatch sets the optional parameter which makes the operation 1961// fail if the object's ETag matches the given value. This is useful for 1962// getting updates only after the object has changed since the last 1963// request. Use googleapi.IsNotModified to check whether the response 1964// error from Do is the result of In-None-Match. 1965func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall { 1966 c.ifNoneMatch_ = entityTag 1967 return c 1968} 1969 1970// Context sets the context to be used in this call's Do method. Any 1971// pending HTTP request will be aborted if the provided context is 1972// canceled. 1973func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall { 1974 c.ctx_ = ctx 1975 return c 1976} 1977 1978// Header returns an http.Header that can be modified by the caller to 1979// add HTTP headers to the request. 1980func (c *ProjectsLocationsInstancesGetCall) Header() http.Header { 1981 if c.header_ == nil { 1982 c.header_ = make(http.Header) 1983 } 1984 return c.header_ 1985} 1986 1987func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) { 1988 reqHeaders := make(http.Header) 1989 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 1990 for k, v := range c.header_ { 1991 reqHeaders[k] = v 1992 } 1993 reqHeaders.Set("User-Agent", c.s.userAgent()) 1994 if c.ifNoneMatch_ != "" { 1995 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1996 } 1997 var body io.Reader = nil 1998 c.urlParams_.Set("alt", alt) 1999 c.urlParams_.Set("prettyPrint", "false") 2000 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2001 urls += "?" + c.urlParams_.Encode() 2002 req, err := http.NewRequest("GET", urls, body) 2003 if err != nil { 2004 return nil, err 2005 } 2006 req.Header = reqHeaders 2007 googleapi.Expand(req.URL, map[string]string{ 2008 "name": c.name, 2009 }) 2010 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2011} 2012 2013// Do executes the "file.projects.locations.instances.get" call. 2014// Exactly one of *Instance or error will be non-nil. Any non-2xx status 2015// code is an error. Response headers are in either 2016// *Instance.ServerResponse.Header or (if a response was returned at 2017// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2018// to check whether the returned error was because 2019// http.StatusNotModified was returned. 2020func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) { 2021 gensupport.SetOptions(c.urlParams_, opts...) 2022 res, err := c.doRequest("json") 2023 if res != nil && res.StatusCode == http.StatusNotModified { 2024 if res.Body != nil { 2025 res.Body.Close() 2026 } 2027 return nil, &googleapi.Error{ 2028 Code: res.StatusCode, 2029 Header: res.Header, 2030 } 2031 } 2032 if err != nil { 2033 return nil, err 2034 } 2035 defer googleapi.CloseBody(res) 2036 if err := googleapi.CheckResponse(res); err != nil { 2037 return nil, err 2038 } 2039 ret := &Instance{ 2040 ServerResponse: googleapi.ServerResponse{ 2041 Header: res.Header, 2042 HTTPStatusCode: res.StatusCode, 2043 }, 2044 } 2045 target := &ret 2046 if err := gensupport.DecodeResponse(target, res); err != nil { 2047 return nil, err 2048 } 2049 return ret, nil 2050 // { 2051 // "description": "Gets the details of a specific instance.", 2052 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}", 2053 // "httpMethod": "GET", 2054 // "id": "file.projects.locations.instances.get", 2055 // "parameterOrder": [ 2056 // "name" 2057 // ], 2058 // "parameters": { 2059 // "name": { 2060 // "description": "The instance resource name, in the format\nprojects/{project_id}/locations/{location}/instances/{instance_id}.", 2061 // "location": "path", 2062 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 2063 // "required": true, 2064 // "type": "string" 2065 // } 2066 // }, 2067 // "path": "v1beta1/{+name}", 2068 // "response": { 2069 // "$ref": "Instance" 2070 // }, 2071 // "scopes": [ 2072 // "https://www.googleapis.com/auth/cloud-platform" 2073 // ] 2074 // } 2075 2076} 2077 2078// method id "file.projects.locations.instances.list": 2079 2080type ProjectsLocationsInstancesListCall struct { 2081 s *Service 2082 parent string 2083 urlParams_ gensupport.URLParams 2084 ifNoneMatch_ string 2085 ctx_ context.Context 2086 header_ http.Header 2087} 2088 2089// List: Lists all instances in a project for either a specified 2090// location 2091// or for all locations. 2092func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall { 2093 c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2094 c.parent = parent 2095 return c 2096} 2097 2098// Filter sets the optional parameter "filter": List filter. 2099func (c *ProjectsLocationsInstancesListCall) Filter(filter string) *ProjectsLocationsInstancesListCall { 2100 c.urlParams_.Set("filter", filter) 2101 return c 2102} 2103 2104// OrderBy sets the optional parameter "orderBy": Sort results. 2105// Supported values are "name", "name desc" or "" (unsorted). 2106func (c *ProjectsLocationsInstancesListCall) OrderBy(orderBy string) *ProjectsLocationsInstancesListCall { 2107 c.urlParams_.Set("orderBy", orderBy) 2108 return c 2109} 2110 2111// PageSize sets the optional parameter "pageSize": The maximum number 2112// of items to return. 2113func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall { 2114 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2115 return c 2116} 2117 2118// PageToken sets the optional parameter "pageToken": The 2119// next_page_token value to use if there are additional 2120// results to retrieve for this list request. 2121func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall { 2122 c.urlParams_.Set("pageToken", pageToken) 2123 return c 2124} 2125 2126// Fields allows partial responses to be retrieved. See 2127// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2128// for more information. 2129func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall { 2130 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2131 return c 2132} 2133 2134// IfNoneMatch sets the optional parameter which makes the operation 2135// fail if the object's ETag matches the given value. This is useful for 2136// getting updates only after the object has changed since the last 2137// request. Use googleapi.IsNotModified to check whether the response 2138// error from Do is the result of In-None-Match. 2139func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall { 2140 c.ifNoneMatch_ = entityTag 2141 return c 2142} 2143 2144// Context sets the context to be used in this call's Do method. Any 2145// pending HTTP request will be aborted if the provided context is 2146// canceled. 2147func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall { 2148 c.ctx_ = ctx 2149 return c 2150} 2151 2152// Header returns an http.Header that can be modified by the caller to 2153// add HTTP headers to the request. 2154func (c *ProjectsLocationsInstancesListCall) Header() http.Header { 2155 if c.header_ == nil { 2156 c.header_ = make(http.Header) 2157 } 2158 return c.header_ 2159} 2160 2161func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) { 2162 reqHeaders := make(http.Header) 2163 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 2164 for k, v := range c.header_ { 2165 reqHeaders[k] = v 2166 } 2167 reqHeaders.Set("User-Agent", c.s.userAgent()) 2168 if c.ifNoneMatch_ != "" { 2169 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2170 } 2171 var body io.Reader = nil 2172 c.urlParams_.Set("alt", alt) 2173 c.urlParams_.Set("prettyPrint", "false") 2174 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instances") 2175 urls += "?" + c.urlParams_.Encode() 2176 req, err := http.NewRequest("GET", urls, body) 2177 if err != nil { 2178 return nil, err 2179 } 2180 req.Header = reqHeaders 2181 googleapi.Expand(req.URL, map[string]string{ 2182 "parent": c.parent, 2183 }) 2184 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2185} 2186 2187// Do executes the "file.projects.locations.instances.list" call. 2188// Exactly one of *ListInstancesResponse or error will be non-nil. Any 2189// non-2xx status code is an error. Response headers are in either 2190// *ListInstancesResponse.ServerResponse.Header or (if a response was 2191// returned at all) in error.(*googleapi.Error).Header. Use 2192// googleapi.IsNotModified to check whether the returned error was 2193// because http.StatusNotModified was returned. 2194func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) { 2195 gensupport.SetOptions(c.urlParams_, opts...) 2196 res, err := c.doRequest("json") 2197 if res != nil && res.StatusCode == http.StatusNotModified { 2198 if res.Body != nil { 2199 res.Body.Close() 2200 } 2201 return nil, &googleapi.Error{ 2202 Code: res.StatusCode, 2203 Header: res.Header, 2204 } 2205 } 2206 if err != nil { 2207 return nil, err 2208 } 2209 defer googleapi.CloseBody(res) 2210 if err := googleapi.CheckResponse(res); err != nil { 2211 return nil, err 2212 } 2213 ret := &ListInstancesResponse{ 2214 ServerResponse: googleapi.ServerResponse{ 2215 Header: res.Header, 2216 HTTPStatusCode: res.StatusCode, 2217 }, 2218 } 2219 target := &ret 2220 if err := gensupport.DecodeResponse(target, res); err != nil { 2221 return nil, err 2222 } 2223 return ret, nil 2224 // { 2225 // "description": "Lists all instances in a project for either a specified location\nor for all locations.", 2226 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances", 2227 // "httpMethod": "GET", 2228 // "id": "file.projects.locations.instances.list", 2229 // "parameterOrder": [ 2230 // "parent" 2231 // ], 2232 // "parameters": { 2233 // "filter": { 2234 // "description": "List filter.", 2235 // "location": "query", 2236 // "type": "string" 2237 // }, 2238 // "orderBy": { 2239 // "description": "Sort results. Supported values are \"name\", \"name desc\" or \"\" (unsorted).", 2240 // "location": "query", 2241 // "type": "string" 2242 // }, 2243 // "pageSize": { 2244 // "description": "The maximum number of items to return.", 2245 // "format": "int32", 2246 // "location": "query", 2247 // "type": "integer" 2248 // }, 2249 // "pageToken": { 2250 // "description": "The next_page_token value to use if there are additional\nresults to retrieve for this list request.", 2251 // "location": "query", 2252 // "type": "string" 2253 // }, 2254 // "parent": { 2255 // "description": "The project and location for which to retrieve instance information,\nin the format projects/{project_id}/locations/{location}. In Cloud\nFilestore, locations map to GCP zones, for example **us-west1-b**. To\nretrieve instance information for all locations, use \"-\" for the {location}\nvalue.", 2256 // "location": "path", 2257 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2258 // "required": true, 2259 // "type": "string" 2260 // } 2261 // }, 2262 // "path": "v1beta1/{+parent}/instances", 2263 // "response": { 2264 // "$ref": "ListInstancesResponse" 2265 // }, 2266 // "scopes": [ 2267 // "https://www.googleapis.com/auth/cloud-platform" 2268 // ] 2269 // } 2270 2271} 2272 2273// Pages invokes f for each page of results. 2274// A non-nil error returned from f will halt the iteration. 2275// The provided context supersedes any context provided to the Context method. 2276func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error { 2277 c.ctx_ = ctx 2278 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2279 for { 2280 x, err := c.Do() 2281 if err != nil { 2282 return err 2283 } 2284 if err := f(x); err != nil { 2285 return err 2286 } 2287 if x.NextPageToken == "" { 2288 return nil 2289 } 2290 c.PageToken(x.NextPageToken) 2291 } 2292} 2293 2294// method id "file.projects.locations.instances.patch": 2295 2296type ProjectsLocationsInstancesPatchCall struct { 2297 s *Service 2298 name string 2299 instance *Instance 2300 urlParams_ gensupport.URLParams 2301 ctx_ context.Context 2302 header_ http.Header 2303} 2304 2305// Patch: Updates the settings of a specific instance. 2306func (r *ProjectsLocationsInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsInstancesPatchCall { 2307 c := &ProjectsLocationsInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2308 c.name = name 2309 c.instance = instance 2310 return c 2311} 2312 2313// UpdateMask sets the optional parameter "updateMask": Mask of fields 2314// to update. At least one path must be supplied in this 2315// field. The elements of the repeated paths field may only include 2316// these 2317// fields: 2318// "description" 2319// "file_shares" 2320// "labels" 2321func (c *ProjectsLocationsInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesPatchCall { 2322 c.urlParams_.Set("updateMask", updateMask) 2323 return c 2324} 2325 2326// Fields allows partial responses to be retrieved. See 2327// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2328// for more information. 2329func (c *ProjectsLocationsInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPatchCall { 2330 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2331 return c 2332} 2333 2334// Context sets the context to be used in this call's Do method. Any 2335// pending HTTP request will be aborted if the provided context is 2336// canceled. 2337func (c *ProjectsLocationsInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesPatchCall { 2338 c.ctx_ = ctx 2339 return c 2340} 2341 2342// Header returns an http.Header that can be modified by the caller to 2343// add HTTP headers to the request. 2344func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { 2345 if c.header_ == nil { 2346 c.header_ = make(http.Header) 2347 } 2348 return c.header_ 2349} 2350 2351func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { 2352 reqHeaders := make(http.Header) 2353 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 2354 for k, v := range c.header_ { 2355 reqHeaders[k] = v 2356 } 2357 reqHeaders.Set("User-Agent", c.s.userAgent()) 2358 var body io.Reader = nil 2359 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) 2360 if err != nil { 2361 return nil, err 2362 } 2363 reqHeaders.Set("Content-Type", "application/json") 2364 c.urlParams_.Set("alt", alt) 2365 c.urlParams_.Set("prettyPrint", "false") 2366 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2367 urls += "?" + c.urlParams_.Encode() 2368 req, err := http.NewRequest("PATCH", urls, body) 2369 if err != nil { 2370 return nil, err 2371 } 2372 req.Header = reqHeaders 2373 googleapi.Expand(req.URL, map[string]string{ 2374 "name": c.name, 2375 }) 2376 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2377} 2378 2379// Do executes the "file.projects.locations.instances.patch" call. 2380// Exactly one of *Operation or error will be non-nil. Any non-2xx 2381// status code is an error. Response headers are in either 2382// *Operation.ServerResponse.Header or (if a response was returned at 2383// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2384// to check whether the returned error was because 2385// http.StatusNotModified was returned. 2386func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2387 gensupport.SetOptions(c.urlParams_, opts...) 2388 res, err := c.doRequest("json") 2389 if res != nil && res.StatusCode == http.StatusNotModified { 2390 if res.Body != nil { 2391 res.Body.Close() 2392 } 2393 return nil, &googleapi.Error{ 2394 Code: res.StatusCode, 2395 Header: res.Header, 2396 } 2397 } 2398 if err != nil { 2399 return nil, err 2400 } 2401 defer googleapi.CloseBody(res) 2402 if err := googleapi.CheckResponse(res); err != nil { 2403 return nil, err 2404 } 2405 ret := &Operation{ 2406 ServerResponse: googleapi.ServerResponse{ 2407 Header: res.Header, 2408 HTTPStatusCode: res.StatusCode, 2409 }, 2410 } 2411 target := &ret 2412 if err := gensupport.DecodeResponse(target, res); err != nil { 2413 return nil, err 2414 } 2415 return ret, nil 2416 // { 2417 // "description": "Updates the settings of a specific instance.", 2418 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}", 2419 // "httpMethod": "PATCH", 2420 // "id": "file.projects.locations.instances.patch", 2421 // "parameterOrder": [ 2422 // "name" 2423 // ], 2424 // "parameters": { 2425 // "name": { 2426 // "description": "Output only. The resource name of the instance, in the format\nprojects/{project_id}/locations/{location_id}/instances/{instance_id}.", 2427 // "location": "path", 2428 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 2429 // "required": true, 2430 // "type": "string" 2431 // }, 2432 // "updateMask": { 2433 // "description": "Mask of fields to update. At least one path must be supplied in this\nfield. The elements of the repeated paths field may only include these\nfields:\n\"description\"\n\"file_shares\"\n\"labels\"", 2434 // "format": "google-fieldmask", 2435 // "location": "query", 2436 // "type": "string" 2437 // } 2438 // }, 2439 // "path": "v1beta1/{+name}", 2440 // "request": { 2441 // "$ref": "Instance" 2442 // }, 2443 // "response": { 2444 // "$ref": "Operation" 2445 // }, 2446 // "scopes": [ 2447 // "https://www.googleapis.com/auth/cloud-platform" 2448 // ] 2449 // } 2450 2451} 2452 2453// method id "file.projects.locations.operations.cancel": 2454 2455type ProjectsLocationsOperationsCancelCall struct { 2456 s *Service 2457 name string 2458 canceloperationrequest *CancelOperationRequest 2459 urlParams_ gensupport.URLParams 2460 ctx_ context.Context 2461 header_ http.Header 2462} 2463 2464// Cancel: Starts asynchronous cancellation on a long-running operation. 2465// The server 2466// makes a best effort to cancel the operation, but success is 2467// not 2468// guaranteed. If the server doesn't support this method, it 2469// returns 2470// `google.rpc.Code.UNIMPLEMENTED`. Clients can 2471// use 2472// Operations.GetOperation or 2473// other methods to check whether the cancellation succeeded or whether 2474// the 2475// operation completed despite cancellation. On successful 2476// cancellation, 2477// the operation is not deleted; instead, it becomes an operation 2478// with 2479// an Operation.error value with a google.rpc.Status.code of 2480// 1, 2481// corresponding to `Code.CANCELLED`. 2482func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { 2483 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2484 c.name = name 2485 c.canceloperationrequest = canceloperationrequest 2486 return c 2487} 2488 2489// Fields allows partial responses to be retrieved. See 2490// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2491// for more information. 2492func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 2493 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2494 return c 2495} 2496 2497// Context sets the context to be used in this call's Do method. Any 2498// pending HTTP request will be aborted if the provided context is 2499// canceled. 2500func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { 2501 c.ctx_ = ctx 2502 return c 2503} 2504 2505// Header returns an http.Header that can be modified by the caller to 2506// add HTTP headers to the request. 2507func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { 2508 if c.header_ == nil { 2509 c.header_ = make(http.Header) 2510 } 2511 return c.header_ 2512} 2513 2514func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 2515 reqHeaders := make(http.Header) 2516 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 2517 for k, v := range c.header_ { 2518 reqHeaders[k] = v 2519 } 2520 reqHeaders.Set("User-Agent", c.s.userAgent()) 2521 var body io.Reader = nil 2522 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 2523 if err != nil { 2524 return nil, err 2525 } 2526 reqHeaders.Set("Content-Type", "application/json") 2527 c.urlParams_.Set("alt", alt) 2528 c.urlParams_.Set("prettyPrint", "false") 2529 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") 2530 urls += "?" + c.urlParams_.Encode() 2531 req, err := http.NewRequest("POST", urls, body) 2532 if err != nil { 2533 return nil, err 2534 } 2535 req.Header = reqHeaders 2536 googleapi.Expand(req.URL, map[string]string{ 2537 "name": c.name, 2538 }) 2539 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2540} 2541 2542// Do executes the "file.projects.locations.operations.cancel" call. 2543// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2544// code is an error. Response headers are in either 2545// *Empty.ServerResponse.Header or (if a response was returned at all) 2546// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2547// check whether the returned error was because http.StatusNotModified 2548// was returned. 2549func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2550 gensupport.SetOptions(c.urlParams_, opts...) 2551 res, err := c.doRequest("json") 2552 if res != nil && res.StatusCode == http.StatusNotModified { 2553 if res.Body != nil { 2554 res.Body.Close() 2555 } 2556 return nil, &googleapi.Error{ 2557 Code: res.StatusCode, 2558 Header: res.Header, 2559 } 2560 } 2561 if err != nil { 2562 return nil, err 2563 } 2564 defer googleapi.CloseBody(res) 2565 if err := googleapi.CheckResponse(res); err != nil { 2566 return nil, err 2567 } 2568 ret := &Empty{ 2569 ServerResponse: googleapi.ServerResponse{ 2570 Header: res.Header, 2571 HTTPStatusCode: res.StatusCode, 2572 }, 2573 } 2574 target := &ret 2575 if err := gensupport.DecodeResponse(target, res); err != nil { 2576 return nil, err 2577 } 2578 return ret, nil 2579 // { 2580 // "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.", 2581 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", 2582 // "httpMethod": "POST", 2583 // "id": "file.projects.locations.operations.cancel", 2584 // "parameterOrder": [ 2585 // "name" 2586 // ], 2587 // "parameters": { 2588 // "name": { 2589 // "description": "The name of the operation resource to be cancelled.", 2590 // "location": "path", 2591 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2592 // "required": true, 2593 // "type": "string" 2594 // } 2595 // }, 2596 // "path": "v1beta1/{+name}:cancel", 2597 // "request": { 2598 // "$ref": "CancelOperationRequest" 2599 // }, 2600 // "response": { 2601 // "$ref": "Empty" 2602 // }, 2603 // "scopes": [ 2604 // "https://www.googleapis.com/auth/cloud-platform" 2605 // ] 2606 // } 2607 2608} 2609 2610// method id "file.projects.locations.operations.delete": 2611 2612type ProjectsLocationsOperationsDeleteCall struct { 2613 s *Service 2614 name string 2615 urlParams_ gensupport.URLParams 2616 ctx_ context.Context 2617 header_ http.Header 2618} 2619 2620// Delete: Deletes a long-running operation. This method indicates that 2621// the client is 2622// no longer interested in the operation result. It does not cancel 2623// the 2624// operation. If the server doesn't support this method, it 2625// returns 2626// `google.rpc.Code.UNIMPLEMENTED`. 2627func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall { 2628 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2629 c.name = name 2630 return c 2631} 2632 2633// Fields allows partial responses to be retrieved. See 2634// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2635// for more information. 2636func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall { 2637 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2638 return c 2639} 2640 2641// Context sets the context to be used in this call's Do method. Any 2642// pending HTTP request will be aborted if the provided context is 2643// canceled. 2644func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall { 2645 c.ctx_ = ctx 2646 return c 2647} 2648 2649// Header returns an http.Header that can be modified by the caller to 2650// add HTTP headers to the request. 2651func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { 2652 if c.header_ == nil { 2653 c.header_ = make(http.Header) 2654 } 2655 return c.header_ 2656} 2657 2658func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 2659 reqHeaders := make(http.Header) 2660 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 2661 for k, v := range c.header_ { 2662 reqHeaders[k] = v 2663 } 2664 reqHeaders.Set("User-Agent", c.s.userAgent()) 2665 var body io.Reader = nil 2666 c.urlParams_.Set("alt", alt) 2667 c.urlParams_.Set("prettyPrint", "false") 2668 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2669 urls += "?" + c.urlParams_.Encode() 2670 req, err := http.NewRequest("DELETE", urls, body) 2671 if err != nil { 2672 return nil, err 2673 } 2674 req.Header = reqHeaders 2675 googleapi.Expand(req.URL, map[string]string{ 2676 "name": c.name, 2677 }) 2678 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2679} 2680 2681// Do executes the "file.projects.locations.operations.delete" call. 2682// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2683// code is an error. Response headers are in either 2684// *Empty.ServerResponse.Header or (if a response was returned at all) 2685// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2686// check whether the returned error was because http.StatusNotModified 2687// was returned. 2688func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2689 gensupport.SetOptions(c.urlParams_, opts...) 2690 res, err := c.doRequest("json") 2691 if res != nil && res.StatusCode == http.StatusNotModified { 2692 if res.Body != nil { 2693 res.Body.Close() 2694 } 2695 return nil, &googleapi.Error{ 2696 Code: res.StatusCode, 2697 Header: res.Header, 2698 } 2699 } 2700 if err != nil { 2701 return nil, err 2702 } 2703 defer googleapi.CloseBody(res) 2704 if err := googleapi.CheckResponse(res); err != nil { 2705 return nil, err 2706 } 2707 ret := &Empty{ 2708 ServerResponse: googleapi.ServerResponse{ 2709 Header: res.Header, 2710 HTTPStatusCode: res.StatusCode, 2711 }, 2712 } 2713 target := &ret 2714 if err := gensupport.DecodeResponse(target, res); err != nil { 2715 return nil, err 2716 } 2717 return ret, nil 2718 // { 2719 // "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.", 2720 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 2721 // "httpMethod": "DELETE", 2722 // "id": "file.projects.locations.operations.delete", 2723 // "parameterOrder": [ 2724 // "name" 2725 // ], 2726 // "parameters": { 2727 // "name": { 2728 // "description": "The name of the operation resource to be deleted.", 2729 // "location": "path", 2730 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2731 // "required": true, 2732 // "type": "string" 2733 // } 2734 // }, 2735 // "path": "v1beta1/{+name}", 2736 // "response": { 2737 // "$ref": "Empty" 2738 // }, 2739 // "scopes": [ 2740 // "https://www.googleapis.com/auth/cloud-platform" 2741 // ] 2742 // } 2743 2744} 2745 2746// method id "file.projects.locations.operations.get": 2747 2748type ProjectsLocationsOperationsGetCall struct { 2749 s *Service 2750 name string 2751 urlParams_ gensupport.URLParams 2752 ifNoneMatch_ string 2753 ctx_ context.Context 2754 header_ http.Header 2755} 2756 2757// Get: Gets the latest state of a long-running operation. Clients can 2758// use this 2759// method to poll the operation result at intervals as recommended by 2760// the API 2761// service. 2762func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 2763 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2764 c.name = name 2765 return c 2766} 2767 2768// Fields allows partial responses to be retrieved. See 2769// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2770// for more information. 2771func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 2772 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2773 return c 2774} 2775 2776// IfNoneMatch sets the optional parameter which makes the operation 2777// fail if the object's ETag matches the given value. This is useful for 2778// getting updates only after the object has changed since the last 2779// request. Use googleapi.IsNotModified to check whether the response 2780// error from Do is the result of In-None-Match. 2781func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 2782 c.ifNoneMatch_ = entityTag 2783 return c 2784} 2785 2786// Context sets the context to be used in this call's Do method. Any 2787// pending HTTP request will be aborted if the provided context is 2788// canceled. 2789func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 2790 c.ctx_ = ctx 2791 return c 2792} 2793 2794// Header returns an http.Header that can be modified by the caller to 2795// add HTTP headers to the request. 2796func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 2797 if c.header_ == nil { 2798 c.header_ = make(http.Header) 2799 } 2800 return c.header_ 2801} 2802 2803func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 2804 reqHeaders := make(http.Header) 2805 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 2806 for k, v := range c.header_ { 2807 reqHeaders[k] = v 2808 } 2809 reqHeaders.Set("User-Agent", c.s.userAgent()) 2810 if c.ifNoneMatch_ != "" { 2811 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2812 } 2813 var body io.Reader = nil 2814 c.urlParams_.Set("alt", alt) 2815 c.urlParams_.Set("prettyPrint", "false") 2816 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2817 urls += "?" + c.urlParams_.Encode() 2818 req, err := http.NewRequest("GET", urls, body) 2819 if err != nil { 2820 return nil, err 2821 } 2822 req.Header = reqHeaders 2823 googleapi.Expand(req.URL, map[string]string{ 2824 "name": c.name, 2825 }) 2826 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2827} 2828 2829// Do executes the "file.projects.locations.operations.get" call. 2830// Exactly one of *Operation or error will be non-nil. Any non-2xx 2831// status code is an error. Response headers are in either 2832// *Operation.ServerResponse.Header or (if a response was returned at 2833// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2834// to check whether the returned error was because 2835// http.StatusNotModified was returned. 2836func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2837 gensupport.SetOptions(c.urlParams_, opts...) 2838 res, err := c.doRequest("json") 2839 if res != nil && res.StatusCode == http.StatusNotModified { 2840 if res.Body != nil { 2841 res.Body.Close() 2842 } 2843 return nil, &googleapi.Error{ 2844 Code: res.StatusCode, 2845 Header: res.Header, 2846 } 2847 } 2848 if err != nil { 2849 return nil, err 2850 } 2851 defer googleapi.CloseBody(res) 2852 if err := googleapi.CheckResponse(res); err != nil { 2853 return nil, err 2854 } 2855 ret := &Operation{ 2856 ServerResponse: googleapi.ServerResponse{ 2857 Header: res.Header, 2858 HTTPStatusCode: res.StatusCode, 2859 }, 2860 } 2861 target := &ret 2862 if err := gensupport.DecodeResponse(target, res); err != nil { 2863 return nil, err 2864 } 2865 return ret, nil 2866 // { 2867 // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.", 2868 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 2869 // "httpMethod": "GET", 2870 // "id": "file.projects.locations.operations.get", 2871 // "parameterOrder": [ 2872 // "name" 2873 // ], 2874 // "parameters": { 2875 // "name": { 2876 // "description": "The name of the operation resource.", 2877 // "location": "path", 2878 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2879 // "required": true, 2880 // "type": "string" 2881 // } 2882 // }, 2883 // "path": "v1beta1/{+name}", 2884 // "response": { 2885 // "$ref": "Operation" 2886 // }, 2887 // "scopes": [ 2888 // "https://www.googleapis.com/auth/cloud-platform" 2889 // ] 2890 // } 2891 2892} 2893 2894// method id "file.projects.locations.operations.list": 2895 2896type ProjectsLocationsOperationsListCall struct { 2897 s *Service 2898 name string 2899 urlParams_ gensupport.URLParams 2900 ifNoneMatch_ string 2901 ctx_ context.Context 2902 header_ http.Header 2903} 2904 2905// List: Lists operations that match the specified filter in the 2906// request. If the 2907// server doesn't support this method, it returns 2908// `UNIMPLEMENTED`. 2909// 2910// NOTE: the `name` binding allows API services to override the 2911// binding 2912// to use different resource name schemes, such as `users/*/operations`. 2913// To 2914// override the binding, API services can add a binding such 2915// as 2916// "/v1/{name=users/*}/operations" to their service configuration. 2917// For backwards compatibility, the default name includes the 2918// operations 2919// collection id, however overriding users must ensure the name 2920// binding 2921// is the parent resource, without the operations collection id. 2922func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 2923 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2924 c.name = name 2925 return c 2926} 2927 2928// Filter sets the optional parameter "filter": The standard list 2929// filter. 2930func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 2931 c.urlParams_.Set("filter", filter) 2932 return c 2933} 2934 2935// PageSize sets the optional parameter "pageSize": The standard list 2936// page size. 2937func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 2938 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2939 return c 2940} 2941 2942// PageToken sets the optional parameter "pageToken": The standard list 2943// page token. 2944func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 2945 c.urlParams_.Set("pageToken", pageToken) 2946 return c 2947} 2948 2949// Fields allows partial responses to be retrieved. See 2950// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2951// for more information. 2952func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 2953 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2954 return c 2955} 2956 2957// IfNoneMatch sets the optional parameter which makes the operation 2958// fail if the object's ETag matches the given value. This is useful for 2959// getting updates only after the object has changed since the last 2960// request. Use googleapi.IsNotModified to check whether the response 2961// error from Do is the result of In-None-Match. 2962func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 2963 c.ifNoneMatch_ = entityTag 2964 return c 2965} 2966 2967// Context sets the context to be used in this call's Do method. Any 2968// pending HTTP request will be aborted if the provided context is 2969// canceled. 2970func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 2971 c.ctx_ = ctx 2972 return c 2973} 2974 2975// Header returns an http.Header that can be modified by the caller to 2976// add HTTP headers to the request. 2977func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 2978 if c.header_ == nil { 2979 c.header_ = make(http.Header) 2980 } 2981 return c.header_ 2982} 2983 2984func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 2985 reqHeaders := make(http.Header) 2986 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 2987 for k, v := range c.header_ { 2988 reqHeaders[k] = v 2989 } 2990 reqHeaders.Set("User-Agent", c.s.userAgent()) 2991 if c.ifNoneMatch_ != "" { 2992 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2993 } 2994 var body io.Reader = nil 2995 c.urlParams_.Set("alt", alt) 2996 c.urlParams_.Set("prettyPrint", "false") 2997 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") 2998 urls += "?" + c.urlParams_.Encode() 2999 req, err := http.NewRequest("GET", urls, body) 3000 if err != nil { 3001 return nil, err 3002 } 3003 req.Header = reqHeaders 3004 googleapi.Expand(req.URL, map[string]string{ 3005 "name": c.name, 3006 }) 3007 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3008} 3009 3010// Do executes the "file.projects.locations.operations.list" call. 3011// Exactly one of *ListOperationsResponse or error will be non-nil. Any 3012// non-2xx status code is an error. Response headers are in either 3013// *ListOperationsResponse.ServerResponse.Header or (if a response was 3014// returned at all) in error.(*googleapi.Error).Header. Use 3015// googleapi.IsNotModified to check whether the returned error was 3016// because http.StatusNotModified was returned. 3017func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 3018 gensupport.SetOptions(c.urlParams_, opts...) 3019 res, err := c.doRequest("json") 3020 if res != nil && res.StatusCode == http.StatusNotModified { 3021 if res.Body != nil { 3022 res.Body.Close() 3023 } 3024 return nil, &googleapi.Error{ 3025 Code: res.StatusCode, 3026 Header: res.Header, 3027 } 3028 } 3029 if err != nil { 3030 return nil, err 3031 } 3032 defer googleapi.CloseBody(res) 3033 if err := googleapi.CheckResponse(res); err != nil { 3034 return nil, err 3035 } 3036 ret := &ListOperationsResponse{ 3037 ServerResponse: googleapi.ServerResponse{ 3038 Header: res.Header, 3039 HTTPStatusCode: res.StatusCode, 3040 }, 3041 } 3042 target := &ret 3043 if err := gensupport.DecodeResponse(target, res); err != nil { 3044 return nil, err 3045 } 3046 return ret, nil 3047 // { 3048 // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.", 3049 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations", 3050 // "httpMethod": "GET", 3051 // "id": "file.projects.locations.operations.list", 3052 // "parameterOrder": [ 3053 // "name" 3054 // ], 3055 // "parameters": { 3056 // "filter": { 3057 // "description": "The standard list filter.", 3058 // "location": "query", 3059 // "type": "string" 3060 // }, 3061 // "name": { 3062 // "description": "The name of the operation's parent resource.", 3063 // "location": "path", 3064 // "pattern": "^projects/[^/]+/locations/[^/]+$", 3065 // "required": true, 3066 // "type": "string" 3067 // }, 3068 // "pageSize": { 3069 // "description": "The standard list page size.", 3070 // "format": "int32", 3071 // "location": "query", 3072 // "type": "integer" 3073 // }, 3074 // "pageToken": { 3075 // "description": "The standard list page token.", 3076 // "location": "query", 3077 // "type": "string" 3078 // } 3079 // }, 3080 // "path": "v1beta1/{+name}/operations", 3081 // "response": { 3082 // "$ref": "ListOperationsResponse" 3083 // }, 3084 // "scopes": [ 3085 // "https://www.googleapis.com/auth/cloud-platform" 3086 // ] 3087 // } 3088 3089} 3090 3091// Pages invokes f for each page of results. 3092// A non-nil error returned from f will halt the iteration. 3093// The provided context supersedes any context provided to the Context method. 3094func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 3095 c.ctx_ = ctx 3096 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3097 for { 3098 x, err := c.Do() 3099 if err != nil { 3100 return err 3101 } 3102 if err := f(x); err != nil { 3103 return err 3104 } 3105 if x.NextPageToken == "" { 3106 return nil 3107 } 3108 c.PageToken(x.NextPageToken) 3109 } 3110} 3111