~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/coordinate/v1/coordinate-gen.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Package coordinate provides access to the Google Maps Coordinate API.
 
2
//
 
3
// See https://developers.google.com/coordinate/
 
4
//
 
5
// Usage example:
 
6
//
 
7
//   import "google.golang.org/api/coordinate/v1"
 
8
//   ...
 
9
//   coordinateService, err := coordinate.New(oauthHttpClient)
 
10
package coordinate
 
11
 
 
12
import (
 
13
        "bytes"
 
14
        "encoding/json"
 
15
        "errors"
 
16
        "fmt"
 
17
        "google.golang.org/api/googleapi"
 
18
        "io"
 
19
        "net/http"
 
20
        "net/url"
 
21
        "strconv"
 
22
        "strings"
 
23
)
 
24
 
 
25
// Always reference these packages, just in case the auto-generated code
 
26
// below doesn't.
 
27
var _ = bytes.NewBuffer
 
28
var _ = strconv.Itoa
 
29
var _ = fmt.Sprintf
 
30
var _ = json.NewDecoder
 
31
var _ = io.Copy
 
32
var _ = url.Parse
 
33
var _ = googleapi.Version
 
34
var _ = errors.New
 
35
var _ = strings.Replace
 
36
 
 
37
const apiId = "coordinate:v1"
 
38
const apiName = "coordinate"
 
39
const apiVersion = "v1"
 
40
const basePath = "https://www.googleapis.com/coordinate/v1/teams/"
 
41
 
 
42
// OAuth2 scopes used by this API.
 
43
const (
 
44
        // View and manage your Google Maps Coordinate jobs
 
45
        CoordinateScope = "https://www.googleapis.com/auth/coordinate"
 
46
 
 
47
        // View your Google Coordinate jobs
 
48
        CoordinateReadonlyScope = "https://www.googleapis.com/auth/coordinate.readonly"
 
49
)
 
50
 
 
51
func New(client *http.Client) (*Service, error) {
 
52
        if client == nil {
 
53
                return nil, errors.New("client is nil")
 
54
        }
 
55
        s := &Service{client: client, BasePath: basePath}
 
56
        s.CustomFieldDef = NewCustomFieldDefService(s)
 
57
        s.Jobs = NewJobsService(s)
 
58
        s.Location = NewLocationService(s)
 
59
        s.Schedule = NewScheduleService(s)
 
60
        s.Worker = NewWorkerService(s)
 
61
        return s, nil
 
62
}
 
63
 
 
64
type Service struct {
 
65
        client   *http.Client
 
66
        BasePath string // API endpoint base URL
 
67
 
 
68
        CustomFieldDef *CustomFieldDefService
 
69
 
 
70
        Jobs *JobsService
 
71
 
 
72
        Location *LocationService
 
73
 
 
74
        Schedule *ScheduleService
 
75
 
 
76
        Worker *WorkerService
 
77
}
 
78
 
 
79
func NewCustomFieldDefService(s *Service) *CustomFieldDefService {
 
80
        rs := &CustomFieldDefService{s: s}
 
81
        return rs
 
82
}
 
83
 
 
84
type CustomFieldDefService struct {
 
85
        s *Service
 
86
}
 
87
 
 
88
func NewJobsService(s *Service) *JobsService {
 
89
        rs := &JobsService{s: s}
 
90
        return rs
 
91
}
 
92
 
 
93
type JobsService struct {
 
94
        s *Service
 
95
}
 
96
 
 
97
func NewLocationService(s *Service) *LocationService {
 
98
        rs := &LocationService{s: s}
 
99
        return rs
 
100
}
 
101
 
 
102
type LocationService struct {
 
103
        s *Service
 
104
}
 
105
 
 
106
func NewScheduleService(s *Service) *ScheduleService {
 
107
        rs := &ScheduleService{s: s}
 
108
        return rs
 
109
}
 
110
 
 
111
type ScheduleService struct {
 
112
        s *Service
 
113
}
 
114
 
 
115
func NewWorkerService(s *Service) *WorkerService {
 
116
        rs := &WorkerService{s: s}
 
117
        return rs
 
118
}
 
119
 
 
120
type WorkerService struct {
 
121
        s *Service
 
122
}
 
123
 
 
124
type CustomField struct {
 
125
        // CustomFieldId: Custom field id.
 
126
        CustomFieldId int64 `json:"customFieldId,omitempty,string"`
 
127
 
 
128
        // Kind: Identifies this object as a custom field.
 
129
        Kind string `json:"kind,omitempty"`
 
130
 
 
131
        // Value: Custom field value.
 
132
        Value string `json:"value,omitempty"`
 
133
}
 
134
 
 
135
type CustomFieldDef struct {
 
136
        // Enabled: Whether the field is enabled.
 
137
        Enabled bool `json:"enabled,omitempty"`
 
138
 
 
139
        // Id: Custom field id.
 
140
        Id int64 `json:"id,omitempty,string"`
 
141
 
 
142
        // Kind: Identifies this object as a custom field definition.
 
143
        Kind string `json:"kind,omitempty"`
 
144
 
 
145
        // Name: Custom field name.
 
146
        Name string `json:"name,omitempty"`
 
147
 
 
148
        // RequiredForCheckout: Whether the field is required for checkout.
 
149
        RequiredForCheckout bool `json:"requiredForCheckout,omitempty"`
 
150
 
 
151
        // Type: Custom field type.
 
152
        Type string `json:"type,omitempty"`
 
153
}
 
154
 
 
155
type CustomFieldDefListResponse struct {
 
156
        // Items: Collection of custom field definitions in a team.
 
157
        Items []*CustomFieldDef `json:"items,omitempty"`
 
158
 
 
159
        // Kind: Identifies this object as a collection of custom field
 
160
        // definitions in a team.
 
161
        Kind string `json:"kind,omitempty"`
 
162
}
 
163
 
 
164
type CustomFields struct {
 
165
        // CustomField: Collection of custom fields.
 
166
        CustomField []*CustomField `json:"customField,omitempty"`
 
167
 
 
168
        // Kind: Identifies this object as a collection of custom fields.
 
169
        Kind string `json:"kind,omitempty"`
 
170
}
 
171
 
 
172
type Job struct {
 
173
        // Id: Job id.
 
174
        Id uint64 `json:"id,omitempty,string"`
 
175
 
 
176
        // JobChange: List of job changes since it was created. The first change
 
177
        // corresponds to the state of the job when it was created.
 
178
        JobChange []*JobChange `json:"jobChange,omitempty"`
 
179
 
 
180
        // Kind: Identifies this object as a job.
 
181
        Kind string `json:"kind,omitempty"`
 
182
 
 
183
        // State: Current job state.
 
184
        State *JobState `json:"state,omitempty"`
 
185
}
 
186
 
 
187
type JobChange struct {
 
188
        // Kind: Identifies this object as a job change.
 
189
        Kind string `json:"kind,omitempty"`
 
190
 
 
191
        // State: Change applied to the job. Only the fields that were changed
 
192
        // are set.
 
193
        State *JobState `json:"state,omitempty"`
 
194
 
 
195
        // Timestamp: Time at which this change was applied.
 
196
        Timestamp uint64 `json:"timestamp,omitempty,string"`
 
197
}
 
198
 
 
199
type JobListResponse struct {
 
200
        // Items: Jobs in the collection.
 
201
        Items []*Job `json:"items,omitempty"`
 
202
 
 
203
        // Kind: Identifies this object as a list of jobs.
 
204
        Kind string `json:"kind,omitempty"`
 
205
 
 
206
        // NextPageToken: A token to provide to get the next page of results.
 
207
        NextPageToken string `json:"nextPageToken,omitempty"`
 
208
}
 
209
 
 
210
type JobState struct {
 
211
        // Assignee: Email address of the assignee.
 
212
        Assignee string `json:"assignee,omitempty"`
 
213
 
 
214
        // CustomFields: Custom fields.
 
215
        CustomFields *CustomFields `json:"customFields,omitempty"`
 
216
 
 
217
        // CustomerName: Customer name.
 
218
        CustomerName string `json:"customerName,omitempty"`
 
219
 
 
220
        // CustomerPhoneNumber: Customer phone number.
 
221
        CustomerPhoneNumber string `json:"customerPhoneNumber,omitempty"`
 
222
 
 
223
        // Kind: Identifies this object as a job state.
 
224
        Kind string `json:"kind,omitempty"`
 
225
 
 
226
        // Location: Job location.
 
227
        Location *Location `json:"location,omitempty"`
 
228
 
 
229
        // Note: Note added to the job.
 
230
        Note []string `json:"note,omitempty"`
 
231
 
 
232
        // Progress: Job progress.
 
233
        Progress string `json:"progress,omitempty"`
 
234
 
 
235
        // Title: Job title.
 
236
        Title string `json:"title,omitempty"`
 
237
}
 
238
 
 
239
type Location struct {
 
240
        // AddressLine: Address.
 
241
        AddressLine []string `json:"addressLine,omitempty"`
 
242
 
 
243
        // Kind: Identifies this object as a location.
 
244
        Kind string `json:"kind,omitempty"`
 
245
 
 
246
        // Lat: Latitude.
 
247
        Lat float64 `json:"lat,omitempty"`
 
248
 
 
249
        // Lng: Longitude.
 
250
        Lng float64 `json:"lng,omitempty"`
 
251
}
 
252
 
 
253
type LocationListResponse struct {
 
254
        // Items: Locations in the collection.
 
255
        Items []*LocationRecord `json:"items,omitempty"`
 
256
 
 
257
        // Kind: Identifies this object as a list of locations.
 
258
        Kind string `json:"kind,omitempty"`
 
259
 
 
260
        // NextPageToken: A token to provide to get the next page of results.
 
261
        NextPageToken string `json:"nextPageToken,omitempty"`
 
262
 
 
263
        // TokenPagination: Pagination information for token pagination.
 
264
        TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
 
265
}
 
266
 
 
267
type LocationRecord struct {
 
268
        // CollectionTime: The collection time in milliseconds since the epoch.
 
269
        CollectionTime int64 `json:"collectionTime,omitempty,string"`
 
270
 
 
271
        // ConfidenceRadius: The location accuracy in meters. This is the radius
 
272
        // of a 95% confidence interval around the location measurement.
 
273
        ConfidenceRadius float64 `json:"confidenceRadius,omitempty"`
 
274
 
 
275
        // Kind: Identifies this object as a location.
 
276
        Kind string `json:"kind,omitempty"`
 
277
 
 
278
        // Latitude: Latitude.
 
279
        Latitude float64 `json:"latitude,omitempty"`
 
280
 
 
281
        // Longitude: Longitude.
 
282
        Longitude float64 `json:"longitude,omitempty"`
 
283
}
 
284
 
 
285
type Schedule struct {
 
286
        // AllDay: Whether the job is scheduled for the whole day. Time of day
 
287
        // in start/end times is ignored if this is true.
 
288
        AllDay bool `json:"allDay,omitempty"`
 
289
 
 
290
        // Duration: Job duration in milliseconds.
 
291
        Duration uint64 `json:"duration,omitempty,string"`
 
292
 
 
293
        // EndTime: Scheduled end time in milliseconds since epoch.
 
294
        EndTime uint64 `json:"endTime,omitempty,string"`
 
295
 
 
296
        // Kind: Identifies this object as a job schedule.
 
297
        Kind string `json:"kind,omitempty"`
 
298
 
 
299
        // StartTime: Scheduled start time in milliseconds since epoch.
 
300
        StartTime uint64 `json:"startTime,omitempty,string"`
 
301
}
 
302
 
 
303
type TokenPagination struct {
 
304
        // Kind: Identifies this object as pagination information.
 
305
        Kind string `json:"kind,omitempty"`
 
306
 
 
307
        // NextPageToken: A token to provide to get the next page of results.
 
308
        NextPageToken string `json:"nextPageToken,omitempty"`
 
309
 
 
310
        // PreviousPageToken: A token to provide to get the previous page of
 
311
        // results.
 
312
        PreviousPageToken string `json:"previousPageToken,omitempty"`
 
313
}
 
314
 
 
315
type Worker struct {
 
316
        // Id: Worker email address.
 
317
        Id string `json:"id,omitempty"`
 
318
 
 
319
        // Kind: Identifies this object as a worker.
 
320
        Kind string `json:"kind,omitempty"`
 
321
}
 
322
 
 
323
type WorkerListResponse struct {
 
324
        // Items: Workers in the collection.
 
325
        Items []*Worker `json:"items,omitempty"`
 
326
 
 
327
        // Kind: Identifies this object as a list of workers.
 
328
        Kind string `json:"kind,omitempty"`
 
329
}
 
330
 
 
331
// method id "coordinate.customFieldDef.list":
 
332
 
 
333
type CustomFieldDefListCall struct {
 
334
        s      *Service
 
335
        teamId string
 
336
        opt_   map[string]interface{}
 
337
}
 
338
 
 
339
// List: Retrieves a list of custom field definitions for a team.
 
340
func (r *CustomFieldDefService) List(teamId string) *CustomFieldDefListCall {
 
341
        c := &CustomFieldDefListCall{s: r.s, opt_: make(map[string]interface{})}
 
342
        c.teamId = teamId
 
343
        return c
 
344
}
 
345
 
 
346
// Fields allows partial responses to be retrieved.
 
347
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
348
// for more information.
 
349
func (c *CustomFieldDefListCall) Fields(s ...googleapi.Field) *CustomFieldDefListCall {
 
350
        c.opt_["fields"] = googleapi.CombineFields(s)
 
351
        return c
 
352
}
 
353
 
 
354
func (c *CustomFieldDefListCall) Do() (*CustomFieldDefListResponse, error) {
 
355
        var body io.Reader = nil
 
356
        params := make(url.Values)
 
357
        params.Set("alt", "json")
 
358
        if v, ok := c.opt_["fields"]; ok {
 
359
                params.Set("fields", fmt.Sprintf("%v", v))
 
360
        }
 
361
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/custom_fields")
 
362
        urls += "?" + params.Encode()
 
363
        req, _ := http.NewRequest("GET", urls, body)
 
364
        googleapi.Expand(req.URL, map[string]string{
 
365
                "teamId": c.teamId,
 
366
        })
 
367
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
368
        res, err := c.s.client.Do(req)
 
369
        if err != nil {
 
370
                return nil, err
 
371
        }
 
372
        defer googleapi.CloseBody(res)
 
373
        if err := googleapi.CheckResponse(res); err != nil {
 
374
                return nil, err
 
375
        }
 
376
        var ret *CustomFieldDefListResponse
 
377
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
378
                return nil, err
 
379
        }
 
380
        return ret, nil
 
381
        // {
 
382
        //   "description": "Retrieves a list of custom field definitions for a team.",
 
383
        //   "httpMethod": "GET",
 
384
        //   "id": "coordinate.customFieldDef.list",
 
385
        //   "parameterOrder": [
 
386
        //     "teamId"
 
387
        //   ],
 
388
        //   "parameters": {
 
389
        //     "teamId": {
 
390
        //       "description": "Team ID",
 
391
        //       "location": "path",
 
392
        //       "required": true,
 
393
        //       "type": "string"
 
394
        //     }
 
395
        //   },
 
396
        //   "path": "{teamId}/custom_fields",
 
397
        //   "response": {
 
398
        //     "$ref": "CustomFieldDefListResponse"
 
399
        //   },
 
400
        //   "scopes": [
 
401
        //     "https://www.googleapis.com/auth/coordinate",
 
402
        //     "https://www.googleapis.com/auth/coordinate.readonly"
 
403
        //   ]
 
404
        // }
 
405
 
 
406
}
 
407
 
 
408
// method id "coordinate.jobs.get":
 
409
 
 
410
type JobsGetCall struct {
 
411
        s      *Service
 
412
        teamId string
 
413
        jobId  uint64
 
414
        opt_   map[string]interface{}
 
415
}
 
416
 
 
417
// Get: Retrieves a job, including all the changes made to the job.
 
418
func (r *JobsService) Get(teamId string, jobId uint64) *JobsGetCall {
 
419
        c := &JobsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
420
        c.teamId = teamId
 
421
        c.jobId = jobId
 
422
        return c
 
423
}
 
424
 
 
425
// Fields allows partial responses to be retrieved.
 
426
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
427
// for more information.
 
428
func (c *JobsGetCall) Fields(s ...googleapi.Field) *JobsGetCall {
 
429
        c.opt_["fields"] = googleapi.CombineFields(s)
 
430
        return c
 
431
}
 
432
 
 
433
func (c *JobsGetCall) Do() (*Job, error) {
 
434
        var body io.Reader = nil
 
435
        params := make(url.Values)
 
436
        params.Set("alt", "json")
 
437
        if v, ok := c.opt_["fields"]; ok {
 
438
                params.Set("fields", fmt.Sprintf("%v", v))
 
439
        }
 
440
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}")
 
441
        urls += "?" + params.Encode()
 
442
        req, _ := http.NewRequest("GET", urls, body)
 
443
        googleapi.Expand(req.URL, map[string]string{
 
444
                "teamId": c.teamId,
 
445
                "jobId":  strconv.FormatUint(c.jobId, 10),
 
446
        })
 
447
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
448
        res, err := c.s.client.Do(req)
 
449
        if err != nil {
 
450
                return nil, err
 
451
        }
 
452
        defer googleapi.CloseBody(res)
 
453
        if err := googleapi.CheckResponse(res); err != nil {
 
454
                return nil, err
 
455
        }
 
456
        var ret *Job
 
457
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
458
                return nil, err
 
459
        }
 
460
        return ret, nil
 
461
        // {
 
462
        //   "description": "Retrieves a job, including all the changes made to the job.",
 
463
        //   "httpMethod": "GET",
 
464
        //   "id": "coordinate.jobs.get",
 
465
        //   "parameterOrder": [
 
466
        //     "teamId",
 
467
        //     "jobId"
 
468
        //   ],
 
469
        //   "parameters": {
 
470
        //     "jobId": {
 
471
        //       "description": "Job number",
 
472
        //       "format": "uint64",
 
473
        //       "location": "path",
 
474
        //       "required": true,
 
475
        //       "type": "string"
 
476
        //     },
 
477
        //     "teamId": {
 
478
        //       "description": "Team ID",
 
479
        //       "location": "path",
 
480
        //       "required": true,
 
481
        //       "type": "string"
 
482
        //     }
 
483
        //   },
 
484
        //   "path": "{teamId}/jobs/{jobId}",
 
485
        //   "response": {
 
486
        //     "$ref": "Job"
 
487
        //   },
 
488
        //   "scopes": [
 
489
        //     "https://www.googleapis.com/auth/coordinate",
 
490
        //     "https://www.googleapis.com/auth/coordinate.readonly"
 
491
        //   ]
 
492
        // }
 
493
 
 
494
}
 
495
 
 
496
// method id "coordinate.jobs.insert":
 
497
 
 
498
type JobsInsertCall struct {
 
499
        s       *Service
 
500
        teamId  string
 
501
        address string
 
502
        lat     float64
 
503
        lng     float64
 
504
        title   string
 
505
        job     *Job
 
506
        opt_    map[string]interface{}
 
507
}
 
508
 
 
509
// Insert: Inserts a new job. Only the state field of the job should be
 
510
// set.
 
511
func (r *JobsService) Insert(teamId string, address string, lat float64, lng float64, title string, job *Job) *JobsInsertCall {
 
512
        c := &JobsInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
513
        c.teamId = teamId
 
514
        c.address = address
 
515
        c.lat = lat
 
516
        c.lng = lng
 
517
        c.title = title
 
518
        c.job = job
 
519
        return c
 
520
}
 
521
 
 
522
// Assignee sets the optional parameter "assignee": Assignee email
 
523
// address, or empty string to unassign.
 
524
func (c *JobsInsertCall) Assignee(assignee string) *JobsInsertCall {
 
525
        c.opt_["assignee"] = assignee
 
526
        return c
 
527
}
 
528
 
 
529
// CustomField sets the optional parameter "customField": Map from
 
530
// custom field id (from /team//custom_fields) to the field value. For
 
531
// example '123=Alice'
 
532
func (c *JobsInsertCall) CustomField(customField string) *JobsInsertCall {
 
533
        c.opt_["customField"] = customField
 
534
        return c
 
535
}
 
536
 
 
537
// CustomerName sets the optional parameter "customerName": Customer
 
538
// name
 
539
func (c *JobsInsertCall) CustomerName(customerName string) *JobsInsertCall {
 
540
        c.opt_["customerName"] = customerName
 
541
        return c
 
542
}
 
543
 
 
544
// CustomerPhoneNumber sets the optional parameter
 
545
// "customerPhoneNumber": Customer phone number
 
546
func (c *JobsInsertCall) CustomerPhoneNumber(customerPhoneNumber string) *JobsInsertCall {
 
547
        c.opt_["customerPhoneNumber"] = customerPhoneNumber
 
548
        return c
 
549
}
 
550
 
 
551
// Note sets the optional parameter "note": Job note as newline (Unix)
 
552
// separated string
 
553
func (c *JobsInsertCall) Note(note string) *JobsInsertCall {
 
554
        c.opt_["note"] = note
 
555
        return c
 
556
}
 
557
 
 
558
// Fields allows partial responses to be retrieved.
 
559
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
560
// for more information.
 
561
func (c *JobsInsertCall) Fields(s ...googleapi.Field) *JobsInsertCall {
 
562
        c.opt_["fields"] = googleapi.CombineFields(s)
 
563
        return c
 
564
}
 
565
 
 
566
func (c *JobsInsertCall) Do() (*Job, error) {
 
567
        var body io.Reader = nil
 
568
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.job)
 
569
        if err != nil {
 
570
                return nil, err
 
571
        }
 
572
        ctype := "application/json"
 
573
        params := make(url.Values)
 
574
        params.Set("alt", "json")
 
575
        params.Set("address", fmt.Sprintf("%v", c.address))
 
576
        params.Set("lat", fmt.Sprintf("%v", c.lat))
 
577
        params.Set("lng", fmt.Sprintf("%v", c.lng))
 
578
        params.Set("title", fmt.Sprintf("%v", c.title))
 
579
        if v, ok := c.opt_["assignee"]; ok {
 
580
                params.Set("assignee", fmt.Sprintf("%v", v))
 
581
        }
 
582
        if v, ok := c.opt_["customField"]; ok {
 
583
                params.Set("customField", fmt.Sprintf("%v", v))
 
584
        }
 
585
        if v, ok := c.opt_["customerName"]; ok {
 
586
                params.Set("customerName", fmt.Sprintf("%v", v))
 
587
        }
 
588
        if v, ok := c.opt_["customerPhoneNumber"]; ok {
 
589
                params.Set("customerPhoneNumber", fmt.Sprintf("%v", v))
 
590
        }
 
591
        if v, ok := c.opt_["note"]; ok {
 
592
                params.Set("note", fmt.Sprintf("%v", v))
 
593
        }
 
594
        if v, ok := c.opt_["fields"]; ok {
 
595
                params.Set("fields", fmt.Sprintf("%v", v))
 
596
        }
 
597
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs")
 
598
        urls += "?" + params.Encode()
 
599
        req, _ := http.NewRequest("POST", urls, body)
 
600
        googleapi.Expand(req.URL, map[string]string{
 
601
                "teamId": c.teamId,
 
602
        })
 
603
        req.Header.Set("Content-Type", ctype)
 
604
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
605
        res, err := c.s.client.Do(req)
 
606
        if err != nil {
 
607
                return nil, err
 
608
        }
 
609
        defer googleapi.CloseBody(res)
 
610
        if err := googleapi.CheckResponse(res); err != nil {
 
611
                return nil, err
 
612
        }
 
613
        var ret *Job
 
614
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
615
                return nil, err
 
616
        }
 
617
        return ret, nil
 
618
        // {
 
619
        //   "description": "Inserts a new job. Only the state field of the job should be set.",
 
620
        //   "httpMethod": "POST",
 
621
        //   "id": "coordinate.jobs.insert",
 
622
        //   "parameterOrder": [
 
623
        //     "teamId",
 
624
        //     "address",
 
625
        //     "lat",
 
626
        //     "lng",
 
627
        //     "title"
 
628
        //   ],
 
629
        //   "parameters": {
 
630
        //     "address": {
 
631
        //       "description": "Job address as newline (Unix) separated string",
 
632
        //       "location": "query",
 
633
        //       "required": true,
 
634
        //       "type": "string"
 
635
        //     },
 
636
        //     "assignee": {
 
637
        //       "description": "Assignee email address, or empty string to unassign.",
 
638
        //       "location": "query",
 
639
        //       "type": "string"
 
640
        //     },
 
641
        //     "customField": {
 
642
        //       "description": "Map from custom field id (from /team//custom_fields) to the field value. For example '123=Alice'",
 
643
        //       "location": "query",
 
644
        //       "repeated": true,
 
645
        //       "type": "string"
 
646
        //     },
 
647
        //     "customerName": {
 
648
        //       "description": "Customer name",
 
649
        //       "location": "query",
 
650
        //       "type": "string"
 
651
        //     },
 
652
        //     "customerPhoneNumber": {
 
653
        //       "description": "Customer phone number",
 
654
        //       "location": "query",
 
655
        //       "type": "string"
 
656
        //     },
 
657
        //     "lat": {
 
658
        //       "description": "The latitude coordinate of this job's location.",
 
659
        //       "format": "double",
 
660
        //       "location": "query",
 
661
        //       "required": true,
 
662
        //       "type": "number"
 
663
        //     },
 
664
        //     "lng": {
 
665
        //       "description": "The longitude coordinate of this job's location.",
 
666
        //       "format": "double",
 
667
        //       "location": "query",
 
668
        //       "required": true,
 
669
        //       "type": "number"
 
670
        //     },
 
671
        //     "note": {
 
672
        //       "description": "Job note as newline (Unix) separated string",
 
673
        //       "location": "query",
 
674
        //       "type": "string"
 
675
        //     },
 
676
        //     "teamId": {
 
677
        //       "description": "Team ID",
 
678
        //       "location": "path",
 
679
        //       "required": true,
 
680
        //       "type": "string"
 
681
        //     },
 
682
        //     "title": {
 
683
        //       "description": "Job title",
 
684
        //       "location": "query",
 
685
        //       "required": true,
 
686
        //       "type": "string"
 
687
        //     }
 
688
        //   },
 
689
        //   "path": "{teamId}/jobs",
 
690
        //   "request": {
 
691
        //     "$ref": "Job"
 
692
        //   },
 
693
        //   "response": {
 
694
        //     "$ref": "Job"
 
695
        //   },
 
696
        //   "scopes": [
 
697
        //     "https://www.googleapis.com/auth/coordinate"
 
698
        //   ]
 
699
        // }
 
700
 
 
701
}
 
702
 
 
703
// method id "coordinate.jobs.list":
 
704
 
 
705
type JobsListCall struct {
 
706
        s      *Service
 
707
        teamId string
 
708
        opt_   map[string]interface{}
 
709
}
 
710
 
 
711
// List: Retrieves jobs created or modified since the given timestamp.
 
712
func (r *JobsService) List(teamId string) *JobsListCall {
 
713
        c := &JobsListCall{s: r.s, opt_: make(map[string]interface{})}
 
714
        c.teamId = teamId
 
715
        return c
 
716
}
 
717
 
 
718
// MaxResults sets the optional parameter "maxResults": Maximum number
 
719
// of results to return in one page.
 
720
func (c *JobsListCall) MaxResults(maxResults int64) *JobsListCall {
 
721
        c.opt_["maxResults"] = maxResults
 
722
        return c
 
723
}
 
724
 
 
725
// MinModifiedTimestampMs sets the optional parameter
 
726
// "minModifiedTimestampMs": Minimum time a job was modified in
 
727
// milliseconds since epoch.
 
728
func (c *JobsListCall) MinModifiedTimestampMs(minModifiedTimestampMs uint64) *JobsListCall {
 
729
        c.opt_["minModifiedTimestampMs"] = minModifiedTimestampMs
 
730
        return c
 
731
}
 
732
 
 
733
// PageToken sets the optional parameter "pageToken": Continuation token
 
734
func (c *JobsListCall) PageToken(pageToken string) *JobsListCall {
 
735
        c.opt_["pageToken"] = pageToken
 
736
        return c
 
737
}
 
738
 
 
739
// Fields allows partial responses to be retrieved.
 
740
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
741
// for more information.
 
742
func (c *JobsListCall) Fields(s ...googleapi.Field) *JobsListCall {
 
743
        c.opt_["fields"] = googleapi.CombineFields(s)
 
744
        return c
 
745
}
 
746
 
 
747
func (c *JobsListCall) Do() (*JobListResponse, error) {
 
748
        var body io.Reader = nil
 
749
        params := make(url.Values)
 
750
        params.Set("alt", "json")
 
751
        if v, ok := c.opt_["maxResults"]; ok {
 
752
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
753
        }
 
754
        if v, ok := c.opt_["minModifiedTimestampMs"]; ok {
 
755
                params.Set("minModifiedTimestampMs", fmt.Sprintf("%v", v))
 
756
        }
 
757
        if v, ok := c.opt_["pageToken"]; ok {
 
758
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
759
        }
 
760
        if v, ok := c.opt_["fields"]; ok {
 
761
                params.Set("fields", fmt.Sprintf("%v", v))
 
762
        }
 
763
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs")
 
764
        urls += "?" + params.Encode()
 
765
        req, _ := http.NewRequest("GET", urls, body)
 
766
        googleapi.Expand(req.URL, map[string]string{
 
767
                "teamId": c.teamId,
 
768
        })
 
769
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
770
        res, err := c.s.client.Do(req)
 
771
        if err != nil {
 
772
                return nil, err
 
773
        }
 
774
        defer googleapi.CloseBody(res)
 
775
        if err := googleapi.CheckResponse(res); err != nil {
 
776
                return nil, err
 
777
        }
 
778
        var ret *JobListResponse
 
779
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
780
                return nil, err
 
781
        }
 
782
        return ret, nil
 
783
        // {
 
784
        //   "description": "Retrieves jobs created or modified since the given timestamp.",
 
785
        //   "httpMethod": "GET",
 
786
        //   "id": "coordinate.jobs.list",
 
787
        //   "parameterOrder": [
 
788
        //     "teamId"
 
789
        //   ],
 
790
        //   "parameters": {
 
791
        //     "maxResults": {
 
792
        //       "description": "Maximum number of results to return in one page.",
 
793
        //       "format": "uint32",
 
794
        //       "location": "query",
 
795
        //       "type": "integer"
 
796
        //     },
 
797
        //     "minModifiedTimestampMs": {
 
798
        //       "description": "Minimum time a job was modified in milliseconds since epoch.",
 
799
        //       "format": "uint64",
 
800
        //       "location": "query",
 
801
        //       "type": "string"
 
802
        //     },
 
803
        //     "pageToken": {
 
804
        //       "description": "Continuation token",
 
805
        //       "location": "query",
 
806
        //       "type": "string"
 
807
        //     },
 
808
        //     "teamId": {
 
809
        //       "description": "Team ID",
 
810
        //       "location": "path",
 
811
        //       "required": true,
 
812
        //       "type": "string"
 
813
        //     }
 
814
        //   },
 
815
        //   "path": "{teamId}/jobs",
 
816
        //   "response": {
 
817
        //     "$ref": "JobListResponse"
 
818
        //   },
 
819
        //   "scopes": [
 
820
        //     "https://www.googleapis.com/auth/coordinate",
 
821
        //     "https://www.googleapis.com/auth/coordinate.readonly"
 
822
        //   ]
 
823
        // }
 
824
 
 
825
}
 
826
 
 
827
// method id "coordinate.jobs.patch":
 
828
 
 
829
type JobsPatchCall struct {
 
830
        s      *Service
 
831
        teamId string
 
832
        jobId  uint64
 
833
        job    *Job
 
834
        opt_   map[string]interface{}
 
835
}
 
836
 
 
837
// Patch: Updates a job. Fields that are set in the job state will be
 
838
// updated. This method supports patch semantics.
 
839
func (r *JobsService) Patch(teamId string, jobId uint64, job *Job) *JobsPatchCall {
 
840
        c := &JobsPatchCall{s: r.s, opt_: make(map[string]interface{})}
 
841
        c.teamId = teamId
 
842
        c.jobId = jobId
 
843
        c.job = job
 
844
        return c
 
845
}
 
846
 
 
847
// Address sets the optional parameter "address": Job address as newline
 
848
// (Unix) separated string
 
849
func (c *JobsPatchCall) Address(address string) *JobsPatchCall {
 
850
        c.opt_["address"] = address
 
851
        return c
 
852
}
 
853
 
 
854
// Assignee sets the optional parameter "assignee": Assignee email
 
855
// address, or empty string to unassign.
 
856
func (c *JobsPatchCall) Assignee(assignee string) *JobsPatchCall {
 
857
        c.opt_["assignee"] = assignee
 
858
        return c
 
859
}
 
860
 
 
861
// CustomField sets the optional parameter "customField": Map from
 
862
// custom field id (from /team//custom_fields) to the field value. For
 
863
// example '123=Alice'
 
864
func (c *JobsPatchCall) CustomField(customField string) *JobsPatchCall {
 
865
        c.opt_["customField"] = customField
 
866
        return c
 
867
}
 
868
 
 
869
// CustomerName sets the optional parameter "customerName": Customer
 
870
// name
 
871
func (c *JobsPatchCall) CustomerName(customerName string) *JobsPatchCall {
 
872
        c.opt_["customerName"] = customerName
 
873
        return c
 
874
}
 
875
 
 
876
// CustomerPhoneNumber sets the optional parameter
 
877
// "customerPhoneNumber": Customer phone number
 
878
func (c *JobsPatchCall) CustomerPhoneNumber(customerPhoneNumber string) *JobsPatchCall {
 
879
        c.opt_["customerPhoneNumber"] = customerPhoneNumber
 
880
        return c
 
881
}
 
882
 
 
883
// Lat sets the optional parameter "lat": The latitude coordinate of
 
884
// this job's location.
 
885
func (c *JobsPatchCall) Lat(lat float64) *JobsPatchCall {
 
886
        c.opt_["lat"] = lat
 
887
        return c
 
888
}
 
889
 
 
890
// Lng sets the optional parameter "lng": The longitude coordinate of
 
891
// this job's location.
 
892
func (c *JobsPatchCall) Lng(lng float64) *JobsPatchCall {
 
893
        c.opt_["lng"] = lng
 
894
        return c
 
895
}
 
896
 
 
897
// Note sets the optional parameter "note": Job note as newline (Unix)
 
898
// separated string
 
899
func (c *JobsPatchCall) Note(note string) *JobsPatchCall {
 
900
        c.opt_["note"] = note
 
901
        return c
 
902
}
 
903
 
 
904
// Progress sets the optional parameter "progress": Job progress
 
905
func (c *JobsPatchCall) Progress(progress string) *JobsPatchCall {
 
906
        c.opt_["progress"] = progress
 
907
        return c
 
908
}
 
909
 
 
910
// Title sets the optional parameter "title": Job title
 
911
func (c *JobsPatchCall) Title(title string) *JobsPatchCall {
 
912
        c.opt_["title"] = title
 
913
        return c
 
914
}
 
915
 
 
916
// Fields allows partial responses to be retrieved.
 
917
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
918
// for more information.
 
919
func (c *JobsPatchCall) Fields(s ...googleapi.Field) *JobsPatchCall {
 
920
        c.opt_["fields"] = googleapi.CombineFields(s)
 
921
        return c
 
922
}
 
923
 
 
924
func (c *JobsPatchCall) Do() (*Job, error) {
 
925
        var body io.Reader = nil
 
926
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.job)
 
927
        if err != nil {
 
928
                return nil, err
 
929
        }
 
930
        ctype := "application/json"
 
931
        params := make(url.Values)
 
932
        params.Set("alt", "json")
 
933
        if v, ok := c.opt_["address"]; ok {
 
934
                params.Set("address", fmt.Sprintf("%v", v))
 
935
        }
 
936
        if v, ok := c.opt_["assignee"]; ok {
 
937
                params.Set("assignee", fmt.Sprintf("%v", v))
 
938
        }
 
939
        if v, ok := c.opt_["customField"]; ok {
 
940
                params.Set("customField", fmt.Sprintf("%v", v))
 
941
        }
 
942
        if v, ok := c.opt_["customerName"]; ok {
 
943
                params.Set("customerName", fmt.Sprintf("%v", v))
 
944
        }
 
945
        if v, ok := c.opt_["customerPhoneNumber"]; ok {
 
946
                params.Set("customerPhoneNumber", fmt.Sprintf("%v", v))
 
947
        }
 
948
        if v, ok := c.opt_["lat"]; ok {
 
949
                params.Set("lat", fmt.Sprintf("%v", v))
 
950
        }
 
951
        if v, ok := c.opt_["lng"]; ok {
 
952
                params.Set("lng", fmt.Sprintf("%v", v))
 
953
        }
 
954
        if v, ok := c.opt_["note"]; ok {
 
955
                params.Set("note", fmt.Sprintf("%v", v))
 
956
        }
 
957
        if v, ok := c.opt_["progress"]; ok {
 
958
                params.Set("progress", fmt.Sprintf("%v", v))
 
959
        }
 
960
        if v, ok := c.opt_["title"]; ok {
 
961
                params.Set("title", fmt.Sprintf("%v", v))
 
962
        }
 
963
        if v, ok := c.opt_["fields"]; ok {
 
964
                params.Set("fields", fmt.Sprintf("%v", v))
 
965
        }
 
966
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}")
 
967
        urls += "?" + params.Encode()
 
968
        req, _ := http.NewRequest("PATCH", urls, body)
 
969
        googleapi.Expand(req.URL, map[string]string{
 
970
                "teamId": c.teamId,
 
971
                "jobId":  strconv.FormatUint(c.jobId, 10),
 
972
        })
 
973
        req.Header.Set("Content-Type", ctype)
 
974
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
975
        res, err := c.s.client.Do(req)
 
976
        if err != nil {
 
977
                return nil, err
 
978
        }
 
979
        defer googleapi.CloseBody(res)
 
980
        if err := googleapi.CheckResponse(res); err != nil {
 
981
                return nil, err
 
982
        }
 
983
        var ret *Job
 
984
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
985
                return nil, err
 
986
        }
 
987
        return ret, nil
 
988
        // {
 
989
        //   "description": "Updates a job. Fields that are set in the job state will be updated. This method supports patch semantics.",
 
990
        //   "httpMethod": "PATCH",
 
991
        //   "id": "coordinate.jobs.patch",
 
992
        //   "parameterOrder": [
 
993
        //     "teamId",
 
994
        //     "jobId"
 
995
        //   ],
 
996
        //   "parameters": {
 
997
        //     "address": {
 
998
        //       "description": "Job address as newline (Unix) separated string",
 
999
        //       "location": "query",
 
1000
        //       "type": "string"
 
1001
        //     },
 
1002
        //     "assignee": {
 
1003
        //       "description": "Assignee email address, or empty string to unassign.",
 
1004
        //       "location": "query",
 
1005
        //       "type": "string"
 
1006
        //     },
 
1007
        //     "customField": {
 
1008
        //       "description": "Map from custom field id (from /team//custom_fields) to the field value. For example '123=Alice'",
 
1009
        //       "location": "query",
 
1010
        //       "repeated": true,
 
1011
        //       "type": "string"
 
1012
        //     },
 
1013
        //     "customerName": {
 
1014
        //       "description": "Customer name",
 
1015
        //       "location": "query",
 
1016
        //       "type": "string"
 
1017
        //     },
 
1018
        //     "customerPhoneNumber": {
 
1019
        //       "description": "Customer phone number",
 
1020
        //       "location": "query",
 
1021
        //       "type": "string"
 
1022
        //     },
 
1023
        //     "jobId": {
 
1024
        //       "description": "Job number",
 
1025
        //       "format": "uint64",
 
1026
        //       "location": "path",
 
1027
        //       "required": true,
 
1028
        //       "type": "string"
 
1029
        //     },
 
1030
        //     "lat": {
 
1031
        //       "description": "The latitude coordinate of this job's location.",
 
1032
        //       "format": "double",
 
1033
        //       "location": "query",
 
1034
        //       "type": "number"
 
1035
        //     },
 
1036
        //     "lng": {
 
1037
        //       "description": "The longitude coordinate of this job's location.",
 
1038
        //       "format": "double",
 
1039
        //       "location": "query",
 
1040
        //       "type": "number"
 
1041
        //     },
 
1042
        //     "note": {
 
1043
        //       "description": "Job note as newline (Unix) separated string",
 
1044
        //       "location": "query",
 
1045
        //       "type": "string"
 
1046
        //     },
 
1047
        //     "progress": {
 
1048
        //       "description": "Job progress",
 
1049
        //       "enum": [
 
1050
        //         "COMPLETED",
 
1051
        //         "IN_PROGRESS",
 
1052
        //         "NOT_ACCEPTED",
 
1053
        //         "NOT_STARTED",
 
1054
        //         "OBSOLETE"
 
1055
        //       ],
 
1056
        //       "enumDescriptions": [
 
1057
        //         "Completed",
 
1058
        //         "In progress",
 
1059
        //         "Not accepted",
 
1060
        //         "Not started",
 
1061
        //         "Obsolete"
 
1062
        //       ],
 
1063
        //       "location": "query",
 
1064
        //       "type": "string"
 
1065
        //     },
 
1066
        //     "teamId": {
 
1067
        //       "description": "Team ID",
 
1068
        //       "location": "path",
 
1069
        //       "required": true,
 
1070
        //       "type": "string"
 
1071
        //     },
 
1072
        //     "title": {
 
1073
        //       "description": "Job title",
 
1074
        //       "location": "query",
 
1075
        //       "type": "string"
 
1076
        //     }
 
1077
        //   },
 
1078
        //   "path": "{teamId}/jobs/{jobId}",
 
1079
        //   "request": {
 
1080
        //     "$ref": "Job"
 
1081
        //   },
 
1082
        //   "response": {
 
1083
        //     "$ref": "Job"
 
1084
        //   },
 
1085
        //   "scopes": [
 
1086
        //     "https://www.googleapis.com/auth/coordinate"
 
1087
        //   ]
 
1088
        // }
 
1089
 
 
1090
}
 
1091
 
 
1092
// method id "coordinate.jobs.update":
 
1093
 
 
1094
type JobsUpdateCall struct {
 
1095
        s      *Service
 
1096
        teamId string
 
1097
        jobId  uint64
 
1098
        job    *Job
 
1099
        opt_   map[string]interface{}
 
1100
}
 
1101
 
 
1102
// Update: Updates a job. Fields that are set in the job state will be
 
1103
// updated.
 
1104
func (r *JobsService) Update(teamId string, jobId uint64, job *Job) *JobsUpdateCall {
 
1105
        c := &JobsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
 
1106
        c.teamId = teamId
 
1107
        c.jobId = jobId
 
1108
        c.job = job
 
1109
        return c
 
1110
}
 
1111
 
 
1112
// Address sets the optional parameter "address": Job address as newline
 
1113
// (Unix) separated string
 
1114
func (c *JobsUpdateCall) Address(address string) *JobsUpdateCall {
 
1115
        c.opt_["address"] = address
 
1116
        return c
 
1117
}
 
1118
 
 
1119
// Assignee sets the optional parameter "assignee": Assignee email
 
1120
// address, or empty string to unassign.
 
1121
func (c *JobsUpdateCall) Assignee(assignee string) *JobsUpdateCall {
 
1122
        c.opt_["assignee"] = assignee
 
1123
        return c
 
1124
}
 
1125
 
 
1126
// CustomField sets the optional parameter "customField": Map from
 
1127
// custom field id (from /team//custom_fields) to the field value. For
 
1128
// example '123=Alice'
 
1129
func (c *JobsUpdateCall) CustomField(customField string) *JobsUpdateCall {
 
1130
        c.opt_["customField"] = customField
 
1131
        return c
 
1132
}
 
1133
 
 
1134
// CustomerName sets the optional parameter "customerName": Customer
 
1135
// name
 
1136
func (c *JobsUpdateCall) CustomerName(customerName string) *JobsUpdateCall {
 
1137
        c.opt_["customerName"] = customerName
 
1138
        return c
 
1139
}
 
1140
 
 
1141
// CustomerPhoneNumber sets the optional parameter
 
1142
// "customerPhoneNumber": Customer phone number
 
1143
func (c *JobsUpdateCall) CustomerPhoneNumber(customerPhoneNumber string) *JobsUpdateCall {
 
1144
        c.opt_["customerPhoneNumber"] = customerPhoneNumber
 
1145
        return c
 
1146
}
 
1147
 
 
1148
// Lat sets the optional parameter "lat": The latitude coordinate of
 
1149
// this job's location.
 
1150
func (c *JobsUpdateCall) Lat(lat float64) *JobsUpdateCall {
 
1151
        c.opt_["lat"] = lat
 
1152
        return c
 
1153
}
 
1154
 
 
1155
// Lng sets the optional parameter "lng": The longitude coordinate of
 
1156
// this job's location.
 
1157
func (c *JobsUpdateCall) Lng(lng float64) *JobsUpdateCall {
 
1158
        c.opt_["lng"] = lng
 
1159
        return c
 
1160
}
 
1161
 
 
1162
// Note sets the optional parameter "note": Job note as newline (Unix)
 
1163
// separated string
 
1164
func (c *JobsUpdateCall) Note(note string) *JobsUpdateCall {
 
1165
        c.opt_["note"] = note
 
1166
        return c
 
1167
}
 
1168
 
 
1169
// Progress sets the optional parameter "progress": Job progress
 
1170
func (c *JobsUpdateCall) Progress(progress string) *JobsUpdateCall {
 
1171
        c.opt_["progress"] = progress
 
1172
        return c
 
1173
}
 
1174
 
 
1175
// Title sets the optional parameter "title": Job title
 
1176
func (c *JobsUpdateCall) Title(title string) *JobsUpdateCall {
 
1177
        c.opt_["title"] = title
 
1178
        return c
 
1179
}
 
1180
 
 
1181
// Fields allows partial responses to be retrieved.
 
1182
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1183
// for more information.
 
1184
func (c *JobsUpdateCall) Fields(s ...googleapi.Field) *JobsUpdateCall {
 
1185
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1186
        return c
 
1187
}
 
1188
 
 
1189
func (c *JobsUpdateCall) Do() (*Job, error) {
 
1190
        var body io.Reader = nil
 
1191
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.job)
 
1192
        if err != nil {
 
1193
                return nil, err
 
1194
        }
 
1195
        ctype := "application/json"
 
1196
        params := make(url.Values)
 
1197
        params.Set("alt", "json")
 
1198
        if v, ok := c.opt_["address"]; ok {
 
1199
                params.Set("address", fmt.Sprintf("%v", v))
 
1200
        }
 
1201
        if v, ok := c.opt_["assignee"]; ok {
 
1202
                params.Set("assignee", fmt.Sprintf("%v", v))
 
1203
        }
 
1204
        if v, ok := c.opt_["customField"]; ok {
 
1205
                params.Set("customField", fmt.Sprintf("%v", v))
 
1206
        }
 
1207
        if v, ok := c.opt_["customerName"]; ok {
 
1208
                params.Set("customerName", fmt.Sprintf("%v", v))
 
1209
        }
 
1210
        if v, ok := c.opt_["customerPhoneNumber"]; ok {
 
1211
                params.Set("customerPhoneNumber", fmt.Sprintf("%v", v))
 
1212
        }
 
1213
        if v, ok := c.opt_["lat"]; ok {
 
1214
                params.Set("lat", fmt.Sprintf("%v", v))
 
1215
        }
 
1216
        if v, ok := c.opt_["lng"]; ok {
 
1217
                params.Set("lng", fmt.Sprintf("%v", v))
 
1218
        }
 
1219
        if v, ok := c.opt_["note"]; ok {
 
1220
                params.Set("note", fmt.Sprintf("%v", v))
 
1221
        }
 
1222
        if v, ok := c.opt_["progress"]; ok {
 
1223
                params.Set("progress", fmt.Sprintf("%v", v))
 
1224
        }
 
1225
        if v, ok := c.opt_["title"]; ok {
 
1226
                params.Set("title", fmt.Sprintf("%v", v))
 
1227
        }
 
1228
        if v, ok := c.opt_["fields"]; ok {
 
1229
                params.Set("fields", fmt.Sprintf("%v", v))
 
1230
        }
 
1231
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}")
 
1232
        urls += "?" + params.Encode()
 
1233
        req, _ := http.NewRequest("PUT", urls, body)
 
1234
        googleapi.Expand(req.URL, map[string]string{
 
1235
                "teamId": c.teamId,
 
1236
                "jobId":  strconv.FormatUint(c.jobId, 10),
 
1237
        })
 
1238
        req.Header.Set("Content-Type", ctype)
 
1239
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1240
        res, err := c.s.client.Do(req)
 
1241
        if err != nil {
 
1242
                return nil, err
 
1243
        }
 
1244
        defer googleapi.CloseBody(res)
 
1245
        if err := googleapi.CheckResponse(res); err != nil {
 
1246
                return nil, err
 
1247
        }
 
1248
        var ret *Job
 
1249
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1250
                return nil, err
 
1251
        }
 
1252
        return ret, nil
 
1253
        // {
 
1254
        //   "description": "Updates a job. Fields that are set in the job state will be updated.",
 
1255
        //   "httpMethod": "PUT",
 
1256
        //   "id": "coordinate.jobs.update",
 
1257
        //   "parameterOrder": [
 
1258
        //     "teamId",
 
1259
        //     "jobId"
 
1260
        //   ],
 
1261
        //   "parameters": {
 
1262
        //     "address": {
 
1263
        //       "description": "Job address as newline (Unix) separated string",
 
1264
        //       "location": "query",
 
1265
        //       "type": "string"
 
1266
        //     },
 
1267
        //     "assignee": {
 
1268
        //       "description": "Assignee email address, or empty string to unassign.",
 
1269
        //       "location": "query",
 
1270
        //       "type": "string"
 
1271
        //     },
 
1272
        //     "customField": {
 
1273
        //       "description": "Map from custom field id (from /team//custom_fields) to the field value. For example '123=Alice'",
 
1274
        //       "location": "query",
 
1275
        //       "repeated": true,
 
1276
        //       "type": "string"
 
1277
        //     },
 
1278
        //     "customerName": {
 
1279
        //       "description": "Customer name",
 
1280
        //       "location": "query",
 
1281
        //       "type": "string"
 
1282
        //     },
 
1283
        //     "customerPhoneNumber": {
 
1284
        //       "description": "Customer phone number",
 
1285
        //       "location": "query",
 
1286
        //       "type": "string"
 
1287
        //     },
 
1288
        //     "jobId": {
 
1289
        //       "description": "Job number",
 
1290
        //       "format": "uint64",
 
1291
        //       "location": "path",
 
1292
        //       "required": true,
 
1293
        //       "type": "string"
 
1294
        //     },
 
1295
        //     "lat": {
 
1296
        //       "description": "The latitude coordinate of this job's location.",
 
1297
        //       "format": "double",
 
1298
        //       "location": "query",
 
1299
        //       "type": "number"
 
1300
        //     },
 
1301
        //     "lng": {
 
1302
        //       "description": "The longitude coordinate of this job's location.",
 
1303
        //       "format": "double",
 
1304
        //       "location": "query",
 
1305
        //       "type": "number"
 
1306
        //     },
 
1307
        //     "note": {
 
1308
        //       "description": "Job note as newline (Unix) separated string",
 
1309
        //       "location": "query",
 
1310
        //       "type": "string"
 
1311
        //     },
 
1312
        //     "progress": {
 
1313
        //       "description": "Job progress",
 
1314
        //       "enum": [
 
1315
        //         "COMPLETED",
 
1316
        //         "IN_PROGRESS",
 
1317
        //         "NOT_ACCEPTED",
 
1318
        //         "NOT_STARTED",
 
1319
        //         "OBSOLETE"
 
1320
        //       ],
 
1321
        //       "enumDescriptions": [
 
1322
        //         "Completed",
 
1323
        //         "In progress",
 
1324
        //         "Not accepted",
 
1325
        //         "Not started",
 
1326
        //         "Obsolete"
 
1327
        //       ],
 
1328
        //       "location": "query",
 
1329
        //       "type": "string"
 
1330
        //     },
 
1331
        //     "teamId": {
 
1332
        //       "description": "Team ID",
 
1333
        //       "location": "path",
 
1334
        //       "required": true,
 
1335
        //       "type": "string"
 
1336
        //     },
 
1337
        //     "title": {
 
1338
        //       "description": "Job title",
 
1339
        //       "location": "query",
 
1340
        //       "type": "string"
 
1341
        //     }
 
1342
        //   },
 
1343
        //   "path": "{teamId}/jobs/{jobId}",
 
1344
        //   "request": {
 
1345
        //     "$ref": "Job"
 
1346
        //   },
 
1347
        //   "response": {
 
1348
        //     "$ref": "Job"
 
1349
        //   },
 
1350
        //   "scopes": [
 
1351
        //     "https://www.googleapis.com/auth/coordinate"
 
1352
        //   ]
 
1353
        // }
 
1354
 
 
1355
}
 
1356
 
 
1357
// method id "coordinate.location.list":
 
1358
 
 
1359
type LocationListCall struct {
 
1360
        s                *Service
 
1361
        teamId           string
 
1362
        workerEmail      string
 
1363
        startTimestampMs uint64
 
1364
        opt_             map[string]interface{}
 
1365
}
 
1366
 
 
1367
// List: Retrieves a list of locations for a worker.
 
1368
func (r *LocationService) List(teamId string, workerEmail string, startTimestampMs uint64) *LocationListCall {
 
1369
        c := &LocationListCall{s: r.s, opt_: make(map[string]interface{})}
 
1370
        c.teamId = teamId
 
1371
        c.workerEmail = workerEmail
 
1372
        c.startTimestampMs = startTimestampMs
 
1373
        return c
 
1374
}
 
1375
 
 
1376
// MaxResults sets the optional parameter "maxResults": Maximum number
 
1377
// of results to return in one page.
 
1378
func (c *LocationListCall) MaxResults(maxResults int64) *LocationListCall {
 
1379
        c.opt_["maxResults"] = maxResults
 
1380
        return c
 
1381
}
 
1382
 
 
1383
// PageToken sets the optional parameter "pageToken": Continuation token
 
1384
func (c *LocationListCall) PageToken(pageToken string) *LocationListCall {
 
1385
        c.opt_["pageToken"] = pageToken
 
1386
        return c
 
1387
}
 
1388
 
 
1389
// Fields allows partial responses to be retrieved.
 
1390
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1391
// for more information.
 
1392
func (c *LocationListCall) Fields(s ...googleapi.Field) *LocationListCall {
 
1393
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1394
        return c
 
1395
}
 
1396
 
 
1397
func (c *LocationListCall) Do() (*LocationListResponse, error) {
 
1398
        var body io.Reader = nil
 
1399
        params := make(url.Values)
 
1400
        params.Set("alt", "json")
 
1401
        params.Set("startTimestampMs", fmt.Sprintf("%v", c.startTimestampMs))
 
1402
        if v, ok := c.opt_["maxResults"]; ok {
 
1403
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
1404
        }
 
1405
        if v, ok := c.opt_["pageToken"]; ok {
 
1406
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
1407
        }
 
1408
        if v, ok := c.opt_["fields"]; ok {
 
1409
                params.Set("fields", fmt.Sprintf("%v", v))
 
1410
        }
 
1411
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/workers/{workerEmail}/locations")
 
1412
        urls += "?" + params.Encode()
 
1413
        req, _ := http.NewRequest("GET", urls, body)
 
1414
        googleapi.Expand(req.URL, map[string]string{
 
1415
                "teamId":      c.teamId,
 
1416
                "workerEmail": c.workerEmail,
 
1417
        })
 
1418
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1419
        res, err := c.s.client.Do(req)
 
1420
        if err != nil {
 
1421
                return nil, err
 
1422
        }
 
1423
        defer googleapi.CloseBody(res)
 
1424
        if err := googleapi.CheckResponse(res); err != nil {
 
1425
                return nil, err
 
1426
        }
 
1427
        var ret *LocationListResponse
 
1428
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1429
                return nil, err
 
1430
        }
 
1431
        return ret, nil
 
1432
        // {
 
1433
        //   "description": "Retrieves a list of locations for a worker.",
 
1434
        //   "httpMethod": "GET",
 
1435
        //   "id": "coordinate.location.list",
 
1436
        //   "parameterOrder": [
 
1437
        //     "teamId",
 
1438
        //     "workerEmail",
 
1439
        //     "startTimestampMs"
 
1440
        //   ],
 
1441
        //   "parameters": {
 
1442
        //     "maxResults": {
 
1443
        //       "description": "Maximum number of results to return in one page.",
 
1444
        //       "format": "uint32",
 
1445
        //       "location": "query",
 
1446
        //       "type": "integer"
 
1447
        //     },
 
1448
        //     "pageToken": {
 
1449
        //       "description": "Continuation token",
 
1450
        //       "location": "query",
 
1451
        //       "type": "string"
 
1452
        //     },
 
1453
        //     "startTimestampMs": {
 
1454
        //       "description": "Start timestamp in milliseconds since the epoch.",
 
1455
        //       "format": "uint64",
 
1456
        //       "location": "query",
 
1457
        //       "required": true,
 
1458
        //       "type": "string"
 
1459
        //     },
 
1460
        //     "teamId": {
 
1461
        //       "description": "Team ID",
 
1462
        //       "location": "path",
 
1463
        //       "required": true,
 
1464
        //       "type": "string"
 
1465
        //     },
 
1466
        //     "workerEmail": {
 
1467
        //       "description": "Worker email address.",
 
1468
        //       "location": "path",
 
1469
        //       "required": true,
 
1470
        //       "type": "string"
 
1471
        //     }
 
1472
        //   },
 
1473
        //   "path": "{teamId}/workers/{workerEmail}/locations",
 
1474
        //   "response": {
 
1475
        //     "$ref": "LocationListResponse"
 
1476
        //   },
 
1477
        //   "scopes": [
 
1478
        //     "https://www.googleapis.com/auth/coordinate",
 
1479
        //     "https://www.googleapis.com/auth/coordinate.readonly"
 
1480
        //   ]
 
1481
        // }
 
1482
 
 
1483
}
 
1484
 
 
1485
// method id "coordinate.schedule.get":
 
1486
 
 
1487
type ScheduleGetCall struct {
 
1488
        s      *Service
 
1489
        teamId string
 
1490
        jobId  uint64
 
1491
        opt_   map[string]interface{}
 
1492
}
 
1493
 
 
1494
// Get: Retrieves the schedule for a job.
 
1495
func (r *ScheduleService) Get(teamId string, jobId uint64) *ScheduleGetCall {
 
1496
        c := &ScheduleGetCall{s: r.s, opt_: make(map[string]interface{})}
 
1497
        c.teamId = teamId
 
1498
        c.jobId = jobId
 
1499
        return c
 
1500
}
 
1501
 
 
1502
// Fields allows partial responses to be retrieved.
 
1503
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1504
// for more information.
 
1505
func (c *ScheduleGetCall) Fields(s ...googleapi.Field) *ScheduleGetCall {
 
1506
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1507
        return c
 
1508
}
 
1509
 
 
1510
func (c *ScheduleGetCall) Do() (*Schedule, error) {
 
1511
        var body io.Reader = nil
 
1512
        params := make(url.Values)
 
1513
        params.Set("alt", "json")
 
1514
        if v, ok := c.opt_["fields"]; ok {
 
1515
                params.Set("fields", fmt.Sprintf("%v", v))
 
1516
        }
 
1517
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}/schedule")
 
1518
        urls += "?" + params.Encode()
 
1519
        req, _ := http.NewRequest("GET", urls, body)
 
1520
        googleapi.Expand(req.URL, map[string]string{
 
1521
                "teamId": c.teamId,
 
1522
                "jobId":  strconv.FormatUint(c.jobId, 10),
 
1523
        })
 
1524
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1525
        res, err := c.s.client.Do(req)
 
1526
        if err != nil {
 
1527
                return nil, err
 
1528
        }
 
1529
        defer googleapi.CloseBody(res)
 
1530
        if err := googleapi.CheckResponse(res); err != nil {
 
1531
                return nil, err
 
1532
        }
 
1533
        var ret *Schedule
 
1534
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1535
                return nil, err
 
1536
        }
 
1537
        return ret, nil
 
1538
        // {
 
1539
        //   "description": "Retrieves the schedule for a job.",
 
1540
        //   "httpMethod": "GET",
 
1541
        //   "id": "coordinate.schedule.get",
 
1542
        //   "parameterOrder": [
 
1543
        //     "teamId",
 
1544
        //     "jobId"
 
1545
        //   ],
 
1546
        //   "parameters": {
 
1547
        //     "jobId": {
 
1548
        //       "description": "Job number",
 
1549
        //       "format": "uint64",
 
1550
        //       "location": "path",
 
1551
        //       "required": true,
 
1552
        //       "type": "string"
 
1553
        //     },
 
1554
        //     "teamId": {
 
1555
        //       "description": "Team ID",
 
1556
        //       "location": "path",
 
1557
        //       "required": true,
 
1558
        //       "type": "string"
 
1559
        //     }
 
1560
        //   },
 
1561
        //   "path": "{teamId}/jobs/{jobId}/schedule",
 
1562
        //   "response": {
 
1563
        //     "$ref": "Schedule"
 
1564
        //   },
 
1565
        //   "scopes": [
 
1566
        //     "https://www.googleapis.com/auth/coordinate",
 
1567
        //     "https://www.googleapis.com/auth/coordinate.readonly"
 
1568
        //   ]
 
1569
        // }
 
1570
 
 
1571
}
 
1572
 
 
1573
// method id "coordinate.schedule.patch":
 
1574
 
 
1575
type SchedulePatchCall struct {
 
1576
        s        *Service
 
1577
        teamId   string
 
1578
        jobId    uint64
 
1579
        schedule *Schedule
 
1580
        opt_     map[string]interface{}
 
1581
}
 
1582
 
 
1583
// Patch: Replaces the schedule of a job with the provided schedule.
 
1584
// This method supports patch semantics.
 
1585
func (r *ScheduleService) Patch(teamId string, jobId uint64, schedule *Schedule) *SchedulePatchCall {
 
1586
        c := &SchedulePatchCall{s: r.s, opt_: make(map[string]interface{})}
 
1587
        c.teamId = teamId
 
1588
        c.jobId = jobId
 
1589
        c.schedule = schedule
 
1590
        return c
 
1591
}
 
1592
 
 
1593
// AllDay sets the optional parameter "allDay": Whether the job is
 
1594
// scheduled for the whole day. Time of day in start/end times is
 
1595
// ignored if this is true.
 
1596
func (c *SchedulePatchCall) AllDay(allDay bool) *SchedulePatchCall {
 
1597
        c.opt_["allDay"] = allDay
 
1598
        return c
 
1599
}
 
1600
 
 
1601
// Duration sets the optional parameter "duration": Job duration in
 
1602
// milliseconds.
 
1603
func (c *SchedulePatchCall) Duration(duration uint64) *SchedulePatchCall {
 
1604
        c.opt_["duration"] = duration
 
1605
        return c
 
1606
}
 
1607
 
 
1608
// EndTime sets the optional parameter "endTime": Scheduled end time in
 
1609
// milliseconds since epoch.
 
1610
func (c *SchedulePatchCall) EndTime(endTime uint64) *SchedulePatchCall {
 
1611
        c.opt_["endTime"] = endTime
 
1612
        return c
 
1613
}
 
1614
 
 
1615
// StartTime sets the optional parameter "startTime": Scheduled start
 
1616
// time in milliseconds since epoch.
 
1617
func (c *SchedulePatchCall) StartTime(startTime uint64) *SchedulePatchCall {
 
1618
        c.opt_["startTime"] = startTime
 
1619
        return c
 
1620
}
 
1621
 
 
1622
// Fields allows partial responses to be retrieved.
 
1623
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1624
// for more information.
 
1625
func (c *SchedulePatchCall) Fields(s ...googleapi.Field) *SchedulePatchCall {
 
1626
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1627
        return c
 
1628
}
 
1629
 
 
1630
func (c *SchedulePatchCall) Do() (*Schedule, error) {
 
1631
        var body io.Reader = nil
 
1632
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.schedule)
 
1633
        if err != nil {
 
1634
                return nil, err
 
1635
        }
 
1636
        ctype := "application/json"
 
1637
        params := make(url.Values)
 
1638
        params.Set("alt", "json")
 
1639
        if v, ok := c.opt_["allDay"]; ok {
 
1640
                params.Set("allDay", fmt.Sprintf("%v", v))
 
1641
        }
 
1642
        if v, ok := c.opt_["duration"]; ok {
 
1643
                params.Set("duration", fmt.Sprintf("%v", v))
 
1644
        }
 
1645
        if v, ok := c.opt_["endTime"]; ok {
 
1646
                params.Set("endTime", fmt.Sprintf("%v", v))
 
1647
        }
 
1648
        if v, ok := c.opt_["startTime"]; ok {
 
1649
                params.Set("startTime", fmt.Sprintf("%v", v))
 
1650
        }
 
1651
        if v, ok := c.opt_["fields"]; ok {
 
1652
                params.Set("fields", fmt.Sprintf("%v", v))
 
1653
        }
 
1654
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}/schedule")
 
1655
        urls += "?" + params.Encode()
 
1656
        req, _ := http.NewRequest("PATCH", urls, body)
 
1657
        googleapi.Expand(req.URL, map[string]string{
 
1658
                "teamId": c.teamId,
 
1659
                "jobId":  strconv.FormatUint(c.jobId, 10),
 
1660
        })
 
1661
        req.Header.Set("Content-Type", ctype)
 
1662
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1663
        res, err := c.s.client.Do(req)
 
1664
        if err != nil {
 
1665
                return nil, err
 
1666
        }
 
1667
        defer googleapi.CloseBody(res)
 
1668
        if err := googleapi.CheckResponse(res); err != nil {
 
1669
                return nil, err
 
1670
        }
 
1671
        var ret *Schedule
 
1672
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1673
                return nil, err
 
1674
        }
 
1675
        return ret, nil
 
1676
        // {
 
1677
        //   "description": "Replaces the schedule of a job with the provided schedule. This method supports patch semantics.",
 
1678
        //   "httpMethod": "PATCH",
 
1679
        //   "id": "coordinate.schedule.patch",
 
1680
        //   "parameterOrder": [
 
1681
        //     "teamId",
 
1682
        //     "jobId"
 
1683
        //   ],
 
1684
        //   "parameters": {
 
1685
        //     "allDay": {
 
1686
        //       "description": "Whether the job is scheduled for the whole day. Time of day in start/end times is ignored if this is true.",
 
1687
        //       "location": "query",
 
1688
        //       "type": "boolean"
 
1689
        //     },
 
1690
        //     "duration": {
 
1691
        //       "description": "Job duration in milliseconds.",
 
1692
        //       "format": "uint64",
 
1693
        //       "location": "query",
 
1694
        //       "type": "string"
 
1695
        //     },
 
1696
        //     "endTime": {
 
1697
        //       "description": "Scheduled end time in milliseconds since epoch.",
 
1698
        //       "format": "uint64",
 
1699
        //       "location": "query",
 
1700
        //       "type": "string"
 
1701
        //     },
 
1702
        //     "jobId": {
 
1703
        //       "description": "Job number",
 
1704
        //       "format": "uint64",
 
1705
        //       "location": "path",
 
1706
        //       "required": true,
 
1707
        //       "type": "string"
 
1708
        //     },
 
1709
        //     "startTime": {
 
1710
        //       "description": "Scheduled start time in milliseconds since epoch.",
 
1711
        //       "format": "uint64",
 
1712
        //       "location": "query",
 
1713
        //       "type": "string"
 
1714
        //     },
 
1715
        //     "teamId": {
 
1716
        //       "description": "Team ID",
 
1717
        //       "location": "path",
 
1718
        //       "required": true,
 
1719
        //       "type": "string"
 
1720
        //     }
 
1721
        //   },
 
1722
        //   "path": "{teamId}/jobs/{jobId}/schedule",
 
1723
        //   "request": {
 
1724
        //     "$ref": "Schedule"
 
1725
        //   },
 
1726
        //   "response": {
 
1727
        //     "$ref": "Schedule"
 
1728
        //   },
 
1729
        //   "scopes": [
 
1730
        //     "https://www.googleapis.com/auth/coordinate"
 
1731
        //   ]
 
1732
        // }
 
1733
 
 
1734
}
 
1735
 
 
1736
// method id "coordinate.schedule.update":
 
1737
 
 
1738
type ScheduleUpdateCall struct {
 
1739
        s        *Service
 
1740
        teamId   string
 
1741
        jobId    uint64
 
1742
        schedule *Schedule
 
1743
        opt_     map[string]interface{}
 
1744
}
 
1745
 
 
1746
// Update: Replaces the schedule of a job with the provided schedule.
 
1747
func (r *ScheduleService) Update(teamId string, jobId uint64, schedule *Schedule) *ScheduleUpdateCall {
 
1748
        c := &ScheduleUpdateCall{s: r.s, opt_: make(map[string]interface{})}
 
1749
        c.teamId = teamId
 
1750
        c.jobId = jobId
 
1751
        c.schedule = schedule
 
1752
        return c
 
1753
}
 
1754
 
 
1755
// AllDay sets the optional parameter "allDay": Whether the job is
 
1756
// scheduled for the whole day. Time of day in start/end times is
 
1757
// ignored if this is true.
 
1758
func (c *ScheduleUpdateCall) AllDay(allDay bool) *ScheduleUpdateCall {
 
1759
        c.opt_["allDay"] = allDay
 
1760
        return c
 
1761
}
 
1762
 
 
1763
// Duration sets the optional parameter "duration": Job duration in
 
1764
// milliseconds.
 
1765
func (c *ScheduleUpdateCall) Duration(duration uint64) *ScheduleUpdateCall {
 
1766
        c.opt_["duration"] = duration
 
1767
        return c
 
1768
}
 
1769
 
 
1770
// EndTime sets the optional parameter "endTime": Scheduled end time in
 
1771
// milliseconds since epoch.
 
1772
func (c *ScheduleUpdateCall) EndTime(endTime uint64) *ScheduleUpdateCall {
 
1773
        c.opt_["endTime"] = endTime
 
1774
        return c
 
1775
}
 
1776
 
 
1777
// StartTime sets the optional parameter "startTime": Scheduled start
 
1778
// time in milliseconds since epoch.
 
1779
func (c *ScheduleUpdateCall) StartTime(startTime uint64) *ScheduleUpdateCall {
 
1780
        c.opt_["startTime"] = startTime
 
1781
        return c
 
1782
}
 
1783
 
 
1784
// Fields allows partial responses to be retrieved.
 
1785
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1786
// for more information.
 
1787
func (c *ScheduleUpdateCall) Fields(s ...googleapi.Field) *ScheduleUpdateCall {
 
1788
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1789
        return c
 
1790
}
 
1791
 
 
1792
func (c *ScheduleUpdateCall) Do() (*Schedule, error) {
 
1793
        var body io.Reader = nil
 
1794
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.schedule)
 
1795
        if err != nil {
 
1796
                return nil, err
 
1797
        }
 
1798
        ctype := "application/json"
 
1799
        params := make(url.Values)
 
1800
        params.Set("alt", "json")
 
1801
        if v, ok := c.opt_["allDay"]; ok {
 
1802
                params.Set("allDay", fmt.Sprintf("%v", v))
 
1803
        }
 
1804
        if v, ok := c.opt_["duration"]; ok {
 
1805
                params.Set("duration", fmt.Sprintf("%v", v))
 
1806
        }
 
1807
        if v, ok := c.opt_["endTime"]; ok {
 
1808
                params.Set("endTime", fmt.Sprintf("%v", v))
 
1809
        }
 
1810
        if v, ok := c.opt_["startTime"]; ok {
 
1811
                params.Set("startTime", fmt.Sprintf("%v", v))
 
1812
        }
 
1813
        if v, ok := c.opt_["fields"]; ok {
 
1814
                params.Set("fields", fmt.Sprintf("%v", v))
 
1815
        }
 
1816
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/jobs/{jobId}/schedule")
 
1817
        urls += "?" + params.Encode()
 
1818
        req, _ := http.NewRequest("PUT", urls, body)
 
1819
        googleapi.Expand(req.URL, map[string]string{
 
1820
                "teamId": c.teamId,
 
1821
                "jobId":  strconv.FormatUint(c.jobId, 10),
 
1822
        })
 
1823
        req.Header.Set("Content-Type", ctype)
 
1824
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1825
        res, err := c.s.client.Do(req)
 
1826
        if err != nil {
 
1827
                return nil, err
 
1828
        }
 
1829
        defer googleapi.CloseBody(res)
 
1830
        if err := googleapi.CheckResponse(res); err != nil {
 
1831
                return nil, err
 
1832
        }
 
1833
        var ret *Schedule
 
1834
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1835
                return nil, err
 
1836
        }
 
1837
        return ret, nil
 
1838
        // {
 
1839
        //   "description": "Replaces the schedule of a job with the provided schedule.",
 
1840
        //   "httpMethod": "PUT",
 
1841
        //   "id": "coordinate.schedule.update",
 
1842
        //   "parameterOrder": [
 
1843
        //     "teamId",
 
1844
        //     "jobId"
 
1845
        //   ],
 
1846
        //   "parameters": {
 
1847
        //     "allDay": {
 
1848
        //       "description": "Whether the job is scheduled for the whole day. Time of day in start/end times is ignored if this is true.",
 
1849
        //       "location": "query",
 
1850
        //       "type": "boolean"
 
1851
        //     },
 
1852
        //     "duration": {
 
1853
        //       "description": "Job duration in milliseconds.",
 
1854
        //       "format": "uint64",
 
1855
        //       "location": "query",
 
1856
        //       "type": "string"
 
1857
        //     },
 
1858
        //     "endTime": {
 
1859
        //       "description": "Scheduled end time in milliseconds since epoch.",
 
1860
        //       "format": "uint64",
 
1861
        //       "location": "query",
 
1862
        //       "type": "string"
 
1863
        //     },
 
1864
        //     "jobId": {
 
1865
        //       "description": "Job number",
 
1866
        //       "format": "uint64",
 
1867
        //       "location": "path",
 
1868
        //       "required": true,
 
1869
        //       "type": "string"
 
1870
        //     },
 
1871
        //     "startTime": {
 
1872
        //       "description": "Scheduled start time in milliseconds since epoch.",
 
1873
        //       "format": "uint64",
 
1874
        //       "location": "query",
 
1875
        //       "type": "string"
 
1876
        //     },
 
1877
        //     "teamId": {
 
1878
        //       "description": "Team ID",
 
1879
        //       "location": "path",
 
1880
        //       "required": true,
 
1881
        //       "type": "string"
 
1882
        //     }
 
1883
        //   },
 
1884
        //   "path": "{teamId}/jobs/{jobId}/schedule",
 
1885
        //   "request": {
 
1886
        //     "$ref": "Schedule"
 
1887
        //   },
 
1888
        //   "response": {
 
1889
        //     "$ref": "Schedule"
 
1890
        //   },
 
1891
        //   "scopes": [
 
1892
        //     "https://www.googleapis.com/auth/coordinate"
 
1893
        //   ]
 
1894
        // }
 
1895
 
 
1896
}
 
1897
 
 
1898
// method id "coordinate.worker.list":
 
1899
 
 
1900
type WorkerListCall struct {
 
1901
        s      *Service
 
1902
        teamId string
 
1903
        opt_   map[string]interface{}
 
1904
}
 
1905
 
 
1906
// List: Retrieves a list of workers in a team.
 
1907
func (r *WorkerService) List(teamId string) *WorkerListCall {
 
1908
        c := &WorkerListCall{s: r.s, opt_: make(map[string]interface{})}
 
1909
        c.teamId = teamId
 
1910
        return c
 
1911
}
 
1912
 
 
1913
// Fields allows partial responses to be retrieved.
 
1914
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1915
// for more information.
 
1916
func (c *WorkerListCall) Fields(s ...googleapi.Field) *WorkerListCall {
 
1917
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1918
        return c
 
1919
}
 
1920
 
 
1921
func (c *WorkerListCall) Do() (*WorkerListResponse, error) {
 
1922
        var body io.Reader = nil
 
1923
        params := make(url.Values)
 
1924
        params.Set("alt", "json")
 
1925
        if v, ok := c.opt_["fields"]; ok {
 
1926
                params.Set("fields", fmt.Sprintf("%v", v))
 
1927
        }
 
1928
        urls := googleapi.ResolveRelative(c.s.BasePath, "{teamId}/workers")
 
1929
        urls += "?" + params.Encode()
 
1930
        req, _ := http.NewRequest("GET", urls, body)
 
1931
        googleapi.Expand(req.URL, map[string]string{
 
1932
                "teamId": c.teamId,
 
1933
        })
 
1934
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1935
        res, err := c.s.client.Do(req)
 
1936
        if err != nil {
 
1937
                return nil, err
 
1938
        }
 
1939
        defer googleapi.CloseBody(res)
 
1940
        if err := googleapi.CheckResponse(res); err != nil {
 
1941
                return nil, err
 
1942
        }
 
1943
        var ret *WorkerListResponse
 
1944
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1945
                return nil, err
 
1946
        }
 
1947
        return ret, nil
 
1948
        // {
 
1949
        //   "description": "Retrieves a list of workers in a team.",
 
1950
        //   "httpMethod": "GET",
 
1951
        //   "id": "coordinate.worker.list",
 
1952
        //   "parameterOrder": [
 
1953
        //     "teamId"
 
1954
        //   ],
 
1955
        //   "parameters": {
 
1956
        //     "teamId": {
 
1957
        //       "description": "Team ID",
 
1958
        //       "location": "path",
 
1959
        //       "required": true,
 
1960
        //       "type": "string"
 
1961
        //     }
 
1962
        //   },
 
1963
        //   "path": "{teamId}/workers",
 
1964
        //   "response": {
 
1965
        //     "$ref": "WorkerListResponse"
 
1966
        //   },
 
1967
        //   "scopes": [
 
1968
        //     "https://www.googleapis.com/auth/coordinate",
 
1969
        //     "https://www.googleapis.com/auth/coordinate.readonly"
 
1970
        //   ]
 
1971
        // }
 
1972
 
 
1973
}