12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427 |
- // Package taskqueue provides access to the TaskQueue API.
- //
- // See https://developers.google.com/appengine/docs/python/taskqueue/rest
- //
- // Usage example:
- //
- // import "google.golang.org/api/taskqueue/v1beta2"
- // ...
- // taskqueueService, err := taskqueue.New(oauthHttpClient)
- package taskqueue // import "google.golang.org/api/taskqueue/v1beta2"
- import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- context "golang.org/x/net/context"
- ctxhttp "golang.org/x/net/context/ctxhttp"
- gensupport "google.golang.org/api/gensupport"
- googleapi "google.golang.org/api/googleapi"
- "io"
- "net/http"
- "net/url"
- "strconv"
- "strings"
- )
- // Always reference these packages, just in case the auto-generated code
- // below doesn't.
- var _ = bytes.NewBuffer
- var _ = strconv.Itoa
- var _ = fmt.Sprintf
- var _ = json.NewDecoder
- var _ = io.Copy
- var _ = url.Parse
- var _ = gensupport.MarshalJSON
- var _ = googleapi.Version
- var _ = errors.New
- var _ = strings.Replace
- var _ = context.Canceled
- var _ = ctxhttp.Do
- const apiId = "taskqueue:v1beta2"
- const apiName = "taskqueue"
- const apiVersion = "v1beta2"
- const basePath = "https://www.googleapis.com/taskqueue/v1beta2/projects/"
- // OAuth2 scopes used by this API.
- const (
- // Manage your Tasks and Taskqueues
- TaskqueueScope = "https://www.googleapis.com/auth/taskqueue"
- // Consume Tasks from your Taskqueues
- TaskqueueConsumerScope = "https://www.googleapis.com/auth/taskqueue.consumer"
- )
- func New(client *http.Client) (*Service, error) {
- if client == nil {
- return nil, errors.New("client is nil")
- }
- s := &Service{client: client, BasePath: basePath}
- s.Taskqueues = NewTaskqueuesService(s)
- s.Tasks = NewTasksService(s)
- return s, nil
- }
- type Service struct {
- client *http.Client
- BasePath string // API endpoint base URL
- UserAgent string // optional additional User-Agent fragment
- Taskqueues *TaskqueuesService
- Tasks *TasksService
- }
- func (s *Service) userAgent() string {
- if s.UserAgent == "" {
- return googleapi.UserAgent
- }
- return googleapi.UserAgent + " " + s.UserAgent
- }
- func NewTaskqueuesService(s *Service) *TaskqueuesService {
- rs := &TaskqueuesService{s: s}
- return rs
- }
- type TaskqueuesService struct {
- s *Service
- }
- func NewTasksService(s *Service) *TasksService {
- rs := &TasksService{s: s}
- return rs
- }
- type TasksService struct {
- s *Service
- }
- type Task struct {
- // EnqueueTimestamp: Time (in seconds since the epoch) at which the task
- // was enqueued.
- EnqueueTimestamp int64 `json:"enqueueTimestamp,omitempty,string"`
- // Id: Name of the task.
- Id string `json:"id,omitempty"`
- // Kind: The kind of object returned, in this case set to task.
- Kind string `json:"kind,omitempty"`
- // LeaseTimestamp: Time (in seconds since the epoch) at which the task
- // lease will expire. This value is 0 if the task isnt currently leased
- // out to a worker.
- LeaseTimestamp int64 `json:"leaseTimestamp,omitempty,string"`
- // PayloadBase64: A bag of bytes which is the task payload. The payload
- // on the JSON side is always Base64 encoded.
- PayloadBase64 string `json:"payloadBase64,omitempty"`
- // QueueName: Name of the queue that the task is in.
- QueueName string `json:"queueName,omitempty"`
- // RetryCount: The number of leases applied to this task.
- RetryCount int64 `json:"retry_count,omitempty"`
- // Tag: Tag for the task, could be used later to lease tasks grouped by
- // a specific tag.
- Tag string `json:"tag,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "EnqueueTimestamp") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Task) MarshalJSON() ([]byte, error) {
- type noMethod Task
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type TaskQueue struct {
- // Acl: ACLs that are applicable to this TaskQueue object.
- Acl *TaskQueueAcl `json:"acl,omitempty"`
- // Id: Name of the taskqueue.
- Id string `json:"id,omitempty"`
- // Kind: The kind of REST object returned, in this case taskqueue.
- Kind string `json:"kind,omitempty"`
- // MaxLeases: The number of times we should lease out tasks before
- // giving up on them. If unset we lease them out forever until a worker
- // deletes the task.
- MaxLeases int64 `json:"maxLeases,omitempty"`
- // Stats: Statistics for the TaskQueue object in question.
- Stats *TaskQueueStats `json:"stats,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Acl") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *TaskQueue) MarshalJSON() ([]byte, error) {
- type noMethod TaskQueue
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // TaskQueueAcl: ACLs that are applicable to this TaskQueue object.
- type TaskQueueAcl struct {
- // AdminEmails: Email addresses of users who are "admins" of the
- // TaskQueue. This means they can control the queue, eg set ACLs for the
- // queue.
- AdminEmails []string `json:"adminEmails,omitempty"`
- // ConsumerEmails: Email addresses of users who can "consume" tasks from
- // the TaskQueue. This means they can Dequeue and Delete tasks from the
- // queue.
- ConsumerEmails []string `json:"consumerEmails,omitempty"`
- // ProducerEmails: Email addresses of users who can "produce" tasks into
- // the TaskQueue. This means they can Insert tasks into the queue.
- ProducerEmails []string `json:"producerEmails,omitempty"`
- // ForceSendFields is a list of field names (e.g. "AdminEmails") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *TaskQueueAcl) MarshalJSON() ([]byte, error) {
- type noMethod TaskQueueAcl
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // TaskQueueStats: Statistics for the TaskQueue object in question.
- type TaskQueueStats struct {
- // LeasedLastHour: Number of tasks leased in the last hour.
- LeasedLastHour int64 `json:"leasedLastHour,omitempty,string"`
- // LeasedLastMinute: Number of tasks leased in the last minute.
- LeasedLastMinute int64 `json:"leasedLastMinute,omitempty,string"`
- // OldestTask: The timestamp (in seconds since the epoch) of the oldest
- // unfinished task.
- OldestTask int64 `json:"oldestTask,omitempty,string"`
- // TotalTasks: Number of tasks in the queue.
- TotalTasks int64 `json:"totalTasks,omitempty"`
- // ForceSendFields is a list of field names (e.g. "LeasedLastHour") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *TaskQueueStats) MarshalJSON() ([]byte, error) {
- type noMethod TaskQueueStats
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type Tasks struct {
- // Items: The actual list of tasks returned as a result of the lease
- // operation.
- Items []*Task `json:"items,omitempty"`
- // Kind: The kind of object returned, a list of tasks.
- Kind string `json:"kind,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Tasks) MarshalJSON() ([]byte, error) {
- type noMethod Tasks
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type Tasks2 struct {
- // Items: The actual list of tasks currently active in the TaskQueue.
- Items []*Task `json:"items,omitempty"`
- // Kind: The kind of object returned, a list of tasks.
- Kind string `json:"kind,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Tasks2) MarshalJSON() ([]byte, error) {
- type noMethod Tasks2
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // method id "taskqueue.taskqueues.get":
- type TaskqueuesGetCall struct {
- s *Service
- project string
- taskqueue string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // Get: Get detailed information about a TaskQueue.
- func (r *TaskqueuesService) Get(project string, taskqueue string) *TaskqueuesGetCall {
- c := &TaskqueuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.taskqueue = taskqueue
- return c
- }
- // GetStats sets the optional parameter "getStats": Whether to get
- // stats.
- func (c *TaskqueuesGetCall) GetStats(getStats bool) *TaskqueuesGetCall {
- c.urlParams_.Set("getStats", fmt.Sprint(getStats))
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *TaskqueuesGetCall) Fields(s ...googleapi.Field) *TaskqueuesGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *TaskqueuesGetCall) IfNoneMatch(entityTag string) *TaskqueuesGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *TaskqueuesGetCall) Context(ctx context.Context) *TaskqueuesGetCall {
- c.ctx_ = ctx
- return c
- }
- func (c *TaskqueuesGetCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "taskqueue": c.taskqueue,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "taskqueue.taskqueues.get" call.
- // Exactly one of *TaskQueue or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *TaskQueue.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *TaskqueuesGetCall) Do(opts ...googleapi.CallOption) (*TaskQueue, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &TaskQueue{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Get detailed information about a TaskQueue.",
- // "httpMethod": "GET",
- // "id": "taskqueue.taskqueues.get",
- // "parameterOrder": [
- // "project",
- // "taskqueue"
- // ],
- // "parameters": {
- // "getStats": {
- // "description": "Whether to get stats. Optional.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "project": {
- // "description": "The project under which the queue lies.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "taskqueue": {
- // "description": "The id of the taskqueue to get the properties of.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{project}/taskqueues/{taskqueue}",
- // "response": {
- // "$ref": "TaskQueue"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/taskqueue",
- // "https://www.googleapis.com/auth/taskqueue.consumer"
- // ]
- // }
- }
- // method id "taskqueue.tasks.delete":
- type TasksDeleteCall struct {
- s *Service
- project string
- taskqueue string
- task string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Delete: Delete a task from a TaskQueue.
- func (r *TasksService) Delete(project string, taskqueue string, task string) *TasksDeleteCall {
- c := &TasksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.taskqueue = taskqueue
- c.task = task
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *TasksDeleteCall) Fields(s ...googleapi.Field) *TasksDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *TasksDeleteCall) Context(ctx context.Context) *TasksDeleteCall {
- c.ctx_ = ctx
- return c
- }
- func (c *TasksDeleteCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "taskqueue": c.taskqueue,
- "task": c.task,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "taskqueue.tasks.delete" call.
- func (c *TasksDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return err
- }
- return nil
- // {
- // "description": "Delete a task from a TaskQueue.",
- // "httpMethod": "DELETE",
- // "id": "taskqueue.tasks.delete",
- // "parameterOrder": [
- // "project",
- // "taskqueue",
- // "task"
- // ],
- // "parameters": {
- // "project": {
- // "description": "The project under which the queue lies.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "task": {
- // "description": "The id of the task to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "taskqueue": {
- // "description": "The taskqueue to delete a task from.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{project}/taskqueues/{taskqueue}/tasks/{task}",
- // "scopes": [
- // "https://www.googleapis.com/auth/taskqueue",
- // "https://www.googleapis.com/auth/taskqueue.consumer"
- // ]
- // }
- }
- // method id "taskqueue.tasks.get":
- type TasksGetCall struct {
- s *Service
- project string
- taskqueue string
- task string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // Get: Get a particular task from a TaskQueue.
- func (r *TasksService) Get(project string, taskqueue string, task string) *TasksGetCall {
- c := &TasksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.taskqueue = taskqueue
- c.task = task
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *TasksGetCall) Fields(s ...googleapi.Field) *TasksGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *TasksGetCall) IfNoneMatch(entityTag string) *TasksGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *TasksGetCall) Context(ctx context.Context) *TasksGetCall {
- c.ctx_ = ctx
- return c
- }
- func (c *TasksGetCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "taskqueue": c.taskqueue,
- "task": c.task,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "taskqueue.tasks.get" call.
- // Exactly one of *Task or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Task.ServerResponse.Header or (if a response was returned at all) in
- // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
- // whether the returned error was because http.StatusNotModified was
- // returned.
- func (c *TasksGetCall) Do(opts ...googleapi.CallOption) (*Task, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Task{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Get a particular task from a TaskQueue.",
- // "httpMethod": "GET",
- // "id": "taskqueue.tasks.get",
- // "parameterOrder": [
- // "project",
- // "taskqueue",
- // "task"
- // ],
- // "parameters": {
- // "project": {
- // "description": "The project under which the queue lies.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "task": {
- // "description": "The task to get properties of.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "taskqueue": {
- // "description": "The taskqueue in which the task belongs.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{project}/taskqueues/{taskqueue}/tasks/{task}",
- // "response": {
- // "$ref": "Task"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/taskqueue",
- // "https://www.googleapis.com/auth/taskqueue.consumer"
- // ]
- // }
- }
- // method id "taskqueue.tasks.insert":
- type TasksInsertCall struct {
- s *Service
- project string
- taskqueue string
- task *Task
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Insert: Insert a new task in a TaskQueue
- func (r *TasksService) Insert(project string, taskqueue string, task *Task) *TasksInsertCall {
- c := &TasksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.taskqueue = taskqueue
- c.task = task
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *TasksInsertCall) Fields(s ...googleapi.Field) *TasksInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *TasksInsertCall) Context(ctx context.Context) *TasksInsertCall {
- c.ctx_ = ctx
- return c
- }
- func (c *TasksInsertCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.task)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "taskqueue": c.taskqueue,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "taskqueue.tasks.insert" call.
- // Exactly one of *Task or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Task.ServerResponse.Header or (if a response was returned at all) in
- // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
- // whether the returned error was because http.StatusNotModified was
- // returned.
- func (c *TasksInsertCall) Do(opts ...googleapi.CallOption) (*Task, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Task{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Insert a new task in a TaskQueue",
- // "httpMethod": "POST",
- // "id": "taskqueue.tasks.insert",
- // "parameterOrder": [
- // "project",
- // "taskqueue"
- // ],
- // "parameters": {
- // "project": {
- // "description": "The project under which the queue lies",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "taskqueue": {
- // "description": "The taskqueue to insert the task into",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{project}/taskqueues/{taskqueue}/tasks",
- // "request": {
- // "$ref": "Task"
- // },
- // "response": {
- // "$ref": "Task"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/taskqueue",
- // "https://www.googleapis.com/auth/taskqueue.consumer"
- // ]
- // }
- }
- // method id "taskqueue.tasks.lease":
- type TasksLeaseCall struct {
- s *Service
- project string
- taskqueue string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Lease: Lease 1 or more tasks from a TaskQueue.
- func (r *TasksService) Lease(project string, taskqueue string, numTasks int64, leaseSecs int64) *TasksLeaseCall {
- c := &TasksLeaseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.taskqueue = taskqueue
- c.urlParams_.Set("numTasks", fmt.Sprint(numTasks))
- c.urlParams_.Set("leaseSecs", fmt.Sprint(leaseSecs))
- return c
- }
- // GroupByTag sets the optional parameter "groupByTag": When true, all
- // returned tasks will have the same tag
- func (c *TasksLeaseCall) GroupByTag(groupByTag bool) *TasksLeaseCall {
- c.urlParams_.Set("groupByTag", fmt.Sprint(groupByTag))
- return c
- }
- // Tag sets the optional parameter "tag": The tag allowed for tasks in
- // the response. Must only be specified if group_by_tag is true. If
- // group_by_tag is true and tag is not specified the tag will be that of
- // the oldest task by eta, i.e. the first available tag
- func (c *TasksLeaseCall) Tag(tag string) *TasksLeaseCall {
- c.urlParams_.Set("tag", tag)
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *TasksLeaseCall) Fields(s ...googleapi.Field) *TasksLeaseCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *TasksLeaseCall) Context(ctx context.Context) *TasksLeaseCall {
- c.ctx_ = ctx
- return c
- }
- func (c *TasksLeaseCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/lease")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "taskqueue": c.taskqueue,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "taskqueue.tasks.lease" call.
- // Exactly one of *Tasks or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Tasks.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *TasksLeaseCall) Do(opts ...googleapi.CallOption) (*Tasks, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Tasks{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lease 1 or more tasks from a TaskQueue.",
- // "httpMethod": "POST",
- // "id": "taskqueue.tasks.lease",
- // "parameterOrder": [
- // "project",
- // "taskqueue",
- // "numTasks",
- // "leaseSecs"
- // ],
- // "parameters": {
- // "groupByTag": {
- // "description": "When true, all returned tasks will have the same tag",
- // "location": "query",
- // "type": "boolean"
- // },
- // "leaseSecs": {
- // "description": "The lease in seconds.",
- // "format": "int32",
- // "location": "query",
- // "required": true,
- // "type": "integer"
- // },
- // "numTasks": {
- // "description": "The number of tasks to lease.",
- // "format": "int32",
- // "location": "query",
- // "required": true,
- // "type": "integer"
- // },
- // "project": {
- // "description": "The project under which the queue lies.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "tag": {
- // "description": "The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag",
- // "location": "query",
- // "type": "string"
- // },
- // "taskqueue": {
- // "description": "The taskqueue to lease a task from.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{project}/taskqueues/{taskqueue}/tasks/lease",
- // "response": {
- // "$ref": "Tasks"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/taskqueue",
- // "https://www.googleapis.com/auth/taskqueue.consumer"
- // ]
- // }
- }
- // method id "taskqueue.tasks.list":
- type TasksListCall struct {
- s *Service
- project string
- taskqueue string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: List Tasks in a TaskQueue
- func (r *TasksService) List(project string, taskqueue string) *TasksListCall {
- c := &TasksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.taskqueue = taskqueue
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *TasksListCall) Fields(s ...googleapi.Field) *TasksListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *TasksListCall) IfNoneMatch(entityTag string) *TasksListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *TasksListCall) Context(ctx context.Context) *TasksListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *TasksListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "taskqueue": c.taskqueue,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "taskqueue.tasks.list" call.
- // Exactly one of *Tasks2 or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Tasks2.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *TasksListCall) Do(opts ...googleapi.CallOption) (*Tasks2, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Tasks2{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "List Tasks in a TaskQueue",
- // "httpMethod": "GET",
- // "id": "taskqueue.tasks.list",
- // "parameterOrder": [
- // "project",
- // "taskqueue"
- // ],
- // "parameters": {
- // "project": {
- // "description": "The project under which the queue lies.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "taskqueue": {
- // "description": "The id of the taskqueue to list tasks from.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{project}/taskqueues/{taskqueue}/tasks",
- // "response": {
- // "$ref": "Tasks2"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/taskqueue",
- // "https://www.googleapis.com/auth/taskqueue.consumer"
- // ]
- // }
- }
- // method id "taskqueue.tasks.patch":
- type TasksPatchCall struct {
- s *Service
- project string
- taskqueue string
- task string
- task2 *Task
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Patch: Update tasks that are leased out of a TaskQueue. This method
- // supports patch semantics.
- func (r *TasksService) Patch(project string, taskqueue string, task string, newLeaseSeconds int64, task2 *Task) *TasksPatchCall {
- c := &TasksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.taskqueue = taskqueue
- c.task = task
- c.urlParams_.Set("newLeaseSeconds", fmt.Sprint(newLeaseSeconds))
- c.task2 = task2
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *TasksPatchCall) Fields(s ...googleapi.Field) *TasksPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *TasksPatchCall) Context(ctx context.Context) *TasksPatchCall {
- c.ctx_ = ctx
- return c
- }
- func (c *TasksPatchCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.task2)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PATCH", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "taskqueue": c.taskqueue,
- "task": c.task,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "taskqueue.tasks.patch" call.
- // Exactly one of *Task or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Task.ServerResponse.Header or (if a response was returned at all) in
- // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
- // whether the returned error was because http.StatusNotModified was
- // returned.
- func (c *TasksPatchCall) Do(opts ...googleapi.CallOption) (*Task, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Task{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Update tasks that are leased out of a TaskQueue. This method supports patch semantics.",
- // "httpMethod": "PATCH",
- // "id": "taskqueue.tasks.patch",
- // "parameterOrder": [
- // "project",
- // "taskqueue",
- // "task",
- // "newLeaseSeconds"
- // ],
- // "parameters": {
- // "newLeaseSeconds": {
- // "description": "The new lease in seconds.",
- // "format": "int32",
- // "location": "query",
- // "required": true,
- // "type": "integer"
- // },
- // "project": {
- // "description": "The project under which the queue lies.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "task": {
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "taskqueue": {
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{project}/taskqueues/{taskqueue}/tasks/{task}",
- // "request": {
- // "$ref": "Task"
- // },
- // "response": {
- // "$ref": "Task"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/taskqueue",
- // "https://www.googleapis.com/auth/taskqueue.consumer"
- // ]
- // }
- }
- // method id "taskqueue.tasks.update":
- type TasksUpdateCall struct {
- s *Service
- project string
- taskqueue string
- task string
- task2 *Task
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Update: Update tasks that are leased out of a TaskQueue.
- func (r *TasksService) Update(project string, taskqueue string, task string, newLeaseSeconds int64, task2 *Task) *TasksUpdateCall {
- c := &TasksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.project = project
- c.taskqueue = taskqueue
- c.task = task
- c.urlParams_.Set("newLeaseSeconds", fmt.Sprint(newLeaseSeconds))
- c.task2 = task2
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *TasksUpdateCall) Fields(s ...googleapi.Field) *TasksUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *TasksUpdateCall) Context(ctx context.Context) *TasksUpdateCall {
- c.ctx_ = ctx
- return c
- }
- func (c *TasksUpdateCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.task2)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "project": c.project,
- "taskqueue": c.taskqueue,
- "task": c.task,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "taskqueue.tasks.update" call.
- // Exactly one of *Task or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Task.ServerResponse.Header or (if a response was returned at all) in
- // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
- // whether the returned error was because http.StatusNotModified was
- // returned.
- func (c *TasksUpdateCall) Do(opts ...googleapi.CallOption) (*Task, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Task{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Update tasks that are leased out of a TaskQueue.",
- // "httpMethod": "POST",
- // "id": "taskqueue.tasks.update",
- // "parameterOrder": [
- // "project",
- // "taskqueue",
- // "task",
- // "newLeaseSeconds"
- // ],
- // "parameters": {
- // "newLeaseSeconds": {
- // "description": "The new lease in seconds.",
- // "format": "int32",
- // "location": "query",
- // "required": true,
- // "type": "integer"
- // },
- // "project": {
- // "description": "The project under which the queue lies.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "task": {
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "taskqueue": {
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{project}/taskqueues/{taskqueue}/tasks/{task}",
- // "request": {
- // "$ref": "Task"
- // },
- // "response": {
- // "$ref": "Task"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/taskqueue",
- // "https://www.googleapis.com/auth/taskqueue.consumer"
- // ]
- // }
- }
|