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