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