gapic-generator 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/lib/gapic/generator/version.rb +1 -1
  4. data/lib/gapic/generators/default_generator.rb +2 -0
  5. data/lib/gapic/generators/default_generator_parameters.rb +3 -1
  6. data/lib/gapic/grpc_service_config/{service_config.rb → config.rb} +2 -2
  7. data/lib/gapic/grpc_service_config/parser.rb +8 -8
  8. data/lib/gapic/model/method/http_annotation.rb +123 -0
  9. data/lib/gapic/model/method/lro.rb +160 -0
  10. data/lib/gapic/model/method/routing.rb +263 -0
  11. data/lib/gapic/model/mixins.rb +181 -0
  12. data/lib/gapic/model/model_error.rb +26 -0
  13. data/lib/gapic/model/service/nonstandard_lro_provider.rb +293 -0
  14. data/lib/gapic/model.rb +22 -0
  15. data/lib/gapic/path_pattern/pattern.rb +46 -0
  16. data/lib/gapic/path_pattern/segment.rb +97 -9
  17. data/lib/gapic/presenters/gem_presenter.rb +34 -2
  18. data/lib/gapic/presenters/{service_config_presenter.rb → grpc_service_config_presenter.rb} +1 -1
  19. data/lib/gapic/presenters/method_presenter.rb +43 -3
  20. data/lib/gapic/presenters/method_rest_presenter.rb +33 -55
  21. data/lib/gapic/presenters/service/lro_client_presenter.rb +90 -0
  22. data/lib/gapic/presenters/service_presenter.rb +185 -3
  23. data/lib/gapic/presenters/service_rest_presenter.rb +81 -0
  24. data/lib/gapic/presenters/snippet_presenter.rb +1 -0
  25. data/lib/gapic/presenters.rb +3 -1
  26. data/lib/gapic/schema/api.rb +56 -2
  27. data/lib/gapic/schema/loader.rb +4 -1
  28. data/lib/gapic/schema/service_config_parser.rb +118 -0
  29. data/lib/gapic/schema/wrappers.rb +124 -1
  30. data/lib/google/api/auth.pb.rb +75 -0
  31. data/lib/google/api/backend.pb.rb +59 -0
  32. data/lib/google/api/billing.pb.rb +53 -0
  33. data/lib/google/api/context.pb.rb +47 -0
  34. data/lib/google/api/control.pb.rb +38 -0
  35. data/lib/google/api/documentation.pb.rb +56 -0
  36. data/lib/google/api/endpoint.pb.rb +42 -0
  37. data/lib/google/api/label.pb.rb +49 -0
  38. data/lib/google/api/launch_stage.pb.rb +37 -0
  39. data/lib/google/api/log.pb.rb +47 -0
  40. data/lib/google/api/logging.pb.rb +48 -0
  41. data/lib/google/api/metric.pb.rb +90 -0
  42. data/lib/google/api/monitored_resource.pb.rb +68 -0
  43. data/lib/google/api/monitoring.pb.rb +48 -0
  44. data/lib/google/api/quota.pb.rb +63 -0
  45. data/lib/google/api/routing.pb.rb +58 -0
  46. data/lib/google/api/service.pb.rb +90 -0
  47. data/lib/google/api/source_info.pb.rb +44 -0
  48. data/lib/google/api/system_parameter.pb.rb +51 -0
  49. data/lib/google/api/usage.pb.rb +47 -0
  50. data/lib/google/cloud/extended_operations.pb.rb +57 -0
  51. data/lib/google/protobuf/any.pb.rb +1 -1
  52. data/lib/google/protobuf/api.pb.rb +69 -0
  53. data/lib/google/protobuf/descriptor.pb.rb +1 -1
  54. data/lib/google/protobuf/duration.pb.rb +41 -0
  55. data/lib/google/protobuf/source_context.pb.rb +39 -0
  56. data/lib/google/protobuf/struct.pb.rb +65 -0
  57. data/lib/google/protobuf/type.pb.rb +128 -0
  58. data/lib/google/protobuf/wrappers.pb.rb +80 -0
  59. data/templates/default/gem/yardopts.erb +1 -1
  60. data/templates/default/lib/_package.erb +4 -0
  61. data/templates/default/lib/_service.erb +6 -0
  62. data/templates/default/service/client/_client.erb +20 -8
  63. data/templates/default/service/client/_nonstandard_lro.erb +57 -0
  64. data/templates/default/service/client/_self_configure_defaults.erb +2 -2
  65. data/templates/default/service/client/method/def/_options_defaults.erb +1 -8
  66. data/templates/default/service/client/method/def/_response.erb +2 -0
  67. data/templates/default/service/client/method/def/_response_nonstandard_lro.erb +23 -0
  68. data/templates/default/service/client/method/def/_routing_params.erb +36 -0
  69. data/templates/default/service/nonstandard_lro.erb +6 -0
  70. data/templates/default/service/rest/client/_client.erb +32 -5
  71. data/templates/default/service/rest/client/method/def/_response.erb +2 -2
  72. data/templates/default/service/rest/client/method/def/_response_nonstandard_lro.erb +23 -0
  73. data/templates/default/service/test/method/_assert_response.erb +3 -0
  74. metadata +61 -7
  75. data/templates/default/service/rest/client/method/def/_response_lro.erb +0 -7
@@ -14,6 +14,7 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
 
17
+ require "gapic/model"
17
18
  require "gapic/presenters/enum_presenter"
18
19
  require "gapic/presenters/enum_value_presenter"
19
20
  require "gapic/presenters/field_presenter"
@@ -25,8 +26,9 @@ require "gapic/presenters/method_rest_presenter"
25
26
  require "gapic/presenters/package_presenter"
26
27
  require "gapic/presenters/resource_presenter"
27
28
  require "gapic/presenters/sample_presenter"
29
+ require "gapic/presenters/service/lro_client_presenter"
28
30
  require "gapic/presenters/service_presenter"
29
- require "gapic/presenters/service_config_presenter"
31
+ require "gapic/presenters/grpc_service_config_presenter"
30
32
  require "gapic/presenters/service_rest_presenter"
31
33
  require "gapic/presenters/snippet_presenter"
32
34
 
@@ -20,6 +20,7 @@ require "gapic/generators/default_generator_parameters"
20
20
  require "gapic/schema/loader"
21
21
  require "gapic/schema/request_param_parser"
22
22
  require "gapic/grpc_service_config/parser"
23
+ require "gapic/schema/service_config_parser"
23
24
 
24
25
  module Gapic
25
26
  module Schema
@@ -60,6 +61,7 @@ module Gapic
60
61
  @files.each { |f| f.parent = self }
61
62
  @configuration = configuration
62
63
  @resource_types = analyze_resources
64
+ @nonstandard_lro_services = analyze_nonstandard_lros
63
65
 
64
66
  parameter_schema ||= Gapic::Generators::DefaultGeneratorParameters.default_schema
65
67
  @protoc_parameters = parse_parameter request.parameter, parameter_schema, error_output
@@ -114,14 +116,17 @@ module Gapic
114
116
  configuration[:overrides][:service].fetch str, str
115
117
  end
116
118
 
119
+ # @return [Enumerable<Gapic::Schema::File>]
117
120
  def generate_files
118
121
  @files.select(&:generate?)
119
122
  end
120
123
 
124
+ # @return [Enumerable<Gapic::Schema::Service>]
121
125
  def services
122
126
  @files.map(&:services).flatten
123
127
  end
124
128
 
129
+ # @return [Enumerable<Gapic::Schema::Message>]
125
130
  def messages
126
131
  @files.map(&:messages).flatten
127
132
  end
@@ -247,12 +252,12 @@ module Gapic
247
252
 
248
253
  # Whether to generate standalone snippets
249
254
  def generate_standalone_snippets?
250
- configuration[:generate_standalone_snippets] ||= false
255
+ configuration.fetch :generate_standalone_snippets, true
251
256
  end
252
257
 
253
258
  # Whether to generate inline documentation snippets
254
259
  def generate_yardoc_snippets?
255
- configuration[:generate_yardoc_snippets] ||= false
260
+ configuration.fetch :generate_yardoc_snippets, true
256
261
  end
257
262
 
258
263
  # Whether to generate gapic metadata (drift manifest) file
@@ -293,6 +298,22 @@ module Gapic
293
298
  @grpc_service_config ||= Gapic::GrpcServiceConfig::Parser.parse grpc_service_config_raw
294
299
  end
295
300
 
301
+ # Raw text of the service.yaml if given as a parameter
302
+ # or nil if no parameter given
303
+ # @return [String]
304
+ def service_config_raw
305
+ @service_config_raw ||= begin
306
+ filename = protoc_options[:service_yaml]
307
+ ::File.read filename if filename
308
+ end
309
+ end
310
+
311
+ # Parsed service config
312
+ # @return [Google::Api::Service]
313
+ def service_config
314
+ @service_config ||= Gapic::Schema::ServiceConfigParser.parse_service_yaml service_config_raw
315
+ end
316
+
296
317
  # Get a resource given its type string
297
318
  def lookup_resource_type resource_type
298
319
  @resource_types[resource_type]
@@ -318,6 +339,21 @@ module Gapic
318
339
  services.find { |s| s.address == addr }
319
340
  end
320
341
 
342
+ ##
343
+ # Returns a model for the nonstandard LRO for a given service
344
+ # The `analyze_nonstandard_lros` method fills in the model cache
345
+ #
346
+ # @param service_full_name [String]
347
+ #
348
+ # @return [Gapic::Model::Service::NonstandardLroProvider, Gapic::Model::Service::NoNonstandardLro]
349
+ def nonstandard_lro_model_for service_full_name
350
+ if @nonstandard_lro_services.key? service_full_name
351
+ @nonstandard_lro_services[service_full_name]
352
+ else
353
+ Gapic::Model::Service::NoNonstandardLro.instance
354
+ end
355
+ end
356
+
321
357
  ##
322
358
  # Whether configuration has an override for the wrapper gem name
323
359
  # @return [Boolean]
@@ -398,6 +434,24 @@ module Gapic
398
434
  end
399
435
  end
400
436
 
437
+ ##
438
+ # Does a pre-analysis of the nonstandard LRO for every service.
439
+ # For the services that provide nonstandard LRO functionality, cashes a model for the future use
440
+ #
441
+ # @return [Hash<String, Gapic::Model::Service::NonstandardLroProvider>]
442
+ def analyze_nonstandard_lros
443
+ service_registry = {}
444
+
445
+ @files.each do |file|
446
+ file.services.each do |service|
447
+ nonstandard_lro = Gapic::Model::Service.parse_nonstandard_lro service
448
+ service_registry[service.full_name] = nonstandard_lro if nonstandard_lro
449
+ end
450
+ end
451
+
452
+ service_registry
453
+ end
454
+
401
455
  # Parse a comma-delimited list of equals-delimited lists of strings, while
402
456
  # mapping backslash-escaped commas and equal signs to literal characters.
403
457
  # @param str [String]
@@ -18,6 +18,8 @@ require "google/api/annotations.pb"
18
18
  require "google/api/client.pb"
19
19
  require "google/api/field_behavior.pb"
20
20
  require "google/api/resource.pb"
21
+ require "google/api/routing.pb"
22
+ require "google/cloud/extended_operations.pb"
21
23
  require "google/longrunning/operations.pb"
22
24
  require "google/protobuf/descriptor.pb"
23
25
  require "gapic/schema/wrappers"
@@ -36,8 +38,9 @@ module Gapic
36
38
  #
37
39
  # @param file_descriptor [Google::Protobuf::FileDescriptorProto] the
38
40
  # descriptor of the proto file.
39
- # @oaram file_to_generate [Boolean] Whether this file is to be
41
+ # @param file_to_generate [Boolean] Whether this file is to be
40
42
  # generated.
43
+ # @return [Gapic::Schema::File]
41
44
  def load_file file_descriptor, file_to_generate
42
45
  # Setup.
43
46
  address = file_descriptor.package.split "."
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require "yaml"
18
+ require "google/api/service.pb"
19
+
20
+ module Gapic
21
+ module Schema
22
+ # Contains logic for parsing a subset of service.yaml used
23
+ # for the service generation
24
+ module ServiceConfigParser
25
+ class << self
26
+ CONFIG_VERSION_KEY = "config_version"
27
+ NAME_KEY = "name"
28
+ VERSION_KEY = "version"
29
+ ID_KEY = "id"
30
+ TITLE_KEY = "title"
31
+ APIS_KEY = "apis"
32
+ HTTP_KEY = "http"
33
+ HTTP_RULES_KEY = "rules"
34
+ HTTP_RULES_SELECTOR_KEY = "selector"
35
+ HTTP_RULES_VERBS_ALLOWED = ["get", "post", "put", "patch", "delete"].freeze
36
+ HTTP_RULES_BODY_KEY = "body"
37
+ HTTP_RULES_ADDITIONAL_BINDINGS_KEY = "additional_bindings"
38
+
39
+ ##
40
+ # Returns the parsed Google::Api::Service object.
41
+ # Only supports a limited subset of fields.
42
+ #
43
+ # @return [::Google::Api::Service]
44
+ #
45
+ def parse_service_yaml service_yaml_text
46
+ return nil unless service_yaml_text && !service_yaml_text.empty?
47
+ service_yaml = YAML.safe_load service_yaml_text
48
+ service = Google::Api::Service.new
49
+
50
+ if service_yaml.key? CONFIG_VERSION_KEY
51
+ config_ver = Google::Protobuf::UInt32Value.new
52
+ config_ver.value = service_yaml[CONFIG_VERSION_KEY]
53
+ service.config_version = config_ver
54
+ end
55
+
56
+ service.name = service_yaml[NAME_KEY] if service_yaml.key? NAME_KEY
57
+ service.id = service_yaml[ID_KEY] if service_yaml.key? ID_KEY
58
+ service.title = service_yaml[TITLE_KEY] if service_yaml.key? TITLE_KEY
59
+
60
+ service.apis = parse_apis service_yaml[APIS_KEY] if service_yaml.key? APIS_KEY
61
+ service.http = parse_http service_yaml[HTTP_KEY] if service_yaml.key? HTTP_KEY
62
+ service
63
+ end
64
+
65
+ private
66
+
67
+ # Parses the Apis section of the service yaml
68
+ # @return [Enumerable<::Google::Protobuf::Api>]
69
+ def parse_apis apis_yaml
70
+ apis_yaml.map { |api_yaml| parse_api api_yaml }
71
+ end
72
+
73
+ # Parses a single Api from yaml
74
+ # only supports a limited amount of fields
75
+ # @return [::Google::Protobuf::Api]
76
+ def parse_api api_yaml
77
+ api = ::Google::Protobuf::Api.new
78
+ api.name = api_yaml[NAME_KEY] if api_yaml.key? NAME_KEY
79
+ api.version = api_yaml[VERSION_KEY] if api_yaml.key? VERSION_KEY
80
+ api
81
+ end
82
+
83
+ # Parses a http section of the service yaml
84
+ # only supports a limited amount of fields
85
+ # @return [::Google::Api::Http]
86
+ def parse_http http_yaml
87
+ http = Google::Api::Http.new
88
+
89
+ if http_yaml.key? HTTP_RULES_KEY
90
+ http.rules = http_yaml[HTTP_RULES_KEY].map { |rule_yaml| parse_http_rule rule_yaml }
91
+ end
92
+
93
+ http
94
+ end
95
+
96
+ # Parses a single Http rule from yaml
97
+ # only supports a limited amount of fields
98
+ # NB: this method is recursive when parsing additional_bindings field
99
+ # @return [::Google::Api::HttpRule]
100
+ def parse_http_rule rule_yaml
101
+ rule = Google::Api::HttpRule.new
102
+ rule.selector = rule_yaml[HTTP_RULES_SELECTOR_KEY] if rule_yaml.key? HTTP_RULES_SELECTOR_KEY
103
+ verb_path = HTTP_RULES_VERBS_ALLOWED.find { |verb| rule_yaml[verb] }
104
+ rule.send "#{verb_path}=", rule_yaml[verb_path] if verb_path
105
+ rule.body = rule_yaml[HTTP_RULES_BODY_KEY] if rule_yaml.key? HTTP_RULES_BODY_KEY
106
+
107
+ if rule_yaml.key? HTTP_RULES_ADDITIONAL_BINDINGS_KEY
108
+ rule.additional_bindings = rule_yaml[HTTP_RULES_ADDITIONAL_BINDINGS_KEY].map do |binding_yaml|
109
+ parse_http_rule binding_yaml
110
+ end
111
+ end
112
+
113
+ rule
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
@@ -283,6 +283,15 @@ module Gapic
283
283
  @resources ||= Gapic::ResourceLookup.for_service self
284
284
  end
285
285
 
286
+ # @return [String] The full name for this service
287
+ # (e.g. `google.example.Service`).
288
+ # Useful when matching against other pieces of information
289
+ # which also reference full proto name, e.g. Service Config
290
+ # or Grpc Service Config
291
+ def full_name
292
+ @address.join "."
293
+ end
294
+
286
295
  # @!method name
287
296
  # @return [String] the unqualified name of the service.
288
297
  # @!method options
@@ -343,7 +352,7 @@ module Gapic
343
352
  end
344
353
 
345
354
  # @return [Boolean] True if this method is marked as deprecated, false
346
- # otherwise.
355
+ # otherwise.
347
356
  def is_deprecated?
348
357
  options[:deprecated] if options
349
358
  end
@@ -354,6 +363,35 @@ module Gapic
354
363
  options[:".google.api.http"] if options
355
364
  end
356
365
 
366
+ # @return [Google::Api::RoutingRule] The Routing bindings for this method. See
367
+ # `google/api/routing.proto`.
368
+ def routing
369
+ options[:".google.api.routing"] if options
370
+ end
371
+
372
+ # @return [String] The full name for this method
373
+ # (e.g. `google.example.Service.Rpc`).
374
+ # Useful when matching against other pieces of information
375
+ # which also reference full proto name.
376
+ def full_name
377
+ @address.join "."
378
+ end
379
+
380
+ # Nonstandard LRO annotation.
381
+ # @return [String] Name of the nonstandard LRO service
382
+ # that should be used for polling the operation object
383
+ # that this method returns
384
+ def operation_service
385
+ options[:".google.cloud.operation_service"] if options
386
+ end
387
+
388
+ # Nonstandard LRO annotation.
389
+ # @return [Boolean] Whether this method is a polling method
390
+ # for a nonstandard LRO service
391
+ def polling_method
392
+ options[:".google.cloud.operation_polling_method"] if options
393
+ end
394
+
357
395
  # @!method name
358
396
  # @return [String] the unqualified name of the method.
359
397
  # @!method options
@@ -576,6 +614,14 @@ module Gapic
576
614
  descriptor.options&.map_entry
577
615
  end
578
616
 
617
+ # @return [String] The full name for this message
618
+ # (e.g. `google.example.Message`).
619
+ # Useful when matching against other pieces of information
620
+ # which also reference full proto name.
621
+ def full_name
622
+ @address.join "."
623
+ end
624
+
579
625
  # @!method name
580
626
  # @return [String] the unqualified name of the message.
581
627
  # @!method oneof_decl
@@ -682,6 +728,83 @@ module Gapic
682
728
  []
683
729
  end
684
730
 
731
+ # @return [String] The full name for this field
732
+ # (e.g. `google.example.Message.field`).
733
+ # Useful when matching against other pieces of information
734
+ # which also reference full proto name.
735
+ def full_name
736
+ @address.join "."
737
+ end
738
+
739
+ # Nonstandard LRO annotation.
740
+ # This annotation goes on the field of the request message of the method
741
+ # that intiates a non-standard LRO.
742
+ #
743
+ # This annotation contains a field name of the request message
744
+ # of the LRO polling method. (e.g. `GetRegionOperationRequest`)
745
+ # (let's call it a 'referenced field')
746
+ #
747
+ # When the this method is called, this value should be saved.
748
+ # Later, when when polling for a nonstandard LRO, this saved value should
749
+ # be copied to the referenced field.
750
+ #
751
+ # This typically would be used for something that a caller method knows,
752
+ # but an Operation object might not have, e.g. a 'region_id'.
753
+ #
754
+ # So if this field is `region_id` and the annotation is
755
+ # `(google.cloud.operation_request_field) = "region"`, then:
756
+ #
757
+ # `get_region_operation_request.region = this_message.region_id`
758
+ #
759
+ # In contrast to the `operation_response_field`, this field
760
+ # - goes onto the fields of the input message of the method that
761
+ # initiates the LRO
762
+ # - semantically annotates a 'push': the value of this field gets
763
+ # 'pushed' into every LRO poll request.
764
+ #
765
+ # @return [String]
766
+ def operation_request_field
767
+ options[:".google.cloud.operation_request_field"] if options
768
+ end
769
+
770
+ # Nonstandard LRO annotation.
771
+ # This annotation goes on the field of the request message of the method
772
+ # that polls for a non-standard LRO.
773
+ #
774
+ # This annotation contains a field name of the LRO object (typically 'Operation')
775
+ # (let's call it a 'referenced field')
776
+ #
777
+ # When polling for a nonstandard LRO, the value of the field
778
+ # that this annotation is on should be copied from the referenced field.
779
+ #
780
+ # This typically would get used for something that is named differently in the
781
+ # operation polling request message vs in the Operation object, e.g. operation's name
782
+ #
783
+ # So if this field is `operation` and the annotation is
784
+ # `(google.cloud.operation_response_field) = "name"`, then:
785
+ #
786
+ # `get_region_operation_request.operation = operation.name`
787
+ #
788
+ # In contrast to the `operation_request_field`, this field
789
+ # - goes onto the fields of the LRO polling method's input message
790
+ # - semantically annotates a 'pull', the value of the referenced field gets
791
+ # 'pulled' into this one.
792
+ #
793
+ # @return [String]
794
+ def operation_response_field
795
+ options[:".google.cloud.operation_response_field"] if options
796
+ end
797
+
798
+ # Nonstandard LRO annotation.
799
+ # This annotation goes on the fields of the nonstandard Operation message
800
+ # Is value can be either `NAME`, `STATUS`, `ERROR_MESSAGE`, or `ERROR_CODE`
801
+ # and the field encodes a corresponding aspect of the LRO behaviour.
802
+ #
803
+ # @return [Integer]
804
+ def operation_field
805
+ options[:".google.cloud.operation_field"] if options
806
+ end
807
+
685
808
  # Specifically denotes a field as optional. While all fields in protocol
686
809
  # buffers are optional, this may be specified for emphasis if
687
810
  # appropriate.
@@ -0,0 +1,75 @@
1
+ # encoding: utf-8
2
+
3
+ ##
4
+ # This file is auto-generated. DO NOT EDIT!
5
+ #
6
+ require 'protobuf'
7
+
8
+ module Google
9
+ module Api
10
+ ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::FileOptions }
11
+
12
+ ##
13
+ # Message Classes
14
+ #
15
+ class Authentication < ::Protobuf::Message; end
16
+ class AuthenticationRule < ::Protobuf::Message; end
17
+ class JwtLocation < ::Protobuf::Message; end
18
+ class AuthProvider < ::Protobuf::Message; end
19
+ class OAuthRequirements < ::Protobuf::Message; end
20
+ class AuthRequirement < ::Protobuf::Message; end
21
+
22
+
23
+ ##
24
+ # File Options
25
+ #
26
+ set_option :java_package, "com.google.api"
27
+ set_option :java_outer_classname, "AuthProto"
28
+ set_option :java_multiple_files, true
29
+ set_option :go_package, "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig"
30
+ set_option :objc_class_prefix, "GAPI"
31
+
32
+
33
+ ##
34
+ # Message Fields
35
+ #
36
+ class Authentication
37
+ repeated ::Google::Api::AuthenticationRule, :rules, 3
38
+ repeated ::Google::Api::AuthProvider, :providers, 4
39
+ end
40
+
41
+ class AuthenticationRule
42
+ optional :string, :selector, 1
43
+ optional ::Google::Api::OAuthRequirements, :oauth, 2
44
+ optional :bool, :allow_without_credential, 5
45
+ repeated ::Google::Api::AuthRequirement, :requirements, 7
46
+ end
47
+
48
+ class JwtLocation
49
+ optional :string, :header, 1
50
+ optional :string, :query, 2
51
+ optional :string, :value_prefix, 3
52
+ end
53
+
54
+ class AuthProvider
55
+ optional :string, :id, 1
56
+ optional :string, :issuer, 2
57
+ optional :string, :jwks_uri, 3
58
+ optional :string, :audiences, 4
59
+ optional :string, :authorization_url, 5
60
+ repeated ::Google::Api::JwtLocation, :jwt_locations, 6
61
+ end
62
+
63
+ class OAuthRequirements
64
+ optional :string, :canonical_scopes, 1
65
+ end
66
+
67
+ class AuthRequirement
68
+ optional :string, :provider_id, 1
69
+ optional :string, :audiences, 2
70
+ end
71
+
72
+ end
73
+
74
+ end
75
+
@@ -0,0 +1,59 @@
1
+ # encoding: utf-8
2
+
3
+ ##
4
+ # This file is auto-generated. DO NOT EDIT!
5
+ #
6
+ require 'protobuf'
7
+
8
+ module Google
9
+ module Api
10
+ ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::FileOptions }
11
+
12
+ ##
13
+ # Message Classes
14
+ #
15
+ class Backend < ::Protobuf::Message; end
16
+ class BackendRule < ::Protobuf::Message
17
+ class PathTranslation < ::Protobuf::Enum
18
+ define :PATH_TRANSLATION_UNSPECIFIED, 0
19
+ define :CONSTANT_ADDRESS, 1
20
+ define :APPEND_PATH_TO_ADDRESS, 2
21
+ end
22
+
23
+ end
24
+
25
+
26
+
27
+ ##
28
+ # File Options
29
+ #
30
+ set_option :java_package, "com.google.api"
31
+ set_option :java_outer_classname, "BackendProto"
32
+ set_option :java_multiple_files, true
33
+ set_option :go_package, "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig"
34
+ set_option :objc_class_prefix, "GAPI"
35
+
36
+
37
+ ##
38
+ # Message Fields
39
+ #
40
+ class Backend
41
+ repeated ::Google::Api::BackendRule, :rules, 1
42
+ end
43
+
44
+ class BackendRule
45
+ optional :string, :selector, 1
46
+ optional :string, :address, 2
47
+ optional :double, :deadline, 3
48
+ optional :double, :min_deadline, 4
49
+ optional :double, :operation_deadline, 5
50
+ optional ::Google::Api::BackendRule::PathTranslation, :path_translation, 6
51
+ optional :string, :jwt_audience, 7
52
+ optional :bool, :disable_auth, 8
53
+ optional :string, :protocol, 9
54
+ end
55
+
56
+ end
57
+
58
+ end
59
+
@@ -0,0 +1,53 @@
1
+ # encoding: utf-8
2
+
3
+ ##
4
+ # This file is auto-generated. DO NOT EDIT!
5
+ #
6
+ require 'protobuf'
7
+
8
+
9
+ ##
10
+ # Imports
11
+ #
12
+ require 'google/api/metric.pb'
13
+
14
+ module Google
15
+ module Api
16
+ ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::FileOptions }
17
+
18
+ ##
19
+ # Message Classes
20
+ #
21
+ class Billing < ::Protobuf::Message
22
+ class BillingDestination < ::Protobuf::Message; end
23
+
24
+ end
25
+
26
+
27
+
28
+ ##
29
+ # File Options
30
+ #
31
+ set_option :java_package, "com.google.api"
32
+ set_option :java_outer_classname, "BillingProto"
33
+ set_option :java_multiple_files, true
34
+ set_option :go_package, "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig"
35
+ set_option :objc_class_prefix, "GAPI"
36
+
37
+
38
+ ##
39
+ # Message Fields
40
+ #
41
+ class Billing
42
+ class BillingDestination
43
+ optional :string, :monitored_resource, 1
44
+ repeated :string, :metrics, 2
45
+ end
46
+
47
+ repeated ::Google::Api::Billing::BillingDestination, :consumer_destinations, 8
48
+ end
49
+
50
+ end
51
+
52
+ end
53
+
@@ -0,0 +1,47 @@
1
+ # encoding: utf-8
2
+
3
+ ##
4
+ # This file is auto-generated. DO NOT EDIT!
5
+ #
6
+ require 'protobuf'
7
+
8
+ module Google
9
+ module Api
10
+ ::Protobuf::Optionable.inject(self) { ::Google::Protobuf::FileOptions }
11
+
12
+ ##
13
+ # Message Classes
14
+ #
15
+ class Context < ::Protobuf::Message; end
16
+ class ContextRule < ::Protobuf::Message; end
17
+
18
+
19
+ ##
20
+ # File Options
21
+ #
22
+ set_option :java_package, "com.google.api"
23
+ set_option :java_outer_classname, "ContextProto"
24
+ set_option :java_multiple_files, true
25
+ set_option :go_package, "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig"
26
+ set_option :objc_class_prefix, "GAPI"
27
+
28
+
29
+ ##
30
+ # Message Fields
31
+ #
32
+ class Context
33
+ repeated ::Google::Api::ContextRule, :rules, 1
34
+ end
35
+
36
+ class ContextRule
37
+ optional :string, :selector, 1
38
+ repeated :string, :requested, 2
39
+ repeated :string, :provided, 3
40
+ repeated :string, :allowed_request_extensions, 4
41
+ repeated :string, :allowed_response_extensions, 5
42
+ end
43
+
44
+ end
45
+
46
+ end
47
+