1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package cloudtasks provides access to the Cloud Tasks API. 8// 9// This package is DEPRECATED. Use package cloud.google.com/go/cloudtasks/apiv2beta2 instead. 10// 11// For product documentation, see: https://cloud.google.com/tasks/ 12// 13// Creating a client 14// 15// Usage example: 16// 17// import "google.golang.org/api/cloudtasks/v2beta2" 18// ... 19// ctx := context.Background() 20// cloudtasksService, err := cloudtasks.NewService(ctx) 21// 22// In this example, Google Application Default Credentials are used for authentication. 23// 24// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 25// 26// Other authentication options 27// 28// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 29// 30// cloudtasksService, err := cloudtasks.NewService(ctx, option.WithAPIKey("AIza...")) 31// 32// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 33// 34// config := &oauth2.Config{...} 35// // ... 36// token, err := config.Exchange(ctx, ...) 37// cloudtasksService, err := cloudtasks.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 38// 39// See https://godoc.org/google.golang.org/api/option/ for details on options. 40package cloudtasks // import "google.golang.org/api/cloudtasks/v2beta2" 41 42import ( 43 "bytes" 44 "context" 45 "encoding/json" 46 "errors" 47 "fmt" 48 "io" 49 "net/http" 50 "net/url" 51 "strconv" 52 "strings" 53 54 googleapi "google.golang.org/api/googleapi" 55 gensupport "google.golang.org/api/internal/gensupport" 56 option "google.golang.org/api/option" 57 internaloption "google.golang.org/api/option/internaloption" 58 htransport "google.golang.org/api/transport/http" 59) 60 61// Always reference these packages, just in case the auto-generated code 62// below doesn't. 63var _ = bytes.NewBuffer 64var _ = strconv.Itoa 65var _ = fmt.Sprintf 66var _ = json.NewDecoder 67var _ = io.Copy 68var _ = url.Parse 69var _ = gensupport.MarshalJSON 70var _ = googleapi.Version 71var _ = errors.New 72var _ = strings.Replace 73var _ = context.Canceled 74var _ = internaloption.WithDefaultEndpoint 75 76const apiId = "cloudtasks:v2beta2" 77const apiName = "cloudtasks" 78const apiVersion = "v2beta2" 79const basePath = "https://cloudtasks.googleapis.com/" 80const mtlsBasePath = "https://cloudtasks.mtls.googleapis.com/" 81 82// OAuth2 scopes used by this API. 83const ( 84 // See, edit, configure, and delete your Google Cloud data and see the 85 // email address for your Google Account. 86 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 87) 88 89// NewService creates a new Service. 90func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 91 scopesOption := option.WithScopes( 92 "https://www.googleapis.com/auth/cloud-platform", 93 ) 94 // NOTE: prepend, so we don't override user-specified scopes. 95 opts = append([]option.ClientOption{scopesOption}, opts...) 96 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 97 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 98 client, endpoint, err := htransport.NewClient(ctx, opts...) 99 if err != nil { 100 return nil, err 101 } 102 s, err := New(client) 103 if err != nil { 104 return nil, err 105 } 106 if endpoint != "" { 107 s.BasePath = endpoint 108 } 109 return s, nil 110} 111 112// New creates a new Service. It uses the provided http.Client for requests. 113// 114// Deprecated: please use NewService instead. 115// To provide a custom HTTP client, use option.WithHTTPClient. 116// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 117func New(client *http.Client) (*Service, error) { 118 if client == nil { 119 return nil, errors.New("client is nil") 120 } 121 s := &Service{client: client, BasePath: basePath} 122 s.Projects = NewProjectsService(s) 123 return s, nil 124} 125 126type Service struct { 127 client *http.Client 128 BasePath string // API endpoint base URL 129 UserAgent string // optional additional User-Agent fragment 130 131 Projects *ProjectsService 132} 133 134func (s *Service) userAgent() string { 135 if s.UserAgent == "" { 136 return googleapi.UserAgent 137 } 138 return googleapi.UserAgent + " " + s.UserAgent 139} 140 141func NewProjectsService(s *Service) *ProjectsService { 142 rs := &ProjectsService{s: s} 143 rs.Locations = NewProjectsLocationsService(s) 144 return rs 145} 146 147type ProjectsService struct { 148 s *Service 149 150 Locations *ProjectsLocationsService 151} 152 153func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 154 rs := &ProjectsLocationsService{s: s} 155 rs.Queues = NewProjectsLocationsQueuesService(s) 156 return rs 157} 158 159type ProjectsLocationsService struct { 160 s *Service 161 162 Queues *ProjectsLocationsQueuesService 163} 164 165func NewProjectsLocationsQueuesService(s *Service) *ProjectsLocationsQueuesService { 166 rs := &ProjectsLocationsQueuesService{s: s} 167 rs.Tasks = NewProjectsLocationsQueuesTasksService(s) 168 return rs 169} 170 171type ProjectsLocationsQueuesService struct { 172 s *Service 173 174 Tasks *ProjectsLocationsQueuesTasksService 175} 176 177func NewProjectsLocationsQueuesTasksService(s *Service) *ProjectsLocationsQueuesTasksService { 178 rs := &ProjectsLocationsQueuesTasksService{s: s} 179 return rs 180} 181 182type ProjectsLocationsQueuesTasksService struct { 183 s *Service 184} 185 186// AcknowledgeTaskRequest: Request message for acknowledging a task 187// using AcknowledgeTask. 188type AcknowledgeTaskRequest struct { 189 // ScheduleTime: Required. The task's current schedule time, available 190 // in the schedule_time returned by LeaseTasks response or RenewLease 191 // response. This restriction is to ensure that your worker currently 192 // holds the lease. 193 ScheduleTime string `json:"scheduleTime,omitempty"` 194 195 // ForceSendFields is a list of field names (e.g. "ScheduleTime") to 196 // unconditionally include in API requests. By default, fields with 197 // empty or default values are omitted from API requests. However, any 198 // non-pointer, non-interface field appearing in ForceSendFields will be 199 // sent to the server regardless of whether the field is empty or not. 200 // This may be used to include empty fields in Patch requests. 201 ForceSendFields []string `json:"-"` 202 203 // NullFields is a list of field names (e.g. "ScheduleTime") to include 204 // in API requests with the JSON null value. By default, fields with 205 // empty values are omitted from API requests. However, any field with 206 // an empty value appearing in NullFields will be sent to the server as 207 // null. It is an error if a field in this list has a non-empty value. 208 // This may be used to include null fields in Patch requests. 209 NullFields []string `json:"-"` 210} 211 212func (s *AcknowledgeTaskRequest) MarshalJSON() ([]byte, error) { 213 type NoMethod AcknowledgeTaskRequest 214 raw := NoMethod(*s) 215 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 216} 217 218// AppEngineHttpRequest: App Engine HTTP request. The message defines 219// the HTTP request that is sent to an App Engine app when the task is 220// dispatched. This proto can only be used for tasks in a queue which 221// has app_engine_http_target set. Using AppEngineHttpRequest requires 222// `appengine.applications.get` 223// (https://cloud.google.com/appengine/docs/admin-api/access-control) 224// Google IAM permission for the project and the following scope: 225// `https://www.googleapis.com/auth/cloud-platform` The task will be 226// delivered to the App Engine app which belongs to the same project as 227// the queue. For more information, see How Requests are Routed 228// (https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 229// and how routing is affected by dispatch files 230// (https://cloud.google.com/appengine/docs/python/config/dispatchref). 231// Traffic is encrypted during transport and never leaves Google 232// datacenters. Because this traffic is carried over a communication 233// mechanism internal to Google, you cannot explicitly set the protocol 234// (for example, HTTP or HTTPS). The request to the handler, however, 235// will appear to have used the HTTP protocol. The AppEngineRouting used 236// to construct the URL that the task is delivered to can be set at the 237// queue-level or task-level: * If set, app_engine_routing_override is 238// used for all tasks in the queue, no matter what the setting is for 239// the task-level app_engine_routing. The `url` that the task will be 240// sent to is: * `url =` host `+` relative_url Tasks can be dispatched 241// to secure app handlers, unsecure app handlers, and URIs restricted 242// with `login: admin` 243// (https://cloud.google.com/appengine/docs/standard/python/config/appref). 244// Because tasks are not run as any user, they cannot be dispatched to 245// URIs restricted with `login: required` 246// (https://cloud.google.com/appengine/docs/standard/python/config/appref) 247// Task dispatches also do not follow redirects. The task attempt has 248// succeeded if the app's request handler returns an HTTP response code 249// in the range [`200` - `299`]. The task attempt has failed if the 250// app's handler returns a non-2xx response code or Cloud Tasks does not 251// receive response before the deadline. Failed tasks will be retried 252// according to the retry configuration. `503` (Service Unavailable) is 253// considered an App Engine system error instead of an application error 254// and will cause Cloud Tasks' traffic congestion control to temporarily 255// throttle the queue's dispatches. Unlike other types of task targets, 256// a `429` (Too Many Requests) response from an app handler does not 257// cause traffic congestion control to throttle the queue. 258type AppEngineHttpRequest struct { 259 // AppEngineRouting: Task-level setting for App Engine routing. If set, 260 // app_engine_routing_override is used for all tasks in the queue, no 261 // matter what the setting is for the task-level app_engine_routing. 262 AppEngineRouting *AppEngineRouting `json:"appEngineRouting,omitempty"` 263 264 // Headers: HTTP request headers. This map contains the header field 265 // names and values. Headers can be set when the task is created. 266 // Repeated headers are not supported but a header value can contain 267 // commas. Cloud Tasks sets some headers to default values: * 268 // `User-Agent`: By default, this header is "AppEngine-Google; 269 // (+http://code.google.com/appengine)". This header can be modified, 270 // but Cloud Tasks will append "AppEngine-Google; 271 // (+http://code.google.com/appengine)" to the modified `User-Agent`. 272 // If the task has a payload, Cloud Tasks sets the following headers: * 273 // `Content-Type`: By default, the `Content-Type` header is set to 274 // "application/octet-stream". The default can be overridden by 275 // explicitly setting `Content-Type` to a particular media type when the 276 // task is created. For example, `Content-Type` can be set to 277 // "application/json". * `Content-Length`: This is computed by Cloud 278 // Tasks. This value is output only. It cannot be changed. The headers 279 // below cannot be set or overridden: * `Host` * `X-Google-*` * 280 // `X-AppEngine-*` In addition, Cloud Tasks sets some headers when the 281 // task is dispatched, such as headers containing information about the 282 // task; see request headers 283 // (https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 284 // These headers are set only when the task is dispatched, so they are 285 // not visible when the task is returned in a Cloud Tasks response. 286 // Although there is no specific limit for the maximum number of headers 287 // or the size, there is a limit on the maximum size of the Task. For 288 // more information, see the CreateTask documentation. 289 Headers map[string]string `json:"headers,omitempty"` 290 291 // HttpMethod: The HTTP method to use for the request. The default is 292 // POST. The app's request handler for the task's target URL must be 293 // able to handle HTTP requests with this http_method, otherwise the 294 // task attempt fails with error code 405 (Method Not Allowed). See 295 // Writing a push task request handler 296 // (https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 297 // and the App Engine documentation for your runtime on How Requests are 298 // Handled 299 // (https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). 300 // 301 // Possible values: 302 // "HTTP_METHOD_UNSPECIFIED" - HTTP method unspecified 303 // "POST" - HTTP POST 304 // "GET" - HTTP GET 305 // "HEAD" - HTTP HEAD 306 // "PUT" - HTTP PUT 307 // "DELETE" - HTTP DELETE 308 HttpMethod string `json:"httpMethod,omitempty"` 309 310 // Payload: Payload. The payload will be sent as the HTTP message body. 311 // A message body, and thus a payload, is allowed only if the HTTP 312 // method is POST or PUT. It is an error to set a data payload on a task 313 // with an incompatible HttpMethod. 314 Payload string `json:"payload,omitempty"` 315 316 // RelativeUrl: The relative URL. The relative URL must begin with "/" 317 // and must be a valid HTTP relative URL. It can contain a path and 318 // query string arguments. If the relative URL is empty, then the root 319 // path "/" will be used. No spaces are allowed, and the maximum length 320 // allowed is 2083 characters. 321 RelativeUrl string `json:"relativeUrl,omitempty"` 322 323 // ForceSendFields is a list of field names (e.g. "AppEngineRouting") to 324 // unconditionally include in API requests. By default, fields with 325 // empty or default values are omitted from API requests. However, any 326 // non-pointer, non-interface field appearing in ForceSendFields will be 327 // sent to the server regardless of whether the field is empty or not. 328 // This may be used to include empty fields in Patch requests. 329 ForceSendFields []string `json:"-"` 330 331 // NullFields is a list of field names (e.g. "AppEngineRouting") to 332 // include in API requests with the JSON null value. By default, fields 333 // with empty values are omitted from API requests. However, any field 334 // with an empty value appearing in NullFields will be sent to the 335 // server as null. It is an error if a field in this list has a 336 // non-empty value. This may be used to include null fields in Patch 337 // requests. 338 NullFields []string `json:"-"` 339} 340 341func (s *AppEngineHttpRequest) MarshalJSON() ([]byte, error) { 342 type NoMethod AppEngineHttpRequest 343 raw := NoMethod(*s) 344 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 345} 346 347// AppEngineHttpTarget: App Engine HTTP target. The task will be 348// delivered to the App Engine application hostname specified by its 349// AppEngineHttpTarget and AppEngineHttpRequest. The documentation for 350// AppEngineHttpRequest explains how the task's host URL is constructed. 351// Using AppEngineHttpTarget requires `appengine.applications.get` 352// (https://cloud.google.com/appengine/docs/admin-api/access-control) 353// Google IAM permission for the project and the following scope: 354// `https://www.googleapis.com/auth/cloud-platform` 355type AppEngineHttpTarget struct { 356 // AppEngineRoutingOverride: Overrides for the task-level 357 // app_engine_routing. If set, `app_engine_routing_override` is used for 358 // all tasks in the queue, no matter what the setting is for the 359 // task-level app_engine_routing. 360 AppEngineRoutingOverride *AppEngineRouting `json:"appEngineRoutingOverride,omitempty"` 361 362 // ForceSendFields is a list of field names (e.g. 363 // "AppEngineRoutingOverride") to unconditionally include in API 364 // requests. By default, fields with empty or default values are omitted 365 // from API requests. However, any non-pointer, non-interface field 366 // appearing in ForceSendFields will be sent to the server regardless of 367 // whether the field is empty or not. This may be used to include empty 368 // fields in Patch requests. 369 ForceSendFields []string `json:"-"` 370 371 // NullFields is a list of field names (e.g. "AppEngineRoutingOverride") 372 // to include in API requests with the JSON null value. By default, 373 // fields with empty values are omitted from API requests. However, any 374 // field with an empty value appearing in NullFields will be sent to the 375 // server as null. It is an error if a field in this list has a 376 // non-empty value. This may be used to include null fields in Patch 377 // requests. 378 NullFields []string `json:"-"` 379} 380 381func (s *AppEngineHttpTarget) MarshalJSON() ([]byte, error) { 382 type NoMethod AppEngineHttpTarget 383 raw := NoMethod(*s) 384 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 385} 386 387// AppEngineRouting: App Engine Routing. Defines routing characteristics 388// specific to App Engine - service, version, and instance. For more 389// information about services, versions, and instances see An Overview 390// of App Engine 391// (https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), 392// Microservices Architecture on Google App Engine 393// (https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), 394// App Engine Standard request routing 395// (https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), 396// and App Engine Flex request routing 397// (https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 398type AppEngineRouting struct { 399 // Host: Output only. The host that the task is sent to. For more 400 // information, see How Requests are Routed 401 // (https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). 402 // The host is constructed as: * `host = [application_domain_name]` `| 403 // [service] + '.' + [application_domain_name]` `| [version] + '.' + 404 // [application_domain_name]` `| [version_dot_service]+ '.' + 405 // [application_domain_name]` `| [instance] + '.' + 406 // [application_domain_name]` `| [instance_dot_service] + '.' + 407 // [application_domain_name]` `| [instance_dot_version] + '.' + 408 // [application_domain_name]` `| [instance_dot_version_dot_service] + 409 // '.' + [application_domain_name]` * `application_domain_name` = The 410 // domain name of the app, for example .appspot.com, which is associated 411 // with the queue's project ID. Some tasks which were created using the 412 // App Engine SDK use a custom domain name. * `service =` service * 413 // `version =` version * `version_dot_service =` version `+ '.' +` 414 // service * `instance =` instance * `instance_dot_service =` instance 415 // `+ '.' +` service * `instance_dot_version =` instance `+ '.' +` 416 // version * `instance_dot_version_dot_service =` instance `+ '.' +` 417 // version `+ '.' +` service If service is empty, then the task will be 418 // sent to the service which is the default service when the task is 419 // attempted. If version is empty, then the task will be sent to the 420 // version which is the default version when the task is attempted. If 421 // instance is empty, then the task will be sent to an instance which is 422 // available when the task is attempted. If service, version, or 423 // instance is invalid, then the task will be sent to the default 424 // version of the default service when the task is attempted. 425 Host string `json:"host,omitempty"` 426 427 // Instance: App instance. By default, the task is sent to an instance 428 // which is available when the task is attempted. Requests can only be 429 // sent to a specific instance if manual scaling is used in App Engine 430 // Standard 431 // (https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). 432 // App Engine Flex does not support instances. For more information, see 433 // App Engine Standard request routing 434 // (https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 435 // and App Engine Flex request routing 436 // (https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 437 Instance string `json:"instance,omitempty"` 438 439 // Service: App service. By default, the task is sent to the service 440 // which is the default service when the task is attempted. For some 441 // queues or tasks which were created using the App Engine Task Queue 442 // API, host is not parsable into service, version, and instance. For 443 // example, some tasks which were created using the App Engine SDK use a 444 // custom domain name; custom domains are not parsed by Cloud Tasks. If 445 // host is not parsable, then service, version, and instance are the 446 // empty string. 447 Service string `json:"service,omitempty"` 448 449 // Version: App version. By default, the task is sent to the version 450 // which is the default version when the task is attempted. For some 451 // queues or tasks which were created using the App Engine Task Queue 452 // API, host is not parsable into service, version, and instance. For 453 // example, some tasks which were created using the App Engine SDK use a 454 // custom domain name; custom domains are not parsed by Cloud Tasks. If 455 // host is not parsable, then service, version, and instance are the 456 // empty string. 457 Version string `json:"version,omitempty"` 458 459 // ForceSendFields is a list of field names (e.g. "Host") to 460 // unconditionally include in API requests. By default, fields with 461 // empty or default values are omitted from API requests. However, any 462 // non-pointer, non-interface field appearing in ForceSendFields will be 463 // sent to the server regardless of whether the field is empty or not. 464 // This may be used to include empty fields in Patch requests. 465 ForceSendFields []string `json:"-"` 466 467 // NullFields is a list of field names (e.g. "Host") to include in API 468 // requests with the JSON null value. By default, fields with empty 469 // values are omitted from API requests. However, any field with an 470 // empty value appearing in NullFields will be sent to the server as 471 // null. It is an error if a field in this list has a non-empty value. 472 // This may be used to include null fields in Patch requests. 473 NullFields []string `json:"-"` 474} 475 476func (s *AppEngineRouting) MarshalJSON() ([]byte, error) { 477 type NoMethod AppEngineRouting 478 raw := NoMethod(*s) 479 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 480} 481 482// AttemptStatus: The status of a task attempt. 483type AttemptStatus struct { 484 // DispatchTime: Output only. The time that this attempt was dispatched. 485 // `dispatch_time` will be truncated to the nearest microsecond. 486 DispatchTime string `json:"dispatchTime,omitempty"` 487 488 // ResponseStatus: Output only. The response from the target for this 489 // attempt. If the task has not been attempted or the task is currently 490 // running then the response status is unset. 491 ResponseStatus *Status `json:"responseStatus,omitempty"` 492 493 // ResponseTime: Output only. The time that this attempt response was 494 // received. `response_time` will be truncated to the nearest 495 // microsecond. 496 ResponseTime string `json:"responseTime,omitempty"` 497 498 // ScheduleTime: Output only. The time that this attempt was scheduled. 499 // `schedule_time` will be truncated to the nearest microsecond. 500 ScheduleTime string `json:"scheduleTime,omitempty"` 501 502 // ForceSendFields is a list of field names (e.g. "DispatchTime") to 503 // unconditionally include in API requests. By default, fields with 504 // empty or default values are omitted from API requests. However, any 505 // non-pointer, non-interface field appearing in ForceSendFields will be 506 // sent to the server regardless of whether the field is empty or not. 507 // This may be used to include empty fields in Patch requests. 508 ForceSendFields []string `json:"-"` 509 510 // NullFields is a list of field names (e.g. "DispatchTime") to include 511 // in API requests with the JSON null value. By default, fields with 512 // empty values are omitted from API requests. However, any field with 513 // an empty value appearing in NullFields will be sent to the server as 514 // null. It is an error if a field in this list has a non-empty value. 515 // This may be used to include null fields in Patch requests. 516 NullFields []string `json:"-"` 517} 518 519func (s *AttemptStatus) MarshalJSON() ([]byte, error) { 520 type NoMethod AttemptStatus 521 raw := NoMethod(*s) 522 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 523} 524 525// Binding: Associates `members` with a `role`. 526type Binding struct { 527 // Condition: The condition that is associated with this binding. If the 528 // condition evaluates to `true`, then this binding applies to the 529 // current request. If the condition evaluates to `false`, then this 530 // binding does not apply to the current request. However, a different 531 // role binding might grant the same role to one or more of the members 532 // in this binding. To learn which resources support conditions in their 533 // IAM policies, see the IAM documentation 534 // (https://cloud.google.com/iam/help/conditions/resource-policies). 535 Condition *Expr `json:"condition,omitempty"` 536 537 // Members: Specifies the identities requesting access for a Cloud 538 // Platform resource. `members` can have the following values: * 539 // `allUsers`: A special identifier that represents anyone who is on the 540 // internet; with or without a Google account. * 541 // `allAuthenticatedUsers`: A special identifier that represents anyone 542 // who is authenticated with a Google account or a service account. * 543 // `user:{emailid}`: An email address that represents a specific Google 544 // account. For example, `alice@example.com` . * 545 // `serviceAccount:{emailid}`: An email address that represents a 546 // service account. For example, 547 // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An 548 // email address that represents a Google group. For example, 549 // `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An 550 // email address (plus unique identifier) representing a user that has 551 // been recently deleted. For example, 552 // `alice@example.com?uid=123456789012345678901`. If the user is 553 // recovered, this value reverts to `user:{emailid}` and the recovered 554 // user retains the role in the binding. * 555 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address 556 // (plus unique identifier) representing a service account that has been 557 // recently deleted. For example, 558 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 559 // If the service account is undeleted, this value reverts to 560 // `serviceAccount:{emailid}` and the undeleted service account retains 561 // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: 562 // An email address (plus unique identifier) representing a Google group 563 // that has been recently deleted. For example, 564 // `admins@example.com?uid=123456789012345678901`. If the group is 565 // recovered, this value reverts to `group:{emailid}` and the recovered 566 // group retains the role in the binding. * `domain:{domain}`: The G 567 // Suite domain (primary) that represents all the users of that domain. 568 // For example, `google.com` or `example.com`. 569 Members []string `json:"members,omitempty"` 570 571 // Role: Role that is assigned to `members`. For example, 572 // `roles/viewer`, `roles/editor`, or `roles/owner`. 573 Role string `json:"role,omitempty"` 574 575 // ForceSendFields is a list of field names (e.g. "Condition") to 576 // unconditionally include in API requests. By default, fields with 577 // empty or default values are omitted from API requests. However, any 578 // non-pointer, non-interface field appearing in ForceSendFields will be 579 // sent to the server regardless of whether the field is empty or not. 580 // This may be used to include empty fields in Patch requests. 581 ForceSendFields []string `json:"-"` 582 583 // NullFields is a list of field names (e.g. "Condition") to include in 584 // API requests with the JSON null value. By default, fields with empty 585 // values are omitted from API requests. However, any field with an 586 // empty value appearing in NullFields will be sent to the server as 587 // null. It is an error if a field in this list has a non-empty value. 588 // This may be used to include null fields in Patch requests. 589 NullFields []string `json:"-"` 590} 591 592func (s *Binding) MarshalJSON() ([]byte, error) { 593 type NoMethod Binding 594 raw := NoMethod(*s) 595 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 596} 597 598// CancelLeaseRequest: Request message for canceling a lease using 599// CancelLease. 600type CancelLeaseRequest struct { 601 // ResponseView: The response_view specifies which subset of the Task 602 // will be returned. By default response_view is BASIC; not all 603 // information is retrieved by default because some data, such as 604 // payloads, might be desirable to return only when needed because of 605 // its large size or because of the sensitivity of data that it 606 // contains. Authorization for FULL requires `cloudtasks.tasks.fullView` 607 // Google IAM (https://cloud.google.com/iam/) permission on the Task 608 // resource. 609 // 610 // Possible values: 611 // "VIEW_UNSPECIFIED" - Unspecified. Defaults to BASIC. 612 // "BASIC" - The basic view omits fields which can be large or can 613 // contain sensitive data. This view does not include the (payload in 614 // AppEngineHttpRequest and payload in PullMessage). These payloads are 615 // desirable to return only when needed, because they can be large and 616 // because of the sensitivity of the data that you choose to store in 617 // it. 618 // "FULL" - All information is returned. Authorization for FULL 619 // requires `cloudtasks.tasks.fullView` [Google 620 // IAM](https://cloud.google.com/iam/) permission on the Queue resource. 621 ResponseView string `json:"responseView,omitempty"` 622 623 // ScheduleTime: Required. The task's current schedule time, available 624 // in the schedule_time returned by LeaseTasks response or RenewLease 625 // response. This restriction is to ensure that your worker currently 626 // holds the lease. 627 ScheduleTime string `json:"scheduleTime,omitempty"` 628 629 // ForceSendFields is a list of field names (e.g. "ResponseView") to 630 // unconditionally include in API requests. By default, fields with 631 // empty or default values are omitted from API requests. However, any 632 // non-pointer, non-interface field appearing in ForceSendFields will be 633 // sent to the server regardless of whether the field is empty or not. 634 // This may be used to include empty fields in Patch requests. 635 ForceSendFields []string `json:"-"` 636 637 // NullFields is a list of field names (e.g. "ResponseView") to include 638 // in API requests with the JSON null value. By default, fields with 639 // empty values are omitted from API requests. However, any field with 640 // an empty value appearing in NullFields will be sent to the server as 641 // null. It is an error if a field in this list has a non-empty value. 642 // This may be used to include null fields in Patch requests. 643 NullFields []string `json:"-"` 644} 645 646func (s *CancelLeaseRequest) MarshalJSON() ([]byte, error) { 647 type NoMethod CancelLeaseRequest 648 raw := NoMethod(*s) 649 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 650} 651 652// CreateTaskRequest: Request message for CreateTask. 653type CreateTaskRequest struct { 654 // ResponseView: The response_view specifies which subset of the Task 655 // will be returned. By default response_view is BASIC; not all 656 // information is retrieved by default because some data, such as 657 // payloads, might be desirable to return only when needed because of 658 // its large size or because of the sensitivity of data that it 659 // contains. Authorization for FULL requires `cloudtasks.tasks.fullView` 660 // Google IAM (https://cloud.google.com/iam/) permission on the Task 661 // resource. 662 // 663 // Possible values: 664 // "VIEW_UNSPECIFIED" - Unspecified. Defaults to BASIC. 665 // "BASIC" - The basic view omits fields which can be large or can 666 // contain sensitive data. This view does not include the (payload in 667 // AppEngineHttpRequest and payload in PullMessage). These payloads are 668 // desirable to return only when needed, because they can be large and 669 // because of the sensitivity of the data that you choose to store in 670 // it. 671 // "FULL" - All information is returned. Authorization for FULL 672 // requires `cloudtasks.tasks.fullView` [Google 673 // IAM](https://cloud.google.com/iam/) permission on the Queue resource. 674 ResponseView string `json:"responseView,omitempty"` 675 676 // Task: Required. The task to add. Task names have the following 677 // format: 678 // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ 679 // ID`. The user can optionally specify a task name. If a name is not 680 // specified then the system will generate a random unique task id, 681 // which will be set in the task returned in the response. If 682 // schedule_time is not set or is in the past then Cloud Tasks will set 683 // it to the current time. Task De-duplication: Explicitly specifying a 684 // task ID enables task de-duplication. If a task's ID is identical to 685 // that of an existing task or a task that was deleted or completed 686 // recently then the call will fail with ALREADY_EXISTS. If the task's 687 // queue was created using Cloud Tasks, then another task with the same 688 // name can't be created for ~1hour after the original task was deleted 689 // or completed. If the task's queue was created using queue.yaml or 690 // queue.xml, then another task with the same name can't be created for 691 // ~9days after the original task was deleted or completed. Because 692 // there is an extra lookup cost to identify duplicate task names, these 693 // CreateTask calls have significantly increased latency. Using hashed 694 // strings for the task id or for the prefix of the task id is 695 // recommended. Choosing task ids that are sequential or have sequential 696 // prefixes, for example using a timestamp, causes an increase in 697 // latency and error rates in all task commands. The infrastructure 698 // relies on an approximately uniform distribution of task ids to store 699 // and serve tasks efficiently. 700 Task *Task `json:"task,omitempty"` 701 702 // ForceSendFields is a list of field names (e.g. "ResponseView") to 703 // unconditionally include in API requests. By default, fields with 704 // empty or default values are omitted from API requests. However, any 705 // non-pointer, non-interface field appearing in ForceSendFields will be 706 // sent to the server regardless of whether the field is empty or not. 707 // This may be used to include empty fields in Patch requests. 708 ForceSendFields []string `json:"-"` 709 710 // NullFields is a list of field names (e.g. "ResponseView") to include 711 // in API requests with the JSON null value. By default, fields with 712 // empty values are omitted from API requests. However, any field with 713 // an empty value appearing in NullFields will be sent to the server as 714 // null. It is an error if a field in this list has a non-empty value. 715 // This may be used to include null fields in Patch requests. 716 NullFields []string `json:"-"` 717} 718 719func (s *CreateTaskRequest) MarshalJSON() ([]byte, error) { 720 type NoMethod CreateTaskRequest 721 raw := NoMethod(*s) 722 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 723} 724 725// Empty: A generic empty message that you can re-use to avoid defining 726// duplicated empty messages in your APIs. A typical example is to use 727// it as the request or the response type of an API method. For 728// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 729// (google.protobuf.Empty); } The JSON representation for `Empty` is 730// empty JSON object `{}`. 731type Empty struct { 732 // ServerResponse contains the HTTP response code and headers from the 733 // server. 734 googleapi.ServerResponse `json:"-"` 735} 736 737// Expr: Represents a textual expression in the Common Expression 738// Language (CEL) syntax. CEL is a C-like expression language. The 739// syntax and semantics of CEL are documented at 740// https://github.com/google/cel-spec. Example (Comparison): title: 741// "Summary size limit" description: "Determines if a summary is less 742// than 100 chars" expression: "document.summary.size() < 100" Example 743// (Equality): title: "Requestor is owner" description: "Determines if 744// requestor is the document owner" expression: "document.owner == 745// request.auth.claims.email" Example (Logic): title: "Public documents" 746// description: "Determine whether the document should be publicly 747// visible" expression: "document.type != 'private' && document.type != 748// 'internal'" Example (Data Manipulation): title: "Notification string" 749// description: "Create a notification string with a timestamp." 750// expression: "'New message received at ' + 751// string(document.create_time)" The exact variables and functions that 752// may be referenced within an expression are determined by the service 753// that evaluates it. See the service documentation for additional 754// information. 755type Expr struct { 756 // Description: Optional. Description of the expression. This is a 757 // longer text which describes the expression, e.g. when hovered over it 758 // in a UI. 759 Description string `json:"description,omitempty"` 760 761 // Expression: Textual representation of an expression in Common 762 // Expression Language syntax. 763 Expression string `json:"expression,omitempty"` 764 765 // Location: Optional. String indicating the location of the expression 766 // for error reporting, e.g. a file name and a position in the file. 767 Location string `json:"location,omitempty"` 768 769 // Title: Optional. Title for the expression, i.e. a short string 770 // describing its purpose. This can be used e.g. in UIs which allow to 771 // enter the expression. 772 Title string `json:"title,omitempty"` 773 774 // ForceSendFields is a list of field names (e.g. "Description") to 775 // unconditionally include in API requests. By default, fields with 776 // empty or default values are omitted from API requests. However, any 777 // non-pointer, non-interface field appearing in ForceSendFields will be 778 // sent to the server regardless of whether the field is empty or not. 779 // This may be used to include empty fields in Patch requests. 780 ForceSendFields []string `json:"-"` 781 782 // NullFields is a list of field names (e.g. "Description") to include 783 // in API requests with the JSON null value. By default, fields with 784 // empty values are omitted from API requests. However, any field with 785 // an empty value appearing in NullFields will be sent to the server as 786 // null. It is an error if a field in this list has a non-empty value. 787 // This may be used to include null fields in Patch requests. 788 NullFields []string `json:"-"` 789} 790 791func (s *Expr) MarshalJSON() ([]byte, error) { 792 type NoMethod Expr 793 raw := NoMethod(*s) 794 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 795} 796 797// GetIamPolicyRequest: Request message for `GetIamPolicy` method. 798type GetIamPolicyRequest struct { 799 // Options: OPTIONAL: A `GetPolicyOptions` object for specifying options 800 // to `GetIamPolicy`. 801 Options *GetPolicyOptions `json:"options,omitempty"` 802 803 // ForceSendFields is a list of field names (e.g. "Options") to 804 // unconditionally include in API requests. By default, fields with 805 // empty or default values are omitted from API requests. However, any 806 // non-pointer, non-interface field appearing in ForceSendFields will be 807 // sent to the server regardless of whether the field is empty or not. 808 // This may be used to include empty fields in Patch requests. 809 ForceSendFields []string `json:"-"` 810 811 // NullFields is a list of field names (e.g. "Options") to include in 812 // API requests with the JSON null value. By default, fields with empty 813 // values are omitted from API requests. However, any field with an 814 // empty value appearing in NullFields will be sent to the server as 815 // null. It is an error if a field in this list has a non-empty value. 816 // This may be used to include null fields in Patch requests. 817 NullFields []string `json:"-"` 818} 819 820func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 821 type NoMethod GetIamPolicyRequest 822 raw := NoMethod(*s) 823 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 824} 825 826// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 827type GetPolicyOptions struct { 828 // RequestedPolicyVersion: Optional. The policy format version to be 829 // returned. Valid values are 0, 1, and 3. Requests specifying an 830 // invalid value will be rejected. Requests for policies with any 831 // conditional bindings must specify version 3. Policies without any 832 // conditional bindings may specify any valid value or leave the field 833 // unset. To learn which resources support conditions in their IAM 834 // policies, see the IAM documentation 835 // (https://cloud.google.com/iam/help/conditions/resource-policies). 836 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 837 838 // ForceSendFields is a list of field names (e.g. 839 // "RequestedPolicyVersion") to unconditionally include in API requests. 840 // By default, fields with empty or default values are omitted from API 841 // requests. However, any non-pointer, non-interface field appearing in 842 // ForceSendFields will be sent to the server regardless of whether the 843 // field is empty or not. This may be used to include empty fields in 844 // Patch requests. 845 ForceSendFields []string `json:"-"` 846 847 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") 848 // to include in API requests with the JSON null value. By default, 849 // fields with empty values are omitted from API requests. However, any 850 // field with an empty value appearing in NullFields will be sent to the 851 // server as null. It is an error if a field in this list has a 852 // non-empty value. This may be used to include null fields in Patch 853 // requests. 854 NullFields []string `json:"-"` 855} 856 857func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 858 type NoMethod GetPolicyOptions 859 raw := NoMethod(*s) 860 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 861} 862 863// LeaseTasksRequest: Request message for leasing tasks using 864// LeaseTasks. 865type LeaseTasksRequest struct { 866 // Filter: `filter` can be used to specify a subset of tasks to lease. 867 // When `filter` is set to `tag=` then the response will contain only 868 // tasks whose tag is equal to ``. `` must be less than 500 characters. 869 // When `filter` is set to `tag_function=oldest_tag()`, only tasks which 870 // have the same tag as the task with the oldest schedule_time will be 871 // returned. Grammar Syntax: * `filter = "tag=" tag | "tag_function=" 872 // function` * `tag = string` * `function = "oldest_tag()" The 873 // `oldest_tag()` function returns tasks which have the same tag as the 874 // oldest task (ordered by schedule time). SDK compatibility: Although 875 // the SDK allows tags to be either string or bytes 876 // (https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), 877 // only UTF-8 encoded tags can be used in Cloud Tasks. Tag which aren't 878 // UTF-8 encoded can't be used in the filter and the task's tag will be 879 // displayed as empty in Cloud Tasks. 880 Filter string `json:"filter,omitempty"` 881 882 // LeaseDuration: Required. The duration of the lease. Each task 883 // returned in the response will have its schedule_time set to the 884 // current time plus the `lease_duration`. The task is leased until its 885 // schedule_time; thus, the task will not be returned to another 886 // LeaseTasks call before its schedule_time. After the worker has 887 // successfully finished the work associated with the task, the worker 888 // must call via AcknowledgeTask before the schedule_time. Otherwise the 889 // task will be returned to a later LeaseTasks call so that another 890 // worker can retry it. The maximum lease duration is 1 week. 891 // `lease_duration` will be truncated to the nearest second. 892 LeaseDuration string `json:"leaseDuration,omitempty"` 893 894 // MaxTasks: The maximum number of tasks to lease. The system will make 895 // a best effort to return as close to as `max_tasks` as possible. The 896 // largest that `max_tasks` can be is 1000. The maximum total size of a 897 // lease tasks response is 32 MB. If the sum of all task sizes requested 898 // reaches this limit, fewer tasks than requested are returned. 899 MaxTasks int64 `json:"maxTasks,omitempty"` 900 901 // ResponseView: The response_view specifies which subset of the Task 902 // will be returned. By default response_view is BASIC; not all 903 // information is retrieved by default because some data, such as 904 // payloads, might be desirable to return only when needed because of 905 // its large size or because of the sensitivity of data that it 906 // contains. Authorization for FULL requires `cloudtasks.tasks.fullView` 907 // Google IAM (https://cloud.google.com/iam/) permission on the Task 908 // resource. 909 // 910 // Possible values: 911 // "VIEW_UNSPECIFIED" - Unspecified. Defaults to BASIC. 912 // "BASIC" - The basic view omits fields which can be large or can 913 // contain sensitive data. This view does not include the (payload in 914 // AppEngineHttpRequest and payload in PullMessage). These payloads are 915 // desirable to return only when needed, because they can be large and 916 // because of the sensitivity of the data that you choose to store in 917 // it. 918 // "FULL" - All information is returned. Authorization for FULL 919 // requires `cloudtasks.tasks.fullView` [Google 920 // IAM](https://cloud.google.com/iam/) permission on the Queue resource. 921 ResponseView string `json:"responseView,omitempty"` 922 923 // ForceSendFields is a list of field names (e.g. "Filter") to 924 // unconditionally include in API requests. By default, fields with 925 // empty or default values are omitted from API requests. However, any 926 // non-pointer, non-interface field appearing in ForceSendFields will be 927 // sent to the server regardless of whether the field is empty or not. 928 // This may be used to include empty fields in Patch requests. 929 ForceSendFields []string `json:"-"` 930 931 // NullFields is a list of field names (e.g. "Filter") to include in API 932 // requests with the JSON null value. By default, fields with empty 933 // values are omitted from API requests. However, any field with an 934 // empty value appearing in NullFields will be sent to the server as 935 // null. It is an error if a field in this list has a non-empty value. 936 // This may be used to include null fields in Patch requests. 937 NullFields []string `json:"-"` 938} 939 940func (s *LeaseTasksRequest) MarshalJSON() ([]byte, error) { 941 type NoMethod LeaseTasksRequest 942 raw := NoMethod(*s) 943 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 944} 945 946// LeaseTasksResponse: Response message for leasing tasks using 947// LeaseTasks. 948type LeaseTasksResponse struct { 949 // Tasks: The leased tasks. 950 Tasks []*Task `json:"tasks,omitempty"` 951 952 // ServerResponse contains the HTTP response code and headers from the 953 // server. 954 googleapi.ServerResponse `json:"-"` 955 956 // ForceSendFields is a list of field names (e.g. "Tasks") to 957 // unconditionally include in API requests. By default, fields with 958 // empty or default values are omitted from API requests. However, any 959 // non-pointer, non-interface field appearing in ForceSendFields will be 960 // sent to the server regardless of whether the field is empty or not. 961 // This may be used to include empty fields in Patch requests. 962 ForceSendFields []string `json:"-"` 963 964 // NullFields is a list of field names (e.g. "Tasks") to include in API 965 // requests with the JSON null value. By default, fields with empty 966 // values are omitted from API requests. However, any field with an 967 // empty value appearing in NullFields will be sent to the server as 968 // null. It is an error if a field in this list has a non-empty value. 969 // This may be used to include null fields in Patch requests. 970 NullFields []string `json:"-"` 971} 972 973func (s *LeaseTasksResponse) MarshalJSON() ([]byte, error) { 974 type NoMethod LeaseTasksResponse 975 raw := NoMethod(*s) 976 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 977} 978 979// ListLocationsResponse: The response message for 980// Locations.ListLocations. 981type ListLocationsResponse struct { 982 // Locations: A list of locations that matches the specified filter in 983 // the request. 984 Locations []*Location `json:"locations,omitempty"` 985 986 // NextPageToken: The standard List next-page token. 987 NextPageToken string `json:"nextPageToken,omitempty"` 988 989 // ServerResponse contains the HTTP response code and headers from the 990 // server. 991 googleapi.ServerResponse `json:"-"` 992 993 // ForceSendFields is a list of field names (e.g. "Locations") to 994 // unconditionally include in API requests. By default, fields with 995 // empty or default values are omitted from API requests. However, any 996 // non-pointer, non-interface field appearing in ForceSendFields will be 997 // sent to the server regardless of whether the field is empty or not. 998 // This may be used to include empty fields in Patch requests. 999 ForceSendFields []string `json:"-"` 1000 1001 // NullFields is a list of field names (e.g. "Locations") to include in 1002 // API requests with the JSON null value. By default, fields with empty 1003 // values are omitted from API requests. However, any field with an 1004 // empty value appearing in NullFields will be sent to the server as 1005 // null. It is an error if a field in this list has a non-empty value. 1006 // This may be used to include null fields in Patch requests. 1007 NullFields []string `json:"-"` 1008} 1009 1010func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) { 1011 type NoMethod ListLocationsResponse 1012 raw := NoMethod(*s) 1013 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1014} 1015 1016// ListQueuesResponse: Response message for ListQueues. 1017type ListQueuesResponse struct { 1018 // NextPageToken: A token to retrieve next page of results. To return 1019 // the next page of results, call ListQueues with this value as the 1020 // page_token. If the next_page_token is empty, there are no more 1021 // results. The page token is valid for only 2 hours. 1022 NextPageToken string `json:"nextPageToken,omitempty"` 1023 1024 // Queues: The list of queues. 1025 Queues []*Queue `json:"queues,omitempty"` 1026 1027 // ServerResponse contains the HTTP response code and headers from the 1028 // server. 1029 googleapi.ServerResponse `json:"-"` 1030 1031 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1032 // unconditionally include in API requests. By default, fields with 1033 // empty or default values are omitted from API requests. However, any 1034 // non-pointer, non-interface field appearing in ForceSendFields will be 1035 // sent to the server regardless of whether the field is empty or not. 1036 // This may be used to include empty fields in Patch requests. 1037 ForceSendFields []string `json:"-"` 1038 1039 // NullFields is a list of field names (e.g. "NextPageToken") to include 1040 // in API requests with the JSON null value. By default, fields with 1041 // empty values are omitted from API requests. However, any field with 1042 // an empty value appearing in NullFields will be sent to the server as 1043 // null. It is an error if a field in this list has a non-empty value. 1044 // This may be used to include null fields in Patch requests. 1045 NullFields []string `json:"-"` 1046} 1047 1048func (s *ListQueuesResponse) MarshalJSON() ([]byte, error) { 1049 type NoMethod ListQueuesResponse 1050 raw := NoMethod(*s) 1051 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1052} 1053 1054// ListTasksResponse: Response message for listing tasks using 1055// ListTasks. 1056type ListTasksResponse struct { 1057 // NextPageToken: A token to retrieve next page of results. To return 1058 // the next page of results, call ListTasks with this value as the 1059 // page_token. If the next_page_token is empty, there are no more 1060 // results. 1061 NextPageToken string `json:"nextPageToken,omitempty"` 1062 1063 // Tasks: The list of tasks. 1064 Tasks []*Task `json:"tasks,omitempty"` 1065 1066 // ServerResponse contains the HTTP response code and headers from the 1067 // server. 1068 googleapi.ServerResponse `json:"-"` 1069 1070 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1071 // unconditionally include in API requests. By default, fields with 1072 // empty or default values are omitted from API requests. However, any 1073 // non-pointer, non-interface field appearing in ForceSendFields will be 1074 // sent to the server regardless of whether the field is empty or not. 1075 // This may be used to include empty fields in Patch requests. 1076 ForceSendFields []string `json:"-"` 1077 1078 // NullFields is a list of field names (e.g. "NextPageToken") to include 1079 // in API requests with the JSON null value. By default, fields with 1080 // empty values are omitted from API requests. However, any field with 1081 // an empty value appearing in NullFields will be sent to the server as 1082 // null. It is an error if a field in this list has a non-empty value. 1083 // This may be used to include null fields in Patch requests. 1084 NullFields []string `json:"-"` 1085} 1086 1087func (s *ListTasksResponse) MarshalJSON() ([]byte, error) { 1088 type NoMethod ListTasksResponse 1089 raw := NoMethod(*s) 1090 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1091} 1092 1093// Location: A resource that represents Google Cloud Platform location. 1094type Location struct { 1095 // DisplayName: The friendly name for this location, typically a nearby 1096 // city name. For example, "Tokyo". 1097 DisplayName string `json:"displayName,omitempty"` 1098 1099 // Labels: Cross-service attributes for the location. For example 1100 // {"cloud.googleapis.com/region": "us-east1"} 1101 Labels map[string]string `json:"labels,omitempty"` 1102 1103 // LocationId: The canonical id for this location. For example: 1104 // "us-east1". 1105 LocationId string `json:"locationId,omitempty"` 1106 1107 // Metadata: Service-specific metadata. For example the available 1108 // capacity at the given location. 1109 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1110 1111 // Name: Resource name for the location, which may vary between 1112 // implementations. For example: 1113 // "projects/example-project/locations/us-east1" 1114 Name string `json:"name,omitempty"` 1115 1116 // ServerResponse contains the HTTP response code and headers from the 1117 // server. 1118 googleapi.ServerResponse `json:"-"` 1119 1120 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1121 // unconditionally include in API requests. By default, fields with 1122 // empty or default values are omitted from API requests. However, any 1123 // non-pointer, non-interface field appearing in ForceSendFields will be 1124 // sent to the server regardless of whether the field is empty or not. 1125 // This may be used to include empty fields in Patch requests. 1126 ForceSendFields []string `json:"-"` 1127 1128 // NullFields is a list of field names (e.g. "DisplayName") to include 1129 // in API requests with the JSON null value. By default, fields with 1130 // empty values are omitted from API requests. However, any field with 1131 // an empty value appearing in NullFields will be sent to the server as 1132 // null. It is an error if a field in this list has a non-empty value. 1133 // This may be used to include null fields in Patch requests. 1134 NullFields []string `json:"-"` 1135} 1136 1137func (s *Location) MarshalJSON() ([]byte, error) { 1138 type NoMethod Location 1139 raw := NoMethod(*s) 1140 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1141} 1142 1143// PauseQueueRequest: Request message for PauseQueue. 1144type PauseQueueRequest struct { 1145} 1146 1147// Policy: An Identity and Access Management (IAM) policy, which 1148// specifies access controls for Google Cloud resources. A `Policy` is a 1149// collection of `bindings`. A `binding` binds one or more `members` to 1150// a single `role`. Members can be user accounts, service accounts, 1151// Google groups, and domains (such as G Suite). A `role` is a named 1152// list of permissions; each `role` can be an IAM predefined role or a 1153// user-created custom role. For some types of Google Cloud resources, a 1154// `binding` can also specify a `condition`, which is a logical 1155// expression that allows access to a resource only if the expression 1156// evaluates to `true`. A condition can add constraints based on 1157// attributes of the request, the resource, or both. To learn which 1158// resources support conditions in their IAM policies, see the IAM 1159// documentation 1160// (https://cloud.google.com/iam/help/conditions/resource-policies). 1161// **JSON example:** { "bindings": [ { "role": 1162// "roles/resourcemanager.organizationAdmin", "members": [ 1163// "user:mike@example.com", "group:admins@example.com", 1164// "domain:google.com", 1165// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 1166// "role": "roles/resourcemanager.organizationViewer", "members": [ 1167// "user:eve@example.com" ], "condition": { "title": "expirable access", 1168// "description": "Does not grant access after Sep 2020", "expression": 1169// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 1170// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - 1171// members: - user:mike@example.com - group:admins@example.com - 1172// domain:google.com - 1173// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 1174// roles/resourcemanager.organizationAdmin - members: - 1175// user:eve@example.com role: roles/resourcemanager.organizationViewer 1176// condition: title: expirable access description: Does not grant access 1177// after Sep 2020 expression: request.time < 1178// timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 1179// For a description of IAM and its features, see the IAM documentation 1180// (https://cloud.google.com/iam/docs/). 1181type Policy struct { 1182 // Bindings: Associates a list of `members` to a `role`. Optionally, may 1183 // specify a `condition` that determines how and when the `bindings` are 1184 // applied. Each of the `bindings` must contain at least one member. 1185 Bindings []*Binding `json:"bindings,omitempty"` 1186 1187 // Etag: `etag` is used for optimistic concurrency control as a way to 1188 // help prevent simultaneous updates of a policy from overwriting each 1189 // other. It is strongly suggested that systems make use of the `etag` 1190 // in the read-modify-write cycle to perform policy updates in order to 1191 // avoid race conditions: An `etag` is returned in the response to 1192 // `getIamPolicy`, and systems are expected to put that etag in the 1193 // request to `setIamPolicy` to ensure that their change will be applied 1194 // to the same version of the policy. **Important:** If you use IAM 1195 // Conditions, you must include the `etag` field whenever you call 1196 // `setIamPolicy`. If you omit this field, then IAM allows you to 1197 // overwrite a version `3` policy with a version `1` policy, and all of 1198 // the conditions in the version `3` policy are lost. 1199 Etag string `json:"etag,omitempty"` 1200 1201 // Version: Specifies the format of the policy. Valid values are `0`, 1202 // `1`, and `3`. Requests that specify an invalid value are rejected. 1203 // Any operation that affects conditional role bindings must specify 1204 // version `3`. This requirement applies to the following operations: * 1205 // Getting a policy that includes a conditional role binding * Adding a 1206 // conditional role binding to a policy * Changing a conditional role 1207 // binding in a policy * Removing any role binding, with or without a 1208 // condition, from a policy that includes conditions **Important:** If 1209 // you use IAM Conditions, you must include the `etag` field whenever 1210 // you call `setIamPolicy`. If you omit this field, then IAM allows you 1211 // to overwrite a version `3` policy with a version `1` policy, and all 1212 // of the conditions in the version `3` policy are lost. If a policy 1213 // does not include any conditions, operations on that policy may 1214 // specify any valid version or leave the field unset. To learn which 1215 // resources support conditions in their IAM policies, see the IAM 1216 // documentation 1217 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1218 Version int64 `json:"version,omitempty"` 1219 1220 // ServerResponse contains the HTTP response code and headers from the 1221 // server. 1222 googleapi.ServerResponse `json:"-"` 1223 1224 // ForceSendFields is a list of field names (e.g. "Bindings") to 1225 // unconditionally include in API requests. By default, fields with 1226 // empty or default values are omitted from API requests. However, any 1227 // non-pointer, non-interface field appearing in ForceSendFields will be 1228 // sent to the server regardless of whether the field is empty or not. 1229 // This may be used to include empty fields in Patch requests. 1230 ForceSendFields []string `json:"-"` 1231 1232 // NullFields is a list of field names (e.g. "Bindings") to include in 1233 // API requests with the JSON null value. By default, fields with empty 1234 // values are omitted from API requests. However, any field with an 1235 // empty value appearing in NullFields will be sent to the server as 1236 // null. It is an error if a field in this list has a non-empty value. 1237 // This may be used to include null fields in Patch requests. 1238 NullFields []string `json:"-"` 1239} 1240 1241func (s *Policy) MarshalJSON() ([]byte, error) { 1242 type NoMethod Policy 1243 raw := NoMethod(*s) 1244 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1245} 1246 1247// PullMessage: The pull message contains data that can be used by the 1248// caller of LeaseTasks to process the task. This proto can only be used 1249// for tasks in a queue which has pull_target set. 1250type PullMessage struct { 1251 // Payload: A data payload consumed by the worker to execute the task. 1252 Payload string `json:"payload,omitempty"` 1253 1254 // Tag: The task's tag. Tags allow similar tasks to be processed in a 1255 // batch. If you label tasks with a tag, your worker can lease tasks 1256 // with the same tag using filter. For example, if you want to aggregate 1257 // the events associated with a specific user once a day, you could tag 1258 // tasks with the user ID. The task's tag can only be set when the task 1259 // is created. The tag must be less than 500 characters. SDK 1260 // compatibility: Although the SDK allows tags to be either string or 1261 // bytes 1262 // (https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), 1263 // only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't 1264 // UTF-8 encoded, the tag will be empty when the task is returned by 1265 // Cloud Tasks. 1266 Tag string `json:"tag,omitempty"` 1267 1268 // ForceSendFields is a list of field names (e.g. "Payload") to 1269 // unconditionally include in API requests. By default, fields with 1270 // empty or default values are omitted from API requests. However, any 1271 // non-pointer, non-interface field appearing in ForceSendFields will be 1272 // sent to the server regardless of whether the field is empty or not. 1273 // This may be used to include empty fields in Patch requests. 1274 ForceSendFields []string `json:"-"` 1275 1276 // NullFields is a list of field names (e.g. "Payload") to include in 1277 // API requests with the JSON null value. By default, fields with empty 1278 // values are omitted from API requests. However, any field with an 1279 // empty value appearing in NullFields will be sent to the server as 1280 // null. It is an error if a field in this list has a non-empty value. 1281 // This may be used to include null fields in Patch requests. 1282 NullFields []string `json:"-"` 1283} 1284 1285func (s *PullMessage) MarshalJSON() ([]byte, error) { 1286 type NoMethod PullMessage 1287 raw := NoMethod(*s) 1288 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1289} 1290 1291// PullTarget: Pull target. 1292type PullTarget struct { 1293} 1294 1295// PurgeQueueRequest: Request message for PurgeQueue. 1296type PurgeQueueRequest struct { 1297} 1298 1299// Queue: A queue is a container of related tasks. Queues are configured 1300// to manage how those tasks are dispatched. Configurable properties 1301// include rate limits, retry options, target types, and others. 1302type Queue struct { 1303 // AppEngineHttpTarget: App Engine HTTP target. An App Engine queue is a 1304 // queue that has an AppEngineHttpTarget. 1305 AppEngineHttpTarget *AppEngineHttpTarget `json:"appEngineHttpTarget,omitempty"` 1306 1307 // Name: Caller-specified and required in CreateQueue, after which it 1308 // becomes output only. The queue name. The queue name must have the 1309 // following format: 1310 // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * 1311 // `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens 1312 // (-), colons (:), or periods (.). For more information, see 1313 // Identifying projects 1314 // (https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) 1315 // * `LOCATION_ID` is the canonical ID for the queue's location. The 1316 // list of available locations can be obtained by calling ListLocations. 1317 // For more information, see https://cloud.google.com/about/locations/. 1318 // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or 1319 // hyphens (-). The maximum length is 100 characters. 1320 Name string `json:"name,omitempty"` 1321 1322 // PullTarget: Pull target. A pull queue is a queue that has a 1323 // PullTarget. 1324 PullTarget *PullTarget `json:"pullTarget,omitempty"` 1325 1326 // PurgeTime: Output only. The last time this queue was purged. All 1327 // tasks that were created before this time were purged. A queue can be 1328 // purged using PurgeQueue, the App Engine Task Queue SDK, or the Cloud 1329 // Console 1330 // (https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). 1331 // Purge time will be truncated to the nearest microsecond. Purge time 1332 // will be unset if the queue has never been purged. 1333 PurgeTime string `json:"purgeTime,omitempty"` 1334 1335 // RateLimits: Rate limits for task dispatches. rate_limits and 1336 // retry_config are related because they both control task attempts 1337 // however they control how tasks are attempted in different ways: * 1338 // rate_limits controls the total rate of dispatches from a queue (i.e. 1339 // all traffic dispatched from the queue, regardless of whether the 1340 // dispatch is from a first attempt or a retry). * retry_config controls 1341 // what happens to particular a task after its first attempt fails. That 1342 // is, retry_config controls task retries (the second attempt, third 1343 // attempt, etc). 1344 RateLimits *RateLimits `json:"rateLimits,omitempty"` 1345 1346 // RetryConfig: Settings that determine the retry behavior. * For tasks 1347 // created using Cloud Tasks: the queue-level retry settings apply to 1348 // all tasks in the queue that were created using Cloud Tasks. Retry 1349 // settings cannot be set on individual tasks. * For tasks created using 1350 // the App Engine SDK: the queue-level retry settings apply to all tasks 1351 // in the queue which do not have retry settings explicitly set on the 1352 // task and were created by the App Engine SDK. See App Engine 1353 // documentation 1354 // (https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). 1355 RetryConfig *RetryConfig `json:"retryConfig,omitempty"` 1356 1357 // State: Output only. The state of the queue. `state` can only be 1358 // changed by called PauseQueue, ResumeQueue, or uploading 1359 // queue.yaml/xml 1360 // (https://cloud.google.com/appengine/docs/python/config/queueref). 1361 // UpdateQueue cannot be used to change `state`. 1362 // 1363 // Possible values: 1364 // "STATE_UNSPECIFIED" - Unspecified state. 1365 // "RUNNING" - The queue is running. Tasks can be dispatched. If the 1366 // queue was created using Cloud Tasks and the queue has had no activity 1367 // (method calls or task dispatches) for 30 days, the queue may take a 1368 // few minutes to re-activate. Some method calls may return NOT_FOUND 1369 // and tasks may not be dispatched for a few minutes until the queue has 1370 // been re-activated. 1371 // "PAUSED" - Tasks are paused by the user. If the queue is paused 1372 // then Cloud Tasks will stop delivering tasks from it, but more tasks 1373 // can still be added to it by the user. When a pull queue is paused, 1374 // all LeaseTasks calls will return a FAILED_PRECONDITION. 1375 // "DISABLED" - The queue is disabled. A queue becomes `DISABLED` when 1376 // [queue.yaml](https://cloud.google.com/appengine/docs/python/config/que 1377 // ueref) or 1378 // [queue.xml](https://cloud.google.com/appengine/docs/standard/java/conf 1379 // ig/queueref) is uploaded which does not contain the queue. You cannot 1380 // directly disable a queue. When a queue is disabled, tasks can still 1381 // be added to a queue but the tasks are not dispatched and LeaseTasks 1382 // calls return a `FAILED_PRECONDITION` error. To permanently delete 1383 // this queue and all of its tasks, call DeleteQueue. 1384 State string `json:"state,omitempty"` 1385 1386 // Stats: Output only. The realtime, informational statistics for a 1387 // queue. In order to receive the statistics the caller should include 1388 // this field in the FieldMask. 1389 Stats *QueueStats `json:"stats,omitempty"` 1390 1391 // TaskTtl: The maximum amount of time that a task will be retained in 1392 // this queue. Queues created by Cloud Tasks have a default `task_ttl` 1393 // of 31 days. After a task has lived for `task_ttl`, the task will be 1394 // deleted regardless of whether it was dispatched or not. The 1395 // `task_ttl` for queues created via queue.yaml/xml is equal to the 1396 // maximum duration because there is a storage quota 1397 // (https://cloud.google.com/appengine/quotas#Task_Queue) for these 1398 // queues. To view the maximum valid duration, see the documentation for 1399 // Duration. 1400 TaskTtl string `json:"taskTtl,omitempty"` 1401 1402 // TombstoneTtl: The task tombstone time to live (TTL). After a task is 1403 // deleted or completed, the task's tombstone is retained for the length 1404 // of time specified by `tombstone_ttl`. The tombstone is used by task 1405 // de-duplication; another task with the same name can't be created 1406 // until the tombstone has expired. For more information about task 1407 // de-duplication, see the documentation for CreateTaskRequest. Queues 1408 // created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. 1409 TombstoneTtl string `json:"tombstoneTtl,omitempty"` 1410 1411 // ServerResponse contains the HTTP response code and headers from the 1412 // server. 1413 googleapi.ServerResponse `json:"-"` 1414 1415 // ForceSendFields is a list of field names (e.g. "AppEngineHttpTarget") 1416 // to unconditionally include in API requests. By default, fields with 1417 // empty or default values are omitted from API requests. However, any 1418 // non-pointer, non-interface field appearing in ForceSendFields will be 1419 // sent to the server regardless of whether the field is empty or not. 1420 // This may be used to include empty fields in Patch requests. 1421 ForceSendFields []string `json:"-"` 1422 1423 // NullFields is a list of field names (e.g. "AppEngineHttpTarget") to 1424 // include in API requests with the JSON null value. By default, fields 1425 // with empty values are omitted from API requests. However, any field 1426 // with an empty value appearing in NullFields will be sent to the 1427 // server as null. It is an error if a field in this list has a 1428 // non-empty value. This may be used to include null fields in Patch 1429 // requests. 1430 NullFields []string `json:"-"` 1431} 1432 1433func (s *Queue) MarshalJSON() ([]byte, error) { 1434 type NoMethod Queue 1435 raw := NoMethod(*s) 1436 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1437} 1438 1439// QueueStats: Statistics for a queue. 1440type QueueStats struct { 1441 // ConcurrentDispatchesCount: Output only. The number of requests that 1442 // the queue has dispatched but has not received a reply for yet. 1443 ConcurrentDispatchesCount int64 `json:"concurrentDispatchesCount,omitempty,string"` 1444 1445 // EffectiveExecutionRate: Output only. The current maximum number of 1446 // tasks per second executed by the queue. The maximum value of this 1447 // variable is controlled by the RateLimits of the Queue. However, this 1448 // value could be less to avoid overloading the endpoints tasks in the 1449 // queue are targeting. 1450 EffectiveExecutionRate float64 `json:"effectiveExecutionRate,omitempty"` 1451 1452 // ExecutedLastMinuteCount: Output only. The number of tasks that the 1453 // queue has dispatched and received a reply for during the last minute. 1454 // This variable counts both successful and non-successful executions. 1455 ExecutedLastMinuteCount int64 `json:"executedLastMinuteCount,omitempty,string"` 1456 1457 // OldestEstimatedArrivalTime: Output only. An estimation of the nearest 1458 // time in the future where a task in the queue is scheduled to be 1459 // executed. 1460 OldestEstimatedArrivalTime string `json:"oldestEstimatedArrivalTime,omitempty"` 1461 1462 // TasksCount: Output only. An estimation of the number of tasks in the 1463 // queue, that is, the tasks in the queue that haven't been executed, 1464 // the tasks in the queue which the queue has dispatched but has not yet 1465 // received a reply for, and the failed tasks that the queue is 1466 // retrying. 1467 TasksCount int64 `json:"tasksCount,omitempty,string"` 1468 1469 // ForceSendFields is a list of field names (e.g. 1470 // "ConcurrentDispatchesCount") to unconditionally include in API 1471 // requests. By default, fields with empty or default values are omitted 1472 // from API requests. However, any non-pointer, non-interface field 1473 // appearing in ForceSendFields will be sent to the server regardless of 1474 // whether the field is empty or not. This may be used to include empty 1475 // fields in Patch requests. 1476 ForceSendFields []string `json:"-"` 1477 1478 // NullFields is a list of field names (e.g. 1479 // "ConcurrentDispatchesCount") to include in API requests with the JSON 1480 // null value. By default, fields with empty values are omitted from API 1481 // requests. However, any field with an empty value appearing in 1482 // NullFields will be sent to the server as null. It is an error if a 1483 // field in this list has a non-empty value. This may be used to include 1484 // null fields in Patch requests. 1485 NullFields []string `json:"-"` 1486} 1487 1488func (s *QueueStats) MarshalJSON() ([]byte, error) { 1489 type NoMethod QueueStats 1490 raw := NoMethod(*s) 1491 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1492} 1493 1494func (s *QueueStats) UnmarshalJSON(data []byte) error { 1495 type NoMethod QueueStats 1496 var s1 struct { 1497 EffectiveExecutionRate gensupport.JSONFloat64 `json:"effectiveExecutionRate"` 1498 *NoMethod 1499 } 1500 s1.NoMethod = (*NoMethod)(s) 1501 if err := json.Unmarshal(data, &s1); err != nil { 1502 return err 1503 } 1504 s.EffectiveExecutionRate = float64(s1.EffectiveExecutionRate) 1505 return nil 1506} 1507 1508// RateLimits: Rate limits. This message determines the maximum rate 1509// that tasks can be dispatched by a queue, regardless of whether the 1510// dispatch is a first task attempt or a retry. Note: The debugging 1511// command, RunTask, will run a task even if the queue has reached its 1512// RateLimits. 1513type RateLimits struct { 1514 // MaxBurstSize: The max burst size. Max burst size limits how fast 1515 // tasks in queue are processed when many tasks are in the queue and the 1516 // rate is high. This field allows the queue to have a high rate so 1517 // processing starts shortly after a task is enqueued, but still limits 1518 // resource usage when many tasks are enqueued in a short period of 1519 // time. The token bucket (https://wikipedia.org/wiki/Token_Bucket) 1520 // algorithm is used to control the rate of task dispatches. Each queue 1521 // has a token bucket that holds tokens, up to the maximum specified by 1522 // `max_burst_size`. Each time a task is dispatched, a token is removed 1523 // from the bucket. Tasks will be dispatched until the queue's bucket 1524 // runs out of tokens. The bucket will be continuously refilled with new 1525 // tokens based on max_dispatches_per_second. The default value of 1526 // `max_burst_size` is picked by Cloud Tasks based on the value of 1527 // max_dispatches_per_second. The maximum value of `max_burst_size` is 1528 // 500. For App Engine queues that were created or updated using 1529 // `queue.yaml/xml`, `max_burst_size` is equal to bucket_size 1530 // (https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). 1531 // If UpdateQueue is called on a queue without explicitly setting a 1532 // value for `max_burst_size`, `max_burst_size` value will get updated 1533 // if UpdateQueue is updating max_dispatches_per_second. 1534 MaxBurstSize int64 `json:"maxBurstSize,omitempty"` 1535 1536 // MaxConcurrentTasks: The maximum number of concurrent tasks that Cloud 1537 // Tasks allows to be dispatched for this queue. After this threshold 1538 // has been reached, Cloud Tasks stops dispatching tasks until the 1539 // number of concurrent requests decreases. If unspecified when the 1540 // queue is created, Cloud Tasks will pick the default. The maximum 1541 // allowed value is 5,000. This field is output only for pull queues and 1542 // always -1, which indicates no limit. No other queue types can have 1543 // `max_concurrent_tasks` set to -1. This field has the same meaning as 1544 // max_concurrent_requests in queue.yaml/xml 1545 // (https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). 1546 MaxConcurrentTasks int64 `json:"maxConcurrentTasks,omitempty"` 1547 1548 // MaxTasksDispatchedPerSecond: The maximum rate at which tasks are 1549 // dispatched from this queue. If unspecified when the queue is created, 1550 // Cloud Tasks will pick the default. * For App Engine queues, the 1551 // maximum allowed value is 500. * This field is output only for pull 1552 // queues. In addition to the `max_tasks_dispatched_per_second` limit, a 1553 // maximum of 10 QPS of LeaseTasks requests are allowed per pull queue. 1554 // This field has the same meaning as rate in queue.yaml/xml 1555 // (https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). 1556 MaxTasksDispatchedPerSecond float64 `json:"maxTasksDispatchedPerSecond,omitempty"` 1557 1558 // ForceSendFields is a list of field names (e.g. "MaxBurstSize") to 1559 // unconditionally include in API requests. By default, fields with 1560 // empty or default values are omitted from API requests. However, any 1561 // non-pointer, non-interface field appearing in ForceSendFields will be 1562 // sent to the server regardless of whether the field is empty or not. 1563 // This may be used to include empty fields in Patch requests. 1564 ForceSendFields []string `json:"-"` 1565 1566 // NullFields is a list of field names (e.g. "MaxBurstSize") to include 1567 // in API requests with the JSON null value. By default, fields with 1568 // empty values are omitted from API requests. However, any field with 1569 // an empty value appearing in NullFields will be sent to the server as 1570 // null. It is an error if a field in this list has a non-empty value. 1571 // This may be used to include null fields in Patch requests. 1572 NullFields []string `json:"-"` 1573} 1574 1575func (s *RateLimits) MarshalJSON() ([]byte, error) { 1576 type NoMethod RateLimits 1577 raw := NoMethod(*s) 1578 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1579} 1580 1581func (s *RateLimits) UnmarshalJSON(data []byte) error { 1582 type NoMethod RateLimits 1583 var s1 struct { 1584 MaxTasksDispatchedPerSecond gensupport.JSONFloat64 `json:"maxTasksDispatchedPerSecond"` 1585 *NoMethod 1586 } 1587 s1.NoMethod = (*NoMethod)(s) 1588 if err := json.Unmarshal(data, &s1); err != nil { 1589 return err 1590 } 1591 s.MaxTasksDispatchedPerSecond = float64(s1.MaxTasksDispatchedPerSecond) 1592 return nil 1593} 1594 1595// RenewLeaseRequest: Request message for renewing a lease using 1596// RenewLease. 1597type RenewLeaseRequest struct { 1598 // LeaseDuration: Required. The desired new lease duration, starting 1599 // from now. The maximum lease duration is 1 week. `lease_duration` will 1600 // be truncated to the nearest second. 1601 LeaseDuration string `json:"leaseDuration,omitempty"` 1602 1603 // ResponseView: The response_view specifies which subset of the Task 1604 // will be returned. By default response_view is BASIC; not all 1605 // information is retrieved by default because some data, such as 1606 // payloads, might be desirable to return only when needed because of 1607 // its large size or because of the sensitivity of data that it 1608 // contains. Authorization for FULL requires `cloudtasks.tasks.fullView` 1609 // Google IAM (https://cloud.google.com/iam/) permission on the Task 1610 // resource. 1611 // 1612 // Possible values: 1613 // "VIEW_UNSPECIFIED" - Unspecified. Defaults to BASIC. 1614 // "BASIC" - The basic view omits fields which can be large or can 1615 // contain sensitive data. This view does not include the (payload in 1616 // AppEngineHttpRequest and payload in PullMessage). These payloads are 1617 // desirable to return only when needed, because they can be large and 1618 // because of the sensitivity of the data that you choose to store in 1619 // it. 1620 // "FULL" - All information is returned. Authorization for FULL 1621 // requires `cloudtasks.tasks.fullView` [Google 1622 // IAM](https://cloud.google.com/iam/) permission on the Queue resource. 1623 ResponseView string `json:"responseView,omitempty"` 1624 1625 // ScheduleTime: Required. The task's current schedule time, available 1626 // in the schedule_time returned by LeaseTasks response or RenewLease 1627 // response. This restriction is to ensure that your worker currently 1628 // holds the lease. 1629 ScheduleTime string `json:"scheduleTime,omitempty"` 1630 1631 // ForceSendFields is a list of field names (e.g. "LeaseDuration") to 1632 // unconditionally include in API requests. By default, fields with 1633 // empty or default values are omitted from API requests. However, any 1634 // non-pointer, non-interface field appearing in ForceSendFields will be 1635 // sent to the server regardless of whether the field is empty or not. 1636 // This may be used to include empty fields in Patch requests. 1637 ForceSendFields []string `json:"-"` 1638 1639 // NullFields is a list of field names (e.g. "LeaseDuration") to include 1640 // in API requests with the JSON null value. By default, fields with 1641 // empty values are omitted from API requests. However, any field with 1642 // an empty value appearing in NullFields will be sent to the server as 1643 // null. It is an error if a field in this list has a non-empty value. 1644 // This may be used to include null fields in Patch requests. 1645 NullFields []string `json:"-"` 1646} 1647 1648func (s *RenewLeaseRequest) MarshalJSON() ([]byte, error) { 1649 type NoMethod RenewLeaseRequest 1650 raw := NoMethod(*s) 1651 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1652} 1653 1654// ResumeQueueRequest: Request message for ResumeQueue. 1655type ResumeQueueRequest struct { 1656} 1657 1658// RetryConfig: Retry config. These settings determine how a failed task 1659// attempt is retried. 1660type RetryConfig struct { 1661 // MaxAttempts: The maximum number of attempts for a task. Cloud Tasks 1662 // will attempt the task `max_attempts` times (that is, if the first 1663 // attempt fails, then there will be `max_attempts - 1` retries). Must 1664 // be > 0. 1665 MaxAttempts int64 `json:"maxAttempts,omitempty"` 1666 1667 // MaxBackoff: A task will be scheduled for retry between min_backoff 1668 // and max_backoff duration after it fails, if the queue's RetryConfig 1669 // specifies that the task should be retried. If unspecified when the 1670 // queue is created, Cloud Tasks will pick the default. This field is 1671 // output only for pull queues. `max_backoff` will be truncated to the 1672 // nearest second. This field has the same meaning as 1673 // max_backoff_seconds in queue.yaml/xml 1674 // (https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). 1675 MaxBackoff string `json:"maxBackoff,omitempty"` 1676 1677 // MaxDoublings: The time between retries will double `max_doublings` 1678 // times. A task's retry interval starts at min_backoff, then doubles 1679 // `max_doublings` times, then increases linearly, and finally retries 1680 // at intervals of max_backoff up to max_attempts times. For example, if 1681 // min_backoff is 10s, max_backoff is 300s, and `max_doublings` is 3, 1682 // then the a task will first be retried in 10s. The retry interval will 1683 // double three times, and then increase linearly by 2^3 * 10s. Finally, 1684 // the task will retry at intervals of max_backoff until the task has 1685 // been attempted max_attempts times. Thus, the requests will retry at 1686 // 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... If unspecified when 1687 // the queue is created, Cloud Tasks will pick the default. This field 1688 // is output only for pull queues. This field has the same meaning as 1689 // max_doublings in queue.yaml/xml 1690 // (https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). 1691 MaxDoublings int64 `json:"maxDoublings,omitempty"` 1692 1693 // MaxRetryDuration: If positive, `max_retry_duration` specifies the 1694 // time limit for retrying a failed task, measured from when the task 1695 // was first attempted. Once `max_retry_duration` time has passed *and* 1696 // the task has been attempted max_attempts times, no further attempts 1697 // will be made and the task will be deleted. If zero, then the task age 1698 // is unlimited. If unspecified when the queue is created, Cloud Tasks 1699 // will pick the default. This field is output only for pull queues. 1700 // `max_retry_duration` will be truncated to the nearest second. This 1701 // field has the same meaning as task_age_limit in queue.yaml/xml 1702 // (https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). 1703 MaxRetryDuration string `json:"maxRetryDuration,omitempty"` 1704 1705 // MinBackoff: A task will be scheduled for retry between min_backoff 1706 // and max_backoff duration after it fails, if the queue's RetryConfig 1707 // specifies that the task should be retried. If unspecified when the 1708 // queue is created, Cloud Tasks will pick the default. This field is 1709 // output only for pull queues. `min_backoff` will be truncated to the 1710 // nearest second. This field has the same meaning as 1711 // min_backoff_seconds in queue.yaml/xml 1712 // (https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). 1713 MinBackoff string `json:"minBackoff,omitempty"` 1714 1715 // UnlimitedAttempts: If true, then the number of attempts is unlimited. 1716 UnlimitedAttempts bool `json:"unlimitedAttempts,omitempty"` 1717 1718 // ForceSendFields is a list of field names (e.g. "MaxAttempts") to 1719 // unconditionally include in API requests. By default, fields with 1720 // empty or default values are omitted from API requests. However, any 1721 // non-pointer, non-interface field appearing in ForceSendFields will be 1722 // sent to the server regardless of whether the field is empty or not. 1723 // This may be used to include empty fields in Patch requests. 1724 ForceSendFields []string `json:"-"` 1725 1726 // NullFields is a list of field names (e.g. "MaxAttempts") to include 1727 // in API requests with the JSON null value. By default, fields with 1728 // empty values are omitted from API requests. However, any field with 1729 // an empty value appearing in NullFields will be sent to the server as 1730 // null. It is an error if a field in this list has a non-empty value. 1731 // This may be used to include null fields in Patch requests. 1732 NullFields []string `json:"-"` 1733} 1734 1735func (s *RetryConfig) MarshalJSON() ([]byte, error) { 1736 type NoMethod RetryConfig 1737 raw := NoMethod(*s) 1738 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1739} 1740 1741// RunTaskRequest: Request message for forcing a task to run now using 1742// RunTask. 1743type RunTaskRequest struct { 1744 // ResponseView: The response_view specifies which subset of the Task 1745 // will be returned. By default response_view is BASIC; not all 1746 // information is retrieved by default because some data, such as 1747 // payloads, might be desirable to return only when needed because of 1748 // its large size or because of the sensitivity of data that it 1749 // contains. Authorization for FULL requires `cloudtasks.tasks.fullView` 1750 // Google IAM (https://cloud.google.com/iam/) permission on the Task 1751 // resource. 1752 // 1753 // Possible values: 1754 // "VIEW_UNSPECIFIED" - Unspecified. Defaults to BASIC. 1755 // "BASIC" - The basic view omits fields which can be large or can 1756 // contain sensitive data. This view does not include the (payload in 1757 // AppEngineHttpRequest and payload in PullMessage). These payloads are 1758 // desirable to return only when needed, because they can be large and 1759 // because of the sensitivity of the data that you choose to store in 1760 // it. 1761 // "FULL" - All information is returned. Authorization for FULL 1762 // requires `cloudtasks.tasks.fullView` [Google 1763 // IAM](https://cloud.google.com/iam/) permission on the Queue resource. 1764 ResponseView string `json:"responseView,omitempty"` 1765 1766 // ForceSendFields is a list of field names (e.g. "ResponseView") to 1767 // unconditionally include in API requests. By default, fields with 1768 // empty or default values are omitted from API requests. However, any 1769 // non-pointer, non-interface field appearing in ForceSendFields will be 1770 // sent to the server regardless of whether the field is empty or not. 1771 // This may be used to include empty fields in Patch requests. 1772 ForceSendFields []string `json:"-"` 1773 1774 // NullFields is a list of field names (e.g. "ResponseView") to include 1775 // in API requests with the JSON null value. By default, fields with 1776 // empty values are omitted from API requests. However, any field with 1777 // an empty value appearing in NullFields will be sent to the server as 1778 // null. It is an error if a field in this list has a non-empty value. 1779 // This may be used to include null fields in Patch requests. 1780 NullFields []string `json:"-"` 1781} 1782 1783func (s *RunTaskRequest) MarshalJSON() ([]byte, error) { 1784 type NoMethod RunTaskRequest 1785 raw := NoMethod(*s) 1786 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1787} 1788 1789// SetIamPolicyRequest: Request message for `SetIamPolicy` method. 1790type SetIamPolicyRequest struct { 1791 // Policy: REQUIRED: The complete policy to be applied to the 1792 // `resource`. The size of the policy is limited to a few 10s of KB. An 1793 // empty policy is a valid policy but certain Cloud Platform services 1794 // (such as Projects) might reject them. 1795 Policy *Policy `json:"policy,omitempty"` 1796 1797 // ForceSendFields is a list of field names (e.g. "Policy") to 1798 // unconditionally include in API requests. By default, fields with 1799 // empty or default values are omitted from API requests. However, any 1800 // non-pointer, non-interface field appearing in ForceSendFields will be 1801 // sent to the server regardless of whether the field is empty or not. 1802 // This may be used to include empty fields in Patch requests. 1803 ForceSendFields []string `json:"-"` 1804 1805 // NullFields is a list of field names (e.g. "Policy") to include in API 1806 // requests with the JSON null value. By default, fields with empty 1807 // values are omitted from API requests. However, any field with an 1808 // empty value appearing in NullFields will be sent to the server as 1809 // null. It is an error if a field in this list has a non-empty value. 1810 // This may be used to include null fields in Patch requests. 1811 NullFields []string `json:"-"` 1812} 1813 1814func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1815 type NoMethod SetIamPolicyRequest 1816 raw := NoMethod(*s) 1817 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1818} 1819 1820// Status: The `Status` type defines a logical error model that is 1821// suitable for different programming environments, including REST APIs 1822// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 1823// `Status` message contains three pieces of data: error code, error 1824// message, and error details. You can find out more about this error 1825// model and how to work with it in the API Design Guide 1826// (https://cloud.google.com/apis/design/errors). 1827type Status struct { 1828 // Code: The status code, which should be an enum value of 1829 // google.rpc.Code. 1830 Code int64 `json:"code,omitempty"` 1831 1832 // Details: A list of messages that carry the error details. There is a 1833 // common set of message types for APIs to use. 1834 Details []googleapi.RawMessage `json:"details,omitempty"` 1835 1836 // Message: A developer-facing error message, which should be in 1837 // English. Any user-facing error message should be localized and sent 1838 // in the google.rpc.Status.details field, or localized by the client. 1839 Message string `json:"message,omitempty"` 1840 1841 // ForceSendFields is a list of field names (e.g. "Code") to 1842 // unconditionally include in API requests. By default, fields with 1843 // empty or default values are omitted from API requests. However, any 1844 // non-pointer, non-interface field appearing in ForceSendFields will be 1845 // sent to the server regardless of whether the field is empty or not. 1846 // This may be used to include empty fields in Patch requests. 1847 ForceSendFields []string `json:"-"` 1848 1849 // NullFields is a list of field names (e.g. "Code") to include in API 1850 // requests with the JSON null value. By default, fields with empty 1851 // values are omitted from API requests. However, any field with an 1852 // empty value appearing in NullFields will be sent to the server as 1853 // null. It is an error if a field in this list has a non-empty value. 1854 // This may be used to include null fields in Patch requests. 1855 NullFields []string `json:"-"` 1856} 1857 1858func (s *Status) MarshalJSON() ([]byte, error) { 1859 type NoMethod Status 1860 raw := NoMethod(*s) 1861 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1862} 1863 1864// Task: A unit of scheduled work. 1865type Task struct { 1866 // AppEngineHttpRequest: App Engine HTTP request that is sent to the 1867 // task's target. Can be set only if app_engine_http_target is set on 1868 // the queue. An App Engine task is a task that has AppEngineHttpRequest 1869 // set. 1870 AppEngineHttpRequest *AppEngineHttpRequest `json:"appEngineHttpRequest,omitempty"` 1871 1872 // CreateTime: Output only. The time that the task was created. 1873 // `create_time` will be truncated to the nearest second. 1874 CreateTime string `json:"createTime,omitempty"` 1875 1876 // Name: Optionally caller-specified in CreateTask. The task name. The 1877 // task name must have the following format: 1878 // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ 1879 // ID` * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), 1880 // hyphens (-), colons (:), or periods (.). For more information, see 1881 // Identifying projects 1882 // (https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) 1883 // * `LOCATION_ID` is the canonical ID for the task's location. The list 1884 // of available locations can be obtained by calling ListLocations. For 1885 // more information, see https://cloud.google.com/about/locations/. * 1886 // `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or 1887 // hyphens (-). The maximum length is 100 characters. * `TASK_ID` can 1888 // contain only letters ([A-Za-z]), numbers ([0-9]), hyphens (-), or 1889 // underscores (_). The maximum length is 500 characters. 1890 Name string `json:"name,omitempty"` 1891 1892 // PullMessage: LeaseTasks to process the task. Can be set only if 1893 // pull_target is set on the queue. A pull task is a task that has 1894 // PullMessage set. 1895 PullMessage *PullMessage `json:"pullMessage,omitempty"` 1896 1897 // ScheduleTime: The time when the task is scheduled to be attempted. 1898 // For App Engine queues, this is when the task will be attempted or 1899 // retried. For pull queues, this is the time when the task is available 1900 // to be leased; if a task is currently leased, this is the time when 1901 // the current lease expires, that is, the time that the task was leased 1902 // plus the lease_duration. `schedule_time` will be truncated to the 1903 // nearest microsecond. 1904 ScheduleTime string `json:"scheduleTime,omitempty"` 1905 1906 // Status: Output only. The task status. 1907 Status *TaskStatus `json:"status,omitempty"` 1908 1909 // View: Output only. The view specifies which subset of the Task has 1910 // been returned. 1911 // 1912 // Possible values: 1913 // "VIEW_UNSPECIFIED" - Unspecified. Defaults to BASIC. 1914 // "BASIC" - The basic view omits fields which can be large or can 1915 // contain sensitive data. This view does not include the (payload in 1916 // AppEngineHttpRequest and payload in PullMessage). These payloads are 1917 // desirable to return only when needed, because they can be large and 1918 // because of the sensitivity of the data that you choose to store in 1919 // it. 1920 // "FULL" - All information is returned. Authorization for FULL 1921 // requires `cloudtasks.tasks.fullView` [Google 1922 // IAM](https://cloud.google.com/iam/) permission on the Queue resource. 1923 View string `json:"view,omitempty"` 1924 1925 // ServerResponse contains the HTTP response code and headers from the 1926 // server. 1927 googleapi.ServerResponse `json:"-"` 1928 1929 // ForceSendFields is a list of field names (e.g. 1930 // "AppEngineHttpRequest") to unconditionally include in API requests. 1931 // By default, fields with empty or default values are omitted from API 1932 // requests. However, any non-pointer, non-interface field appearing in 1933 // ForceSendFields will be sent to the server regardless of whether the 1934 // field is empty or not. This may be used to include empty fields in 1935 // Patch requests. 1936 ForceSendFields []string `json:"-"` 1937 1938 // NullFields is a list of field names (e.g. "AppEngineHttpRequest") to 1939 // include in API requests with the JSON null value. By default, fields 1940 // with empty values are omitted from API requests. However, any field 1941 // with an empty value appearing in NullFields will be sent to the 1942 // server as null. It is an error if a field in this list has a 1943 // non-empty value. This may be used to include null fields in Patch 1944 // requests. 1945 NullFields []string `json:"-"` 1946} 1947 1948func (s *Task) MarshalJSON() ([]byte, error) { 1949 type NoMethod Task 1950 raw := NoMethod(*s) 1951 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1952} 1953 1954// TaskStatus: Status of the task. 1955type TaskStatus struct { 1956 // AttemptDispatchCount: Output only. The number of attempts dispatched. 1957 // This count includes attempts which have been dispatched but haven't 1958 // received a response. 1959 AttemptDispatchCount int64 `json:"attemptDispatchCount,omitempty"` 1960 1961 // AttemptResponseCount: Output only. The number of attempts which have 1962 // received a response. This field is not calculated for pull tasks. 1963 AttemptResponseCount int64 `json:"attemptResponseCount,omitempty"` 1964 1965 // FirstAttemptStatus: Output only. The status of the task's first 1966 // attempt. Only dispatch_time will be set. The other AttemptStatus 1967 // information is not retained by Cloud Tasks. This field is not 1968 // calculated for pull tasks. 1969 FirstAttemptStatus *AttemptStatus `json:"firstAttemptStatus,omitempty"` 1970 1971 // LastAttemptStatus: Output only. The status of the task's last 1972 // attempt. This field is not calculated for pull tasks. 1973 LastAttemptStatus *AttemptStatus `json:"lastAttemptStatus,omitempty"` 1974 1975 // ForceSendFields is a list of field names (e.g. 1976 // "AttemptDispatchCount") to unconditionally include in API requests. 1977 // By default, fields with empty or default values are omitted from API 1978 // requests. However, any non-pointer, non-interface field appearing in 1979 // ForceSendFields will be sent to the server regardless of whether the 1980 // field is empty or not. This may be used to include empty fields in 1981 // Patch requests. 1982 ForceSendFields []string `json:"-"` 1983 1984 // NullFields is a list of field names (e.g. "AttemptDispatchCount") to 1985 // include in API requests with the JSON null value. By default, fields 1986 // with empty values are omitted from API requests. However, any field 1987 // with an empty value appearing in NullFields will be sent to the 1988 // server as null. It is an error if a field in this list has a 1989 // non-empty value. This may be used to include null fields in Patch 1990 // requests. 1991 NullFields []string `json:"-"` 1992} 1993 1994func (s *TaskStatus) MarshalJSON() ([]byte, error) { 1995 type NoMethod TaskStatus 1996 raw := NoMethod(*s) 1997 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1998} 1999 2000// TestIamPermissionsRequest: Request message for `TestIamPermissions` 2001// method. 2002type TestIamPermissionsRequest struct { 2003 // Permissions: The set of permissions to check for the `resource`. 2004 // Permissions with wildcards (such as '*' or 'storage.*') are not 2005 // allowed. For more information see IAM Overview 2006 // (https://cloud.google.com/iam/docs/overview#permissions). 2007 Permissions []string `json:"permissions,omitempty"` 2008 2009 // ForceSendFields is a list of field names (e.g. "Permissions") to 2010 // unconditionally include in API requests. By default, fields with 2011 // empty or default values are omitted from API requests. However, any 2012 // non-pointer, non-interface field appearing in ForceSendFields will be 2013 // sent to the server regardless of whether the field is empty or not. 2014 // This may be used to include empty fields in Patch requests. 2015 ForceSendFields []string `json:"-"` 2016 2017 // NullFields is a list of field names (e.g. "Permissions") to include 2018 // in API requests with the JSON null value. By default, fields with 2019 // empty values are omitted from API requests. However, any field with 2020 // an empty value appearing in NullFields will be sent to the server as 2021 // null. It is an error if a field in this list has a non-empty value. 2022 // This may be used to include null fields in Patch requests. 2023 NullFields []string `json:"-"` 2024} 2025 2026func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 2027 type NoMethod TestIamPermissionsRequest 2028 raw := NoMethod(*s) 2029 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2030} 2031 2032// TestIamPermissionsResponse: Response message for `TestIamPermissions` 2033// method. 2034type TestIamPermissionsResponse struct { 2035 // Permissions: A subset of `TestPermissionsRequest.permissions` that 2036 // the caller is allowed. 2037 Permissions []string `json:"permissions,omitempty"` 2038 2039 // ServerResponse contains the HTTP response code and headers from the 2040 // server. 2041 googleapi.ServerResponse `json:"-"` 2042 2043 // ForceSendFields is a list of field names (e.g. "Permissions") to 2044 // unconditionally include in API requests. By default, fields with 2045 // empty or default values are omitted from API requests. However, any 2046 // non-pointer, non-interface field appearing in ForceSendFields will be 2047 // sent to the server regardless of whether the field is empty or not. 2048 // This may be used to include empty fields in Patch requests. 2049 ForceSendFields []string `json:"-"` 2050 2051 // NullFields is a list of field names (e.g. "Permissions") to include 2052 // in API requests with the JSON null value. By default, fields with 2053 // empty values are omitted from API requests. However, any field with 2054 // an empty value appearing in NullFields will be sent to the server as 2055 // null. It is an error if a field in this list has a non-empty value. 2056 // This may be used to include null fields in Patch requests. 2057 NullFields []string `json:"-"` 2058} 2059 2060func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 2061 type NoMethod TestIamPermissionsResponse 2062 raw := NoMethod(*s) 2063 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2064} 2065 2066// method id "cloudtasks.projects.locations.get": 2067 2068type ProjectsLocationsGetCall struct { 2069 s *Service 2070 name string 2071 urlParams_ gensupport.URLParams 2072 ifNoneMatch_ string 2073 ctx_ context.Context 2074 header_ http.Header 2075} 2076 2077// Get: Gets information about a location. 2078// 2079// - name: Resource name for the location. 2080func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { 2081 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2082 c.name = name 2083 return c 2084} 2085 2086// Fields allows partial responses to be retrieved. See 2087// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2088// for more information. 2089func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { 2090 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2091 return c 2092} 2093 2094// IfNoneMatch sets the optional parameter which makes the operation 2095// fail if the object's ETag matches the given value. This is useful for 2096// getting updates only after the object has changed since the last 2097// request. Use googleapi.IsNotModified to check whether the response 2098// error from Do is the result of In-None-Match. 2099func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { 2100 c.ifNoneMatch_ = entityTag 2101 return c 2102} 2103 2104// Context sets the context to be used in this call's Do method. Any 2105// pending HTTP request will be aborted if the provided context is 2106// canceled. 2107func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { 2108 c.ctx_ = ctx 2109 return c 2110} 2111 2112// Header returns an http.Header that can be modified by the caller to 2113// add HTTP headers to the request. 2114func (c *ProjectsLocationsGetCall) Header() http.Header { 2115 if c.header_ == nil { 2116 c.header_ = make(http.Header) 2117 } 2118 return c.header_ 2119} 2120 2121func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { 2122 reqHeaders := make(http.Header) 2123 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 2124 for k, v := range c.header_ { 2125 reqHeaders[k] = v 2126 } 2127 reqHeaders.Set("User-Agent", c.s.userAgent()) 2128 if c.ifNoneMatch_ != "" { 2129 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2130 } 2131 var body io.Reader = nil 2132 c.urlParams_.Set("alt", alt) 2133 c.urlParams_.Set("prettyPrint", "false") 2134 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") 2135 urls += "?" + c.urlParams_.Encode() 2136 req, err := http.NewRequest("GET", urls, body) 2137 if err != nil { 2138 return nil, err 2139 } 2140 req.Header = reqHeaders 2141 googleapi.Expand(req.URL, map[string]string{ 2142 "name": c.name, 2143 }) 2144 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2145} 2146 2147// Do executes the "cloudtasks.projects.locations.get" call. 2148// Exactly one of *Location or error will be non-nil. Any non-2xx status 2149// code is an error. Response headers are in either 2150// *Location.ServerResponse.Header or (if a response was returned at 2151// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2152// to check whether the returned error was because 2153// http.StatusNotModified was returned. 2154func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { 2155 gensupport.SetOptions(c.urlParams_, opts...) 2156 res, err := c.doRequest("json") 2157 if res != nil && res.StatusCode == http.StatusNotModified { 2158 if res.Body != nil { 2159 res.Body.Close() 2160 } 2161 return nil, &googleapi.Error{ 2162 Code: res.StatusCode, 2163 Header: res.Header, 2164 } 2165 } 2166 if err != nil { 2167 return nil, err 2168 } 2169 defer googleapi.CloseBody(res) 2170 if err := googleapi.CheckResponse(res); err != nil { 2171 return nil, err 2172 } 2173 ret := &Location{ 2174 ServerResponse: googleapi.ServerResponse{ 2175 Header: res.Header, 2176 HTTPStatusCode: res.StatusCode, 2177 }, 2178 } 2179 target := &ret 2180 if err := gensupport.DecodeResponse(target, res); err != nil { 2181 return nil, err 2182 } 2183 return ret, nil 2184 // { 2185 // "description": "Gets information about a location.", 2186 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}", 2187 // "httpMethod": "GET", 2188 // "id": "cloudtasks.projects.locations.get", 2189 // "parameterOrder": [ 2190 // "name" 2191 // ], 2192 // "parameters": { 2193 // "name": { 2194 // "description": "Resource name for the location.", 2195 // "location": "path", 2196 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2197 // "required": true, 2198 // "type": "string" 2199 // } 2200 // }, 2201 // "path": "v2beta2/{+name}", 2202 // "response": { 2203 // "$ref": "Location" 2204 // }, 2205 // "scopes": [ 2206 // "https://www.googleapis.com/auth/cloud-platform" 2207 // ] 2208 // } 2209 2210} 2211 2212// method id "cloudtasks.projects.locations.list": 2213 2214type ProjectsLocationsListCall struct { 2215 s *Service 2216 name string 2217 urlParams_ gensupport.URLParams 2218 ifNoneMatch_ string 2219 ctx_ context.Context 2220 header_ http.Header 2221} 2222 2223// List: Lists information about the supported locations for this 2224// service. 2225// 2226// - name: The resource that owns the locations collection, if 2227// applicable. 2228func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { 2229 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2230 c.name = name 2231 return c 2232} 2233 2234// Filter sets the optional parameter "filter": A filter to narrow down 2235// results to a preferred subset. The filtering language accepts strings 2236// like "displayName=tokyo", and is documented in more detail in AIP-160 2237// (https://google.aip.dev/160). 2238func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { 2239 c.urlParams_.Set("filter", filter) 2240 return c 2241} 2242 2243// PageSize sets the optional parameter "pageSize": The maximum number 2244// of results to return. If not set, the service selects a default. 2245func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { 2246 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2247 return c 2248} 2249 2250// PageToken sets the optional parameter "pageToken": A page token 2251// received from the `next_page_token` field in the response. Send that 2252// page token to receive the subsequent page. 2253func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { 2254 c.urlParams_.Set("pageToken", pageToken) 2255 return c 2256} 2257 2258// Fields allows partial responses to be retrieved. See 2259// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2260// for more information. 2261func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { 2262 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2263 return c 2264} 2265 2266// IfNoneMatch sets the optional parameter which makes the operation 2267// fail if the object's ETag matches the given value. This is useful for 2268// getting updates only after the object has changed since the last 2269// request. Use googleapi.IsNotModified to check whether the response 2270// error from Do is the result of In-None-Match. 2271func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { 2272 c.ifNoneMatch_ = entityTag 2273 return c 2274} 2275 2276// Context sets the context to be used in this call's Do method. Any 2277// pending HTTP request will be aborted if the provided context is 2278// canceled. 2279func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { 2280 c.ctx_ = ctx 2281 return c 2282} 2283 2284// Header returns an http.Header that can be modified by the caller to 2285// add HTTP headers to the request. 2286func (c *ProjectsLocationsListCall) Header() http.Header { 2287 if c.header_ == nil { 2288 c.header_ = make(http.Header) 2289 } 2290 return c.header_ 2291} 2292 2293func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { 2294 reqHeaders := make(http.Header) 2295 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 2296 for k, v := range c.header_ { 2297 reqHeaders[k] = v 2298 } 2299 reqHeaders.Set("User-Agent", c.s.userAgent()) 2300 if c.ifNoneMatch_ != "" { 2301 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2302 } 2303 var body io.Reader = nil 2304 c.urlParams_.Set("alt", alt) 2305 c.urlParams_.Set("prettyPrint", "false") 2306 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}/locations") 2307 urls += "?" + c.urlParams_.Encode() 2308 req, err := http.NewRequest("GET", urls, body) 2309 if err != nil { 2310 return nil, err 2311 } 2312 req.Header = reqHeaders 2313 googleapi.Expand(req.URL, map[string]string{ 2314 "name": c.name, 2315 }) 2316 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2317} 2318 2319// Do executes the "cloudtasks.projects.locations.list" call. 2320// Exactly one of *ListLocationsResponse or error will be non-nil. Any 2321// non-2xx status code is an error. Response headers are in either 2322// *ListLocationsResponse.ServerResponse.Header or (if a response was 2323// returned at all) in error.(*googleapi.Error).Header. Use 2324// googleapi.IsNotModified to check whether the returned error was 2325// because http.StatusNotModified was returned. 2326func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { 2327 gensupport.SetOptions(c.urlParams_, opts...) 2328 res, err := c.doRequest("json") 2329 if res != nil && res.StatusCode == http.StatusNotModified { 2330 if res.Body != nil { 2331 res.Body.Close() 2332 } 2333 return nil, &googleapi.Error{ 2334 Code: res.StatusCode, 2335 Header: res.Header, 2336 } 2337 } 2338 if err != nil { 2339 return nil, err 2340 } 2341 defer googleapi.CloseBody(res) 2342 if err := googleapi.CheckResponse(res); err != nil { 2343 return nil, err 2344 } 2345 ret := &ListLocationsResponse{ 2346 ServerResponse: googleapi.ServerResponse{ 2347 Header: res.Header, 2348 HTTPStatusCode: res.StatusCode, 2349 }, 2350 } 2351 target := &ret 2352 if err := gensupport.DecodeResponse(target, res); err != nil { 2353 return nil, err 2354 } 2355 return ret, nil 2356 // { 2357 // "description": "Lists information about the supported locations for this service.", 2358 // "flatPath": "v2beta2/projects/{projectsId}/locations", 2359 // "httpMethod": "GET", 2360 // "id": "cloudtasks.projects.locations.list", 2361 // "parameterOrder": [ 2362 // "name" 2363 // ], 2364 // "parameters": { 2365 // "filter": { 2366 // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in [AIP-160](https://google.aip.dev/160).", 2367 // "location": "query", 2368 // "type": "string" 2369 // }, 2370 // "name": { 2371 // "description": "The resource that owns the locations collection, if applicable.", 2372 // "location": "path", 2373 // "pattern": "^projects/[^/]+$", 2374 // "required": true, 2375 // "type": "string" 2376 // }, 2377 // "pageSize": { 2378 // "description": "The maximum number of results to return. If not set, the service selects a default.", 2379 // "format": "int32", 2380 // "location": "query", 2381 // "type": "integer" 2382 // }, 2383 // "pageToken": { 2384 // "description": "A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.", 2385 // "location": "query", 2386 // "type": "string" 2387 // } 2388 // }, 2389 // "path": "v2beta2/{+name}/locations", 2390 // "response": { 2391 // "$ref": "ListLocationsResponse" 2392 // }, 2393 // "scopes": [ 2394 // "https://www.googleapis.com/auth/cloud-platform" 2395 // ] 2396 // } 2397 2398} 2399 2400// Pages invokes f for each page of results. 2401// A non-nil error returned from f will halt the iteration. 2402// The provided context supersedes any context provided to the Context method. 2403func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { 2404 c.ctx_ = ctx 2405 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2406 for { 2407 x, err := c.Do() 2408 if err != nil { 2409 return err 2410 } 2411 if err := f(x); err != nil { 2412 return err 2413 } 2414 if x.NextPageToken == "" { 2415 return nil 2416 } 2417 c.PageToken(x.NextPageToken) 2418 } 2419} 2420 2421// method id "cloudtasks.projects.locations.queues.create": 2422 2423type ProjectsLocationsQueuesCreateCall struct { 2424 s *Service 2425 parent string 2426 queue *Queue 2427 urlParams_ gensupport.URLParams 2428 ctx_ context.Context 2429 header_ http.Header 2430} 2431 2432// Create: Creates a queue. Queues created with this method allow tasks 2433// to live for a maximum of 31 days. After a task is 31 days old, the 2434// task will be deleted regardless of whether it was dispatched or not. 2435// WARNING: Using this method may have unintended side effects if you 2436// are using an App Engine `queue.yaml` or `queue.xml` file to manage 2437// your queues. Read Overview of Queue Management and queue.yaml 2438// (https://cloud.google.com/tasks/docs/queue-yaml) before using this 2439// method. 2440// 2441// - parent: The location name in which the queue will be created. For 2442// example: `projects/PROJECT_ID/locations/LOCATION_ID` The list of 2443// allowed locations can be obtained by calling Cloud Tasks' 2444// implementation of ListLocations. 2445func (r *ProjectsLocationsQueuesService) Create(parent string, queue *Queue) *ProjectsLocationsQueuesCreateCall { 2446 c := &ProjectsLocationsQueuesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2447 c.parent = parent 2448 c.queue = queue 2449 return c 2450} 2451 2452// Fields allows partial responses to be retrieved. See 2453// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2454// for more information. 2455func (c *ProjectsLocationsQueuesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesCreateCall { 2456 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2457 return c 2458} 2459 2460// Context sets the context to be used in this call's Do method. Any 2461// pending HTTP request will be aborted if the provided context is 2462// canceled. 2463func (c *ProjectsLocationsQueuesCreateCall) Context(ctx context.Context) *ProjectsLocationsQueuesCreateCall { 2464 c.ctx_ = ctx 2465 return c 2466} 2467 2468// Header returns an http.Header that can be modified by the caller to 2469// add HTTP headers to the request. 2470func (c *ProjectsLocationsQueuesCreateCall) Header() http.Header { 2471 if c.header_ == nil { 2472 c.header_ = make(http.Header) 2473 } 2474 return c.header_ 2475} 2476 2477func (c *ProjectsLocationsQueuesCreateCall) doRequest(alt string) (*http.Response, error) { 2478 reqHeaders := make(http.Header) 2479 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 2480 for k, v := range c.header_ { 2481 reqHeaders[k] = v 2482 } 2483 reqHeaders.Set("User-Agent", c.s.userAgent()) 2484 var body io.Reader = nil 2485 body, err := googleapi.WithoutDataWrapper.JSONReader(c.queue) 2486 if err != nil { 2487 return nil, err 2488 } 2489 reqHeaders.Set("Content-Type", "application/json") 2490 c.urlParams_.Set("alt", alt) 2491 c.urlParams_.Set("prettyPrint", "false") 2492 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+parent}/queues") 2493 urls += "?" + c.urlParams_.Encode() 2494 req, err := http.NewRequest("POST", urls, body) 2495 if err != nil { 2496 return nil, err 2497 } 2498 req.Header = reqHeaders 2499 googleapi.Expand(req.URL, map[string]string{ 2500 "parent": c.parent, 2501 }) 2502 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2503} 2504 2505// Do executes the "cloudtasks.projects.locations.queues.create" call. 2506// Exactly one of *Queue or error will be non-nil. Any non-2xx status 2507// code is an error. Response headers are in either 2508// *Queue.ServerResponse.Header or (if a response was returned at all) 2509// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2510// check whether the returned error was because http.StatusNotModified 2511// was returned. 2512func (c *ProjectsLocationsQueuesCreateCall) Do(opts ...googleapi.CallOption) (*Queue, error) { 2513 gensupport.SetOptions(c.urlParams_, opts...) 2514 res, err := c.doRequest("json") 2515 if res != nil && res.StatusCode == http.StatusNotModified { 2516 if res.Body != nil { 2517 res.Body.Close() 2518 } 2519 return nil, &googleapi.Error{ 2520 Code: res.StatusCode, 2521 Header: res.Header, 2522 } 2523 } 2524 if err != nil { 2525 return nil, err 2526 } 2527 defer googleapi.CloseBody(res) 2528 if err := googleapi.CheckResponse(res); err != nil { 2529 return nil, err 2530 } 2531 ret := &Queue{ 2532 ServerResponse: googleapi.ServerResponse{ 2533 Header: res.Header, 2534 HTTPStatusCode: res.StatusCode, 2535 }, 2536 } 2537 target := &ret 2538 if err := gensupport.DecodeResponse(target, res); err != nil { 2539 return nil, err 2540 } 2541 return ret, nil 2542 // { 2543 // "description": "Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", 2544 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues", 2545 // "httpMethod": "POST", 2546 // "id": "cloudtasks.projects.locations.queues.create", 2547 // "parameterOrder": [ 2548 // "parent" 2549 // ], 2550 // "parameters": { 2551 // "parent": { 2552 // "description": "Required. The location name in which the queue will be created. For example: `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained by calling Cloud Tasks' implementation of ListLocations.", 2553 // "location": "path", 2554 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2555 // "required": true, 2556 // "type": "string" 2557 // } 2558 // }, 2559 // "path": "v2beta2/{+parent}/queues", 2560 // "request": { 2561 // "$ref": "Queue" 2562 // }, 2563 // "response": { 2564 // "$ref": "Queue" 2565 // }, 2566 // "scopes": [ 2567 // "https://www.googleapis.com/auth/cloud-platform" 2568 // ] 2569 // } 2570 2571} 2572 2573// method id "cloudtasks.projects.locations.queues.delete": 2574 2575type ProjectsLocationsQueuesDeleteCall struct { 2576 s *Service 2577 name string 2578 urlParams_ gensupport.URLParams 2579 ctx_ context.Context 2580 header_ http.Header 2581} 2582 2583// Delete: Deletes a queue. This command will delete the queue even if 2584// it has tasks in it. Note: If you delete a queue, a queue with the 2585// same name can't be created for 7 days. WARNING: Using this method may 2586// have unintended side effects if you are using an App Engine 2587// `queue.yaml` or `queue.xml` file to manage your queues. Read Overview 2588// of Queue Management and queue.yaml 2589// (https://cloud.google.com/tasks/docs/queue-yaml) before using this 2590// method. 2591// 2592// - name: The queue name. For example: 2593// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`. 2594func (r *ProjectsLocationsQueuesService) Delete(name string) *ProjectsLocationsQueuesDeleteCall { 2595 c := &ProjectsLocationsQueuesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2596 c.name = name 2597 return c 2598} 2599 2600// Fields allows partial responses to be retrieved. See 2601// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2602// for more information. 2603func (c *ProjectsLocationsQueuesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesDeleteCall { 2604 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2605 return c 2606} 2607 2608// Context sets the context to be used in this call's Do method. Any 2609// pending HTTP request will be aborted if the provided context is 2610// canceled. 2611func (c *ProjectsLocationsQueuesDeleteCall) Context(ctx context.Context) *ProjectsLocationsQueuesDeleteCall { 2612 c.ctx_ = ctx 2613 return c 2614} 2615 2616// Header returns an http.Header that can be modified by the caller to 2617// add HTTP headers to the request. 2618func (c *ProjectsLocationsQueuesDeleteCall) Header() http.Header { 2619 if c.header_ == nil { 2620 c.header_ = make(http.Header) 2621 } 2622 return c.header_ 2623} 2624 2625func (c *ProjectsLocationsQueuesDeleteCall) doRequest(alt string) (*http.Response, error) { 2626 reqHeaders := make(http.Header) 2627 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 2628 for k, v := range c.header_ { 2629 reqHeaders[k] = v 2630 } 2631 reqHeaders.Set("User-Agent", c.s.userAgent()) 2632 var body io.Reader = nil 2633 c.urlParams_.Set("alt", alt) 2634 c.urlParams_.Set("prettyPrint", "false") 2635 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") 2636 urls += "?" + c.urlParams_.Encode() 2637 req, err := http.NewRequest("DELETE", urls, body) 2638 if err != nil { 2639 return nil, err 2640 } 2641 req.Header = reqHeaders 2642 googleapi.Expand(req.URL, map[string]string{ 2643 "name": c.name, 2644 }) 2645 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2646} 2647 2648// Do executes the "cloudtasks.projects.locations.queues.delete" call. 2649// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2650// code is an error. Response headers are in either 2651// *Empty.ServerResponse.Header or (if a response was returned at all) 2652// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2653// check whether the returned error was because http.StatusNotModified 2654// was returned. 2655func (c *ProjectsLocationsQueuesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2656 gensupport.SetOptions(c.urlParams_, opts...) 2657 res, err := c.doRequest("json") 2658 if res != nil && res.StatusCode == http.StatusNotModified { 2659 if res.Body != nil { 2660 res.Body.Close() 2661 } 2662 return nil, &googleapi.Error{ 2663 Code: res.StatusCode, 2664 Header: res.Header, 2665 } 2666 } 2667 if err != nil { 2668 return nil, err 2669 } 2670 defer googleapi.CloseBody(res) 2671 if err := googleapi.CheckResponse(res); err != nil { 2672 return nil, err 2673 } 2674 ret := &Empty{ 2675 ServerResponse: googleapi.ServerResponse{ 2676 Header: res.Header, 2677 HTTPStatusCode: res.StatusCode, 2678 }, 2679 } 2680 target := &ret 2681 if err := gensupport.DecodeResponse(target, res); err != nil { 2682 return nil, err 2683 } 2684 return ret, nil 2685 // { 2686 // "description": "Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", 2687 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}", 2688 // "httpMethod": "DELETE", 2689 // "id": "cloudtasks.projects.locations.queues.delete", 2690 // "parameterOrder": [ 2691 // "name" 2692 // ], 2693 // "parameters": { 2694 // "name": { 2695 // "description": "Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`", 2696 // "location": "path", 2697 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 2698 // "required": true, 2699 // "type": "string" 2700 // } 2701 // }, 2702 // "path": "v2beta2/{+name}", 2703 // "response": { 2704 // "$ref": "Empty" 2705 // }, 2706 // "scopes": [ 2707 // "https://www.googleapis.com/auth/cloud-platform" 2708 // ] 2709 // } 2710 2711} 2712 2713// method id "cloudtasks.projects.locations.queues.get": 2714 2715type ProjectsLocationsQueuesGetCall struct { 2716 s *Service 2717 name string 2718 urlParams_ gensupport.URLParams 2719 ifNoneMatch_ string 2720 ctx_ context.Context 2721 header_ http.Header 2722} 2723 2724// Get: Gets a queue. 2725// 2726// - name: The resource name of the queue. For example: 2727// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`. 2728func (r *ProjectsLocationsQueuesService) Get(name string) *ProjectsLocationsQueuesGetCall { 2729 c := &ProjectsLocationsQueuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2730 c.name = name 2731 return c 2732} 2733 2734// ReadMask sets the optional parameter "readMask": Read mask is used 2735// for a more granular control over what the API returns. If the mask is 2736// not present all fields will be returned except [Queue.stats]. 2737// [Queue.stats] will be returned only if it was explicitly specified in 2738// the mask. 2739func (c *ProjectsLocationsQueuesGetCall) ReadMask(readMask string) *ProjectsLocationsQueuesGetCall { 2740 c.urlParams_.Set("readMask", readMask) 2741 return c 2742} 2743 2744// Fields allows partial responses to be retrieved. See 2745// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2746// for more information. 2747func (c *ProjectsLocationsQueuesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesGetCall { 2748 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2749 return c 2750} 2751 2752// IfNoneMatch sets the optional parameter which makes the operation 2753// fail if the object's ETag matches the given value. This is useful for 2754// getting updates only after the object has changed since the last 2755// request. Use googleapi.IsNotModified to check whether the response 2756// error from Do is the result of In-None-Match. 2757func (c *ProjectsLocationsQueuesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsQueuesGetCall { 2758 c.ifNoneMatch_ = entityTag 2759 return c 2760} 2761 2762// Context sets the context to be used in this call's Do method. Any 2763// pending HTTP request will be aborted if the provided context is 2764// canceled. 2765func (c *ProjectsLocationsQueuesGetCall) Context(ctx context.Context) *ProjectsLocationsQueuesGetCall { 2766 c.ctx_ = ctx 2767 return c 2768} 2769 2770// Header returns an http.Header that can be modified by the caller to 2771// add HTTP headers to the request. 2772func (c *ProjectsLocationsQueuesGetCall) Header() http.Header { 2773 if c.header_ == nil { 2774 c.header_ = make(http.Header) 2775 } 2776 return c.header_ 2777} 2778 2779func (c *ProjectsLocationsQueuesGetCall) doRequest(alt string) (*http.Response, error) { 2780 reqHeaders := make(http.Header) 2781 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 2782 for k, v := range c.header_ { 2783 reqHeaders[k] = v 2784 } 2785 reqHeaders.Set("User-Agent", c.s.userAgent()) 2786 if c.ifNoneMatch_ != "" { 2787 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2788 } 2789 var body io.Reader = nil 2790 c.urlParams_.Set("alt", alt) 2791 c.urlParams_.Set("prettyPrint", "false") 2792 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") 2793 urls += "?" + c.urlParams_.Encode() 2794 req, err := http.NewRequest("GET", urls, body) 2795 if err != nil { 2796 return nil, err 2797 } 2798 req.Header = reqHeaders 2799 googleapi.Expand(req.URL, map[string]string{ 2800 "name": c.name, 2801 }) 2802 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2803} 2804 2805// Do executes the "cloudtasks.projects.locations.queues.get" call. 2806// Exactly one of *Queue or error will be non-nil. Any non-2xx status 2807// code is an error. Response headers are in either 2808// *Queue.ServerResponse.Header or (if a response was returned at all) 2809// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2810// check whether the returned error was because http.StatusNotModified 2811// was returned. 2812func (c *ProjectsLocationsQueuesGetCall) Do(opts ...googleapi.CallOption) (*Queue, error) { 2813 gensupport.SetOptions(c.urlParams_, opts...) 2814 res, err := c.doRequest("json") 2815 if res != nil && res.StatusCode == http.StatusNotModified { 2816 if res.Body != nil { 2817 res.Body.Close() 2818 } 2819 return nil, &googleapi.Error{ 2820 Code: res.StatusCode, 2821 Header: res.Header, 2822 } 2823 } 2824 if err != nil { 2825 return nil, err 2826 } 2827 defer googleapi.CloseBody(res) 2828 if err := googleapi.CheckResponse(res); err != nil { 2829 return nil, err 2830 } 2831 ret := &Queue{ 2832 ServerResponse: googleapi.ServerResponse{ 2833 Header: res.Header, 2834 HTTPStatusCode: res.StatusCode, 2835 }, 2836 } 2837 target := &ret 2838 if err := gensupport.DecodeResponse(target, res); err != nil { 2839 return nil, err 2840 } 2841 return ret, nil 2842 // { 2843 // "description": "Gets a queue.", 2844 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}", 2845 // "httpMethod": "GET", 2846 // "id": "cloudtasks.projects.locations.queues.get", 2847 // "parameterOrder": [ 2848 // "name" 2849 // ], 2850 // "parameters": { 2851 // "name": { 2852 // "description": "Required. The resource name of the queue. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`", 2853 // "location": "path", 2854 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 2855 // "required": true, 2856 // "type": "string" 2857 // }, 2858 // "readMask": { 2859 // "description": "Optional. Read mask is used for a more granular control over what the API returns. If the mask is not present all fields will be returned except [Queue.stats]. [Queue.stats] will be returned only if it was explicitly specified in the mask.", 2860 // "format": "google-fieldmask", 2861 // "location": "query", 2862 // "type": "string" 2863 // } 2864 // }, 2865 // "path": "v2beta2/{+name}", 2866 // "response": { 2867 // "$ref": "Queue" 2868 // }, 2869 // "scopes": [ 2870 // "https://www.googleapis.com/auth/cloud-platform" 2871 // ] 2872 // } 2873 2874} 2875 2876// method id "cloudtasks.projects.locations.queues.getIamPolicy": 2877 2878type ProjectsLocationsQueuesGetIamPolicyCall struct { 2879 s *Service 2880 resource string 2881 getiampolicyrequest *GetIamPolicyRequest 2882 urlParams_ gensupport.URLParams 2883 ctx_ context.Context 2884 header_ http.Header 2885} 2886 2887// GetIamPolicy: Gets the access control policy for a Queue. Returns an 2888// empty policy if the resource exists and does not have a policy set. 2889// Authorization requires the following Google IAM 2890// (https://cloud.google.com/iam) permission on the specified resource 2891// parent: * `cloudtasks.queues.getIamPolicy` 2892// 2893// - resource: REQUIRED: The resource for which the policy is being 2894// requested. See the operation documentation for the appropriate 2895// value for this field. 2896func (r *ProjectsLocationsQueuesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsQueuesGetIamPolicyCall { 2897 c := &ProjectsLocationsQueuesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2898 c.resource = resource 2899 c.getiampolicyrequest = getiampolicyrequest 2900 return c 2901} 2902 2903// Fields allows partial responses to be retrieved. See 2904// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2905// for more information. 2906func (c *ProjectsLocationsQueuesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesGetIamPolicyCall { 2907 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2908 return c 2909} 2910 2911// Context sets the context to be used in this call's Do method. Any 2912// pending HTTP request will be aborted if the provided context is 2913// canceled. 2914func (c *ProjectsLocationsQueuesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsQueuesGetIamPolicyCall { 2915 c.ctx_ = ctx 2916 return c 2917} 2918 2919// Header returns an http.Header that can be modified by the caller to 2920// add HTTP headers to the request. 2921func (c *ProjectsLocationsQueuesGetIamPolicyCall) Header() http.Header { 2922 if c.header_ == nil { 2923 c.header_ = make(http.Header) 2924 } 2925 return c.header_ 2926} 2927 2928func (c *ProjectsLocationsQueuesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 2929 reqHeaders := make(http.Header) 2930 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 2931 for k, v := range c.header_ { 2932 reqHeaders[k] = v 2933 } 2934 reqHeaders.Set("User-Agent", c.s.userAgent()) 2935 var body io.Reader = nil 2936 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 2937 if err != nil { 2938 return nil, err 2939 } 2940 reqHeaders.Set("Content-Type", "application/json") 2941 c.urlParams_.Set("alt", alt) 2942 c.urlParams_.Set("prettyPrint", "false") 2943 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+resource}:getIamPolicy") 2944 urls += "?" + c.urlParams_.Encode() 2945 req, err := http.NewRequest("POST", urls, body) 2946 if err != nil { 2947 return nil, err 2948 } 2949 req.Header = reqHeaders 2950 googleapi.Expand(req.URL, map[string]string{ 2951 "resource": c.resource, 2952 }) 2953 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2954} 2955 2956// Do executes the "cloudtasks.projects.locations.queues.getIamPolicy" call. 2957// Exactly one of *Policy or error will be non-nil. Any non-2xx status 2958// code is an error. Response headers are in either 2959// *Policy.ServerResponse.Header or (if a response was returned at all) 2960// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2961// check whether the returned error was because http.StatusNotModified 2962// was returned. 2963func (c *ProjectsLocationsQueuesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 2964 gensupport.SetOptions(c.urlParams_, opts...) 2965 res, err := c.doRequest("json") 2966 if res != nil && res.StatusCode == http.StatusNotModified { 2967 if res.Body != nil { 2968 res.Body.Close() 2969 } 2970 return nil, &googleapi.Error{ 2971 Code: res.StatusCode, 2972 Header: res.Header, 2973 } 2974 } 2975 if err != nil { 2976 return nil, err 2977 } 2978 defer googleapi.CloseBody(res) 2979 if err := googleapi.CheckResponse(res); err != nil { 2980 return nil, err 2981 } 2982 ret := &Policy{ 2983 ServerResponse: googleapi.ServerResponse{ 2984 Header: res.Header, 2985 HTTPStatusCode: res.StatusCode, 2986 }, 2987 } 2988 target := &ret 2989 if err := gensupport.DecodeResponse(target, res); err != nil { 2990 return nil, err 2991 } 2992 return ret, nil 2993 // { 2994 // "description": "Gets the access control policy for a Queue. Returns an empty policy if the resource exists and does not have a policy set. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.getIamPolicy`", 2995 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:getIamPolicy", 2996 // "httpMethod": "POST", 2997 // "id": "cloudtasks.projects.locations.queues.getIamPolicy", 2998 // "parameterOrder": [ 2999 // "resource" 3000 // ], 3001 // "parameters": { 3002 // "resource": { 3003 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 3004 // "location": "path", 3005 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 3006 // "required": true, 3007 // "type": "string" 3008 // } 3009 // }, 3010 // "path": "v2beta2/{+resource}:getIamPolicy", 3011 // "request": { 3012 // "$ref": "GetIamPolicyRequest" 3013 // }, 3014 // "response": { 3015 // "$ref": "Policy" 3016 // }, 3017 // "scopes": [ 3018 // "https://www.googleapis.com/auth/cloud-platform" 3019 // ] 3020 // } 3021 3022} 3023 3024// method id "cloudtasks.projects.locations.queues.list": 3025 3026type ProjectsLocationsQueuesListCall struct { 3027 s *Service 3028 parent string 3029 urlParams_ gensupport.URLParams 3030 ifNoneMatch_ string 3031 ctx_ context.Context 3032 header_ http.Header 3033} 3034 3035// List: Lists queues. Queues are returned in lexicographical order. 3036// 3037// - parent: The location name. For example: 3038// `projects/PROJECT_ID/locations/LOCATION_ID`. 3039func (r *ProjectsLocationsQueuesService) List(parent string) *ProjectsLocationsQueuesListCall { 3040 c := &ProjectsLocationsQueuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3041 c.parent = parent 3042 return c 3043} 3044 3045// Filter sets the optional parameter "filter": `filter` can be used to 3046// specify a subset of queues. Any Queue field can be used as a filter 3047// and several operators as supported. For example: `<=, <, >=, >, !=, 3048// =, :`. The filter syntax is the same as described in Stackdriver's 3049// Advanced Logs Filters 3050// (https://cloud.google.com/logging/docs/view/advanced_filters). Sample 3051// filter "app_engine_http_target: *". Note that using filters might 3052// cause fewer queues than the requested_page size to be returned. 3053func (c *ProjectsLocationsQueuesListCall) Filter(filter string) *ProjectsLocationsQueuesListCall { 3054 c.urlParams_.Set("filter", filter) 3055 return c 3056} 3057 3058// PageSize sets the optional parameter "pageSize": Requested page size. 3059// The maximum page size is 9800. If unspecified, the page size will be 3060// the maximum. Fewer queues than requested might be returned, even if 3061// more queues exist; use the next_page_token in the response to 3062// determine if more queues exist. 3063func (c *ProjectsLocationsQueuesListCall) PageSize(pageSize int64) *ProjectsLocationsQueuesListCall { 3064 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3065 return c 3066} 3067 3068// PageToken sets the optional parameter "pageToken": A token 3069// identifying the page of results to return. To request the first page 3070// results, page_token must be empty. To request the next page of 3071// results, page_token must be the value of next_page_token returned 3072// from the previous call to ListQueues method. It is an error to switch 3073// the value of the filter while iterating through pages. 3074func (c *ProjectsLocationsQueuesListCall) PageToken(pageToken string) *ProjectsLocationsQueuesListCall { 3075 c.urlParams_.Set("pageToken", pageToken) 3076 return c 3077} 3078 3079// ReadMask sets the optional parameter "readMask": Read mask is used 3080// for a more granular control over what the API returns. If the mask is 3081// not present all fields will be returned except [Queue.stats]. 3082// [Queue.stats] will be returned only if it was explicitly specified in 3083// the mask. 3084func (c *ProjectsLocationsQueuesListCall) ReadMask(readMask string) *ProjectsLocationsQueuesListCall { 3085 c.urlParams_.Set("readMask", readMask) 3086 return c 3087} 3088 3089// Fields allows partial responses to be retrieved. See 3090// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3091// for more information. 3092func (c *ProjectsLocationsQueuesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesListCall { 3093 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3094 return c 3095} 3096 3097// IfNoneMatch sets the optional parameter which makes the operation 3098// fail if the object's ETag matches the given value. This is useful for 3099// getting updates only after the object has changed since the last 3100// request. Use googleapi.IsNotModified to check whether the response 3101// error from Do is the result of In-None-Match. 3102func (c *ProjectsLocationsQueuesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsQueuesListCall { 3103 c.ifNoneMatch_ = entityTag 3104 return c 3105} 3106 3107// Context sets the context to be used in this call's Do method. Any 3108// pending HTTP request will be aborted if the provided context is 3109// canceled. 3110func (c *ProjectsLocationsQueuesListCall) Context(ctx context.Context) *ProjectsLocationsQueuesListCall { 3111 c.ctx_ = ctx 3112 return c 3113} 3114 3115// Header returns an http.Header that can be modified by the caller to 3116// add HTTP headers to the request. 3117func (c *ProjectsLocationsQueuesListCall) Header() http.Header { 3118 if c.header_ == nil { 3119 c.header_ = make(http.Header) 3120 } 3121 return c.header_ 3122} 3123 3124func (c *ProjectsLocationsQueuesListCall) doRequest(alt string) (*http.Response, error) { 3125 reqHeaders := make(http.Header) 3126 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3127 for k, v := range c.header_ { 3128 reqHeaders[k] = v 3129 } 3130 reqHeaders.Set("User-Agent", c.s.userAgent()) 3131 if c.ifNoneMatch_ != "" { 3132 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3133 } 3134 var body io.Reader = nil 3135 c.urlParams_.Set("alt", alt) 3136 c.urlParams_.Set("prettyPrint", "false") 3137 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+parent}/queues") 3138 urls += "?" + c.urlParams_.Encode() 3139 req, err := http.NewRequest("GET", urls, body) 3140 if err != nil { 3141 return nil, err 3142 } 3143 req.Header = reqHeaders 3144 googleapi.Expand(req.URL, map[string]string{ 3145 "parent": c.parent, 3146 }) 3147 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3148} 3149 3150// Do executes the "cloudtasks.projects.locations.queues.list" call. 3151// Exactly one of *ListQueuesResponse or error will be non-nil. Any 3152// non-2xx status code is an error. Response headers are in either 3153// *ListQueuesResponse.ServerResponse.Header or (if a response was 3154// returned at all) in error.(*googleapi.Error).Header. Use 3155// googleapi.IsNotModified to check whether the returned error was 3156// because http.StatusNotModified was returned. 3157func (c *ProjectsLocationsQueuesListCall) Do(opts ...googleapi.CallOption) (*ListQueuesResponse, error) { 3158 gensupport.SetOptions(c.urlParams_, opts...) 3159 res, err := c.doRequest("json") 3160 if res != nil && res.StatusCode == http.StatusNotModified { 3161 if res.Body != nil { 3162 res.Body.Close() 3163 } 3164 return nil, &googleapi.Error{ 3165 Code: res.StatusCode, 3166 Header: res.Header, 3167 } 3168 } 3169 if err != nil { 3170 return nil, err 3171 } 3172 defer googleapi.CloseBody(res) 3173 if err := googleapi.CheckResponse(res); err != nil { 3174 return nil, err 3175 } 3176 ret := &ListQueuesResponse{ 3177 ServerResponse: googleapi.ServerResponse{ 3178 Header: res.Header, 3179 HTTPStatusCode: res.StatusCode, 3180 }, 3181 } 3182 target := &ret 3183 if err := gensupport.DecodeResponse(target, res); err != nil { 3184 return nil, err 3185 } 3186 return ret, nil 3187 // { 3188 // "description": "Lists queues. Queues are returned in lexicographical order.", 3189 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues", 3190 // "httpMethod": "GET", 3191 // "id": "cloudtasks.projects.locations.queues.list", 3192 // "parameterOrder": [ 3193 // "parent" 3194 // ], 3195 // "parameters": { 3196 // "filter": { 3197 // "description": "`filter` can be used to specify a subset of queues. Any Queue field can be used as a filter and several operators as supported. For example: `\u003c=, \u003c, \u003e=, \u003e, !=, =, :`. The filter syntax is the same as described in [Stackdriver's Advanced Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). Sample filter \"app_engine_http_target: *\". Note that using filters might cause fewer queues than the requested_page size to be returned.", 3198 // "location": "query", 3199 // "type": "string" 3200 // }, 3201 // "pageSize": { 3202 // "description": "Requested page size. The maximum page size is 9800. If unspecified, the page size will be the maximum. Fewer queues than requested might be returned, even if more queues exist; use the next_page_token in the response to determine if more queues exist.", 3203 // "format": "int32", 3204 // "location": "query", 3205 // "type": "integer" 3206 // }, 3207 // "pageToken": { 3208 // "description": "A token identifying the page of results to return. To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of next_page_token returned from the previous call to ListQueues method. It is an error to switch the value of the filter while iterating through pages.", 3209 // "location": "query", 3210 // "type": "string" 3211 // }, 3212 // "parent": { 3213 // "description": "Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`", 3214 // "location": "path", 3215 // "pattern": "^projects/[^/]+/locations/[^/]+$", 3216 // "required": true, 3217 // "type": "string" 3218 // }, 3219 // "readMask": { 3220 // "description": "Optional. Read mask is used for a more granular control over what the API returns. If the mask is not present all fields will be returned except [Queue.stats]. [Queue.stats] will be returned only if it was explicitly specified in the mask.", 3221 // "format": "google-fieldmask", 3222 // "location": "query", 3223 // "type": "string" 3224 // } 3225 // }, 3226 // "path": "v2beta2/{+parent}/queues", 3227 // "response": { 3228 // "$ref": "ListQueuesResponse" 3229 // }, 3230 // "scopes": [ 3231 // "https://www.googleapis.com/auth/cloud-platform" 3232 // ] 3233 // } 3234 3235} 3236 3237// Pages invokes f for each page of results. 3238// A non-nil error returned from f will halt the iteration. 3239// The provided context supersedes any context provided to the Context method. 3240func (c *ProjectsLocationsQueuesListCall) Pages(ctx context.Context, f func(*ListQueuesResponse) error) error { 3241 c.ctx_ = ctx 3242 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3243 for { 3244 x, err := c.Do() 3245 if err != nil { 3246 return err 3247 } 3248 if err := f(x); err != nil { 3249 return err 3250 } 3251 if x.NextPageToken == "" { 3252 return nil 3253 } 3254 c.PageToken(x.NextPageToken) 3255 } 3256} 3257 3258// method id "cloudtasks.projects.locations.queues.patch": 3259 3260type ProjectsLocationsQueuesPatchCall struct { 3261 s *Service 3262 name string 3263 queue *Queue 3264 urlParams_ gensupport.URLParams 3265 ctx_ context.Context 3266 header_ http.Header 3267} 3268 3269// Patch: Updates a queue. This method creates the queue if it does not 3270// exist and updates the queue if it does exist. Queues created with 3271// this method allow tasks to live for a maximum of 31 days. After a 3272// task is 31 days old, the task will be deleted regardless of whether 3273// it was dispatched or not. WARNING: Using this method may have 3274// unintended side effects if you are using an App Engine `queue.yaml` 3275// or `queue.xml` file to manage your queues. Read Overview of Queue 3276// Management and queue.yaml 3277// (https://cloud.google.com/tasks/docs/queue-yaml) before using this 3278// method. 3279// 3280// - name: Caller-specified and required in CreateQueue, after which it 3281// becomes output only. The queue name. The queue name must have the 3282// following format: 3283// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * 3284// `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), 3285// hyphens (-), colons (:), or periods (.). For more information, see 3286// Identifying projects 3287// (https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) 3288// * `LOCATION_ID` is the canonical ID for the queue's location. The 3289// list of available locations can be obtained by calling 3290// ListLocations. For more information, see 3291// https://cloud.google.com/about/locations/. * `QUEUE_ID` can contain 3292// letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum 3293// length is 100 characters. 3294func (r *ProjectsLocationsQueuesService) Patch(name string, queue *Queue) *ProjectsLocationsQueuesPatchCall { 3295 c := &ProjectsLocationsQueuesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3296 c.name = name 3297 c.queue = queue 3298 return c 3299} 3300 3301// UpdateMask sets the optional parameter "updateMask": A mask used to 3302// specify which fields of the queue are being updated. If empty, then 3303// all fields will be updated. 3304func (c *ProjectsLocationsQueuesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsQueuesPatchCall { 3305 c.urlParams_.Set("updateMask", updateMask) 3306 return c 3307} 3308 3309// Fields allows partial responses to be retrieved. See 3310// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3311// for more information. 3312func (c *ProjectsLocationsQueuesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesPatchCall { 3313 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3314 return c 3315} 3316 3317// Context sets the context to be used in this call's Do method. Any 3318// pending HTTP request will be aborted if the provided context is 3319// canceled. 3320func (c *ProjectsLocationsQueuesPatchCall) Context(ctx context.Context) *ProjectsLocationsQueuesPatchCall { 3321 c.ctx_ = ctx 3322 return c 3323} 3324 3325// Header returns an http.Header that can be modified by the caller to 3326// add HTTP headers to the request. 3327func (c *ProjectsLocationsQueuesPatchCall) Header() http.Header { 3328 if c.header_ == nil { 3329 c.header_ = make(http.Header) 3330 } 3331 return c.header_ 3332} 3333 3334func (c *ProjectsLocationsQueuesPatchCall) doRequest(alt string) (*http.Response, error) { 3335 reqHeaders := make(http.Header) 3336 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3337 for k, v := range c.header_ { 3338 reqHeaders[k] = v 3339 } 3340 reqHeaders.Set("User-Agent", c.s.userAgent()) 3341 var body io.Reader = nil 3342 body, err := googleapi.WithoutDataWrapper.JSONReader(c.queue) 3343 if err != nil { 3344 return nil, err 3345 } 3346 reqHeaders.Set("Content-Type", "application/json") 3347 c.urlParams_.Set("alt", alt) 3348 c.urlParams_.Set("prettyPrint", "false") 3349 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") 3350 urls += "?" + c.urlParams_.Encode() 3351 req, err := http.NewRequest("PATCH", urls, body) 3352 if err != nil { 3353 return nil, err 3354 } 3355 req.Header = reqHeaders 3356 googleapi.Expand(req.URL, map[string]string{ 3357 "name": c.name, 3358 }) 3359 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3360} 3361 3362// Do executes the "cloudtasks.projects.locations.queues.patch" call. 3363// Exactly one of *Queue or error will be non-nil. Any non-2xx status 3364// code is an error. Response headers are in either 3365// *Queue.ServerResponse.Header or (if a response was returned at all) 3366// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3367// check whether the returned error was because http.StatusNotModified 3368// was returned. 3369func (c *ProjectsLocationsQueuesPatchCall) Do(opts ...googleapi.CallOption) (*Queue, error) { 3370 gensupport.SetOptions(c.urlParams_, opts...) 3371 res, err := c.doRequest("json") 3372 if res != nil && res.StatusCode == http.StatusNotModified { 3373 if res.Body != nil { 3374 res.Body.Close() 3375 } 3376 return nil, &googleapi.Error{ 3377 Code: res.StatusCode, 3378 Header: res.Header, 3379 } 3380 } 3381 if err != nil { 3382 return nil, err 3383 } 3384 defer googleapi.CloseBody(res) 3385 if err := googleapi.CheckResponse(res); err != nil { 3386 return nil, err 3387 } 3388 ret := &Queue{ 3389 ServerResponse: googleapi.ServerResponse{ 3390 Header: res.Header, 3391 HTTPStatusCode: res.StatusCode, 3392 }, 3393 } 3394 target := &ret 3395 if err := gensupport.DecodeResponse(target, res); err != nil { 3396 return nil, err 3397 } 3398 return ret, nil 3399 // { 3400 // "description": "Updates a queue. This method creates the queue if it does not exist and updates the queue if it does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", 3401 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}", 3402 // "httpMethod": "PATCH", 3403 // "id": "cloudtasks.projects.locations.queues.patch", 3404 // "parameterOrder": [ 3405 // "name" 3406 // ], 3407 // "parameters": { 3408 // "name": { 3409 // "description": "Caller-specified and required in CreateQueue, after which it becomes output only. The queue name. The queue name must have the following format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for the queue's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters.", 3410 // "location": "path", 3411 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 3412 // "required": true, 3413 // "type": "string" 3414 // }, 3415 // "updateMask": { 3416 // "description": "A mask used to specify which fields of the queue are being updated. If empty, then all fields will be updated.", 3417 // "format": "google-fieldmask", 3418 // "location": "query", 3419 // "type": "string" 3420 // } 3421 // }, 3422 // "path": "v2beta2/{+name}", 3423 // "request": { 3424 // "$ref": "Queue" 3425 // }, 3426 // "response": { 3427 // "$ref": "Queue" 3428 // }, 3429 // "scopes": [ 3430 // "https://www.googleapis.com/auth/cloud-platform" 3431 // ] 3432 // } 3433 3434} 3435 3436// method id "cloudtasks.projects.locations.queues.pause": 3437 3438type ProjectsLocationsQueuesPauseCall struct { 3439 s *Service 3440 name string 3441 pausequeuerequest *PauseQueueRequest 3442 urlParams_ gensupport.URLParams 3443 ctx_ context.Context 3444 header_ http.Header 3445} 3446 3447// Pause: Pauses the queue. If a queue is paused then the system will 3448// stop dispatching tasks until the queue is resumed via ResumeQueue. 3449// Tasks can still be added when the queue is paused. A queue is paused 3450// if its state is PAUSED. 3451// 3452// - name: The queue name. For example: 3453// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`. 3454func (r *ProjectsLocationsQueuesService) Pause(name string, pausequeuerequest *PauseQueueRequest) *ProjectsLocationsQueuesPauseCall { 3455 c := &ProjectsLocationsQueuesPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3456 c.name = name 3457 c.pausequeuerequest = pausequeuerequest 3458 return c 3459} 3460 3461// Fields allows partial responses to be retrieved. See 3462// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3463// for more information. 3464func (c *ProjectsLocationsQueuesPauseCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesPauseCall { 3465 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3466 return c 3467} 3468 3469// Context sets the context to be used in this call's Do method. Any 3470// pending HTTP request will be aborted if the provided context is 3471// canceled. 3472func (c *ProjectsLocationsQueuesPauseCall) Context(ctx context.Context) *ProjectsLocationsQueuesPauseCall { 3473 c.ctx_ = ctx 3474 return c 3475} 3476 3477// Header returns an http.Header that can be modified by the caller to 3478// add HTTP headers to the request. 3479func (c *ProjectsLocationsQueuesPauseCall) Header() http.Header { 3480 if c.header_ == nil { 3481 c.header_ = make(http.Header) 3482 } 3483 return c.header_ 3484} 3485 3486func (c *ProjectsLocationsQueuesPauseCall) doRequest(alt string) (*http.Response, error) { 3487 reqHeaders := make(http.Header) 3488 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3489 for k, v := range c.header_ { 3490 reqHeaders[k] = v 3491 } 3492 reqHeaders.Set("User-Agent", c.s.userAgent()) 3493 var body io.Reader = nil 3494 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausequeuerequest) 3495 if err != nil { 3496 return nil, err 3497 } 3498 reqHeaders.Set("Content-Type", "application/json") 3499 c.urlParams_.Set("alt", alt) 3500 c.urlParams_.Set("prettyPrint", "false") 3501 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}:pause") 3502 urls += "?" + c.urlParams_.Encode() 3503 req, err := http.NewRequest("POST", urls, body) 3504 if err != nil { 3505 return nil, err 3506 } 3507 req.Header = reqHeaders 3508 googleapi.Expand(req.URL, map[string]string{ 3509 "name": c.name, 3510 }) 3511 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3512} 3513 3514// Do executes the "cloudtasks.projects.locations.queues.pause" call. 3515// Exactly one of *Queue or error will be non-nil. Any non-2xx status 3516// code is an error. Response headers are in either 3517// *Queue.ServerResponse.Header or (if a response was returned at all) 3518// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3519// check whether the returned error was because http.StatusNotModified 3520// was returned. 3521func (c *ProjectsLocationsQueuesPauseCall) Do(opts ...googleapi.CallOption) (*Queue, error) { 3522 gensupport.SetOptions(c.urlParams_, opts...) 3523 res, err := c.doRequest("json") 3524 if res != nil && res.StatusCode == http.StatusNotModified { 3525 if res.Body != nil { 3526 res.Body.Close() 3527 } 3528 return nil, &googleapi.Error{ 3529 Code: res.StatusCode, 3530 Header: res.Header, 3531 } 3532 } 3533 if err != nil { 3534 return nil, err 3535 } 3536 defer googleapi.CloseBody(res) 3537 if err := googleapi.CheckResponse(res); err != nil { 3538 return nil, err 3539 } 3540 ret := &Queue{ 3541 ServerResponse: googleapi.ServerResponse{ 3542 Header: res.Header, 3543 HTTPStatusCode: res.StatusCode, 3544 }, 3545 } 3546 target := &ret 3547 if err := gensupport.DecodeResponse(target, res); err != nil { 3548 return nil, err 3549 } 3550 return ret, nil 3551 // { 3552 // "description": "Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the queue is resumed via ResumeQueue. Tasks can still be added when the queue is paused. A queue is paused if its state is PAUSED.", 3553 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:pause", 3554 // "httpMethod": "POST", 3555 // "id": "cloudtasks.projects.locations.queues.pause", 3556 // "parameterOrder": [ 3557 // "name" 3558 // ], 3559 // "parameters": { 3560 // "name": { 3561 // "description": "Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`", 3562 // "location": "path", 3563 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 3564 // "required": true, 3565 // "type": "string" 3566 // } 3567 // }, 3568 // "path": "v2beta2/{+name}:pause", 3569 // "request": { 3570 // "$ref": "PauseQueueRequest" 3571 // }, 3572 // "response": { 3573 // "$ref": "Queue" 3574 // }, 3575 // "scopes": [ 3576 // "https://www.googleapis.com/auth/cloud-platform" 3577 // ] 3578 // } 3579 3580} 3581 3582// method id "cloudtasks.projects.locations.queues.purge": 3583 3584type ProjectsLocationsQueuesPurgeCall struct { 3585 s *Service 3586 name string 3587 purgequeuerequest *PurgeQueueRequest 3588 urlParams_ gensupport.URLParams 3589 ctx_ context.Context 3590 header_ http.Header 3591} 3592 3593// Purge: Purges a queue by deleting all of its tasks. All tasks created 3594// before this method is called are permanently deleted. Purge 3595// operations can take up to one minute to take effect. Tasks might be 3596// dispatched before the purge takes effect. A purge is irreversible. 3597// 3598// - name: The queue name. For example: 3599// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`. 3600func (r *ProjectsLocationsQueuesService) Purge(name string, purgequeuerequest *PurgeQueueRequest) *ProjectsLocationsQueuesPurgeCall { 3601 c := &ProjectsLocationsQueuesPurgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3602 c.name = name 3603 c.purgequeuerequest = purgequeuerequest 3604 return c 3605} 3606 3607// Fields allows partial responses to be retrieved. See 3608// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3609// for more information. 3610func (c *ProjectsLocationsQueuesPurgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesPurgeCall { 3611 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3612 return c 3613} 3614 3615// Context sets the context to be used in this call's Do method. Any 3616// pending HTTP request will be aborted if the provided context is 3617// canceled. 3618func (c *ProjectsLocationsQueuesPurgeCall) Context(ctx context.Context) *ProjectsLocationsQueuesPurgeCall { 3619 c.ctx_ = ctx 3620 return c 3621} 3622 3623// Header returns an http.Header that can be modified by the caller to 3624// add HTTP headers to the request. 3625func (c *ProjectsLocationsQueuesPurgeCall) Header() http.Header { 3626 if c.header_ == nil { 3627 c.header_ = make(http.Header) 3628 } 3629 return c.header_ 3630} 3631 3632func (c *ProjectsLocationsQueuesPurgeCall) doRequest(alt string) (*http.Response, error) { 3633 reqHeaders := make(http.Header) 3634 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3635 for k, v := range c.header_ { 3636 reqHeaders[k] = v 3637 } 3638 reqHeaders.Set("User-Agent", c.s.userAgent()) 3639 var body io.Reader = nil 3640 body, err := googleapi.WithoutDataWrapper.JSONReader(c.purgequeuerequest) 3641 if err != nil { 3642 return nil, err 3643 } 3644 reqHeaders.Set("Content-Type", "application/json") 3645 c.urlParams_.Set("alt", alt) 3646 c.urlParams_.Set("prettyPrint", "false") 3647 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}:purge") 3648 urls += "?" + c.urlParams_.Encode() 3649 req, err := http.NewRequest("POST", urls, body) 3650 if err != nil { 3651 return nil, err 3652 } 3653 req.Header = reqHeaders 3654 googleapi.Expand(req.URL, map[string]string{ 3655 "name": c.name, 3656 }) 3657 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3658} 3659 3660// Do executes the "cloudtasks.projects.locations.queues.purge" call. 3661// Exactly one of *Queue or error will be non-nil. Any non-2xx status 3662// code is an error. Response headers are in either 3663// *Queue.ServerResponse.Header or (if a response was returned at all) 3664// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3665// check whether the returned error was because http.StatusNotModified 3666// was returned. 3667func (c *ProjectsLocationsQueuesPurgeCall) Do(opts ...googleapi.CallOption) (*Queue, error) { 3668 gensupport.SetOptions(c.urlParams_, opts...) 3669 res, err := c.doRequest("json") 3670 if res != nil && res.StatusCode == http.StatusNotModified { 3671 if res.Body != nil { 3672 res.Body.Close() 3673 } 3674 return nil, &googleapi.Error{ 3675 Code: res.StatusCode, 3676 Header: res.Header, 3677 } 3678 } 3679 if err != nil { 3680 return nil, err 3681 } 3682 defer googleapi.CloseBody(res) 3683 if err := googleapi.CheckResponse(res); err != nil { 3684 return nil, err 3685 } 3686 ret := &Queue{ 3687 ServerResponse: googleapi.ServerResponse{ 3688 Header: res.Header, 3689 HTTPStatusCode: res.StatusCode, 3690 }, 3691 } 3692 target := &ret 3693 if err := gensupport.DecodeResponse(target, res); err != nil { 3694 return nil, err 3695 } 3696 return ret, nil 3697 // { 3698 // "description": "Purges a queue by deleting all of its tasks. All tasks created before this method is called are permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.", 3699 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:purge", 3700 // "httpMethod": "POST", 3701 // "id": "cloudtasks.projects.locations.queues.purge", 3702 // "parameterOrder": [ 3703 // "name" 3704 // ], 3705 // "parameters": { 3706 // "name": { 3707 // "description": "Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`", 3708 // "location": "path", 3709 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 3710 // "required": true, 3711 // "type": "string" 3712 // } 3713 // }, 3714 // "path": "v2beta2/{+name}:purge", 3715 // "request": { 3716 // "$ref": "PurgeQueueRequest" 3717 // }, 3718 // "response": { 3719 // "$ref": "Queue" 3720 // }, 3721 // "scopes": [ 3722 // "https://www.googleapis.com/auth/cloud-platform" 3723 // ] 3724 // } 3725 3726} 3727 3728// method id "cloudtasks.projects.locations.queues.resume": 3729 3730type ProjectsLocationsQueuesResumeCall struct { 3731 s *Service 3732 name string 3733 resumequeuerequest *ResumeQueueRequest 3734 urlParams_ gensupport.URLParams 3735 ctx_ context.Context 3736 header_ http.Header 3737} 3738 3739// Resume: Resume a queue. This method resumes a queue after it has been 3740// PAUSED or DISABLED. The state of a queue is stored in the queue's 3741// state; after calling this method it will be set to RUNNING. WARNING: 3742// Resuming many high-QPS queues at the same time can lead to target 3743// overloading. If you are resuming high-QPS queues, follow the 500/50/5 3744// pattern described in Managing Cloud Tasks Scaling Risks 3745// (https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). 3746// 3747// - name: The queue name. For example: 3748// `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`. 3749func (r *ProjectsLocationsQueuesService) Resume(name string, resumequeuerequest *ResumeQueueRequest) *ProjectsLocationsQueuesResumeCall { 3750 c := &ProjectsLocationsQueuesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3751 c.name = name 3752 c.resumequeuerequest = resumequeuerequest 3753 return c 3754} 3755 3756// Fields allows partial responses to be retrieved. See 3757// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3758// for more information. 3759func (c *ProjectsLocationsQueuesResumeCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesResumeCall { 3760 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3761 return c 3762} 3763 3764// Context sets the context to be used in this call's Do method. Any 3765// pending HTTP request will be aborted if the provided context is 3766// canceled. 3767func (c *ProjectsLocationsQueuesResumeCall) Context(ctx context.Context) *ProjectsLocationsQueuesResumeCall { 3768 c.ctx_ = ctx 3769 return c 3770} 3771 3772// Header returns an http.Header that can be modified by the caller to 3773// add HTTP headers to the request. 3774func (c *ProjectsLocationsQueuesResumeCall) Header() http.Header { 3775 if c.header_ == nil { 3776 c.header_ = make(http.Header) 3777 } 3778 return c.header_ 3779} 3780 3781func (c *ProjectsLocationsQueuesResumeCall) doRequest(alt string) (*http.Response, error) { 3782 reqHeaders := make(http.Header) 3783 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3784 for k, v := range c.header_ { 3785 reqHeaders[k] = v 3786 } 3787 reqHeaders.Set("User-Agent", c.s.userAgent()) 3788 var body io.Reader = nil 3789 body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumequeuerequest) 3790 if err != nil { 3791 return nil, err 3792 } 3793 reqHeaders.Set("Content-Type", "application/json") 3794 c.urlParams_.Set("alt", alt) 3795 c.urlParams_.Set("prettyPrint", "false") 3796 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}:resume") 3797 urls += "?" + c.urlParams_.Encode() 3798 req, err := http.NewRequest("POST", urls, body) 3799 if err != nil { 3800 return nil, err 3801 } 3802 req.Header = reqHeaders 3803 googleapi.Expand(req.URL, map[string]string{ 3804 "name": c.name, 3805 }) 3806 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3807} 3808 3809// Do executes the "cloudtasks.projects.locations.queues.resume" call. 3810// Exactly one of *Queue or error will be non-nil. Any non-2xx status 3811// code is an error. Response headers are in either 3812// *Queue.ServerResponse.Header or (if a response was returned at all) 3813// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3814// check whether the returned error was because http.StatusNotModified 3815// was returned. 3816func (c *ProjectsLocationsQueuesResumeCall) Do(opts ...googleapi.CallOption) (*Queue, error) { 3817 gensupport.SetOptions(c.urlParams_, opts...) 3818 res, err := c.doRequest("json") 3819 if res != nil && res.StatusCode == http.StatusNotModified { 3820 if res.Body != nil { 3821 res.Body.Close() 3822 } 3823 return nil, &googleapi.Error{ 3824 Code: res.StatusCode, 3825 Header: res.Header, 3826 } 3827 } 3828 if err != nil { 3829 return nil, err 3830 } 3831 defer googleapi.CloseBody(res) 3832 if err := googleapi.CheckResponse(res); err != nil { 3833 return nil, err 3834 } 3835 ret := &Queue{ 3836 ServerResponse: googleapi.ServerResponse{ 3837 Header: res.Header, 3838 HTTPStatusCode: res.StatusCode, 3839 }, 3840 } 3841 target := &ret 3842 if err := gensupport.DecodeResponse(target, res); err != nil { 3843 return nil, err 3844 } 3845 return ret, nil 3846 // { 3847 // "description": "Resume a queue. This method resumes a queue after it has been PAUSED or DISABLED. The state of a queue is stored in the queue's state; after calling this method it will be set to RUNNING. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).", 3848 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:resume", 3849 // "httpMethod": "POST", 3850 // "id": "cloudtasks.projects.locations.queues.resume", 3851 // "parameterOrder": [ 3852 // "name" 3853 // ], 3854 // "parameters": { 3855 // "name": { 3856 // "description": "Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`", 3857 // "location": "path", 3858 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 3859 // "required": true, 3860 // "type": "string" 3861 // } 3862 // }, 3863 // "path": "v2beta2/{+name}:resume", 3864 // "request": { 3865 // "$ref": "ResumeQueueRequest" 3866 // }, 3867 // "response": { 3868 // "$ref": "Queue" 3869 // }, 3870 // "scopes": [ 3871 // "https://www.googleapis.com/auth/cloud-platform" 3872 // ] 3873 // } 3874 3875} 3876 3877// method id "cloudtasks.projects.locations.queues.setIamPolicy": 3878 3879type ProjectsLocationsQueuesSetIamPolicyCall struct { 3880 s *Service 3881 resource string 3882 setiampolicyrequest *SetIamPolicyRequest 3883 urlParams_ gensupport.URLParams 3884 ctx_ context.Context 3885 header_ http.Header 3886} 3887 3888// SetIamPolicy: Sets the access control policy for a Queue. Replaces 3889// any existing policy. Note: The Cloud Console does not check 3890// queue-level IAM permissions yet. Project-level permissions are 3891// required to use the Cloud Console. Authorization requires the 3892// following Google IAM (https://cloud.google.com/iam) permission on the 3893// specified resource parent: * `cloudtasks.queues.setIamPolicy` 3894// 3895// - resource: REQUIRED: The resource for which the policy is being 3896// specified. See the operation documentation for the appropriate 3897// value for this field. 3898func (r *ProjectsLocationsQueuesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsQueuesSetIamPolicyCall { 3899 c := &ProjectsLocationsQueuesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3900 c.resource = resource 3901 c.setiampolicyrequest = setiampolicyrequest 3902 return c 3903} 3904 3905// Fields allows partial responses to be retrieved. See 3906// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3907// for more information. 3908func (c *ProjectsLocationsQueuesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesSetIamPolicyCall { 3909 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3910 return c 3911} 3912 3913// Context sets the context to be used in this call's Do method. Any 3914// pending HTTP request will be aborted if the provided context is 3915// canceled. 3916func (c *ProjectsLocationsQueuesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsQueuesSetIamPolicyCall { 3917 c.ctx_ = ctx 3918 return c 3919} 3920 3921// Header returns an http.Header that can be modified by the caller to 3922// add HTTP headers to the request. 3923func (c *ProjectsLocationsQueuesSetIamPolicyCall) Header() http.Header { 3924 if c.header_ == nil { 3925 c.header_ = make(http.Header) 3926 } 3927 return c.header_ 3928} 3929 3930func (c *ProjectsLocationsQueuesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3931 reqHeaders := make(http.Header) 3932 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3933 for k, v := range c.header_ { 3934 reqHeaders[k] = v 3935 } 3936 reqHeaders.Set("User-Agent", c.s.userAgent()) 3937 var body io.Reader = nil 3938 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 3939 if err != nil { 3940 return nil, err 3941 } 3942 reqHeaders.Set("Content-Type", "application/json") 3943 c.urlParams_.Set("alt", alt) 3944 c.urlParams_.Set("prettyPrint", "false") 3945 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+resource}:setIamPolicy") 3946 urls += "?" + c.urlParams_.Encode() 3947 req, err := http.NewRequest("POST", urls, body) 3948 if err != nil { 3949 return nil, err 3950 } 3951 req.Header = reqHeaders 3952 googleapi.Expand(req.URL, map[string]string{ 3953 "resource": c.resource, 3954 }) 3955 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3956} 3957 3958// Do executes the "cloudtasks.projects.locations.queues.setIamPolicy" call. 3959// Exactly one of *Policy or error will be non-nil. Any non-2xx status 3960// code is an error. Response headers are in either 3961// *Policy.ServerResponse.Header or (if a response was returned at all) 3962// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3963// check whether the returned error was because http.StatusNotModified 3964// was returned. 3965func (c *ProjectsLocationsQueuesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3966 gensupport.SetOptions(c.urlParams_, opts...) 3967 res, err := c.doRequest("json") 3968 if res != nil && res.StatusCode == http.StatusNotModified { 3969 if res.Body != nil { 3970 res.Body.Close() 3971 } 3972 return nil, &googleapi.Error{ 3973 Code: res.StatusCode, 3974 Header: res.Header, 3975 } 3976 } 3977 if err != nil { 3978 return nil, err 3979 } 3980 defer googleapi.CloseBody(res) 3981 if err := googleapi.CheckResponse(res); err != nil { 3982 return nil, err 3983 } 3984 ret := &Policy{ 3985 ServerResponse: googleapi.ServerResponse{ 3986 Header: res.Header, 3987 HTTPStatusCode: res.StatusCode, 3988 }, 3989 } 3990 target := &ret 3991 if err := gensupport.DecodeResponse(target, res); err != nil { 3992 return nil, err 3993 } 3994 return ret, nil 3995 // { 3996 // "description": "Sets the access control policy for a Queue. Replaces any existing policy. Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.setIamPolicy`", 3997 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:setIamPolicy", 3998 // "httpMethod": "POST", 3999 // "id": "cloudtasks.projects.locations.queues.setIamPolicy", 4000 // "parameterOrder": [ 4001 // "resource" 4002 // ], 4003 // "parameters": { 4004 // "resource": { 4005 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 4006 // "location": "path", 4007 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 4008 // "required": true, 4009 // "type": "string" 4010 // } 4011 // }, 4012 // "path": "v2beta2/{+resource}:setIamPolicy", 4013 // "request": { 4014 // "$ref": "SetIamPolicyRequest" 4015 // }, 4016 // "response": { 4017 // "$ref": "Policy" 4018 // }, 4019 // "scopes": [ 4020 // "https://www.googleapis.com/auth/cloud-platform" 4021 // ] 4022 // } 4023 4024} 4025 4026// method id "cloudtasks.projects.locations.queues.testIamPermissions": 4027 4028type ProjectsLocationsQueuesTestIamPermissionsCall struct { 4029 s *Service 4030 resource string 4031 testiampermissionsrequest *TestIamPermissionsRequest 4032 urlParams_ gensupport.URLParams 4033 ctx_ context.Context 4034 header_ http.Header 4035} 4036 4037// TestIamPermissions: Returns permissions that a caller has on a Queue. 4038// If the resource does not exist, this will return an empty set of 4039// permissions, not a NOT_FOUND error. Note: This operation is designed 4040// to be used for building permission-aware UIs and command-line tools, 4041// not for authorization checking. This operation may "fail open" 4042// without warning. 4043// 4044// - resource: REQUIRED: The resource for which the policy detail is 4045// being requested. See the operation documentation for the 4046// appropriate value for this field. 4047func (r *ProjectsLocationsQueuesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsQueuesTestIamPermissionsCall { 4048 c := &ProjectsLocationsQueuesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4049 c.resource = resource 4050 c.testiampermissionsrequest = testiampermissionsrequest 4051 return c 4052} 4053 4054// Fields allows partial responses to be retrieved. See 4055// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4056// for more information. 4057func (c *ProjectsLocationsQueuesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesTestIamPermissionsCall { 4058 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4059 return c 4060} 4061 4062// Context sets the context to be used in this call's Do method. Any 4063// pending HTTP request will be aborted if the provided context is 4064// canceled. 4065func (c *ProjectsLocationsQueuesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsQueuesTestIamPermissionsCall { 4066 c.ctx_ = ctx 4067 return c 4068} 4069 4070// Header returns an http.Header that can be modified by the caller to 4071// add HTTP headers to the request. 4072func (c *ProjectsLocationsQueuesTestIamPermissionsCall) Header() http.Header { 4073 if c.header_ == nil { 4074 c.header_ = make(http.Header) 4075 } 4076 return c.header_ 4077} 4078 4079func (c *ProjectsLocationsQueuesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 4080 reqHeaders := make(http.Header) 4081 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4082 for k, v := range c.header_ { 4083 reqHeaders[k] = v 4084 } 4085 reqHeaders.Set("User-Agent", c.s.userAgent()) 4086 var body io.Reader = nil 4087 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 4088 if err != nil { 4089 return nil, err 4090 } 4091 reqHeaders.Set("Content-Type", "application/json") 4092 c.urlParams_.Set("alt", alt) 4093 c.urlParams_.Set("prettyPrint", "false") 4094 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+resource}:testIamPermissions") 4095 urls += "?" + c.urlParams_.Encode() 4096 req, err := http.NewRequest("POST", urls, body) 4097 if err != nil { 4098 return nil, err 4099 } 4100 req.Header = reqHeaders 4101 googleapi.Expand(req.URL, map[string]string{ 4102 "resource": c.resource, 4103 }) 4104 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4105} 4106 4107// Do executes the "cloudtasks.projects.locations.queues.testIamPermissions" call. 4108// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 4109// Any non-2xx status code is an error. Response headers are in either 4110// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 4111// was returned at all) in error.(*googleapi.Error).Header. Use 4112// googleapi.IsNotModified to check whether the returned error was 4113// because http.StatusNotModified was returned. 4114func (c *ProjectsLocationsQueuesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 4115 gensupport.SetOptions(c.urlParams_, opts...) 4116 res, err := c.doRequest("json") 4117 if res != nil && res.StatusCode == http.StatusNotModified { 4118 if res.Body != nil { 4119 res.Body.Close() 4120 } 4121 return nil, &googleapi.Error{ 4122 Code: res.StatusCode, 4123 Header: res.Header, 4124 } 4125 } 4126 if err != nil { 4127 return nil, err 4128 } 4129 defer googleapi.CloseBody(res) 4130 if err := googleapi.CheckResponse(res); err != nil { 4131 return nil, err 4132 } 4133 ret := &TestIamPermissionsResponse{ 4134 ServerResponse: googleapi.ServerResponse{ 4135 Header: res.Header, 4136 HTTPStatusCode: res.StatusCode, 4137 }, 4138 } 4139 target := &ret 4140 if err := gensupport.DecodeResponse(target, res); err != nil { 4141 return nil, err 4142 } 4143 return ret, nil 4144 // { 4145 // "description": "Returns permissions that a caller has on a Queue. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 4146 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:testIamPermissions", 4147 // "httpMethod": "POST", 4148 // "id": "cloudtasks.projects.locations.queues.testIamPermissions", 4149 // "parameterOrder": [ 4150 // "resource" 4151 // ], 4152 // "parameters": { 4153 // "resource": { 4154 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 4155 // "location": "path", 4156 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 4157 // "required": true, 4158 // "type": "string" 4159 // } 4160 // }, 4161 // "path": "v2beta2/{+resource}:testIamPermissions", 4162 // "request": { 4163 // "$ref": "TestIamPermissionsRequest" 4164 // }, 4165 // "response": { 4166 // "$ref": "TestIamPermissionsResponse" 4167 // }, 4168 // "scopes": [ 4169 // "https://www.googleapis.com/auth/cloud-platform" 4170 // ] 4171 // } 4172 4173} 4174 4175// method id "cloudtasks.projects.locations.queues.tasks.acknowledge": 4176 4177type ProjectsLocationsQueuesTasksAcknowledgeCall struct { 4178 s *Service 4179 name string 4180 acknowledgetaskrequest *AcknowledgeTaskRequest 4181 urlParams_ gensupport.URLParams 4182 ctx_ context.Context 4183 header_ http.Header 4184} 4185 4186// Acknowledge: Acknowledges a pull task. The worker, that is, the 4187// entity that leased this task must call this method to indicate that 4188// the work associated with the task has finished. The worker must 4189// acknowledge a task within the lease_duration or the lease will expire 4190// and the task will become available to be leased again. After the task 4191// is acknowledged, it will not be returned by a later LeaseTasks, 4192// GetTask, or ListTasks. 4193// 4194// - name: The task name. For example: 4195// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TAS 4196// K_ID`. 4197func (r *ProjectsLocationsQueuesTasksService) Acknowledge(name string, acknowledgetaskrequest *AcknowledgeTaskRequest) *ProjectsLocationsQueuesTasksAcknowledgeCall { 4198 c := &ProjectsLocationsQueuesTasksAcknowledgeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4199 c.name = name 4200 c.acknowledgetaskrequest = acknowledgetaskrequest 4201 return c 4202} 4203 4204// Fields allows partial responses to be retrieved. See 4205// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4206// for more information. 4207func (c *ProjectsLocationsQueuesTasksAcknowledgeCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesTasksAcknowledgeCall { 4208 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4209 return c 4210} 4211 4212// Context sets the context to be used in this call's Do method. Any 4213// pending HTTP request will be aborted if the provided context is 4214// canceled. 4215func (c *ProjectsLocationsQueuesTasksAcknowledgeCall) Context(ctx context.Context) *ProjectsLocationsQueuesTasksAcknowledgeCall { 4216 c.ctx_ = ctx 4217 return c 4218} 4219 4220// Header returns an http.Header that can be modified by the caller to 4221// add HTTP headers to the request. 4222func (c *ProjectsLocationsQueuesTasksAcknowledgeCall) Header() http.Header { 4223 if c.header_ == nil { 4224 c.header_ = make(http.Header) 4225 } 4226 return c.header_ 4227} 4228 4229func (c *ProjectsLocationsQueuesTasksAcknowledgeCall) doRequest(alt string) (*http.Response, error) { 4230 reqHeaders := make(http.Header) 4231 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4232 for k, v := range c.header_ { 4233 reqHeaders[k] = v 4234 } 4235 reqHeaders.Set("User-Agent", c.s.userAgent()) 4236 var body io.Reader = nil 4237 body, err := googleapi.WithoutDataWrapper.JSONReader(c.acknowledgetaskrequest) 4238 if err != nil { 4239 return nil, err 4240 } 4241 reqHeaders.Set("Content-Type", "application/json") 4242 c.urlParams_.Set("alt", alt) 4243 c.urlParams_.Set("prettyPrint", "false") 4244 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}:acknowledge") 4245 urls += "?" + c.urlParams_.Encode() 4246 req, err := http.NewRequest("POST", urls, body) 4247 if err != nil { 4248 return nil, err 4249 } 4250 req.Header = reqHeaders 4251 googleapi.Expand(req.URL, map[string]string{ 4252 "name": c.name, 4253 }) 4254 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4255} 4256 4257// Do executes the "cloudtasks.projects.locations.queues.tasks.acknowledge" call. 4258// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4259// code is an error. Response headers are in either 4260// *Empty.ServerResponse.Header or (if a response was returned at all) 4261// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4262// check whether the returned error was because http.StatusNotModified 4263// was returned. 4264func (c *ProjectsLocationsQueuesTasksAcknowledgeCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4265 gensupport.SetOptions(c.urlParams_, opts...) 4266 res, err := c.doRequest("json") 4267 if res != nil && res.StatusCode == http.StatusNotModified { 4268 if res.Body != nil { 4269 res.Body.Close() 4270 } 4271 return nil, &googleapi.Error{ 4272 Code: res.StatusCode, 4273 Header: res.Header, 4274 } 4275 } 4276 if err != nil { 4277 return nil, err 4278 } 4279 defer googleapi.CloseBody(res) 4280 if err := googleapi.CheckResponse(res); err != nil { 4281 return nil, err 4282 } 4283 ret := &Empty{ 4284 ServerResponse: googleapi.ServerResponse{ 4285 Header: res.Header, 4286 HTTPStatusCode: res.StatusCode, 4287 }, 4288 } 4289 target := &ret 4290 if err := gensupport.DecodeResponse(target, res); err != nil { 4291 return nil, err 4292 } 4293 return ret, nil 4294 // { 4295 // "description": "Acknowledges a pull task. The worker, that is, the entity that leased this task must call this method to indicate that the work associated with the task has finished. The worker must acknowledge a task within the lease_duration or the lease will expire and the task will become available to be leased again. After the task is acknowledged, it will not be returned by a later LeaseTasks, GetTask, or ListTasks.", 4296 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:acknowledge", 4297 // "httpMethod": "POST", 4298 // "id": "cloudtasks.projects.locations.queues.tasks.acknowledge", 4299 // "parameterOrder": [ 4300 // "name" 4301 // ], 4302 // "parameters": { 4303 // "name": { 4304 // "description": "Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", 4305 // "location": "path", 4306 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", 4307 // "required": true, 4308 // "type": "string" 4309 // } 4310 // }, 4311 // "path": "v2beta2/{+name}:acknowledge", 4312 // "request": { 4313 // "$ref": "AcknowledgeTaskRequest" 4314 // }, 4315 // "response": { 4316 // "$ref": "Empty" 4317 // }, 4318 // "scopes": [ 4319 // "https://www.googleapis.com/auth/cloud-platform" 4320 // ] 4321 // } 4322 4323} 4324 4325// method id "cloudtasks.projects.locations.queues.tasks.cancelLease": 4326 4327type ProjectsLocationsQueuesTasksCancelLeaseCall struct { 4328 s *Service 4329 name string 4330 cancelleaserequest *CancelLeaseRequest 4331 urlParams_ gensupport.URLParams 4332 ctx_ context.Context 4333 header_ http.Header 4334} 4335 4336// CancelLease: Cancel a pull task's lease. The worker can use this 4337// method to cancel a task's lease by setting its schedule_time to now. 4338// This will make the task available to be leased to the next caller of 4339// LeaseTasks. 4340// 4341// - name: The task name. For example: 4342// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TAS 4343// K_ID`. 4344func (r *ProjectsLocationsQueuesTasksService) CancelLease(name string, cancelleaserequest *CancelLeaseRequest) *ProjectsLocationsQueuesTasksCancelLeaseCall { 4345 c := &ProjectsLocationsQueuesTasksCancelLeaseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4346 c.name = name 4347 c.cancelleaserequest = cancelleaserequest 4348 return c 4349} 4350 4351// Fields allows partial responses to be retrieved. See 4352// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4353// for more information. 4354func (c *ProjectsLocationsQueuesTasksCancelLeaseCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesTasksCancelLeaseCall { 4355 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4356 return c 4357} 4358 4359// Context sets the context to be used in this call's Do method. Any 4360// pending HTTP request will be aborted if the provided context is 4361// canceled. 4362func (c *ProjectsLocationsQueuesTasksCancelLeaseCall) Context(ctx context.Context) *ProjectsLocationsQueuesTasksCancelLeaseCall { 4363 c.ctx_ = ctx 4364 return c 4365} 4366 4367// Header returns an http.Header that can be modified by the caller to 4368// add HTTP headers to the request. 4369func (c *ProjectsLocationsQueuesTasksCancelLeaseCall) Header() http.Header { 4370 if c.header_ == nil { 4371 c.header_ = make(http.Header) 4372 } 4373 return c.header_ 4374} 4375 4376func (c *ProjectsLocationsQueuesTasksCancelLeaseCall) doRequest(alt string) (*http.Response, error) { 4377 reqHeaders := make(http.Header) 4378 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4379 for k, v := range c.header_ { 4380 reqHeaders[k] = v 4381 } 4382 reqHeaders.Set("User-Agent", c.s.userAgent()) 4383 var body io.Reader = nil 4384 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelleaserequest) 4385 if err != nil { 4386 return nil, err 4387 } 4388 reqHeaders.Set("Content-Type", "application/json") 4389 c.urlParams_.Set("alt", alt) 4390 c.urlParams_.Set("prettyPrint", "false") 4391 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}:cancelLease") 4392 urls += "?" + c.urlParams_.Encode() 4393 req, err := http.NewRequest("POST", urls, body) 4394 if err != nil { 4395 return nil, err 4396 } 4397 req.Header = reqHeaders 4398 googleapi.Expand(req.URL, map[string]string{ 4399 "name": c.name, 4400 }) 4401 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4402} 4403 4404// Do executes the "cloudtasks.projects.locations.queues.tasks.cancelLease" call. 4405// Exactly one of *Task or error will be non-nil. Any non-2xx status 4406// code is an error. Response headers are in either 4407// *Task.ServerResponse.Header or (if a response was returned at all) in 4408// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4409// whether the returned error was because http.StatusNotModified was 4410// returned. 4411func (c *ProjectsLocationsQueuesTasksCancelLeaseCall) Do(opts ...googleapi.CallOption) (*Task, error) { 4412 gensupport.SetOptions(c.urlParams_, opts...) 4413 res, err := c.doRequest("json") 4414 if res != nil && res.StatusCode == http.StatusNotModified { 4415 if res.Body != nil { 4416 res.Body.Close() 4417 } 4418 return nil, &googleapi.Error{ 4419 Code: res.StatusCode, 4420 Header: res.Header, 4421 } 4422 } 4423 if err != nil { 4424 return nil, err 4425 } 4426 defer googleapi.CloseBody(res) 4427 if err := googleapi.CheckResponse(res); err != nil { 4428 return nil, err 4429 } 4430 ret := &Task{ 4431 ServerResponse: googleapi.ServerResponse{ 4432 Header: res.Header, 4433 HTTPStatusCode: res.StatusCode, 4434 }, 4435 } 4436 target := &ret 4437 if err := gensupport.DecodeResponse(target, res); err != nil { 4438 return nil, err 4439 } 4440 return ret, nil 4441 // { 4442 // "description": "Cancel a pull task's lease. The worker can use this method to cancel a task's lease by setting its schedule_time to now. This will make the task available to be leased to the next caller of LeaseTasks.", 4443 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:cancelLease", 4444 // "httpMethod": "POST", 4445 // "id": "cloudtasks.projects.locations.queues.tasks.cancelLease", 4446 // "parameterOrder": [ 4447 // "name" 4448 // ], 4449 // "parameters": { 4450 // "name": { 4451 // "description": "Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", 4452 // "location": "path", 4453 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", 4454 // "required": true, 4455 // "type": "string" 4456 // } 4457 // }, 4458 // "path": "v2beta2/{+name}:cancelLease", 4459 // "request": { 4460 // "$ref": "CancelLeaseRequest" 4461 // }, 4462 // "response": { 4463 // "$ref": "Task" 4464 // }, 4465 // "scopes": [ 4466 // "https://www.googleapis.com/auth/cloud-platform" 4467 // ] 4468 // } 4469 4470} 4471 4472// method id "cloudtasks.projects.locations.queues.tasks.create": 4473 4474type ProjectsLocationsQueuesTasksCreateCall struct { 4475 s *Service 4476 parent string 4477 createtaskrequest *CreateTaskRequest 4478 urlParams_ gensupport.URLParams 4479 ctx_ context.Context 4480 header_ http.Header 4481} 4482 4483// Create: Creates a task and adds it to a queue. Tasks cannot be 4484// updated after creation; there is no UpdateTask command. * For App 4485// Engine queues, the maximum task size is 100KB. * For pull queues, the 4486// maximum task size is 1MB. 4487// 4488// - parent: The queue name. For example: 4489// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The 4490// queue must already exist. 4491func (r *ProjectsLocationsQueuesTasksService) Create(parent string, createtaskrequest *CreateTaskRequest) *ProjectsLocationsQueuesTasksCreateCall { 4492 c := &ProjectsLocationsQueuesTasksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4493 c.parent = parent 4494 c.createtaskrequest = createtaskrequest 4495 return c 4496} 4497 4498// Fields allows partial responses to be retrieved. See 4499// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4500// for more information. 4501func (c *ProjectsLocationsQueuesTasksCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesTasksCreateCall { 4502 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4503 return c 4504} 4505 4506// Context sets the context to be used in this call's Do method. Any 4507// pending HTTP request will be aborted if the provided context is 4508// canceled. 4509func (c *ProjectsLocationsQueuesTasksCreateCall) Context(ctx context.Context) *ProjectsLocationsQueuesTasksCreateCall { 4510 c.ctx_ = ctx 4511 return c 4512} 4513 4514// Header returns an http.Header that can be modified by the caller to 4515// add HTTP headers to the request. 4516func (c *ProjectsLocationsQueuesTasksCreateCall) Header() http.Header { 4517 if c.header_ == nil { 4518 c.header_ = make(http.Header) 4519 } 4520 return c.header_ 4521} 4522 4523func (c *ProjectsLocationsQueuesTasksCreateCall) doRequest(alt string) (*http.Response, error) { 4524 reqHeaders := make(http.Header) 4525 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4526 for k, v := range c.header_ { 4527 reqHeaders[k] = v 4528 } 4529 reqHeaders.Set("User-Agent", c.s.userAgent()) 4530 var body io.Reader = nil 4531 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtaskrequest) 4532 if err != nil { 4533 return nil, err 4534 } 4535 reqHeaders.Set("Content-Type", "application/json") 4536 c.urlParams_.Set("alt", alt) 4537 c.urlParams_.Set("prettyPrint", "false") 4538 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+parent}/tasks") 4539 urls += "?" + c.urlParams_.Encode() 4540 req, err := http.NewRequest("POST", urls, body) 4541 if err != nil { 4542 return nil, err 4543 } 4544 req.Header = reqHeaders 4545 googleapi.Expand(req.URL, map[string]string{ 4546 "parent": c.parent, 4547 }) 4548 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4549} 4550 4551// Do executes the "cloudtasks.projects.locations.queues.tasks.create" call. 4552// Exactly one of *Task or error will be non-nil. Any non-2xx status 4553// code is an error. Response headers are in either 4554// *Task.ServerResponse.Header or (if a response was returned at all) in 4555// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4556// whether the returned error was because http.StatusNotModified was 4557// returned. 4558func (c *ProjectsLocationsQueuesTasksCreateCall) Do(opts ...googleapi.CallOption) (*Task, error) { 4559 gensupport.SetOptions(c.urlParams_, opts...) 4560 res, err := c.doRequest("json") 4561 if res != nil && res.StatusCode == http.StatusNotModified { 4562 if res.Body != nil { 4563 res.Body.Close() 4564 } 4565 return nil, &googleapi.Error{ 4566 Code: res.StatusCode, 4567 Header: res.Header, 4568 } 4569 } 4570 if err != nil { 4571 return nil, err 4572 } 4573 defer googleapi.CloseBody(res) 4574 if err := googleapi.CheckResponse(res); err != nil { 4575 return nil, err 4576 } 4577 ret := &Task{ 4578 ServerResponse: googleapi.ServerResponse{ 4579 Header: res.Header, 4580 HTTPStatusCode: res.StatusCode, 4581 }, 4582 } 4583 target := &ret 4584 if err := gensupport.DecodeResponse(target, res); err != nil { 4585 return nil, err 4586 } 4587 return ret, nil 4588 // { 4589 // "description": "Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no UpdateTask command. * For App Engine queues, the maximum task size is 100KB. * For pull queues, the maximum task size is 1MB.", 4590 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks", 4591 // "httpMethod": "POST", 4592 // "id": "cloudtasks.projects.locations.queues.tasks.create", 4593 // "parameterOrder": [ 4594 // "parent" 4595 // ], 4596 // "parameters": { 4597 // "parent": { 4598 // "description": "Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist.", 4599 // "location": "path", 4600 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 4601 // "required": true, 4602 // "type": "string" 4603 // } 4604 // }, 4605 // "path": "v2beta2/{+parent}/tasks", 4606 // "request": { 4607 // "$ref": "CreateTaskRequest" 4608 // }, 4609 // "response": { 4610 // "$ref": "Task" 4611 // }, 4612 // "scopes": [ 4613 // "https://www.googleapis.com/auth/cloud-platform" 4614 // ] 4615 // } 4616 4617} 4618 4619// method id "cloudtasks.projects.locations.queues.tasks.delete": 4620 4621type ProjectsLocationsQueuesTasksDeleteCall struct { 4622 s *Service 4623 name string 4624 urlParams_ gensupport.URLParams 4625 ctx_ context.Context 4626 header_ http.Header 4627} 4628 4629// Delete: Deletes a task. A task can be deleted if it is scheduled or 4630// dispatched. A task cannot be deleted if it has completed successfully 4631// or permanently failed. 4632// 4633// - name: The task name. For example: 4634// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TAS 4635// K_ID`. 4636func (r *ProjectsLocationsQueuesTasksService) Delete(name string) *ProjectsLocationsQueuesTasksDeleteCall { 4637 c := &ProjectsLocationsQueuesTasksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4638 c.name = name 4639 return c 4640} 4641 4642// Fields allows partial responses to be retrieved. See 4643// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4644// for more information. 4645func (c *ProjectsLocationsQueuesTasksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesTasksDeleteCall { 4646 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4647 return c 4648} 4649 4650// Context sets the context to be used in this call's Do method. Any 4651// pending HTTP request will be aborted if the provided context is 4652// canceled. 4653func (c *ProjectsLocationsQueuesTasksDeleteCall) Context(ctx context.Context) *ProjectsLocationsQueuesTasksDeleteCall { 4654 c.ctx_ = ctx 4655 return c 4656} 4657 4658// Header returns an http.Header that can be modified by the caller to 4659// add HTTP headers to the request. 4660func (c *ProjectsLocationsQueuesTasksDeleteCall) Header() http.Header { 4661 if c.header_ == nil { 4662 c.header_ = make(http.Header) 4663 } 4664 return c.header_ 4665} 4666 4667func (c *ProjectsLocationsQueuesTasksDeleteCall) doRequest(alt string) (*http.Response, error) { 4668 reqHeaders := make(http.Header) 4669 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4670 for k, v := range c.header_ { 4671 reqHeaders[k] = v 4672 } 4673 reqHeaders.Set("User-Agent", c.s.userAgent()) 4674 var body io.Reader = nil 4675 c.urlParams_.Set("alt", alt) 4676 c.urlParams_.Set("prettyPrint", "false") 4677 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") 4678 urls += "?" + c.urlParams_.Encode() 4679 req, err := http.NewRequest("DELETE", urls, body) 4680 if err != nil { 4681 return nil, err 4682 } 4683 req.Header = reqHeaders 4684 googleapi.Expand(req.URL, map[string]string{ 4685 "name": c.name, 4686 }) 4687 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4688} 4689 4690// Do executes the "cloudtasks.projects.locations.queues.tasks.delete" call. 4691// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4692// code is an error. Response headers are in either 4693// *Empty.ServerResponse.Header or (if a response was returned at all) 4694// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4695// check whether the returned error was because http.StatusNotModified 4696// was returned. 4697func (c *ProjectsLocationsQueuesTasksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4698 gensupport.SetOptions(c.urlParams_, opts...) 4699 res, err := c.doRequest("json") 4700 if res != nil && res.StatusCode == http.StatusNotModified { 4701 if res.Body != nil { 4702 res.Body.Close() 4703 } 4704 return nil, &googleapi.Error{ 4705 Code: res.StatusCode, 4706 Header: res.Header, 4707 } 4708 } 4709 if err != nil { 4710 return nil, err 4711 } 4712 defer googleapi.CloseBody(res) 4713 if err := googleapi.CheckResponse(res); err != nil { 4714 return nil, err 4715 } 4716 ret := &Empty{ 4717 ServerResponse: googleapi.ServerResponse{ 4718 Header: res.Header, 4719 HTTPStatusCode: res.StatusCode, 4720 }, 4721 } 4722 target := &ret 4723 if err := gensupport.DecodeResponse(target, res); err != nil { 4724 return nil, err 4725 } 4726 return ret, nil 4727 // { 4728 // "description": "Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has completed successfully or permanently failed.", 4729 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}", 4730 // "httpMethod": "DELETE", 4731 // "id": "cloudtasks.projects.locations.queues.tasks.delete", 4732 // "parameterOrder": [ 4733 // "name" 4734 // ], 4735 // "parameters": { 4736 // "name": { 4737 // "description": "Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", 4738 // "location": "path", 4739 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", 4740 // "required": true, 4741 // "type": "string" 4742 // } 4743 // }, 4744 // "path": "v2beta2/{+name}", 4745 // "response": { 4746 // "$ref": "Empty" 4747 // }, 4748 // "scopes": [ 4749 // "https://www.googleapis.com/auth/cloud-platform" 4750 // ] 4751 // } 4752 4753} 4754 4755// method id "cloudtasks.projects.locations.queues.tasks.get": 4756 4757type ProjectsLocationsQueuesTasksGetCall struct { 4758 s *Service 4759 name string 4760 urlParams_ gensupport.URLParams 4761 ifNoneMatch_ string 4762 ctx_ context.Context 4763 header_ http.Header 4764} 4765 4766// Get: Gets a task. 4767// 4768// - name: The task name. For example: 4769// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TAS 4770// K_ID`. 4771func (r *ProjectsLocationsQueuesTasksService) Get(name string) *ProjectsLocationsQueuesTasksGetCall { 4772 c := &ProjectsLocationsQueuesTasksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4773 c.name = name 4774 return c 4775} 4776 4777// ResponseView sets the optional parameter "responseView": The 4778// response_view specifies which subset of the Task will be returned. By 4779// default response_view is BASIC; not all information is retrieved by 4780// default because some data, such as payloads, might be desirable to 4781// return only when needed because of its large size or because of the 4782// sensitivity of data that it contains. Authorization for FULL requires 4783// `cloudtasks.tasks.fullView` Google IAM 4784// (https://cloud.google.com/iam/) permission on the Task resource. 4785// 4786// Possible values: 4787// "VIEW_UNSPECIFIED" - Unspecified. Defaults to BASIC. 4788// "BASIC" - The basic view omits fields which can be large or can 4789// contain sensitive data. This view does not include the (payload in 4790// AppEngineHttpRequest and payload in PullMessage). These payloads are 4791// desirable to return only when needed, because they can be large and 4792// because of the sensitivity of the data that you choose to store in 4793// it. 4794// "FULL" - All information is returned. Authorization for FULL 4795// requires `cloudtasks.tasks.fullView` [Google 4796// IAM](https://cloud.google.com/iam/) permission on the Queue resource. 4797func (c *ProjectsLocationsQueuesTasksGetCall) ResponseView(responseView string) *ProjectsLocationsQueuesTasksGetCall { 4798 c.urlParams_.Set("responseView", responseView) 4799 return c 4800} 4801 4802// Fields allows partial responses to be retrieved. See 4803// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4804// for more information. 4805func (c *ProjectsLocationsQueuesTasksGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesTasksGetCall { 4806 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4807 return c 4808} 4809 4810// IfNoneMatch sets the optional parameter which makes the operation 4811// fail if the object's ETag matches the given value. This is useful for 4812// getting updates only after the object has changed since the last 4813// request. Use googleapi.IsNotModified to check whether the response 4814// error from Do is the result of In-None-Match. 4815func (c *ProjectsLocationsQueuesTasksGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsQueuesTasksGetCall { 4816 c.ifNoneMatch_ = entityTag 4817 return c 4818} 4819 4820// Context sets the context to be used in this call's Do method. Any 4821// pending HTTP request will be aborted if the provided context is 4822// canceled. 4823func (c *ProjectsLocationsQueuesTasksGetCall) Context(ctx context.Context) *ProjectsLocationsQueuesTasksGetCall { 4824 c.ctx_ = ctx 4825 return c 4826} 4827 4828// Header returns an http.Header that can be modified by the caller to 4829// add HTTP headers to the request. 4830func (c *ProjectsLocationsQueuesTasksGetCall) Header() http.Header { 4831 if c.header_ == nil { 4832 c.header_ = make(http.Header) 4833 } 4834 return c.header_ 4835} 4836 4837func (c *ProjectsLocationsQueuesTasksGetCall) doRequest(alt string) (*http.Response, error) { 4838 reqHeaders := make(http.Header) 4839 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4840 for k, v := range c.header_ { 4841 reqHeaders[k] = v 4842 } 4843 reqHeaders.Set("User-Agent", c.s.userAgent()) 4844 if c.ifNoneMatch_ != "" { 4845 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4846 } 4847 var body io.Reader = nil 4848 c.urlParams_.Set("alt", alt) 4849 c.urlParams_.Set("prettyPrint", "false") 4850 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}") 4851 urls += "?" + c.urlParams_.Encode() 4852 req, err := http.NewRequest("GET", urls, body) 4853 if err != nil { 4854 return nil, err 4855 } 4856 req.Header = reqHeaders 4857 googleapi.Expand(req.URL, map[string]string{ 4858 "name": c.name, 4859 }) 4860 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4861} 4862 4863// Do executes the "cloudtasks.projects.locations.queues.tasks.get" call. 4864// Exactly one of *Task or error will be non-nil. Any non-2xx status 4865// code is an error. Response headers are in either 4866// *Task.ServerResponse.Header or (if a response was returned at all) in 4867// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4868// whether the returned error was because http.StatusNotModified was 4869// returned. 4870func (c *ProjectsLocationsQueuesTasksGetCall) Do(opts ...googleapi.CallOption) (*Task, error) { 4871 gensupport.SetOptions(c.urlParams_, opts...) 4872 res, err := c.doRequest("json") 4873 if res != nil && res.StatusCode == http.StatusNotModified { 4874 if res.Body != nil { 4875 res.Body.Close() 4876 } 4877 return nil, &googleapi.Error{ 4878 Code: res.StatusCode, 4879 Header: res.Header, 4880 } 4881 } 4882 if err != nil { 4883 return nil, err 4884 } 4885 defer googleapi.CloseBody(res) 4886 if err := googleapi.CheckResponse(res); err != nil { 4887 return nil, err 4888 } 4889 ret := &Task{ 4890 ServerResponse: googleapi.ServerResponse{ 4891 Header: res.Header, 4892 HTTPStatusCode: res.StatusCode, 4893 }, 4894 } 4895 target := &ret 4896 if err := gensupport.DecodeResponse(target, res); err != nil { 4897 return nil, err 4898 } 4899 return ret, nil 4900 // { 4901 // "description": "Gets a task.", 4902 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}", 4903 // "httpMethod": "GET", 4904 // "id": "cloudtasks.projects.locations.queues.tasks.get", 4905 // "parameterOrder": [ 4906 // "name" 4907 // ], 4908 // "parameters": { 4909 // "name": { 4910 // "description": "Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", 4911 // "location": "path", 4912 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", 4913 // "required": true, 4914 // "type": "string" 4915 // }, 4916 // "responseView": { 4917 // "description": "The response_view specifies which subset of the Task will be returned. By default response_view is BASIC; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Task resource.", 4918 // "enum": [ 4919 // "VIEW_UNSPECIFIED", 4920 // "BASIC", 4921 // "FULL" 4922 // ], 4923 // "enumDescriptions": [ 4924 // "Unspecified. Defaults to BASIC.", 4925 // "The basic view omits fields which can be large or can contain sensitive data. This view does not include the (payload in AppEngineHttpRequest and payload in PullMessage). These payloads are desirable to return only when needed, because they can be large and because of the sensitivity of the data that you choose to store in it.", 4926 // "All information is returned. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Queue resource." 4927 // ], 4928 // "location": "query", 4929 // "type": "string" 4930 // } 4931 // }, 4932 // "path": "v2beta2/{+name}", 4933 // "response": { 4934 // "$ref": "Task" 4935 // }, 4936 // "scopes": [ 4937 // "https://www.googleapis.com/auth/cloud-platform" 4938 // ] 4939 // } 4940 4941} 4942 4943// method id "cloudtasks.projects.locations.queues.tasks.lease": 4944 4945type ProjectsLocationsQueuesTasksLeaseCall struct { 4946 s *Service 4947 parent string 4948 leasetasksrequest *LeaseTasksRequest 4949 urlParams_ gensupport.URLParams 4950 ctx_ context.Context 4951 header_ http.Header 4952} 4953 4954// Lease: Leases tasks from a pull queue for lease_duration. This method 4955// is invoked by the worker to obtain a lease. The worker must 4956// acknowledge the task via AcknowledgeTask after they have performed 4957// the work associated with the task. The payload is intended to store 4958// data that the worker needs to perform the work associated with the 4959// task. To return the payloads in the response, set response_view to 4960// FULL. A maximum of 10 qps of LeaseTasks requests are allowed per 4961// queue. RESOURCE_EXHAUSTED is returned when this limit is exceeded. 4962// RESOURCE_EXHAUSTED is also returned when 4963// max_tasks_dispatched_per_second is exceeded. 4964// 4965// - parent: The queue name. For example: 4966// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`. 4967func (r *ProjectsLocationsQueuesTasksService) Lease(parent string, leasetasksrequest *LeaseTasksRequest) *ProjectsLocationsQueuesTasksLeaseCall { 4968 c := &ProjectsLocationsQueuesTasksLeaseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4969 c.parent = parent 4970 c.leasetasksrequest = leasetasksrequest 4971 return c 4972} 4973 4974// Fields allows partial responses to be retrieved. See 4975// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4976// for more information. 4977func (c *ProjectsLocationsQueuesTasksLeaseCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesTasksLeaseCall { 4978 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4979 return c 4980} 4981 4982// Context sets the context to be used in this call's Do method. Any 4983// pending HTTP request will be aborted if the provided context is 4984// canceled. 4985func (c *ProjectsLocationsQueuesTasksLeaseCall) Context(ctx context.Context) *ProjectsLocationsQueuesTasksLeaseCall { 4986 c.ctx_ = ctx 4987 return c 4988} 4989 4990// Header returns an http.Header that can be modified by the caller to 4991// add HTTP headers to the request. 4992func (c *ProjectsLocationsQueuesTasksLeaseCall) Header() http.Header { 4993 if c.header_ == nil { 4994 c.header_ = make(http.Header) 4995 } 4996 return c.header_ 4997} 4998 4999func (c *ProjectsLocationsQueuesTasksLeaseCall) doRequest(alt string) (*http.Response, error) { 5000 reqHeaders := make(http.Header) 5001 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5002 for k, v := range c.header_ { 5003 reqHeaders[k] = v 5004 } 5005 reqHeaders.Set("User-Agent", c.s.userAgent()) 5006 var body io.Reader = nil 5007 body, err := googleapi.WithoutDataWrapper.JSONReader(c.leasetasksrequest) 5008 if err != nil { 5009 return nil, err 5010 } 5011 reqHeaders.Set("Content-Type", "application/json") 5012 c.urlParams_.Set("alt", alt) 5013 c.urlParams_.Set("prettyPrint", "false") 5014 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+parent}/tasks:lease") 5015 urls += "?" + c.urlParams_.Encode() 5016 req, err := http.NewRequest("POST", urls, body) 5017 if err != nil { 5018 return nil, err 5019 } 5020 req.Header = reqHeaders 5021 googleapi.Expand(req.URL, map[string]string{ 5022 "parent": c.parent, 5023 }) 5024 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5025} 5026 5027// Do executes the "cloudtasks.projects.locations.queues.tasks.lease" call. 5028// Exactly one of *LeaseTasksResponse or error will be non-nil. Any 5029// non-2xx status code is an error. Response headers are in either 5030// *LeaseTasksResponse.ServerResponse.Header or (if a response was 5031// returned at all) in error.(*googleapi.Error).Header. Use 5032// googleapi.IsNotModified to check whether the returned error was 5033// because http.StatusNotModified was returned. 5034func (c *ProjectsLocationsQueuesTasksLeaseCall) Do(opts ...googleapi.CallOption) (*LeaseTasksResponse, error) { 5035 gensupport.SetOptions(c.urlParams_, opts...) 5036 res, err := c.doRequest("json") 5037 if res != nil && res.StatusCode == http.StatusNotModified { 5038 if res.Body != nil { 5039 res.Body.Close() 5040 } 5041 return nil, &googleapi.Error{ 5042 Code: res.StatusCode, 5043 Header: res.Header, 5044 } 5045 } 5046 if err != nil { 5047 return nil, err 5048 } 5049 defer googleapi.CloseBody(res) 5050 if err := googleapi.CheckResponse(res); err != nil { 5051 return nil, err 5052 } 5053 ret := &LeaseTasksResponse{ 5054 ServerResponse: googleapi.ServerResponse{ 5055 Header: res.Header, 5056 HTTPStatusCode: res.StatusCode, 5057 }, 5058 } 5059 target := &ret 5060 if err := gensupport.DecodeResponse(target, res); err != nil { 5061 return nil, err 5062 } 5063 return ret, nil 5064 // { 5065 // "description": "Leases tasks from a pull queue for lease_duration. This method is invoked by the worker to obtain a lease. The worker must acknowledge the task via AcknowledgeTask after they have performed the work associated with the task. The payload is intended to store data that the worker needs to perform the work associated with the task. To return the payloads in the response, set response_view to FULL. A maximum of 10 qps of LeaseTasks requests are allowed per queue. RESOURCE_EXHAUSTED is returned when this limit is exceeded. RESOURCE_EXHAUSTED is also returned when max_tasks_dispatched_per_second is exceeded.", 5066 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks:lease", 5067 // "httpMethod": "POST", 5068 // "id": "cloudtasks.projects.locations.queues.tasks.lease", 5069 // "parameterOrder": [ 5070 // "parent" 5071 // ], 5072 // "parameters": { 5073 // "parent": { 5074 // "description": "Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`", 5075 // "location": "path", 5076 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 5077 // "required": true, 5078 // "type": "string" 5079 // } 5080 // }, 5081 // "path": "v2beta2/{+parent}/tasks:lease", 5082 // "request": { 5083 // "$ref": "LeaseTasksRequest" 5084 // }, 5085 // "response": { 5086 // "$ref": "LeaseTasksResponse" 5087 // }, 5088 // "scopes": [ 5089 // "https://www.googleapis.com/auth/cloud-platform" 5090 // ] 5091 // } 5092 5093} 5094 5095// method id "cloudtasks.projects.locations.queues.tasks.list": 5096 5097type ProjectsLocationsQueuesTasksListCall struct { 5098 s *Service 5099 parent string 5100 urlParams_ gensupport.URLParams 5101 ifNoneMatch_ string 5102 ctx_ context.Context 5103 header_ http.Header 5104} 5105 5106// List: Lists the tasks in a queue. By default, only the BASIC view is 5107// retrieved due to performance considerations; response_view controls 5108// the subset of information which is returned. The tasks may be 5109// returned in any order. The ordering may change at any time. 5110// 5111// - parent: The queue name. For example: 5112// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`. 5113func (r *ProjectsLocationsQueuesTasksService) List(parent string) *ProjectsLocationsQueuesTasksListCall { 5114 c := &ProjectsLocationsQueuesTasksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5115 c.parent = parent 5116 return c 5117} 5118 5119// PageSize sets the optional parameter "pageSize": Maximum page size. 5120// Fewer tasks than requested might be returned, even if more tasks 5121// exist; use next_page_token in the response to determine if more tasks 5122// exist. The maximum page size is 1000. If unspecified, the page size 5123// will be the maximum. 5124func (c *ProjectsLocationsQueuesTasksListCall) PageSize(pageSize int64) *ProjectsLocationsQueuesTasksListCall { 5125 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5126 return c 5127} 5128 5129// PageToken sets the optional parameter "pageToken": A token 5130// identifying the page of results to return. To request the first page 5131// results, page_token must be empty. To request the next page of 5132// results, page_token must be the value of next_page_token returned 5133// from the previous call to ListTasks method. The page token is valid 5134// for only 2 hours. 5135func (c *ProjectsLocationsQueuesTasksListCall) PageToken(pageToken string) *ProjectsLocationsQueuesTasksListCall { 5136 c.urlParams_.Set("pageToken", pageToken) 5137 return c 5138} 5139 5140// ResponseView sets the optional parameter "responseView": The 5141// response_view specifies which subset of the Task will be returned. By 5142// default response_view is BASIC; not all information is retrieved by 5143// default because some data, such as payloads, might be desirable to 5144// return only when needed because of its large size or because of the 5145// sensitivity of data that it contains. Authorization for FULL requires 5146// `cloudtasks.tasks.fullView` Google IAM 5147// (https://cloud.google.com/iam/) permission on the Task resource. 5148// 5149// Possible values: 5150// "VIEW_UNSPECIFIED" - Unspecified. Defaults to BASIC. 5151// "BASIC" - The basic view omits fields which can be large or can 5152// contain sensitive data. This view does not include the (payload in 5153// AppEngineHttpRequest and payload in PullMessage). These payloads are 5154// desirable to return only when needed, because they can be large and 5155// because of the sensitivity of the data that you choose to store in 5156// it. 5157// "FULL" - All information is returned. Authorization for FULL 5158// requires `cloudtasks.tasks.fullView` [Google 5159// IAM](https://cloud.google.com/iam/) permission on the Queue resource. 5160func (c *ProjectsLocationsQueuesTasksListCall) ResponseView(responseView string) *ProjectsLocationsQueuesTasksListCall { 5161 c.urlParams_.Set("responseView", responseView) 5162 return c 5163} 5164 5165// Fields allows partial responses to be retrieved. See 5166// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5167// for more information. 5168func (c *ProjectsLocationsQueuesTasksListCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesTasksListCall { 5169 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5170 return c 5171} 5172 5173// IfNoneMatch sets the optional parameter which makes the operation 5174// fail if the object's ETag matches the given value. This is useful for 5175// getting updates only after the object has changed since the last 5176// request. Use googleapi.IsNotModified to check whether the response 5177// error from Do is the result of In-None-Match. 5178func (c *ProjectsLocationsQueuesTasksListCall) IfNoneMatch(entityTag string) *ProjectsLocationsQueuesTasksListCall { 5179 c.ifNoneMatch_ = entityTag 5180 return c 5181} 5182 5183// Context sets the context to be used in this call's Do method. Any 5184// pending HTTP request will be aborted if the provided context is 5185// canceled. 5186func (c *ProjectsLocationsQueuesTasksListCall) Context(ctx context.Context) *ProjectsLocationsQueuesTasksListCall { 5187 c.ctx_ = ctx 5188 return c 5189} 5190 5191// Header returns an http.Header that can be modified by the caller to 5192// add HTTP headers to the request. 5193func (c *ProjectsLocationsQueuesTasksListCall) Header() http.Header { 5194 if c.header_ == nil { 5195 c.header_ = make(http.Header) 5196 } 5197 return c.header_ 5198} 5199 5200func (c *ProjectsLocationsQueuesTasksListCall) doRequest(alt string) (*http.Response, error) { 5201 reqHeaders := make(http.Header) 5202 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5203 for k, v := range c.header_ { 5204 reqHeaders[k] = v 5205 } 5206 reqHeaders.Set("User-Agent", c.s.userAgent()) 5207 if c.ifNoneMatch_ != "" { 5208 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5209 } 5210 var body io.Reader = nil 5211 c.urlParams_.Set("alt", alt) 5212 c.urlParams_.Set("prettyPrint", "false") 5213 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+parent}/tasks") 5214 urls += "?" + c.urlParams_.Encode() 5215 req, err := http.NewRequest("GET", urls, body) 5216 if err != nil { 5217 return nil, err 5218 } 5219 req.Header = reqHeaders 5220 googleapi.Expand(req.URL, map[string]string{ 5221 "parent": c.parent, 5222 }) 5223 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5224} 5225 5226// Do executes the "cloudtasks.projects.locations.queues.tasks.list" call. 5227// Exactly one of *ListTasksResponse or error will be non-nil. Any 5228// non-2xx status code is an error. Response headers are in either 5229// *ListTasksResponse.ServerResponse.Header or (if a response was 5230// returned at all) in error.(*googleapi.Error).Header. Use 5231// googleapi.IsNotModified to check whether the returned error was 5232// because http.StatusNotModified was returned. 5233func (c *ProjectsLocationsQueuesTasksListCall) Do(opts ...googleapi.CallOption) (*ListTasksResponse, error) { 5234 gensupport.SetOptions(c.urlParams_, opts...) 5235 res, err := c.doRequest("json") 5236 if res != nil && res.StatusCode == http.StatusNotModified { 5237 if res.Body != nil { 5238 res.Body.Close() 5239 } 5240 return nil, &googleapi.Error{ 5241 Code: res.StatusCode, 5242 Header: res.Header, 5243 } 5244 } 5245 if err != nil { 5246 return nil, err 5247 } 5248 defer googleapi.CloseBody(res) 5249 if err := googleapi.CheckResponse(res); err != nil { 5250 return nil, err 5251 } 5252 ret := &ListTasksResponse{ 5253 ServerResponse: googleapi.ServerResponse{ 5254 Header: res.Header, 5255 HTTPStatusCode: res.StatusCode, 5256 }, 5257 } 5258 target := &ret 5259 if err := gensupport.DecodeResponse(target, res); err != nil { 5260 return nil, err 5261 } 5262 return ret, nil 5263 // { 5264 // "description": "Lists the tasks in a queue. By default, only the BASIC view is retrieved due to performance considerations; response_view controls the subset of information which is returned. The tasks may be returned in any order. The ordering may change at any time.", 5265 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks", 5266 // "httpMethod": "GET", 5267 // "id": "cloudtasks.projects.locations.queues.tasks.list", 5268 // "parameterOrder": [ 5269 // "parent" 5270 // ], 5271 // "parameters": { 5272 // "pageSize": { 5273 // "description": "Maximum page size. Fewer tasks than requested might be returned, even if more tasks exist; use next_page_token in the response to determine if more tasks exist. The maximum page size is 1000. If unspecified, the page size will be the maximum.", 5274 // "format": "int32", 5275 // "location": "query", 5276 // "type": "integer" 5277 // }, 5278 // "pageToken": { 5279 // "description": "A token identifying the page of results to return. To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of next_page_token returned from the previous call to ListTasks method. The page token is valid for only 2 hours.", 5280 // "location": "query", 5281 // "type": "string" 5282 // }, 5283 // "parent": { 5284 // "description": "Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`", 5285 // "location": "path", 5286 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", 5287 // "required": true, 5288 // "type": "string" 5289 // }, 5290 // "responseView": { 5291 // "description": "The response_view specifies which subset of the Task will be returned. By default response_view is BASIC; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Task resource.", 5292 // "enum": [ 5293 // "VIEW_UNSPECIFIED", 5294 // "BASIC", 5295 // "FULL" 5296 // ], 5297 // "enumDescriptions": [ 5298 // "Unspecified. Defaults to BASIC.", 5299 // "The basic view omits fields which can be large or can contain sensitive data. This view does not include the (payload in AppEngineHttpRequest and payload in PullMessage). These payloads are desirable to return only when needed, because they can be large and because of the sensitivity of the data that you choose to store in it.", 5300 // "All information is returned. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the Queue resource." 5301 // ], 5302 // "location": "query", 5303 // "type": "string" 5304 // } 5305 // }, 5306 // "path": "v2beta2/{+parent}/tasks", 5307 // "response": { 5308 // "$ref": "ListTasksResponse" 5309 // }, 5310 // "scopes": [ 5311 // "https://www.googleapis.com/auth/cloud-platform" 5312 // ] 5313 // } 5314 5315} 5316 5317// Pages invokes f for each page of results. 5318// A non-nil error returned from f will halt the iteration. 5319// The provided context supersedes any context provided to the Context method. 5320func (c *ProjectsLocationsQueuesTasksListCall) Pages(ctx context.Context, f func(*ListTasksResponse) error) error { 5321 c.ctx_ = ctx 5322 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5323 for { 5324 x, err := c.Do() 5325 if err != nil { 5326 return err 5327 } 5328 if err := f(x); err != nil { 5329 return err 5330 } 5331 if x.NextPageToken == "" { 5332 return nil 5333 } 5334 c.PageToken(x.NextPageToken) 5335 } 5336} 5337 5338// method id "cloudtasks.projects.locations.queues.tasks.renewLease": 5339 5340type ProjectsLocationsQueuesTasksRenewLeaseCall struct { 5341 s *Service 5342 name string 5343 renewleaserequest *RenewLeaseRequest 5344 urlParams_ gensupport.URLParams 5345 ctx_ context.Context 5346 header_ http.Header 5347} 5348 5349// RenewLease: Renew the current lease of a pull task. The worker can 5350// use this method to extend the lease by a new duration, starting from 5351// now. The new task lease will be returned in the task's schedule_time. 5352// 5353// - name: The task name. For example: 5354// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TAS 5355// K_ID`. 5356func (r *ProjectsLocationsQueuesTasksService) RenewLease(name string, renewleaserequest *RenewLeaseRequest) *ProjectsLocationsQueuesTasksRenewLeaseCall { 5357 c := &ProjectsLocationsQueuesTasksRenewLeaseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5358 c.name = name 5359 c.renewleaserequest = renewleaserequest 5360 return c 5361} 5362 5363// Fields allows partial responses to be retrieved. See 5364// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5365// for more information. 5366func (c *ProjectsLocationsQueuesTasksRenewLeaseCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesTasksRenewLeaseCall { 5367 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5368 return c 5369} 5370 5371// Context sets the context to be used in this call's Do method. Any 5372// pending HTTP request will be aborted if the provided context is 5373// canceled. 5374func (c *ProjectsLocationsQueuesTasksRenewLeaseCall) Context(ctx context.Context) *ProjectsLocationsQueuesTasksRenewLeaseCall { 5375 c.ctx_ = ctx 5376 return c 5377} 5378 5379// Header returns an http.Header that can be modified by the caller to 5380// add HTTP headers to the request. 5381func (c *ProjectsLocationsQueuesTasksRenewLeaseCall) Header() http.Header { 5382 if c.header_ == nil { 5383 c.header_ = make(http.Header) 5384 } 5385 return c.header_ 5386} 5387 5388func (c *ProjectsLocationsQueuesTasksRenewLeaseCall) doRequest(alt string) (*http.Response, error) { 5389 reqHeaders := make(http.Header) 5390 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5391 for k, v := range c.header_ { 5392 reqHeaders[k] = v 5393 } 5394 reqHeaders.Set("User-Agent", c.s.userAgent()) 5395 var body io.Reader = nil 5396 body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewleaserequest) 5397 if err != nil { 5398 return nil, err 5399 } 5400 reqHeaders.Set("Content-Type", "application/json") 5401 c.urlParams_.Set("alt", alt) 5402 c.urlParams_.Set("prettyPrint", "false") 5403 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}:renewLease") 5404 urls += "?" + c.urlParams_.Encode() 5405 req, err := http.NewRequest("POST", urls, body) 5406 if err != nil { 5407 return nil, err 5408 } 5409 req.Header = reqHeaders 5410 googleapi.Expand(req.URL, map[string]string{ 5411 "name": c.name, 5412 }) 5413 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5414} 5415 5416// Do executes the "cloudtasks.projects.locations.queues.tasks.renewLease" call. 5417// Exactly one of *Task or error will be non-nil. Any non-2xx status 5418// code is an error. Response headers are in either 5419// *Task.ServerResponse.Header or (if a response was returned at all) in 5420// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5421// whether the returned error was because http.StatusNotModified was 5422// returned. 5423func (c *ProjectsLocationsQueuesTasksRenewLeaseCall) Do(opts ...googleapi.CallOption) (*Task, error) { 5424 gensupport.SetOptions(c.urlParams_, opts...) 5425 res, err := c.doRequest("json") 5426 if res != nil && res.StatusCode == http.StatusNotModified { 5427 if res.Body != nil { 5428 res.Body.Close() 5429 } 5430 return nil, &googleapi.Error{ 5431 Code: res.StatusCode, 5432 Header: res.Header, 5433 } 5434 } 5435 if err != nil { 5436 return nil, err 5437 } 5438 defer googleapi.CloseBody(res) 5439 if err := googleapi.CheckResponse(res); err != nil { 5440 return nil, err 5441 } 5442 ret := &Task{ 5443 ServerResponse: googleapi.ServerResponse{ 5444 Header: res.Header, 5445 HTTPStatusCode: res.StatusCode, 5446 }, 5447 } 5448 target := &ret 5449 if err := gensupport.DecodeResponse(target, res); err != nil { 5450 return nil, err 5451 } 5452 return ret, nil 5453 // { 5454 // "description": "Renew the current lease of a pull task. The worker can use this method to extend the lease by a new duration, starting from now. The new task lease will be returned in the task's schedule_time.", 5455 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:renewLease", 5456 // "httpMethod": "POST", 5457 // "id": "cloudtasks.projects.locations.queues.tasks.renewLease", 5458 // "parameterOrder": [ 5459 // "name" 5460 // ], 5461 // "parameters": { 5462 // "name": { 5463 // "description": "Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", 5464 // "location": "path", 5465 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", 5466 // "required": true, 5467 // "type": "string" 5468 // } 5469 // }, 5470 // "path": "v2beta2/{+name}:renewLease", 5471 // "request": { 5472 // "$ref": "RenewLeaseRequest" 5473 // }, 5474 // "response": { 5475 // "$ref": "Task" 5476 // }, 5477 // "scopes": [ 5478 // "https://www.googleapis.com/auth/cloud-platform" 5479 // ] 5480 // } 5481 5482} 5483 5484// method id "cloudtasks.projects.locations.queues.tasks.run": 5485 5486type ProjectsLocationsQueuesTasksRunCall struct { 5487 s *Service 5488 name string 5489 runtaskrequest *RunTaskRequest 5490 urlParams_ gensupport.URLParams 5491 ctx_ context.Context 5492 header_ http.Header 5493} 5494 5495// Run: Forces a task to run now. When this method is called, Cloud 5496// Tasks will dispatch the task, even if the task is already running, 5497// the queue has reached its RateLimits or is PAUSED. This command is 5498// meant to be used for manual debugging. For example, RunTask can be 5499// used to retry a failed task after a fix has been made or to manually 5500// force a task to be dispatched now. The dispatched task is returned. 5501// That is, the task that is returned contains the status after the task 5502// is dispatched but before the task is received by its target. If Cloud 5503// Tasks receives a successful response from the task's target, then the 5504// task will be deleted; otherwise the task's schedule_time will be 5505// reset to the time that RunTask was called plus the retry delay 5506// specified in the queue's RetryConfig. RunTask returns NOT_FOUND when 5507// it is called on a task that has already succeeded or permanently 5508// failed. RunTask cannot be called on a pull task. 5509// 5510// - name: The task name. For example: 5511// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TAS 5512// K_ID`. 5513func (r *ProjectsLocationsQueuesTasksService) Run(name string, runtaskrequest *RunTaskRequest) *ProjectsLocationsQueuesTasksRunCall { 5514 c := &ProjectsLocationsQueuesTasksRunCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5515 c.name = name 5516 c.runtaskrequest = runtaskrequest 5517 return c 5518} 5519 5520// Fields allows partial responses to be retrieved. See 5521// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5522// for more information. 5523func (c *ProjectsLocationsQueuesTasksRunCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesTasksRunCall { 5524 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5525 return c 5526} 5527 5528// Context sets the context to be used in this call's Do method. Any 5529// pending HTTP request will be aborted if the provided context is 5530// canceled. 5531func (c *ProjectsLocationsQueuesTasksRunCall) Context(ctx context.Context) *ProjectsLocationsQueuesTasksRunCall { 5532 c.ctx_ = ctx 5533 return c 5534} 5535 5536// Header returns an http.Header that can be modified by the caller to 5537// add HTTP headers to the request. 5538func (c *ProjectsLocationsQueuesTasksRunCall) Header() http.Header { 5539 if c.header_ == nil { 5540 c.header_ = make(http.Header) 5541 } 5542 return c.header_ 5543} 5544 5545func (c *ProjectsLocationsQueuesTasksRunCall) doRequest(alt string) (*http.Response, error) { 5546 reqHeaders := make(http.Header) 5547 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5548 for k, v := range c.header_ { 5549 reqHeaders[k] = v 5550 } 5551 reqHeaders.Set("User-Agent", c.s.userAgent()) 5552 var body io.Reader = nil 5553 body, err := googleapi.WithoutDataWrapper.JSONReader(c.runtaskrequest) 5554 if err != nil { 5555 return nil, err 5556 } 5557 reqHeaders.Set("Content-Type", "application/json") 5558 c.urlParams_.Set("alt", alt) 5559 c.urlParams_.Set("prettyPrint", "false") 5560 urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta2/{+name}:run") 5561 urls += "?" + c.urlParams_.Encode() 5562 req, err := http.NewRequest("POST", urls, body) 5563 if err != nil { 5564 return nil, err 5565 } 5566 req.Header = reqHeaders 5567 googleapi.Expand(req.URL, map[string]string{ 5568 "name": c.name, 5569 }) 5570 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5571} 5572 5573// Do executes the "cloudtasks.projects.locations.queues.tasks.run" call. 5574// Exactly one of *Task or error will be non-nil. Any non-2xx status 5575// code is an error. Response headers are in either 5576// *Task.ServerResponse.Header or (if a response was returned at all) in 5577// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5578// whether the returned error was because http.StatusNotModified was 5579// returned. 5580func (c *ProjectsLocationsQueuesTasksRunCall) Do(opts ...googleapi.CallOption) (*Task, error) { 5581 gensupport.SetOptions(c.urlParams_, opts...) 5582 res, err := c.doRequest("json") 5583 if res != nil && res.StatusCode == http.StatusNotModified { 5584 if res.Body != nil { 5585 res.Body.Close() 5586 } 5587 return nil, &googleapi.Error{ 5588 Code: res.StatusCode, 5589 Header: res.Header, 5590 } 5591 } 5592 if err != nil { 5593 return nil, err 5594 } 5595 defer googleapi.CloseBody(res) 5596 if err := googleapi.CheckResponse(res); err != nil { 5597 return nil, err 5598 } 5599 ret := &Task{ 5600 ServerResponse: googleapi.ServerResponse{ 5601 Header: res.Header, 5602 HTTPStatusCode: res.StatusCode, 5603 }, 5604 } 5605 target := &ret 5606 if err := gensupport.DecodeResponse(target, res); err != nil { 5607 return nil, err 5608 } 5609 return ret, nil 5610 // { 5611 // "description": "Forces a task to run now. When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its RateLimits or is PAUSED. This command is meant to be used for manual debugging. For example, RunTask can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now. The dispatched task is returned. That is, the task that is returned contains the status after the task is dispatched but before the task is received by its target. If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's schedule_time will be reset to the time that RunTask was called plus the retry delay specified in the queue's RetryConfig. RunTask returns NOT_FOUND when it is called on a task that has already succeeded or permanently failed. RunTask cannot be called on a pull task.", 5612 // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}/tasks/{tasksId}:run", 5613 // "httpMethod": "POST", 5614 // "id": "cloudtasks.projects.locations.queues.tasks.run", 5615 // "parameterOrder": [ 5616 // "name" 5617 // ], 5618 // "parameters": { 5619 // "name": { 5620 // "description": "Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`", 5621 // "location": "path", 5622 // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+$", 5623 // "required": true, 5624 // "type": "string" 5625 // } 5626 // }, 5627 // "path": "v2beta2/{+name}:run", 5628 // "request": { 5629 // "$ref": "RunTaskRequest" 5630 // }, 5631 // "response": { 5632 // "$ref": "Task" 5633 // }, 5634 // "scopes": [ 5635 // "https://www.googleapis.com/auth/cloud-platform" 5636 // ] 5637 // } 5638 5639} 5640