/
classes.rb
968 lines (799 loc) · 36.3 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
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
# Copyright 2020 Google LLC
#
# 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 DiscoveryV1
#
class DirectoryList
include Google::Apis::Core::Hashable
# Indicate the version of the Discovery API used to generate this doc.
# Corresponds to the JSON property `discoveryVersion`
# @return [String]
attr_accessor :discovery_version
# The individual directory entries. One entry per api/version pair.
# Corresponds to the JSON property `items`
# @return [Array<Google::Apis::DiscoveryV1::DirectoryList::Item>]
attr_accessor :items
# The kind for this response.
# 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)
@discovery_version = args[:discovery_version] if args.key?(:discovery_version)
@items = args[:items] if args.key?(:items)
@kind = args[:kind] if args.key?(:kind)
end
#
class Item
include Google::Apis::Core::Hashable
# The description of this API.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# A link to the discovery document.
# Corresponds to the JSON property `discoveryLink`
# @return [String]
attr_accessor :discovery_link
# The URL for the discovery REST document.
# Corresponds to the JSON property `discoveryRestUrl`
# @return [String]
attr_accessor :discovery_rest_url
# A link to human readable documentation for the API.
# Corresponds to the JSON property `documentationLink`
# @return [String]
attr_accessor :documentation_link
# Links to 16x16 and 32x32 icons representing the API.
# Corresponds to the JSON property `icons`
# @return [Google::Apis::DiscoveryV1::DirectoryList::Item::Icons]
attr_accessor :icons
# The id of this API.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# The kind for this response.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Labels for the status of this API, such as labs or deprecated.
# Corresponds to the JSON property `labels`
# @return [Array<String>]
attr_accessor :labels
# The name of the API.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# True if this version is the preferred version to use.
# Corresponds to the JSON property `preferred`
# @return [Boolean]
attr_accessor :preferred
alias_method :preferred?, :preferred
# The title of this API.
# Corresponds to the JSON property `title`
# @return [String]
attr_accessor :title
# The version of the API.
# Corresponds to the JSON property `version`
# @return [String]
attr_accessor :version
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
@discovery_link = args[:discovery_link] if args.key?(:discovery_link)
@discovery_rest_url = args[:discovery_rest_url] if args.key?(:discovery_rest_url)
@documentation_link = args[:documentation_link] if args.key?(:documentation_link)
@icons = args[:icons] if args.key?(:icons)
@id = args[:id] if args.key?(:id)
@kind = args[:kind] if args.key?(:kind)
@labels = args[:labels] if args.key?(:labels)
@name = args[:name] if args.key?(:name)
@preferred = args[:preferred] if args.key?(:preferred)
@title = args[:title] if args.key?(:title)
@version = args[:version] if args.key?(:version)
end
# Links to 16x16 and 32x32 icons representing the API.
class Icons
include Google::Apis::Core::Hashable
# The URL of the 16x16 icon.
# Corresponds to the JSON property `x16`
# @return [String]
attr_accessor :x16
# The URL of the 32x32 icon.
# Corresponds to the JSON property `x32`
# @return [String]
attr_accessor :x32
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@x16 = args[:x16] if args.key?(:x16)
@x32 = args[:x32] if args.key?(:x32)
end
end
end
end
#
class JsonSchema
include Google::Apis::Core::Hashable
# A reference to another schema. The value of this property is the "id" of
# another schema.
# Corresponds to the JSON property `$ref`
# @return [String]
attr_accessor :_ref
# If this is a schema for an object, this property is the schema for any
# additional properties with dynamic keys on this object.
# Corresponds to the JSON property `additionalProperties`
# @return [Google::Apis::DiscoveryV1::JsonSchema]
attr_accessor :additional_properties
# Additional information about this property.
# Corresponds to the JSON property `annotations`
# @return [Google::Apis::DiscoveryV1::JsonSchema::Annotations]
attr_accessor :annotations
# The default value of this property (if one exists).
# Corresponds to the JSON property `default`
# @return [String]
attr_accessor :default
# A description of this object.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Values this parameter may take (if it is an enum).
# Corresponds to the JSON property `enum`
# @return [Array<String>]
attr_accessor :enum
# The descriptions for the enums. Each position maps to the corresponding value
# in the "enum" array.
# Corresponds to the JSON property `enumDescriptions`
# @return [Array<String>]
attr_accessor :enum_descriptions
# An additional regular expression or key that helps constrain the value. For
# more details see: http://tools.ietf.org/html/draft-zyp-json-schema-03#section-
# 5.23
# Corresponds to the JSON property `format`
# @return [String]
attr_accessor :format
# Unique identifier for this schema.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# If this is a schema for an array, this property is the schema for each element
# in the array.
# Corresponds to the JSON property `items`
# @return [Google::Apis::DiscoveryV1::JsonSchema]
attr_accessor :items
# Whether this parameter goes in the query or the path for REST requests.
# Corresponds to the JSON property `location`
# @return [String]
attr_accessor :location
# The maximum value of this parameter.
# Corresponds to the JSON property `maximum`
# @return [String]
attr_accessor :maximum
# The minimum value of this parameter.
# Corresponds to the JSON property `minimum`
# @return [String]
attr_accessor :minimum
# The regular expression this parameter must conform to. Uses Java 6 regex
# format: http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
# Corresponds to the JSON property `pattern`
# @return [String]
attr_accessor :pattern
# If this is a schema for an object, list the schema for each property of this
# object.
# Corresponds to the JSON property `properties`
# @return [Hash<String,Google::Apis::DiscoveryV1::JsonSchema>]
attr_accessor :properties
# The value is read-only, generated by the service. The value cannot be modified
# by the client. If the value is included in a POST, PUT, or PATCH request, it
# is ignored by the service.
# Corresponds to the JSON property `readOnly`
# @return [Boolean]
attr_accessor :read_only
alias_method :read_only?, :read_only
# Whether this parameter may appear multiple times.
# Corresponds to the JSON property `repeated`
# @return [Boolean]
attr_accessor :repeated
alias_method :repeated?, :repeated
# Whether the parameter is required.
# Corresponds to the JSON property `required`
# @return [Boolean]
attr_accessor :required
alias_method :required?, :required
# The value type for this schema. A list of values can be found here: http://
# tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
# In a variant data type, the value of one property is used to determine how to
# interpret the entire entity. Its value must exist in a map of descriminant
# values to schema names.
# Corresponds to the JSON property `variant`
# @return [Google::Apis::DiscoveryV1::JsonSchema::Variant]
attr_accessor :variant
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@_ref = args[:_ref] if args.key?(:_ref)
@additional_properties = args[:additional_properties] if args.key?(:additional_properties)
@annotations = args[:annotations] if args.key?(:annotations)
@default = args[:default] if args.key?(:default)
@description = args[:description] if args.key?(:description)
@enum = args[:enum] if args.key?(:enum)
@enum_descriptions = args[:enum_descriptions] if args.key?(:enum_descriptions)
@format = args[:format] if args.key?(:format)
@id = args[:id] if args.key?(:id)
@items = args[:items] if args.key?(:items)
@location = args[:location] if args.key?(:location)
@maximum = args[:maximum] if args.key?(:maximum)
@minimum = args[:minimum] if args.key?(:minimum)
@pattern = args[:pattern] if args.key?(:pattern)
@properties = args[:properties] if args.key?(:properties)
@read_only = args[:read_only] if args.key?(:read_only)
@repeated = args[:repeated] if args.key?(:repeated)
@required = args[:required] if args.key?(:required)
@type = args[:type] if args.key?(:type)
@variant = args[:variant] if args.key?(:variant)
end
# Additional information about this property.
class Annotations
include Google::Apis::Core::Hashable
# A list of methods for which this property is required on requests.
# Corresponds to the JSON property `required`
# @return [Array<String>]
attr_accessor :required
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@required = args[:required] if args.key?(:required)
end
end
# In a variant data type, the value of one property is used to determine how to
# interpret the entire entity. Its value must exist in a map of descriminant
# values to schema names.
class Variant
include Google::Apis::Core::Hashable
# The name of the type discriminant property.
# Corresponds to the JSON property `discriminant`
# @return [String]
attr_accessor :discriminant
# The map of discriminant value to schema to use for parsing..
# Corresponds to the JSON property `map`
# @return [Array<Google::Apis::DiscoveryV1::JsonSchema::Variant::Map>]
attr_accessor :map
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@discriminant = args[:discriminant] if args.key?(:discriminant)
@map = args[:map] if args.key?(:map)
end
#
class Map
include Google::Apis::Core::Hashable
#
# Corresponds to the JSON property `$ref`
# @return [String]
attr_accessor :_ref
#
# Corresponds to the JSON property `type_value`
# @return [String]
attr_accessor :type_value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@_ref = args[:_ref] if args.key?(:_ref)
@type_value = args[:type_value] if args.key?(:type_value)
end
end
end
end
#
class RestDescription
include Google::Apis::Core::Hashable
# Authentication information.
# Corresponds to the JSON property `auth`
# @return [Google::Apis::DiscoveryV1::RestDescription::Auth]
attr_accessor :auth
# [DEPRECATED] The base path for REST requests.
# Corresponds to the JSON property `basePath`
# @return [String]
attr_accessor :base_path
# [DEPRECATED] The base URL for REST requests.
# Corresponds to the JSON property `baseUrl`
# @return [String]
attr_accessor :base_url
# The path for REST batch requests.
# Corresponds to the JSON property `batchPath`
# @return [String]
attr_accessor :batch_path
# Indicates how the API name should be capitalized and split into various parts.
# Useful for generating pretty class names.
# Corresponds to the JSON property `canonicalName`
# @return [String]
attr_accessor :canonical_name
# The description of this API.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Indicate the version of the Discovery API used to generate this doc.
# Corresponds to the JSON property `discoveryVersion`
# @return [String]
attr_accessor :discovery_version
# A link to human readable documentation for the API.
# Corresponds to the JSON property `documentationLink`
# @return [String]
attr_accessor :documentation_link
# The ETag for this response.
# Corresponds to the JSON property `etag`
# @return [String]
attr_accessor :etag
# Enable exponential backoff for suitable methods in the generated clients.
# Corresponds to the JSON property `exponentialBackoffDefault`
# @return [Boolean]
attr_accessor :exponential_backoff_default
alias_method :exponential_backoff_default?, :exponential_backoff_default
# A list of supported features for this API.
# Corresponds to the JSON property `features`
# @return [Array<String>]
attr_accessor :features
# Links to 16x16 and 32x32 icons representing the API.
# Corresponds to the JSON property `icons`
# @return [Google::Apis::DiscoveryV1::RestDescription::Icons]
attr_accessor :icons
# The ID of this API.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# The kind for this response.
# Corresponds to the JSON property `kind`
# @return [String]
attr_accessor :kind
# Labels for the status of this API, such as labs or deprecated.
# Corresponds to the JSON property `labels`
# @return [Array<String>]
attr_accessor :labels
# API-level methods for this API.
# Corresponds to the JSON property `methods`
# @return [Hash<String,Google::Apis::DiscoveryV1::RestMethod>]
attr_accessor :api_methods
# The name of this API.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The domain of the owner of this API. Together with the ownerName and a
# packagePath values, this can be used to generate a library for this API which
# would have a unique fully qualified name.
# Corresponds to the JSON property `ownerDomain`
# @return [String]
attr_accessor :owner_domain
# The name of the owner of this API. See ownerDomain.
# Corresponds to the JSON property `ownerName`
# @return [String]
attr_accessor :owner_name
# The package of the owner of this API. See ownerDomain.
# Corresponds to the JSON property `packagePath`
# @return [String]
attr_accessor :package_path
# Common parameters that apply across all apis.
# Corresponds to the JSON property `parameters`
# @return [Hash<String,Google::Apis::DiscoveryV1::JsonSchema>]
attr_accessor :parameters
# The protocol described by this document.
# Corresponds to the JSON property `protocol`
# @return [String]
attr_accessor :protocol
# The resources in this API.
# Corresponds to the JSON property `resources`
# @return [Hash<String,Google::Apis::DiscoveryV1::RestResource>]
attr_accessor :resources
# The version of this API.
# Corresponds to the JSON property `revision`
# @return [String]
attr_accessor :revision
# The root URL under which all API services live.
# Corresponds to the JSON property `rootUrl`
# @return [String]
attr_accessor :root_url
# The schemas for this API.
# Corresponds to the JSON property `schemas`
# @return [Hash<String,Google::Apis::DiscoveryV1::JsonSchema>]
attr_accessor :schemas
# The base path for all REST requests.
# Corresponds to the JSON property `servicePath`
# @return [String]
attr_accessor :service_path
# The title of this API.
# Corresponds to the JSON property `title`
# @return [String]
attr_accessor :title
# The version of this API.
# Corresponds to the JSON property `version`
# @return [String]
attr_accessor :version
#
# Corresponds to the JSON property `version_module`
# @return [Boolean]
attr_accessor :version_module
alias_method :version_module?, :version_module
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@auth = args[:auth] if args.key?(:auth)
@base_path = args[:base_path] if args.key?(:base_path)
@base_url = args[:base_url] if args.key?(:base_url)
@batch_path = args[:batch_path] if args.key?(:batch_path)
@canonical_name = args[:canonical_name] if args.key?(:canonical_name)
@description = args[:description] if args.key?(:description)
@discovery_version = args[:discovery_version] if args.key?(:discovery_version)
@documentation_link = args[:documentation_link] if args.key?(:documentation_link)
@etag = args[:etag] if args.key?(:etag)
@exponential_backoff_default = args[:exponential_backoff_default] if args.key?(:exponential_backoff_default)
@features = args[:features] if args.key?(:features)
@icons = args[:icons] if args.key?(:icons)
@id = args[:id] if args.key?(:id)
@kind = args[:kind] if args.key?(:kind)
@labels = args[:labels] if args.key?(:labels)
@api_methods = args[:api_methods] if args.key?(:api_methods)
@name = args[:name] if args.key?(:name)
@owner_domain = args[:owner_domain] if args.key?(:owner_domain)
@owner_name = args[:owner_name] if args.key?(:owner_name)
@package_path = args[:package_path] if args.key?(:package_path)
@parameters = args[:parameters] if args.key?(:parameters)
@protocol = args[:protocol] if args.key?(:protocol)
@resources = args[:resources] if args.key?(:resources)
@revision = args[:revision] if args.key?(:revision)
@root_url = args[:root_url] if args.key?(:root_url)
@schemas = args[:schemas] if args.key?(:schemas)
@service_path = args[:service_path] if args.key?(:service_path)
@title = args[:title] if args.key?(:title)
@version = args[:version] if args.key?(:version)
@version_module = args[:version_module] if args.key?(:version_module)
end
# Authentication information.
class Auth
include Google::Apis::Core::Hashable
# OAuth 2.0 authentication information.
# Corresponds to the JSON property `oauth2`
# @return [Google::Apis::DiscoveryV1::RestDescription::Auth::Oauth2]
attr_accessor :oauth2
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@oauth2 = args[:oauth2] if args.key?(:oauth2)
end
# OAuth 2.0 authentication information.
class Oauth2
include Google::Apis::Core::Hashable
# Available OAuth 2.0 scopes.
# Corresponds to the JSON property `scopes`
# @return [Hash<String,Google::Apis::DiscoveryV1::RestDescription::Auth::Oauth2::Scope>]
attr_accessor :scopes
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@scopes = args[:scopes] if args.key?(:scopes)
end
# The scope value.
class Scope
include Google::Apis::Core::Hashable
# Description of scope.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
end
end
end
end
# Links to 16x16 and 32x32 icons representing the API.
class Icons
include Google::Apis::Core::Hashable
# The URL of the 16x16 icon.
# Corresponds to the JSON property `x16`
# @return [String]
attr_accessor :x16
# The URL of the 32x32 icon.
# Corresponds to the JSON property `x32`
# @return [String]
attr_accessor :x32
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@x16 = args[:x16] if args.key?(:x16)
@x32 = args[:x32] if args.key?(:x32)
end
end
end
#
class RestMethod
include Google::Apis::Core::Hashable
# Description of this method.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# Whether this method requires an ETag to be specified. The ETag is sent as an
# HTTP If-Match or If-None-Match header.
# Corresponds to the JSON property `etagRequired`
# @return [Boolean]
attr_accessor :etag_required
alias_method :etag_required?, :etag_required
# The URI path of this REST method in (RFC 6570) format without level 2 features
# (`+var`). Supplementary to the path property.
# Corresponds to the JSON property `flatPath`
# @return [String]
attr_accessor :flat_path
# HTTP method used by this method.
# Corresponds to the JSON property `httpMethod`
# @return [String]
attr_accessor :http_method
# A unique ID for this method. This property can be used to match methods
# between different versions of Discovery.
# Corresponds to the JSON property `id`
# @return [String]
attr_accessor :id
# Media upload parameters.
# Corresponds to the JSON property `mediaUpload`
# @return [Google::Apis::DiscoveryV1::RestMethod::MediaUpload]
attr_accessor :media_upload
# Ordered list of required parameters, serves as a hint to clients on how to
# structure their method signatures. The array is ordered such that the "most-
# significant" parameter appears first.
# Corresponds to the JSON property `parameterOrder`
# @return [Array<String>]
attr_accessor :parameter_order
# Details for all parameters in this method.
# Corresponds to the JSON property `parameters`
# @return [Hash<String,Google::Apis::DiscoveryV1::JsonSchema>]
attr_accessor :parameters
# The URI path of this REST method. Should be used in conjunction with the
# basePath property at the api-level.
# Corresponds to the JSON property `path`
# @return [String]
attr_accessor :path
# The schema for the request.
# Corresponds to the JSON property `request`
# @return [Google::Apis::DiscoveryV1::RestMethod::Request]
attr_accessor :request
# The schema for the response.
# Corresponds to the JSON property `response`
# @return [Google::Apis::DiscoveryV1::RestMethod::Response]
attr_accessor :response
# OAuth 2.0 scopes applicable to this method.
# Corresponds to the JSON property `scopes`
# @return [Array<String>]
attr_accessor :scopes
# Whether this method supports media downloads.
# Corresponds to the JSON property `supportsMediaDownload`
# @return [Boolean]
attr_accessor :supports_media_download
alias_method :supports_media_download?, :supports_media_download
# Whether this method supports media uploads.
# Corresponds to the JSON property `supportsMediaUpload`
# @return [Boolean]
attr_accessor :supports_media_upload
alias_method :supports_media_upload?, :supports_media_upload
# Whether this method supports subscriptions.
# Corresponds to the JSON property `supportsSubscription`
# @return [Boolean]
attr_accessor :supports_subscription
alias_method :supports_subscription?, :supports_subscription
# Indicates that downloads from this method should use the download service URL (
# i.e. "/download"). Only applies if the method supports media download.
# Corresponds to the JSON property `useMediaDownloadService`
# @return [Boolean]
attr_accessor :use_media_download_service
alias_method :use_media_download_service?, :use_media_download_service
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
@etag_required = args[:etag_required] if args.key?(:etag_required)
@flat_path = args[:flat_path] if args.key?(:flat_path)
@http_method = args[:http_method] if args.key?(:http_method)
@id = args[:id] if args.key?(:id)
@media_upload = args[:media_upload] if args.key?(:media_upload)
@parameter_order = args[:parameter_order] if args.key?(:parameter_order)
@parameters = args[:parameters] if args.key?(:parameters)
@path = args[:path] if args.key?(:path)
@request = args[:request] if args.key?(:request)
@response = args[:response] if args.key?(:response)
@scopes = args[:scopes] if args.key?(:scopes)
@supports_media_download = args[:supports_media_download] if args.key?(:supports_media_download)
@supports_media_upload = args[:supports_media_upload] if args.key?(:supports_media_upload)
@supports_subscription = args[:supports_subscription] if args.key?(:supports_subscription)
@use_media_download_service = args[:use_media_download_service] if args.key?(:use_media_download_service)
end
# Media upload parameters.
class MediaUpload
include Google::Apis::Core::Hashable
# MIME Media Ranges for acceptable media uploads to this method.
# Corresponds to the JSON property `accept`
# @return [Array<String>]
attr_accessor :accept
# Maximum size of a media upload, such as "1MB", "2GB" or "3TB".
# Corresponds to the JSON property `maxSize`
# @return [String]
attr_accessor :max_size
# Supported upload protocols.
# Corresponds to the JSON property `protocols`
# @return [Google::Apis::DiscoveryV1::RestMethod::MediaUpload::Protocols]
attr_accessor :protocols
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@accept = args[:accept] if args.key?(:accept)
@max_size = args[:max_size] if args.key?(:max_size)
@protocols = args[:protocols] if args.key?(:protocols)
end
# Supported upload protocols.
class Protocols
include Google::Apis::Core::Hashable
# Supports the Resumable Media Upload protocol.
# Corresponds to the JSON property `resumable`
# @return [Google::Apis::DiscoveryV1::RestMethod::MediaUpload::Protocols::Resumable]
attr_accessor :resumable
# Supports uploading as a single HTTP request.
# Corresponds to the JSON property `simple`
# @return [Google::Apis::DiscoveryV1::RestMethod::MediaUpload::Protocols::Simple]
attr_accessor :simple
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@resumable = args[:resumable] if args.key?(:resumable)
@simple = args[:simple] if args.key?(:simple)
end
# Supports the Resumable Media Upload protocol.
class Resumable
include Google::Apis::Core::Hashable
# True if this endpoint supports uploading multipart media.
# Corresponds to the JSON property `multipart`
# @return [Boolean]
attr_accessor :multipart
alias_method :multipart?, :multipart
# The URI path to be used for upload. Should be used in conjunction with the
# basePath property at the api-level.
# Corresponds to the JSON property `path`
# @return [String]
attr_accessor :path
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@multipart = args[:multipart] if args.key?(:multipart)
@path = args[:path] if args.key?(:path)
end
end
# Supports uploading as a single HTTP request.
class Simple
include Google::Apis::Core::Hashable
# True if this endpoint supports upload multipart media.
# Corresponds to the JSON property `multipart`
# @return [Boolean]
attr_accessor :multipart
alias_method :multipart?, :multipart
# The URI path to be used for upload. Should be used in conjunction with the
# basePath property at the api-level.
# Corresponds to the JSON property `path`
# @return [String]
attr_accessor :path
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@multipart = args[:multipart] if args.key?(:multipart)
@path = args[:path] if args.key?(:path)
end
end
end
end
# The schema for the request.
class Request
include Google::Apis::Core::Hashable
# Schema ID for the request schema.
# Corresponds to the JSON property `$ref`
# @return [String]
attr_accessor :_ref
# parameter name.
# Corresponds to the JSON property `parameterName`
# @return [String]
attr_accessor :parameter_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@_ref = args[:_ref] if args.key?(:_ref)
@parameter_name = args[:parameter_name] if args.key?(:parameter_name)
end
end
# The schema for the response.
class Response
include Google::Apis::Core::Hashable
# Schema ID for the response schema.
# Corresponds to the JSON property `$ref`
# @return [String]
attr_accessor :_ref
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@_ref = args[:_ref] if args.key?(:_ref)
end
end
end
#
class RestResource
include Google::Apis::Core::Hashable
# Methods on this resource.
# Corresponds to the JSON property `methods`
# @return [Hash<String,Google::Apis::DiscoveryV1::RestMethod>]
attr_accessor :api_methods
# Sub-resources on this resource.
# Corresponds to the JSON property `resources`
# @return [Hash<String,Google::Apis::DiscoveryV1::RestResource>]
attr_accessor :resources
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@api_methods = args[:api_methods] if args.key?(:api_methods)
@resources = args[:resources] if args.key?(:resources)
end
end
end
end
end