forked from googleapis/google-api-ruby-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.rb
669 lines (547 loc) · 21.9 KB
/
classes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module CoordinateV1
# Custom field.
class CustomField
include Google::Apis::Core::Hashable
# Custom field id.
# Corresponds to the JSON property `customFieldId`
# @return [String]
attr_accessor :custom_field_id
# Identifies this object as a custom field.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Custom field value.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@custom_field_id = args[:custom_field_id] unless args[:custom_field_id].nil?
@kind = args[:kind] unless args[:kind].nil?
@value = args[:value] unless args[:value].nil?
end
end
# Custom field definition.
class CustomFieldDef
include Google::Apis::Core::Hashable
# Whether the field is enabled.
# Corresponds to the JSON property `enabled`
# @return [Boolean]
attr_accessor :enabled
alias_method :enabled?, :enabled
# List of enum items for this custom field. Populated only if the field type is
# enum. Enum fields appear as 'lists' in the Coordinate web and mobile UI.
# Corresponds to the JSON property `enumitems`
# @return [Array<Google::Apis::CoordinateV1::EnumItemDef>]
attr_accessor :enumitems
# Custom field id.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# Identifies this object as a custom field definition.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Custom field name.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Whether the field is required for checkout.
# Corresponds to the JSON property `requiredForCheckout`
# @return [Boolean]
attr_accessor :required_for_checkout
alias_method :required_for_checkout?, :required_for_checkout
# Custom field type.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@enabled = args[:enabled] unless args[:enabled].nil?
@enumitems = args[:enumitems] unless args[:enumitems].nil?
@id = args[:id] unless args[:id].nil?
@kind = args[:kind] unless args[:kind].nil?
@name = args[:name] unless args[:name].nil?
@required_for_checkout = args[:required_for_checkout] unless args[:required_for_checkout].nil?
@type = args[:type] unless args[:type].nil?
end
end
# Collection of custom field definitions for a team.
class ListCustomFieldDefResponse
include Google::Apis::Core::Hashable
# Collection of custom field definitions in a team.
# Corresponds to the JSON property `items`
# @return [Array<Google::Apis::CoordinateV1::CustomFieldDef>]
attr_accessor :items
# Identifies this object as a collection of custom field definitions in a team.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@items = args[:items] unless args[:items].nil?
@kind = args[:kind] unless args[:kind].nil?
end
end
# Collection of custom fields.
class CustomFields
include Google::Apis::Core::Hashable
# Collection of custom fields.
# Corresponds to the JSON property `customField`
# @return [Array<Google::Apis::CoordinateV1::CustomField>]
attr_accessor :custom_field
# Identifies this object as a collection of custom fields.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@custom_field = args[:custom_field] unless args[:custom_field].nil?
@kind = args[:kind] unless args[:kind].nil?
end
end
# Enum Item definition.
class EnumItemDef
include Google::Apis::Core::Hashable
# Whether the enum item is active. Jobs may contain inactive enum values;
# however, setting an enum to an inactive value when creating or updating a job
# will result in a 500 error.
# Corresponds to the JSON property `active`
# @return [Boolean]
attr_accessor :active
alias_method :active?, :active
# Identifies this object as an enum item definition.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Custom field value.
# Corresponds to the JSON property `value`
# @return [String]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@active = args[:active] unless args[:active].nil?
@kind = args[:kind] unless args[:kind].nil?
@value = args[:value] unless args[:value].nil?
end
end
# A job.
class Job
include Google::Apis::Core::Hashable
# Job id.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# List of job changes since it was created. The first change corresponds to the
# state of the job when it was created.
# Corresponds to the JSON property `jobChange`
# @return [Array<Google::Apis::CoordinateV1::JobChange>]
attr_accessor :job_change
# Identifies this object as a job.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Current state of a job.
# Corresponds to the JSON property `state`
# @return [Google::Apis::CoordinateV1::JobState]
attr_accessor :state
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@id = args[:id] unless args[:id].nil?
@job_change = args[:job_change] unless args[:job_change].nil?
@kind = args[:kind] unless args[:kind].nil?
@state = args[:state] unless args[:state].nil?
end
end
# Change to a job. For example assigning the job to a different worker.
class JobChange
include Google::Apis::Core::Hashable
# Identifies this object as a job change.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Current state of a job.
# Corresponds to the JSON property `state`
# @return [Google::Apis::CoordinateV1::JobState]
attr_accessor :state
# Time at which this change was applied.
# Corresponds to the JSON property `timestamp`
# @return [String]
attr_accessor :timestamp
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@kind = args[:kind] unless args[:kind].nil?
@state = args[:state] unless args[:state].nil?
@timestamp = args[:timestamp] unless args[:timestamp].nil?
end
end
# Response from a List Jobs request.
class ListJobResponse
include Google::Apis::Core::Hashable
# Jobs in the collection.
# Corresponds to the JSON property `items`
# @return [Array<Google::Apis::CoordinateV1::Job>]
attr_accessor :items
# Identifies this object as a list of jobs.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# A token to provide to get the next page of results.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@items = args[:items] unless args[:items].nil?
@kind = args[:kind] unless args[:kind].nil?
@next_page_token = args[:next_page_token] unless args[:next_page_token].nil?
end
end
# Current state of a job.
class JobState
include Google::Apis::Core::Hashable
# Email address of the assignee, or the string "DELETED_USER" if the account is
# no longer available.
# Corresponds to the JSON property `assignee`
# @return [String]
attr_accessor :assignee
# Collection of custom fields.
# Corresponds to the JSON property `customFields`
# @return [Google::Apis::CoordinateV1::CustomFields]
attr_accessor :custom_fields
# Customer name.
# Corresponds to the JSON property `customerName`
# @return [String]
attr_accessor :customer_name
# Customer phone number.
# Corresponds to the JSON property `customerPhoneNumber`
# @return [String]
attr_accessor :customer_phone_number
# Identifies this object as a job state.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Location of a job.
# Corresponds to the JSON property `location`
# @return [Google::Apis::CoordinateV1::Location]
attr_accessor :location
# Note added to the job.
# Corresponds to the JSON property `note`
# @return [Array<String>]
attr_accessor :note
# Job progress.
# Corresponds to the JSON property `progress`
# @return [String]
attr_accessor :progress
# Job title.
# Corresponds to the JSON property `title`
# @return [String]
attr_accessor :title
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@assignee = args[:assignee] unless args[:assignee].nil?
@custom_fields = args[:custom_fields] unless args[:custom_fields].nil?
@customer_name = args[:customer_name] unless args[:customer_name].nil?
@customer_phone_number = args[:customer_phone_number] unless args[:customer_phone_number].nil?
@kind = args[:kind] unless args[:kind].nil?
@location = args[:location] unless args[:location].nil?
@note = args[:note] unless args[:note].nil?
@progress = args[:progress] unless args[:progress].nil?
@title = args[:title] unless args[:title].nil?
end
end
# Location of a job.
class Location
include Google::Apis::Core::Hashable
# Address.
# Corresponds to the JSON property `addressLine`
# @return [Array<String>]
attr_accessor :address_line
# Identifies this object as a location.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Latitude.
# Corresponds to the JSON property `lat`
# @return [Float]
attr_accessor :lat
# Longitude.
# Corresponds to the JSON property `lng`
# @return [Float]
attr_accessor :lng
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@address_line = args[:address_line] unless args[:address_line].nil?
@kind = args[:kind] unless args[:kind].nil?
@lat = args[:lat] unless args[:lat].nil?
@lng = args[:lng] unless args[:lng].nil?
end
end
# Response from a List Locations request.
class ListLocationResponse
include Google::Apis::Core::Hashable
# Locations in the collection.
# Corresponds to the JSON property `items`
# @return [Array<Google::Apis::CoordinateV1::LocationRecord>]
attr_accessor :items
# Identifies this object as a list of locations.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# A token to provide to get the next page of results.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# Pagination information.
# Corresponds to the JSON property `tokenPagination`
# @return [Google::Apis::CoordinateV1::TokenPagination]
attr_accessor :token_pagination
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@items = args[:items] unless args[:items].nil?
@kind = args[:kind] unless args[:kind].nil?
@next_page_token = args[:next_page_token] unless args[:next_page_token].nil?
@token_pagination = args[:token_pagination] unless args[:token_pagination].nil?
end
end
# Recorded location of a worker.
class LocationRecord
include Google::Apis::Core::Hashable
# The collection time in milliseconds since the epoch.
# Corresponds to the JSON property `collectionTime`
# @return [String]
attr_accessor :collection_time
# The location accuracy in meters. This is the radius of a 95% confidence
# interval around the location measurement.
# Corresponds to the JSON property `confidenceRadius`
# @return [Float]
attr_accessor :confidence_radius
# Identifies this object as a location.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Latitude.
# Corresponds to the JSON property `latitude`
# @return [Float]
attr_accessor :latitude
# Longitude.
# Corresponds to the JSON property `longitude`
# @return [Float]
attr_accessor :longitude
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@collection_time = args[:collection_time] unless args[:collection_time].nil?
@confidence_radius = args[:confidence_radius] unless args[:confidence_radius].nil?
@kind = args[:kind] unless args[:kind].nil?
@latitude = args[:latitude] unless args[:latitude].nil?
@longitude = args[:longitude] unless args[:longitude].nil?
end
end
# Job schedule.
class Schedule
include Google::Apis::Core::Hashable
# Whether the job is scheduled for the whole day. Time of day in start/end times
# is ignored if this is true.
# Corresponds to the JSON property `allDay`
# @return [Boolean]
attr_accessor :all_day
alias_method :all_day?, :all_day
# Job duration in milliseconds.
# Corresponds to the JSON property `duration`
# @return [String]
attr_accessor :duration
# Scheduled end time in milliseconds since epoch.
# Corresponds to the JSON property `endTime`
# @return [String]
attr_accessor :end_time
# Identifies this object as a job schedule.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Scheduled start time in milliseconds since epoch.
# Corresponds to the JSON property `startTime`
# @return [String]
attr_accessor :start_time
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@all_day = args[:all_day] unless args[:all_day].nil?
@duration = args[:duration] unless args[:duration].nil?
@end_time = args[:end_time] unless args[:end_time].nil?
@kind = args[:kind] unless args[:kind].nil?
@start_time = args[:start_time] unless args[:start_time].nil?
end
end
# A Coordinate team.
class Team
include Google::Apis::Core::Hashable
# Team id, as found in a coordinate team url e.g. https://coordinate.google.com/
# f/xyz where "xyz" is the team id.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# Identifies this object as a team.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Team name
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@id = args[:id] unless args[:id].nil?
@kind = args[:kind] unless args[:kind].nil?
@name = args[:name] unless args[:name].nil?
end
end
# Response from a List Teams request.
class ListTeamResponse
include Google::Apis::Core::Hashable
# Teams in the collection.
# Corresponds to the JSON property `items`
# @return [Array<Google::Apis::CoordinateV1::Team>]
attr_accessor :items
# Identifies this object as a list of teams.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@items = args[:items] unless args[:items].nil?
@kind = args[:kind] unless args[:kind].nil?
end
end
# Pagination information.
class TokenPagination
include Google::Apis::Core::Hashable
# Identifies this object as pagination information.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# A token to provide to get the next page of results.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# A token to provide to get the previous page of results.
# Corresponds to the JSON property `previousPageToken`
# @return [String]
attr_accessor :previous_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@kind = args[:kind] unless args[:kind].nil?
@next_page_token = args[:next_page_token] unless args[:next_page_token].nil?
@previous_page_token = args[:previous_page_token] unless args[:previous_page_token].nil?
end
end
# A worker in a Coordinate team.
class Worker
include Google::Apis::Core::Hashable
# Worker email address. If a worker has been deleted from your team, the email
# address will appear as DELETED_USER.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# Identifies this object as a worker.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@id = args[:id] unless args[:id].nil?
@kind = args[:kind] unless args[:kind].nil?
end
end
# Response from a List Workers request.
class ListWorkerResponse
include Google::Apis::Core::Hashable
# Workers in the collection.
# Corresponds to the JSON property `items`
# @return [Array<Google::Apis::CoordinateV1::Worker>]
attr_accessor :items
# Identifies this object as a list of workers.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@items = args[:items] unless args[:items].nil?
@kind = args[:kind] unless args[:kind].nil?
end
end
end
end
end