1
// Package coordinate provides access to the Google Maps Coordinate API.
3
// See https://developers.google.com/coordinate/
7
// import "google.golang.org/api/coordinate/v1"
9
// coordinateService, err := coordinate.New(oauthHttpClient)
17
"google.golang.org/api/googleapi"
25
// Always reference these packages, just in case the auto-generated code
27
var _ = bytes.NewBuffer
30
var _ = json.NewDecoder
33
var _ = googleapi.Version
35
var _ = strings.Replace
37
const apiId = "coordinate:v1"
38
const apiName = "coordinate"
39
const apiVersion = "v1"
40
const basePath = "https://www.googleapis.com/coordinate/v1/teams/"
42
// OAuth2 scopes used by this API.
44
// View and manage your Google Maps Coordinate jobs
45
CoordinateScope = "https://www.googleapis.com/auth/coordinate"
47
// View your Google Coordinate jobs
48
CoordinateReadonlyScope = "https://www.googleapis.com/auth/coordinate.readonly"
51
func New(client *http.Client) (*Service, error) {
53
return nil, errors.New("client is nil")
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)
66
BasePath string // API endpoint base URL
68
CustomFieldDef *CustomFieldDefService
72
Location *LocationService
74
Schedule *ScheduleService
79
func NewCustomFieldDefService(s *Service) *CustomFieldDefService {
80
rs := &CustomFieldDefService{s: s}
84
type CustomFieldDefService struct {
88
func NewJobsService(s *Service) *JobsService {
89
rs := &JobsService{s: s}
93
type JobsService struct {
97
func NewLocationService(s *Service) *LocationService {
98
rs := &LocationService{s: s}
102
type LocationService struct {
106
func NewScheduleService(s *Service) *ScheduleService {
107
rs := &ScheduleService{s: s}
111
type ScheduleService struct {
115
func NewWorkerService(s *Service) *WorkerService {
116
rs := &WorkerService{s: s}
120
type WorkerService struct {
124
type CustomField struct {
125
// CustomFieldId: Custom field id.
126
CustomFieldId int64 `json:"customFieldId,omitempty,string"`
128
// Kind: Identifies this object as a custom field.
129
Kind string `json:"kind,omitempty"`
131
// Value: Custom field value.
132
Value string `json:"value,omitempty"`
135
type CustomFieldDef struct {
136
// Enabled: Whether the field is enabled.
137
Enabled bool `json:"enabled,omitempty"`
139
// Id: Custom field id.
140
Id int64 `json:"id,omitempty,string"`
142
// Kind: Identifies this object as a custom field definition.
143
Kind string `json:"kind,omitempty"`
145
// Name: Custom field name.
146
Name string `json:"name,omitempty"`
148
// RequiredForCheckout: Whether the field is required for checkout.
149
RequiredForCheckout bool `json:"requiredForCheckout,omitempty"`
151
// Type: Custom field type.
152
Type string `json:"type,omitempty"`
155
type CustomFieldDefListResponse struct {
156
// Items: Collection of custom field definitions in a team.
157
Items []*CustomFieldDef `json:"items,omitempty"`
159
// Kind: Identifies this object as a collection of custom field
160
// definitions in a team.
161
Kind string `json:"kind,omitempty"`
164
type CustomFields struct {
165
// CustomField: Collection of custom fields.
166
CustomField []*CustomField `json:"customField,omitempty"`
168
// Kind: Identifies this object as a collection of custom fields.
169
Kind string `json:"kind,omitempty"`
174
Id uint64 `json:"id,omitempty,string"`
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"`
180
// Kind: Identifies this object as a job.
181
Kind string `json:"kind,omitempty"`
183
// State: Current job state.
184
State *JobState `json:"state,omitempty"`
187
type JobChange struct {
188
// Kind: Identifies this object as a job change.
189
Kind string `json:"kind,omitempty"`
191
// State: Change applied to the job. Only the fields that were changed
193
State *JobState `json:"state,omitempty"`
195
// Timestamp: Time at which this change was applied.
196
Timestamp uint64 `json:"timestamp,omitempty,string"`
199
type JobListResponse struct {
200
// Items: Jobs in the collection.
201
Items []*Job `json:"items,omitempty"`
203
// Kind: Identifies this object as a list of jobs.
204
Kind string `json:"kind,omitempty"`
206
// NextPageToken: A token to provide to get the next page of results.
207
NextPageToken string `json:"nextPageToken,omitempty"`
210
type JobState struct {
211
// Assignee: Email address of the assignee.
212
Assignee string `json:"assignee,omitempty"`
214
// CustomFields: Custom fields.
215
CustomFields *CustomFields `json:"customFields,omitempty"`
217
// CustomerName: Customer name.
218
CustomerName string `json:"customerName,omitempty"`
220
// CustomerPhoneNumber: Customer phone number.
221
CustomerPhoneNumber string `json:"customerPhoneNumber,omitempty"`
223
// Kind: Identifies this object as a job state.
224
Kind string `json:"kind,omitempty"`
226
// Location: Job location.
227
Location *Location `json:"location,omitempty"`
229
// Note: Note added to the job.
230
Note []string `json:"note,omitempty"`
232
// Progress: Job progress.
233
Progress string `json:"progress,omitempty"`
236
Title string `json:"title,omitempty"`
239
type Location struct {
240
// AddressLine: Address.
241
AddressLine []string `json:"addressLine,omitempty"`
243
// Kind: Identifies this object as a location.
244
Kind string `json:"kind,omitempty"`
247
Lat float64 `json:"lat,omitempty"`
250
Lng float64 `json:"lng,omitempty"`
253
type LocationListResponse struct {
254
// Items: Locations in the collection.
255
Items []*LocationRecord `json:"items,omitempty"`
257
// Kind: Identifies this object as a list of locations.
258
Kind string `json:"kind,omitempty"`
260
// NextPageToken: A token to provide to get the next page of results.
261
NextPageToken string `json:"nextPageToken,omitempty"`
263
// TokenPagination: Pagination information for token pagination.
264
TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
267
type LocationRecord struct {
268
// CollectionTime: The collection time in milliseconds since the epoch.
269
CollectionTime int64 `json:"collectionTime,omitempty,string"`
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"`
275
// Kind: Identifies this object as a location.
276
Kind string `json:"kind,omitempty"`
278
// Latitude: Latitude.
279
Latitude float64 `json:"latitude,omitempty"`
281
// Longitude: Longitude.
282
Longitude float64 `json:"longitude,omitempty"`
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"`
290
// Duration: Job duration in milliseconds.
291
Duration uint64 `json:"duration,omitempty,string"`
293
// EndTime: Scheduled end time in milliseconds since epoch.
294
EndTime uint64 `json:"endTime,omitempty,string"`
296
// Kind: Identifies this object as a job schedule.
297
Kind string `json:"kind,omitempty"`
299
// StartTime: Scheduled start time in milliseconds since epoch.
300
StartTime uint64 `json:"startTime,omitempty,string"`
303
type TokenPagination struct {
304
// Kind: Identifies this object as pagination information.
305
Kind string `json:"kind,omitempty"`
307
// NextPageToken: A token to provide to get the next page of results.
308
NextPageToken string `json:"nextPageToken,omitempty"`
310
// PreviousPageToken: A token to provide to get the previous page of
312
PreviousPageToken string `json:"previousPageToken,omitempty"`
316
// Id: Worker email address.
317
Id string `json:"id,omitempty"`
319
// Kind: Identifies this object as a worker.
320
Kind string `json:"kind,omitempty"`
323
type WorkerListResponse struct {
324
// Items: Workers in the collection.
325
Items []*Worker `json:"items,omitempty"`
327
// Kind: Identifies this object as a list of workers.
328
Kind string `json:"kind,omitempty"`
331
// method id "coordinate.customFieldDef.list":
333
type CustomFieldDefListCall struct {
336
opt_ map[string]interface{}
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{})}
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)
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))
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{
367
req.Header.Set("User-Agent", "google-api-go-client/0.5")
368
res, err := c.s.client.Do(req)
372
defer googleapi.CloseBody(res)
373
if err := googleapi.CheckResponse(res); err != nil {
376
var ret *CustomFieldDefListResponse
377
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
382
// "description": "Retrieves a list of custom field definitions for a team.",
383
// "httpMethod": "GET",
384
// "id": "coordinate.customFieldDef.list",
385
// "parameterOrder": [
390
// "description": "Team ID",
391
// "location": "path",
396
// "path": "{teamId}/custom_fields",
398
// "$ref": "CustomFieldDefListResponse"
401
// "https://www.googleapis.com/auth/coordinate",
402
// "https://www.googleapis.com/auth/coordinate.readonly"
408
// method id "coordinate.jobs.get":
410
type JobsGetCall struct {
414
opt_ map[string]interface{}
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{})}
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)
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))
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{
445
"jobId": strconv.FormatUint(c.jobId, 10),
447
req.Header.Set("User-Agent", "google-api-go-client/0.5")
448
res, err := c.s.client.Do(req)
452
defer googleapi.CloseBody(res)
453
if err := googleapi.CheckResponse(res); err != nil {
457
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
462
// "description": "Retrieves a job, including all the changes made to the job.",
463
// "httpMethod": "GET",
464
// "id": "coordinate.jobs.get",
465
// "parameterOrder": [
471
// "description": "Job number",
472
// "format": "uint64",
473
// "location": "path",
478
// "description": "Team ID",
479
// "location": "path",
484
// "path": "{teamId}/jobs/{jobId}",
489
// "https://www.googleapis.com/auth/coordinate",
490
// "https://www.googleapis.com/auth/coordinate.readonly"
496
// method id "coordinate.jobs.insert":
498
type JobsInsertCall struct {
506
opt_ map[string]interface{}
509
// Insert: Inserts a new job. Only the state field of the job should be
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{})}
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
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
537
// CustomerName sets the optional parameter "customerName": Customer
539
func (c *JobsInsertCall) CustomerName(customerName string) *JobsInsertCall {
540
c.opt_["customerName"] = customerName
544
// CustomerPhoneNumber sets the optional parameter
545
// "customerPhoneNumber": Customer phone number
546
func (c *JobsInsertCall) CustomerPhoneNumber(customerPhoneNumber string) *JobsInsertCall {
547
c.opt_["customerPhoneNumber"] = customerPhoneNumber
551
// Note sets the optional parameter "note": Job note as newline (Unix)
553
func (c *JobsInsertCall) Note(note string) *JobsInsertCall {
554
c.opt_["note"] = note
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)
566
func (c *JobsInsertCall) Do() (*Job, error) {
567
var body io.Reader = nil
568
body, err := googleapi.WithoutDataWrapper.JSONReader(c.job)
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))
582
if v, ok := c.opt_["customField"]; ok {
583
params.Set("customField", fmt.Sprintf("%v", v))
585
if v, ok := c.opt_["customerName"]; ok {
586
params.Set("customerName", fmt.Sprintf("%v", v))
588
if v, ok := c.opt_["customerPhoneNumber"]; ok {
589
params.Set("customerPhoneNumber", fmt.Sprintf("%v", v))
591
if v, ok := c.opt_["note"]; ok {
592
params.Set("note", fmt.Sprintf("%v", v))
594
if v, ok := c.opt_["fields"]; ok {
595
params.Set("fields", fmt.Sprintf("%v", v))
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{
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)
609
defer googleapi.CloseBody(res)
610
if err := googleapi.CheckResponse(res); err != nil {
614
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
631
// "description": "Job address as newline (Unix) separated string",
632
// "location": "query",
637
// "description": "Assignee email address, or empty string to unassign.",
638
// "location": "query",
642
// "description": "Map from custom field id (from /team//custom_fields) to the field value. For example '123=Alice'",
643
// "location": "query",
648
// "description": "Customer name",
649
// "location": "query",
652
// "customerPhoneNumber": {
653
// "description": "Customer phone number",
654
// "location": "query",
658
// "description": "The latitude coordinate of this job's location.",
659
// "format": "double",
660
// "location": "query",
665
// "description": "The longitude coordinate of this job's location.",
666
// "format": "double",
667
// "location": "query",
672
// "description": "Job note as newline (Unix) separated string",
673
// "location": "query",
677
// "description": "Team ID",
678
// "location": "path",
683
// "description": "Job title",
684
// "location": "query",
689
// "path": "{teamId}/jobs",
697
// "https://www.googleapis.com/auth/coordinate"
703
// method id "coordinate.jobs.list":
705
type JobsListCall struct {
708
opt_ map[string]interface{}
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{})}
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
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
733
// PageToken sets the optional parameter "pageToken": Continuation token
734
func (c *JobsListCall) PageToken(pageToken string) *JobsListCall {
735
c.opt_["pageToken"] = pageToken
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)
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))
754
if v, ok := c.opt_["minModifiedTimestampMs"]; ok {
755
params.Set("minModifiedTimestampMs", fmt.Sprintf("%v", v))
757
if v, ok := c.opt_["pageToken"]; ok {
758
params.Set("pageToken", fmt.Sprintf("%v", v))
760
if v, ok := c.opt_["fields"]; ok {
761
params.Set("fields", fmt.Sprintf("%v", v))
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{
769
req.Header.Set("User-Agent", "google-api-go-client/0.5")
770
res, err := c.s.client.Do(req)
774
defer googleapi.CloseBody(res)
775
if err := googleapi.CheckResponse(res); err != nil {
778
var ret *JobListResponse
779
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
784
// "description": "Retrieves jobs created or modified since the given timestamp.",
785
// "httpMethod": "GET",
786
// "id": "coordinate.jobs.list",
787
// "parameterOrder": [
792
// "description": "Maximum number of results to return in one page.",
793
// "format": "uint32",
794
// "location": "query",
797
// "minModifiedTimestampMs": {
798
// "description": "Minimum time a job was modified in milliseconds since epoch.",
799
// "format": "uint64",
800
// "location": "query",
804
// "description": "Continuation token",
805
// "location": "query",
809
// "description": "Team ID",
810
// "location": "path",
815
// "path": "{teamId}/jobs",
817
// "$ref": "JobListResponse"
820
// "https://www.googleapis.com/auth/coordinate",
821
// "https://www.googleapis.com/auth/coordinate.readonly"
827
// method id "coordinate.jobs.patch":
829
type JobsPatchCall struct {
834
opt_ map[string]interface{}
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{})}
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
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
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
869
// CustomerName sets the optional parameter "customerName": Customer
871
func (c *JobsPatchCall) CustomerName(customerName string) *JobsPatchCall {
872
c.opt_["customerName"] = customerName
876
// CustomerPhoneNumber sets the optional parameter
877
// "customerPhoneNumber": Customer phone number
878
func (c *JobsPatchCall) CustomerPhoneNumber(customerPhoneNumber string) *JobsPatchCall {
879
c.opt_["customerPhoneNumber"] = customerPhoneNumber
883
// Lat sets the optional parameter "lat": The latitude coordinate of
884
// this job's location.
885
func (c *JobsPatchCall) Lat(lat float64) *JobsPatchCall {
890
// Lng sets the optional parameter "lng": The longitude coordinate of
891
// this job's location.
892
func (c *JobsPatchCall) Lng(lng float64) *JobsPatchCall {
897
// Note sets the optional parameter "note": Job note as newline (Unix)
899
func (c *JobsPatchCall) Note(note string) *JobsPatchCall {
900
c.opt_["note"] = note
904
// Progress sets the optional parameter "progress": Job progress
905
func (c *JobsPatchCall) Progress(progress string) *JobsPatchCall {
906
c.opt_["progress"] = progress
910
// Title sets the optional parameter "title": Job title
911
func (c *JobsPatchCall) Title(title string) *JobsPatchCall {
912
c.opt_["title"] = title
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)
924
func (c *JobsPatchCall) Do() (*Job, error) {
925
var body io.Reader = nil
926
body, err := googleapi.WithoutDataWrapper.JSONReader(c.job)
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))
936
if v, ok := c.opt_["assignee"]; ok {
937
params.Set("assignee", fmt.Sprintf("%v", v))
939
if v, ok := c.opt_["customField"]; ok {
940
params.Set("customField", fmt.Sprintf("%v", v))
942
if v, ok := c.opt_["customerName"]; ok {
943
params.Set("customerName", fmt.Sprintf("%v", v))
945
if v, ok := c.opt_["customerPhoneNumber"]; ok {
946
params.Set("customerPhoneNumber", fmt.Sprintf("%v", v))
948
if v, ok := c.opt_["lat"]; ok {
949
params.Set("lat", fmt.Sprintf("%v", v))
951
if v, ok := c.opt_["lng"]; ok {
952
params.Set("lng", fmt.Sprintf("%v", v))
954
if v, ok := c.opt_["note"]; ok {
955
params.Set("note", fmt.Sprintf("%v", v))
957
if v, ok := c.opt_["progress"]; ok {
958
params.Set("progress", fmt.Sprintf("%v", v))
960
if v, ok := c.opt_["title"]; ok {
961
params.Set("title", fmt.Sprintf("%v", v))
963
if v, ok := c.opt_["fields"]; ok {
964
params.Set("fields", fmt.Sprintf("%v", v))
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{
971
"jobId": strconv.FormatUint(c.jobId, 10),
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)
979
defer googleapi.CloseBody(res)
980
if err := googleapi.CheckResponse(res); err != nil {
984
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
998
// "description": "Job address as newline (Unix) separated string",
999
// "location": "query",
1003
// "description": "Assignee email address, or empty string to unassign.",
1004
// "location": "query",
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,
1013
// "customerName": {
1014
// "description": "Customer name",
1015
// "location": "query",
1018
// "customerPhoneNumber": {
1019
// "description": "Customer phone number",
1020
// "location": "query",
1024
// "description": "Job number",
1025
// "format": "uint64",
1026
// "location": "path",
1027
// "required": true,
1031
// "description": "The latitude coordinate of this job's location.",
1032
// "format": "double",
1033
// "location": "query",
1037
// "description": "The longitude coordinate of this job's location.",
1038
// "format": "double",
1039
// "location": "query",
1043
// "description": "Job note as newline (Unix) separated string",
1044
// "location": "query",
1048
// "description": "Job progress",
1056
// "enumDescriptions": [
1063
// "location": "query",
1067
// "description": "Team ID",
1068
// "location": "path",
1069
// "required": true,
1073
// "description": "Job title",
1074
// "location": "query",
1078
// "path": "{teamId}/jobs/{jobId}",
1086
// "https://www.googleapis.com/auth/coordinate"
1092
// method id "coordinate.jobs.update":
1094
type JobsUpdateCall struct {
1099
opt_ map[string]interface{}
1102
// Update: Updates a job. Fields that are set in the job state will be
1104
func (r *JobsService) Update(teamId string, jobId uint64, job *Job) *JobsUpdateCall {
1105
c := &JobsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
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
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
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
1134
// CustomerName sets the optional parameter "customerName": Customer
1136
func (c *JobsUpdateCall) CustomerName(customerName string) *JobsUpdateCall {
1137
c.opt_["customerName"] = customerName
1141
// CustomerPhoneNumber sets the optional parameter
1142
// "customerPhoneNumber": Customer phone number
1143
func (c *JobsUpdateCall) CustomerPhoneNumber(customerPhoneNumber string) *JobsUpdateCall {
1144
c.opt_["customerPhoneNumber"] = customerPhoneNumber
1148
// Lat sets the optional parameter "lat": The latitude coordinate of
1149
// this job's location.
1150
func (c *JobsUpdateCall) Lat(lat float64) *JobsUpdateCall {
1155
// Lng sets the optional parameter "lng": The longitude coordinate of
1156
// this job's location.
1157
func (c *JobsUpdateCall) Lng(lng float64) *JobsUpdateCall {
1162
// Note sets the optional parameter "note": Job note as newline (Unix)
1164
func (c *JobsUpdateCall) Note(note string) *JobsUpdateCall {
1165
c.opt_["note"] = note
1169
// Progress sets the optional parameter "progress": Job progress
1170
func (c *JobsUpdateCall) Progress(progress string) *JobsUpdateCall {
1171
c.opt_["progress"] = progress
1175
// Title sets the optional parameter "title": Job title
1176
func (c *JobsUpdateCall) Title(title string) *JobsUpdateCall {
1177
c.opt_["title"] = title
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)
1189
func (c *JobsUpdateCall) Do() (*Job, error) {
1190
var body io.Reader = nil
1191
body, err := googleapi.WithoutDataWrapper.JSONReader(c.job)
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))
1201
if v, ok := c.opt_["assignee"]; ok {
1202
params.Set("assignee", fmt.Sprintf("%v", v))
1204
if v, ok := c.opt_["customField"]; ok {
1205
params.Set("customField", fmt.Sprintf("%v", v))
1207
if v, ok := c.opt_["customerName"]; ok {
1208
params.Set("customerName", fmt.Sprintf("%v", v))
1210
if v, ok := c.opt_["customerPhoneNumber"]; ok {
1211
params.Set("customerPhoneNumber", fmt.Sprintf("%v", v))
1213
if v, ok := c.opt_["lat"]; ok {
1214
params.Set("lat", fmt.Sprintf("%v", v))
1216
if v, ok := c.opt_["lng"]; ok {
1217
params.Set("lng", fmt.Sprintf("%v", v))
1219
if v, ok := c.opt_["note"]; ok {
1220
params.Set("note", fmt.Sprintf("%v", v))
1222
if v, ok := c.opt_["progress"]; ok {
1223
params.Set("progress", fmt.Sprintf("%v", v))
1225
if v, ok := c.opt_["title"]; ok {
1226
params.Set("title", fmt.Sprintf("%v", v))
1228
if v, ok := c.opt_["fields"]; ok {
1229
params.Set("fields", fmt.Sprintf("%v", v))
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{
1236
"jobId": strconv.FormatUint(c.jobId, 10),
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)
1244
defer googleapi.CloseBody(res)
1245
if err := googleapi.CheckResponse(res); err != nil {
1249
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
1263
// "description": "Job address as newline (Unix) separated string",
1264
// "location": "query",
1268
// "description": "Assignee email address, or empty string to unassign.",
1269
// "location": "query",
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,
1278
// "customerName": {
1279
// "description": "Customer name",
1280
// "location": "query",
1283
// "customerPhoneNumber": {
1284
// "description": "Customer phone number",
1285
// "location": "query",
1289
// "description": "Job number",
1290
// "format": "uint64",
1291
// "location": "path",
1292
// "required": true,
1296
// "description": "The latitude coordinate of this job's location.",
1297
// "format": "double",
1298
// "location": "query",
1302
// "description": "The longitude coordinate of this job's location.",
1303
// "format": "double",
1304
// "location": "query",
1308
// "description": "Job note as newline (Unix) separated string",
1309
// "location": "query",
1313
// "description": "Job progress",
1321
// "enumDescriptions": [
1328
// "location": "query",
1332
// "description": "Team ID",
1333
// "location": "path",
1334
// "required": true,
1338
// "description": "Job title",
1339
// "location": "query",
1343
// "path": "{teamId}/jobs/{jobId}",
1351
// "https://www.googleapis.com/auth/coordinate"
1357
// method id "coordinate.location.list":
1359
type LocationListCall struct {
1363
startTimestampMs uint64
1364
opt_ map[string]interface{}
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{})}
1371
c.workerEmail = workerEmail
1372
c.startTimestampMs = startTimestampMs
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
1383
// PageToken sets the optional parameter "pageToken": Continuation token
1384
func (c *LocationListCall) PageToken(pageToken string) *LocationListCall {
1385
c.opt_["pageToken"] = pageToken
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)
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))
1405
if v, ok := c.opt_["pageToken"]; ok {
1406
params.Set("pageToken", fmt.Sprintf("%v", v))
1408
if v, ok := c.opt_["fields"]; ok {
1409
params.Set("fields", fmt.Sprintf("%v", v))
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{
1416
"workerEmail": c.workerEmail,
1418
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1419
res, err := c.s.client.Do(req)
1423
defer googleapi.CloseBody(res)
1424
if err := googleapi.CheckResponse(res); err != nil {
1427
var ret *LocationListResponse
1428
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1433
// "description": "Retrieves a list of locations for a worker.",
1434
// "httpMethod": "GET",
1435
// "id": "coordinate.location.list",
1436
// "parameterOrder": [
1439
// "startTimestampMs"
1443
// "description": "Maximum number of results to return in one page.",
1444
// "format": "uint32",
1445
// "location": "query",
1446
// "type": "integer"
1449
// "description": "Continuation token",
1450
// "location": "query",
1453
// "startTimestampMs": {
1454
// "description": "Start timestamp in milliseconds since the epoch.",
1455
// "format": "uint64",
1456
// "location": "query",
1457
// "required": true,
1461
// "description": "Team ID",
1462
// "location": "path",
1463
// "required": true,
1467
// "description": "Worker email address.",
1468
// "location": "path",
1469
// "required": true,
1473
// "path": "{teamId}/workers/{workerEmail}/locations",
1475
// "$ref": "LocationListResponse"
1478
// "https://www.googleapis.com/auth/coordinate",
1479
// "https://www.googleapis.com/auth/coordinate.readonly"
1485
// method id "coordinate.schedule.get":
1487
type ScheduleGetCall struct {
1491
opt_ map[string]interface{}
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{})}
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)
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))
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{
1522
"jobId": strconv.FormatUint(c.jobId, 10),
1524
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1525
res, err := c.s.client.Do(req)
1529
defer googleapi.CloseBody(res)
1530
if err := googleapi.CheckResponse(res); err != nil {
1534
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1539
// "description": "Retrieves the schedule for a job.",
1540
// "httpMethod": "GET",
1541
// "id": "coordinate.schedule.get",
1542
// "parameterOrder": [
1548
// "description": "Job number",
1549
// "format": "uint64",
1550
// "location": "path",
1551
// "required": true,
1555
// "description": "Team ID",
1556
// "location": "path",
1557
// "required": true,
1561
// "path": "{teamId}/jobs/{jobId}/schedule",
1563
// "$ref": "Schedule"
1566
// "https://www.googleapis.com/auth/coordinate",
1567
// "https://www.googleapis.com/auth/coordinate.readonly"
1573
// method id "coordinate.schedule.patch":
1575
type SchedulePatchCall struct {
1580
opt_ map[string]interface{}
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{})}
1589
c.schedule = schedule
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
1601
// Duration sets the optional parameter "duration": Job duration in
1603
func (c *SchedulePatchCall) Duration(duration uint64) *SchedulePatchCall {
1604
c.opt_["duration"] = duration
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
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
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)
1630
func (c *SchedulePatchCall) Do() (*Schedule, error) {
1631
var body io.Reader = nil
1632
body, err := googleapi.WithoutDataWrapper.JSONReader(c.schedule)
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))
1642
if v, ok := c.opt_["duration"]; ok {
1643
params.Set("duration", fmt.Sprintf("%v", v))
1645
if v, ok := c.opt_["endTime"]; ok {
1646
params.Set("endTime", fmt.Sprintf("%v", v))
1648
if v, ok := c.opt_["startTime"]; ok {
1649
params.Set("startTime", fmt.Sprintf("%v", v))
1651
if v, ok := c.opt_["fields"]; ok {
1652
params.Set("fields", fmt.Sprintf("%v", v))
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{
1659
"jobId": strconv.FormatUint(c.jobId, 10),
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)
1667
defer googleapi.CloseBody(res)
1668
if err := googleapi.CheckResponse(res); err != nil {
1672
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
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"
1691
// "description": "Job duration in milliseconds.",
1692
// "format": "uint64",
1693
// "location": "query",
1697
// "description": "Scheduled end time in milliseconds since epoch.",
1698
// "format": "uint64",
1699
// "location": "query",
1703
// "description": "Job number",
1704
// "format": "uint64",
1705
// "location": "path",
1706
// "required": true,
1710
// "description": "Scheduled start time in milliseconds since epoch.",
1711
// "format": "uint64",
1712
// "location": "query",
1716
// "description": "Team ID",
1717
// "location": "path",
1718
// "required": true,
1722
// "path": "{teamId}/jobs/{jobId}/schedule",
1724
// "$ref": "Schedule"
1727
// "$ref": "Schedule"
1730
// "https://www.googleapis.com/auth/coordinate"
1736
// method id "coordinate.schedule.update":
1738
type ScheduleUpdateCall struct {
1743
opt_ map[string]interface{}
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{})}
1751
c.schedule = schedule
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
1763
// Duration sets the optional parameter "duration": Job duration in
1765
func (c *ScheduleUpdateCall) Duration(duration uint64) *ScheduleUpdateCall {
1766
c.opt_["duration"] = duration
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
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
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)
1792
func (c *ScheduleUpdateCall) Do() (*Schedule, error) {
1793
var body io.Reader = nil
1794
body, err := googleapi.WithoutDataWrapper.JSONReader(c.schedule)
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))
1804
if v, ok := c.opt_["duration"]; ok {
1805
params.Set("duration", fmt.Sprintf("%v", v))
1807
if v, ok := c.opt_["endTime"]; ok {
1808
params.Set("endTime", fmt.Sprintf("%v", v))
1810
if v, ok := c.opt_["startTime"]; ok {
1811
params.Set("startTime", fmt.Sprintf("%v", v))
1813
if v, ok := c.opt_["fields"]; ok {
1814
params.Set("fields", fmt.Sprintf("%v", v))
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{
1821
"jobId": strconv.FormatUint(c.jobId, 10),
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)
1829
defer googleapi.CloseBody(res)
1830
if err := googleapi.CheckResponse(res); err != nil {
1834
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1839
// "description": "Replaces the schedule of a job with the provided schedule.",
1840
// "httpMethod": "PUT",
1841
// "id": "coordinate.schedule.update",
1842
// "parameterOrder": [
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"
1853
// "description": "Job duration in milliseconds.",
1854
// "format": "uint64",
1855
// "location": "query",
1859
// "description": "Scheduled end time in milliseconds since epoch.",
1860
// "format": "uint64",
1861
// "location": "query",
1865
// "description": "Job number",
1866
// "format": "uint64",
1867
// "location": "path",
1868
// "required": true,
1872
// "description": "Scheduled start time in milliseconds since epoch.",
1873
// "format": "uint64",
1874
// "location": "query",
1878
// "description": "Team ID",
1879
// "location": "path",
1880
// "required": true,
1884
// "path": "{teamId}/jobs/{jobId}/schedule",
1886
// "$ref": "Schedule"
1889
// "$ref": "Schedule"
1892
// "https://www.googleapis.com/auth/coordinate"
1898
// method id "coordinate.worker.list":
1900
type WorkerListCall struct {
1903
opt_ map[string]interface{}
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{})}
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)
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))
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{
1934
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1935
res, err := c.s.client.Do(req)
1939
defer googleapi.CloseBody(res)
1940
if err := googleapi.CheckResponse(res); err != nil {
1943
var ret *WorkerListResponse
1944
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1949
// "description": "Retrieves a list of workers in a team.",
1950
// "httpMethod": "GET",
1951
// "id": "coordinate.worker.list",
1952
// "parameterOrder": [
1957
// "description": "Team ID",
1958
// "location": "path",
1959
// "required": true,
1963
// "path": "{teamId}/workers",
1965
// "$ref": "WorkerListResponse"
1968
// "https://www.googleapis.com/auth/coordinate",
1969
// "https://www.googleapis.com/auth/coordinate.readonly"