protostar 0.1.0.beta1

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 (223) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +60 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +647 -0
  5. data/THIRD_PARTY_NOTICES.md +61 -0
  6. data/exe/protoc-gen-protostar +7 -0
  7. data/exe/protostar +7 -0
  8. data/lib/protostar/builder/generator.rb +71 -0
  9. data/lib/protostar/builder/sink.rb +35 -0
  10. data/lib/protostar/builder.rb +965 -0
  11. data/lib/protostar/cli.rb +267 -0
  12. data/lib/protostar/codec/decode_generator.rb +199 -0
  13. data/lib/protostar/codec/decoder.rb +296 -0
  14. data/lib/protostar/codec/encode_generator.rb +224 -0
  15. data/lib/protostar/codec/encoder.rb +121 -0
  16. data/lib/protostar/codec/sizer.rb +91 -0
  17. data/lib/protostar/codec.rb +15 -0
  18. data/lib/protostar/compiler/ast.rb +193 -0
  19. data/lib/protostar/compiler/emitters/descriptor_set.rb +57 -0
  20. data/lib/protostar/compiler/emitters/google_ruby.rb +103 -0
  21. data/lib/protostar/compiler/emitters/grpc.rb +175 -0
  22. data/lib/protostar/compiler/emitters/protostar_rbs.rb +252 -0
  23. data/lib/protostar/compiler/emitters/rbs.rb +394 -0
  24. data/lib/protostar/compiler/emitters/ruby.rb +503 -0
  25. data/lib/protostar/compiler/emitters.rb +268 -0
  26. data/lib/protostar/compiler/include/LICENSE +32 -0
  27. data/lib/protostar/compiler/include/google/protobuf/any.proto +106 -0
  28. data/lib/protostar/compiler/include/google/protobuf/api.proto +229 -0
  29. data/lib/protostar/compiler/include/google/protobuf/compiler/plugin.proto +180 -0
  30. data/lib/protostar/compiler/include/google/protobuf/cpp_features.proto +87 -0
  31. data/lib/protostar/compiler/include/google/protobuf/descriptor.proto +1532 -0
  32. data/lib/protostar/compiler/include/google/protobuf/duration.proto +115 -0
  33. data/lib/protostar/compiler/include/google/protobuf/empty.proto +51 -0
  34. data/lib/protostar/compiler/include/google/protobuf/field_mask.proto +243 -0
  35. data/lib/protostar/compiler/include/google/protobuf/java_features.proto +132 -0
  36. data/lib/protostar/compiler/include/google/protobuf/source_context.proto +48 -0
  37. data/lib/protostar/compiler/include/google/protobuf/struct.proto +111 -0
  38. data/lib/protostar/compiler/include/google/protobuf/timestamp.proto +145 -0
  39. data/lib/protostar/compiler/include/google/protobuf/type.proto +217 -0
  40. data/lib/protostar/compiler/include/google/protobuf/wrappers.proto +157 -0
  41. data/lib/protostar/compiler/lexer.rb +659 -0
  42. data/lib/protostar/compiler/linker.rb +894 -0
  43. data/lib/protostar/compiler/option_interpreter.rb +363 -0
  44. data/lib/protostar/compiler/parser.rb +1696 -0
  45. data/lib/protostar/compiler/retention.rb +104 -0
  46. data/lib/protostar/compiler/run.rb +184 -0
  47. data/lib/protostar/compiler/source_info.rb +161 -0
  48. data/lib/protostar/compiler/symbol_table.rb +223 -0
  49. data/lib/protostar/compiler/text_format.rb +340 -0
  50. data/lib/protostar/compiler/validator.rb +944 -0
  51. data/lib/protostar/compiler.rb +304 -0
  52. data/lib/protostar/diagnostics/codes.rb +1307 -0
  53. data/lib/protostar/diagnostics/formats.rb +64 -0
  54. data/lib/protostar/diagnostics/renderer.rb +240 -0
  55. data/lib/protostar/diagnostics/source.rb +153 -0
  56. data/lib/protostar/diagnostics.rb +117 -0
  57. data/lib/protostar/dsl.rb +367 -0
  58. data/lib/protostar/enum.rb +70 -0
  59. data/lib/protostar/errors.rb +23 -0
  60. data/lib/protostar/google/protobuf/any_pb.rb +90 -0
  61. data/lib/protostar/google/protobuf/api_pb.rb +199 -0
  62. data/lib/protostar/google/protobuf/compiler/plugin_pb.rb +168 -0
  63. data/lib/protostar/google/protobuf/descriptor_pb.rb +1239 -0
  64. data/lib/protostar/google/protobuf/duration_pb.rb +99 -0
  65. data/lib/protostar/google/protobuf/empty_pb.rb +36 -0
  66. data/lib/protostar/google/protobuf/field_mask_pb.rb +228 -0
  67. data/lib/protostar/google/protobuf/source_context_pb.rb +33 -0
  68. data/lib/protostar/google/protobuf/struct_pb.rb +91 -0
  69. data/lib/protostar/google/protobuf/timestamp_pb.rb +129 -0
  70. data/lib/protostar/google/protobuf/type_pb.rb +202 -0
  71. data/lib/protostar/google/protobuf/wrappers_pb.rb +125 -0
  72. data/lib/protostar/google_protobuf_shim.rb +24 -0
  73. data/lib/protostar/json/encoder.rb +340 -0
  74. data/lib/protostar/json/errors.rb +34 -0
  75. data/lib/protostar/json/parser.rb +437 -0
  76. data/lib/protostar/json/path.rb +39 -0
  77. data/lib/protostar/json.rb +95 -0
  78. data/lib/protostar/lint/command.rb +197 -0
  79. data/lib/protostar/lint/config.rb +98 -0
  80. data/lib/protostar/lint/context.rb +126 -0
  81. data/lib/protostar/lint/directives.rb +56 -0
  82. data/lib/protostar/lint/fixer.rb +165 -0
  83. data/lib/protostar/lint/naming.rb +54 -0
  84. data/lib/protostar/lint/rule.rb +120 -0
  85. data/lib/protostar/lint/rules/comment_enum.rb +31 -0
  86. data/lib/protostar/lint/rules/comment_enum_value.rb +32 -0
  87. data/lib/protostar/lint/rules/comment_field.rb +33 -0
  88. data/lib/protostar/lint/rules/comment_message.rb +31 -0
  89. data/lib/protostar/lint/rules/comment_rpc.rb +31 -0
  90. data/lib/protostar/lint/rules/comment_service.rb +31 -0
  91. data/lib/protostar/lint/rules/edition_recommended.rb +31 -0
  92. data/lib/protostar/lint/rules/enum_first_value_zero.rb +34 -0
  93. data/lib/protostar/lint/rules/enum_pascal_case.rb +25 -0
  94. data/lib/protostar/lint/rules/enum_value_prefix.rb +38 -0
  95. data/lib/protostar/lint/rules/enum_value_upper_snake_case.rb +28 -0
  96. data/lib/protostar/lint/rules/enum_zero_value_suffix.rb +41 -0
  97. data/lib/protostar/lint/rules/field_lower_snake_case.rb +34 -0
  98. data/lib/protostar/lint/rules/field_not_required.rb +39 -0
  99. data/lib/protostar/lint/rules/field_number_reuse_risk.rb +45 -0
  100. data/lib/protostar/lint/rules/field_numbers_hot_range.rb +44 -0
  101. data/lib/protostar/lint/rules/file_lower_snake_case.rb +27 -0
  102. data/lib/protostar/lint/rules/import_no_public.rb +29 -0
  103. data/lib/protostar/lint/rules/import_no_weak.rb +28 -0
  104. data/lib/protostar/lint/rules/import_used.rb +33 -0
  105. data/lib/protostar/lint/rules/message_pascal_case.rb +27 -0
  106. data/lib/protostar/lint/rules/no_deprecated_features.rb +50 -0
  107. data/lib/protostar/lint/rules/no_groups.rb +34 -0
  108. data/lib/protostar/lint/rules/oneof_lower_snake_case.rb +27 -0
  109. data/lib/protostar/lint/rules/package_defined.rb +28 -0
  110. data/lib/protostar/lint/rules/package_directory_match.rb +33 -0
  111. data/lib/protostar/lint/rules/package_lower_snake_case.rb +28 -0
  112. data/lib/protostar/lint/rules/package_same_directory.rb +39 -0
  113. data/lib/protostar/lint/rules/package_version_suffix.rb +31 -0
  114. data/lib/protostar/lint/rules/reserved_names_with_numbers.rb +44 -0
  115. data/lib/protostar/lint/rules/rpc_pascal_case.rb +25 -0
  116. data/lib/protostar/lint/rules/rpc_request_response_unique.rb +40 -0
  117. data/lib/protostar/lint/rules/rpc_request_standard_name.rb +32 -0
  118. data/lib/protostar/lint/rules/rpc_response_standard_name.rb +31 -0
  119. data/lib/protostar/lint/rules/service_pascal_case.rb +25 -0
  120. data/lib/protostar/lint/rules/service_suffix.rb +28 -0
  121. data/lib/protostar/lint/rules/syntax_specified.rb +35 -0
  122. data/lib/protostar/lint/runner.rb +135 -0
  123. data/lib/protostar/lint.rb +122 -0
  124. data/lib/protostar/message/accessors.rb +86 -0
  125. data/lib/protostar/message/coercion.rb +171 -0
  126. data/lib/protostar/message/field_info.rb +145 -0
  127. data/lib/protostar/message/reflection.rb +149 -0
  128. data/lib/protostar/message.rb +572 -0
  129. data/lib/protostar/plugin.rb +94 -0
  130. data/lib/protostar/schema/default_value.rb +113 -0
  131. data/lib/protostar/schema/descriptor.rb +41 -0
  132. data/lib/protostar/schema/draft/copy.rb +88 -0
  133. data/lib/protostar/schema/draft/resolution.rb +177 -0
  134. data/lib/protostar/schema/draft.rb +779 -0
  135. data/lib/protostar/schema/enum.rb +106 -0
  136. data/lib/protostar/schema/extension_range.rb +37 -0
  137. data/lib/protostar/schema/features.rb +153 -0
  138. data/lib/protostar/schema/field.rb +201 -0
  139. data/lib/protostar/schema/file.rb +217 -0
  140. data/lib/protostar/schema/freezer.rb +61 -0
  141. data/lib/protostar/schema/message.rb +104 -0
  142. data/lib/protostar/schema/oneof.rb +38 -0
  143. data/lib/protostar/schema/options.rb +367 -0
  144. data/lib/protostar/schema/pool.rb +179 -0
  145. data/lib/protostar/schema/proto.rb +576 -0
  146. data/lib/protostar/schema/resolver.rb +118 -0
  147. data/lib/protostar/schema/service.rb +89 -0
  148. data/lib/protostar/schema/source_info.rb +53 -0
  149. data/lib/protostar/schema.rb +65 -0
  150. data/lib/protostar/short_names/any.rb +7 -0
  151. data/lib/protostar/short_names/duration.rb +7 -0
  152. data/lib/protostar/short_names/empty.rb +7 -0
  153. data/lib/protostar/short_names/field_mask.rb +7 -0
  154. data/lib/protostar/short_names/struct.rb +9 -0
  155. data/lib/protostar/short_names/timestamp.rb +7 -0
  156. data/lib/protostar/short_names/wrappers.rb +15 -0
  157. data/lib/protostar/text/extensions.rb +114 -0
  158. data/lib/protostar/text/parser.rb +439 -0
  159. data/lib/protostar/text/printer.rb +304 -0
  160. data/lib/protostar/text/tokenizer.rb +116 -0
  161. data/lib/protostar/text.rb +67 -0
  162. data/lib/protostar/types.rb +152 -0
  163. data/lib/protostar/unknown_field.rb +58 -0
  164. data/lib/protostar/version.rb +5 -0
  165. data/lib/protostar/view/generator.rb +298 -0
  166. data/lib/protostar/view/map.rb +194 -0
  167. data/lib/protostar/view/repeated.rb +143 -0
  168. data/lib/protostar/view/scan.rb +183 -0
  169. data/lib/protostar/view.rb +283 -0
  170. data/lib/protostar/well_known/any.rb +52 -0
  171. data/lib/protostar/well_known/duration.rb +53 -0
  172. data/lib/protostar/well_known/list_value.rb +63 -0
  173. data/lib/protostar/well_known/struct.rb +55 -0
  174. data/lib/protostar/well_known/timestamp.rb +64 -0
  175. data/lib/protostar/well_known/value.rb +60 -0
  176. data/lib/protostar/well_known.rb +38 -0
  177. data/lib/protostar/wire/io_source.rb +40 -0
  178. data/lib/protostar/wire/reader.rb +254 -0
  179. data/lib/protostar/wire/writer.rb +201 -0
  180. data/lib/protostar/wire.rb +96 -0
  181. data/lib/protostar.rb +95 -0
  182. data/shims/google-protobuf/lib/google/protobuf/any_pb.rb +17 -0
  183. data/shims/google-protobuf/lib/google/protobuf/api_pb.rb +22 -0
  184. data/shims/google-protobuf/lib/google/protobuf/compiler/plugin_pb.rb +25 -0
  185. data/shims/google-protobuf/lib/google/protobuf/descriptor_pb.rb +72 -0
  186. data/shims/google-protobuf/lib/google/protobuf/descriptor_pool.rb +164 -0
  187. data/shims/google-protobuf/lib/google/protobuf/descriptors.rb +553 -0
  188. data/shims/google-protobuf/lib/google/protobuf/duration_pb.rb +17 -0
  189. data/shims/google-protobuf/lib/google/protobuf/empty_pb.rb +17 -0
  190. data/shims/google-protobuf/lib/google/protobuf/field_mask_pb.rb +17 -0
  191. data/shims/google-protobuf/lib/google/protobuf/internal/convert.rb +180 -0
  192. data/shims/google-protobuf/lib/google/protobuf/internal/extensions.rb +154 -0
  193. data/shims/google-protobuf/lib/google/protobuf/internal/json.rb +104 -0
  194. data/shims/google-protobuf/lib/google/protobuf/internal/well_known.rb +140 -0
  195. data/shims/google-protobuf/lib/google/protobuf/map.rb +216 -0
  196. data/shims/google-protobuf/lib/google/protobuf/message.rb +544 -0
  197. data/shims/google-protobuf/lib/google/protobuf/message_exts.rb +41 -0
  198. data/shims/google-protobuf/lib/google/protobuf/plugin_pb.rb +4 -0
  199. data/shims/google-protobuf/lib/google/protobuf/repeated_field.rb +366 -0
  200. data/shims/google-protobuf/lib/google/protobuf/source_context_pb.rb +17 -0
  201. data/shims/google-protobuf/lib/google/protobuf/struct_pb.rb +20 -0
  202. data/shims/google-protobuf/lib/google/protobuf/timestamp_pb.rb +17 -0
  203. data/shims/google-protobuf/lib/google/protobuf/type_pb.rb +27 -0
  204. data/shims/google-protobuf/lib/google/protobuf/well_known_types.rb +37 -0
  205. data/shims/google-protobuf/lib/google/protobuf/wrappers_pb.rb +25 -0
  206. data/shims/google-protobuf/lib/google/protobuf.rb +107 -0
  207. data/shims/google-protobuf/lib/google/protobuf_ffi.rb +5 -0
  208. data/shims/google-protobuf/lib/google/protobuf_native.rb +5 -0
  209. data/sig/protostar/google/protobuf/any_pb.rbs +77 -0
  210. data/sig/protostar/google/protobuf/api_pb.rbs +242 -0
  211. data/sig/protostar/google/protobuf/compiler/plugin_pb.rbs +264 -0
  212. data/sig/protostar/google/protobuf/descriptor_pb.rbs +2220 -0
  213. data/sig/protostar/google/protobuf/duration_pb.rbs +82 -0
  214. data/sig/protostar/google/protobuf/empty_pb.rbs +18 -0
  215. data/sig/protostar/google/protobuf/field_mask_pb.rbs +170 -0
  216. data/sig/protostar/google/protobuf/source_context_pb.rbs +24 -0
  217. data/sig/protostar/google/protobuf/struct_pb.rbs +135 -0
  218. data/sig/protostar/google/protobuf/timestamp_pb.rbs +102 -0
  219. data/sig/protostar/google/protobuf/type_pb.rbs +304 -0
  220. data/sig/protostar/google/protobuf/wrappers_pb.rbs +169 -0
  221. data/sig/protostar/lint.rbs +216 -0
  222. data/sig/protostar.rbs +326 -0
  223. metadata +366 -0
@@ -0,0 +1,199 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated by protostar from google/protobuf/api.proto. Do not edit.
4
+
5
+ require "protostar"
6
+ require "protostar/google/protobuf/source_context_pb"
7
+ require "protostar/google/protobuf/type_pb"
8
+
9
+ Protostar::DSL.file(
10
+ "google/protobuf/api.proto",
11
+ package: "google.protobuf",
12
+ syntax: :proto3,
13
+ dependencies: ["google/protobuf/source_context.proto", "google/protobuf/type.proto"],
14
+ java_package: "com.google.protobuf",
15
+ java_outer_classname: "ApiProto",
16
+ java_multiple_files: true,
17
+ objc_class_prefix: "GPB",
18
+ csharp_namespace: "Google.Protobuf.WellKnownTypes",
19
+ go_package: "google.golang.org/protobuf/types/known/apipb"
20
+ ) do |f|
21
+ # Api is a light-weight descriptor for an API Interface.
22
+ #
23
+ # Interfaces are also described as "protocol buffer services" in some contexts,
24
+ # such as by the "service" keyword in a .proto file, but they are different
25
+ # from API Services, which represent a concrete implementation of an interface
26
+ # as opposed to simply a description of methods and bindings. They are also
27
+ # sometimes simply referred to as "APIs" in other contexts, such as the name of
28
+ # this message itself. See https://cloud.google.com/apis/design/glossary for
29
+ # detailed terminology.
30
+ #
31
+ # New usages of this message as an alternative to ServiceDescriptorProto are
32
+ # strongly discouraged. This message does not reliability preserve all
33
+ # information necessary to model the schema and preserve semantics. Instead
34
+ # make use of FileDescriptorSet which preserves the necessary information.
35
+ f.message "Api" do |m|
36
+ # The fully qualified name of this interface, including package name
37
+ # followed by the interface's simple name.
38
+ m.field :name, 1, :string
39
+ # The methods of this interface, in unspecified order.
40
+ m.field :methods, 2, :message, ".google.protobuf.Method", label: :repeated
41
+ # Any metadata attached to the interface.
42
+ m.field :options, 3, :message, ".google.protobuf.Option", label: :repeated
43
+ # A version string for this interface. If specified, must have the form
44
+ # `major-version.minor-version`, as in `1.10`. If the minor version is
45
+ # omitted, it defaults to zero. If the entire version field is empty, the
46
+ # major version is derived from the package name, as outlined below. If the
47
+ # field is not empty, the version in the package name will be verified to be
48
+ # consistent with what is provided here.
49
+ #
50
+ # The versioning schema uses [semantic
51
+ # versioning](http://semver.org) where the major version number
52
+ # indicates a breaking change and the minor version an additive,
53
+ # non-breaking change. Both version numbers are signals to users
54
+ # what to expect from different versions, and should be carefully
55
+ # chosen based on the product plan.
56
+ #
57
+ # The major version is also reflected in the package name of the
58
+ # interface, which must end in `v<major-version>`, as in
59
+ # `google.feature.v1`. For major versions 0 and 1, the suffix can
60
+ # be omitted. Zero major versions must only be used for
61
+ # experimental, non-GA interfaces.
62
+ #
63
+ m.field :version, 4, :string
64
+ # Source context for the protocol buffer service represented by this
65
+ # message.
66
+ m.field :source_context, 5, :message, ".google.protobuf.SourceContext"
67
+ # Included interfaces. See [Mixin][].
68
+ m.field :mixins, 6, :message, ".google.protobuf.Mixin", label: :repeated
69
+ # The source syntax of the service.
70
+ m.field :syntax, 7, :enum, ".google.protobuf.Syntax"
71
+ # The source edition string, only valid when syntax is SYNTAX_EDITIONS.
72
+ m.field :edition, 8, :string
73
+ end
74
+ # Method represents a method of an API interface.
75
+ #
76
+ # New usages of this message as an alternative to MethodDescriptorProto are
77
+ # strongly discouraged. This message does not reliability preserve all
78
+ # information necessary to model the schema and preserve semantics. Instead
79
+ # make use of FileDescriptorSet which preserves the necessary information.
80
+ f.message "Method" do |m|
81
+ # The simple name of this method.
82
+ m.field :name, 1, :string
83
+ # A URL of the input message type.
84
+ m.field :request_type_url, 2, :string
85
+ # If true, the request is streamed.
86
+ m.field :request_streaming, 3, :bool
87
+ # The URL of the output message type.
88
+ m.field :response_type_url, 4, :string
89
+ # If true, the response is streamed.
90
+ m.field :response_streaming, 5, :bool
91
+ # Any metadata attached to the method.
92
+ m.field :options, 6, :message, ".google.protobuf.Option", label: :repeated
93
+ # The source syntax of this method.
94
+ #
95
+ # This field should be ignored, instead the syntax should be inherited from
96
+ # Api. This is similar to Field and EnumValue.
97
+ m.field :syntax, 7, :enum, ".google.protobuf.Syntax", deprecated: true
98
+ # The source edition string, only valid when syntax is SYNTAX_EDITIONS.
99
+ #
100
+ # This field should be ignored, instead the edition should be inherited from
101
+ # Api. This is similar to Field and EnumValue.
102
+ m.field :edition, 8, :string, deprecated: true
103
+ end
104
+ # Declares an API Interface to be included in this interface. The including
105
+ # interface must redeclare all the methods from the included interface, but
106
+ # documentation and options are inherited as follows:
107
+ #
108
+ # - If after comment and whitespace stripping, the documentation
109
+ # string of the redeclared method is empty, it will be inherited
110
+ # from the original method.
111
+ #
112
+ # - Each annotation belonging to the service config (http,
113
+ # visibility) which is not set in the redeclared method will be
114
+ # inherited.
115
+ #
116
+ # - If an http annotation is inherited, the path pattern will be
117
+ # modified as follows. Any version prefix will be replaced by the
118
+ # version of the including interface plus the [root][] path if
119
+ # specified.
120
+ #
121
+ # Example of a simple mixin:
122
+ #
123
+ # package google.acl.v1;
124
+ # service AccessControl {
125
+ # // Get the underlying ACL object.
126
+ # rpc GetAcl(GetAclRequest) returns (Acl) {
127
+ # option (google.api.http).get = "/v1/{resource=**}:getAcl";
128
+ # }
129
+ # }
130
+ #
131
+ # package google.storage.v2;
132
+ # service Storage {
133
+ # rpc GetAcl(GetAclRequest) returns (Acl);
134
+ #
135
+ # // Get a data record.
136
+ # rpc GetData(GetDataRequest) returns (Data) {
137
+ # option (google.api.http).get = "/v2/{resource=**}";
138
+ # }
139
+ # }
140
+ #
141
+ # Example of a mixin configuration:
142
+ #
143
+ # apis:
144
+ # - name: google.storage.v2.Storage
145
+ # mixins:
146
+ # - name: google.acl.v1.AccessControl
147
+ #
148
+ # The mixin construct implies that all methods in `AccessControl` are
149
+ # also declared with same name and request/response types in
150
+ # `Storage`. A documentation generator or annotation processor will
151
+ # see the effective `Storage.GetAcl` method after inheriting
152
+ # documentation and annotations as follows:
153
+ #
154
+ # service Storage {
155
+ # // Get the underlying ACL object.
156
+ # rpc GetAcl(GetAclRequest) returns (Acl) {
157
+ # option (google.api.http).get = "/v2/{resource=**}:getAcl";
158
+ # }
159
+ # ...
160
+ # }
161
+ #
162
+ # Note how the version in the path pattern changed from `v1` to `v2`.
163
+ #
164
+ # If the `root` field in the mixin is specified, it should be a
165
+ # relative path under which inherited HTTP paths are placed. Example:
166
+ #
167
+ # apis:
168
+ # - name: google.storage.v2.Storage
169
+ # mixins:
170
+ # - name: google.acl.v1.AccessControl
171
+ # root: acls
172
+ #
173
+ # This implies the following inherited HTTP annotation:
174
+ #
175
+ # service Storage {
176
+ # // Get the underlying ACL object.
177
+ # rpc GetAcl(GetAclRequest) returns (Acl) {
178
+ # option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
179
+ # }
180
+ # ...
181
+ # }
182
+ f.message "Mixin" do |m|
183
+ # The fully qualified name of the interface which is included.
184
+ m.field :name, 1, :string
185
+ # If non-empty specifies a path under which inherited HTTP paths
186
+ # are rooted.
187
+ m.field :root, 2, :string
188
+ end
189
+ end
190
+
191
+ module Protostar
192
+ module Google
193
+ module Protobuf
194
+ Api = Protostar::DSL.message("google.protobuf.Api")
195
+ Method = Protostar::DSL.message("google.protobuf.Method")
196
+ Mixin = Protostar::DSL.message("google.protobuf.Mixin")
197
+ end
198
+ end
199
+ end
@@ -0,0 +1,168 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated by protostar from google/protobuf/compiler/plugin.proto. Do not edit.
4
+
5
+ require "protostar"
6
+ require "protostar/google/protobuf/descriptor_pb"
7
+
8
+ Protostar::DSL.file(
9
+ "google/protobuf/compiler/plugin.proto",
10
+ package: "google.protobuf.compiler",
11
+ dependencies: ["google/protobuf/descriptor.proto"],
12
+ java_package: "com.google.protobuf.compiler",
13
+ java_outer_classname: "PluginProtos",
14
+ csharp_namespace: "Google.Protobuf.Compiler",
15
+ go_package: "google.golang.org/protobuf/types/pluginpb"
16
+ ) do |f|
17
+ # The version number of protocol compiler.
18
+ f.message "Version" do |m|
19
+ m.field :major, 1, :int32
20
+ m.field :minor, 2, :int32
21
+ m.field :patch, 3, :int32
22
+ # A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
23
+ # be empty for mainline stable releases.
24
+ m.field :suffix, 4, :string
25
+ end
26
+ # An encoded CodeGeneratorRequest is written to the plugin's stdin.
27
+ f.message "CodeGeneratorRequest" do |m|
28
+ # The .proto files that were explicitly listed on the command-line. The
29
+ # code generator should generate code only for these files. Each file's
30
+ # descriptor will be included in proto_file, below.
31
+ m.field :file_to_generate, 1, :string, label: :repeated
32
+ # The generator parameter passed on the command-line.
33
+ m.field :parameter, 2, :string
34
+ # FileDescriptorProtos for all files in files_to_generate and everything
35
+ # they import. The files will appear in topological order, so each file
36
+ # appears before any file that imports it.
37
+ #
38
+ # Note: the files listed in files_to_generate will include runtime-retention
39
+ # options only, but all other files will include source-retention options.
40
+ # The source_file_descriptors field below is available in case you need
41
+ # source-retention options for files_to_generate.
42
+ #
43
+ # protoc guarantees that all proto_files will be written after
44
+ # the fields above, even though this is not technically guaranteed by the
45
+ # protobuf wire format. This theoretically could allow a plugin to stream
46
+ # in the FileDescriptorProtos and handle them one by one rather than read
47
+ # the entire set into memory at once. However, as of this writing, this
48
+ # is not similarly optimized on protoc's end -- it will store all fields in
49
+ # memory at once before sending them to the plugin.
50
+ #
51
+ # Type names of fields and extensions in the FileDescriptorProto are always
52
+ # fully qualified.
53
+ m.field :proto_file, 15, :message, ".google.protobuf.FileDescriptorProto", label: :repeated
54
+ # File descriptors with all options, including source-retention options.
55
+ # These descriptors are only provided for the files listed in
56
+ # files_to_generate.
57
+ m.field :source_file_descriptors, 17, :message, ".google.protobuf.FileDescriptorProto",
58
+ label: :repeated
59
+ # The version number of protocol compiler.
60
+ m.field :compiler_version, 3, :message, ".google.protobuf.compiler.Version"
61
+ end
62
+ # The plugin writes an encoded CodeGeneratorResponse to stdout.
63
+ f.message "CodeGeneratorResponse" do |m|
64
+ # Error message. If non-empty, code generation failed. The plugin process
65
+ # should exit with status code zero even if it reports an error in this way.
66
+ #
67
+ # This should be used to indicate errors in .proto files which prevent the
68
+ # code generator from generating correct code. Errors which indicate a
69
+ # problem in protoc itself -- such as the input CodeGeneratorRequest being
70
+ # unparseable -- should be reported by writing a message to stderr and
71
+ # exiting with a non-zero status code.
72
+ m.field :error, 1, :string
73
+ # A bitmask of supported features that the code generator supports.
74
+ # This is a bitwise "or" of values from the Feature enum.
75
+ m.field :supported_features, 2, :uint64
76
+ # The minimum edition this plugin supports. This will be treated as an
77
+ # Edition enum, but we want to allow unknown values. It should be specified
78
+ # according the edition enum value, *not* the edition number. Only takes
79
+ # effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
80
+ m.field :minimum_edition, 3, :int32
81
+ # The maximum edition this plugin supports. This will be treated as an
82
+ # Edition enum, but we want to allow unknown values. It should be specified
83
+ # according the edition enum value, *not* the edition number. Only takes
84
+ # effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
85
+ m.field :maximum_edition, 4, :int32
86
+ m.field :file, 15, :message, ".google.protobuf.compiler.CodeGeneratorResponse.File",
87
+ label: :repeated
88
+ # Represents a single generated file.
89
+ m.message "File" do |m|
90
+ # The file name, relative to the output directory. The name must not
91
+ # contain "." or ".." components and must be relative, not be absolute (so,
92
+ # the file cannot lie outside the output directory). "/" must be used as
93
+ # the path separator, not "\".
94
+ #
95
+ # If the name is omitted, the content will be appended to the previous
96
+ # file. This allows the generator to break large files into small chunks,
97
+ # and allows the generated text to be streamed back to protoc so that large
98
+ # files need not reside completely in memory at one time. Note that as of
99
+ # this writing protoc does not optimize for this -- it will read the entire
100
+ # CodeGeneratorResponse before writing files to disk.
101
+ m.field :name, 1, :string
102
+ # If non-empty, indicates that the named file should already exist, and the
103
+ # content here is to be inserted into that file at a defined insertion
104
+ # point. This feature allows a code generator to extend the output
105
+ # produced by another code generator. The original generator may provide
106
+ # insertion points by placing special annotations in the file that look
107
+ # like:
108
+ # @@protoc_insertion_point(NAME)
109
+ # The annotation can have arbitrary text before and after it on the line,
110
+ # which allows it to be placed in a comment. NAME should be replaced with
111
+ # an identifier naming the point -- this is what other generators will use
112
+ # as the insertion_point. Code inserted at this point will be placed
113
+ # immediately above the line containing the insertion point (thus multiple
114
+ # insertions to the same point will come out in the order they were added).
115
+ # The double-@ is intended to make it unlikely that the generated code
116
+ # could contain things that look like insertion points by accident.
117
+ #
118
+ # For example, the C++ code generator places the following line in the
119
+ # .pb.h files that it generates:
120
+ # // @@protoc_insertion_point(namespace_scope)
121
+ # This line appears within the scope of the file's package namespace, but
122
+ # outside of any particular class. Another plugin can then specify the
123
+ # insertion_point "namespace_scope" to generate additional classes or
124
+ # other declarations that should be placed in this scope.
125
+ #
126
+ # Note that if the line containing the insertion point begins with
127
+ # whitespace, the same whitespace will be added to every line of the
128
+ # inserted text. This is useful for languages like Python, where
129
+ # indentation matters. In these languages, the insertion point comment
130
+ # should be indented the same amount as any inserted code will need to be
131
+ # in order to work correctly in that context.
132
+ #
133
+ # The code generator that generates the initial file and the one which
134
+ # inserts into it must both run as part of a single invocation of protoc.
135
+ # Code generators are executed in the order in which they appear on the
136
+ # command line.
137
+ #
138
+ # If |insertion_point| is present, |name| must also be present.
139
+ m.field :insertion_point, 2, :string
140
+ # The file contents.
141
+ m.field :content, 15, :string
142
+ # Information describing the file content being inserted. If an insertion
143
+ # point is used, this information will be appropriately offset and inserted
144
+ # into the code generation metadata for the generated files.
145
+ m.field :generated_code_info, 16, :message, ".google.protobuf.GeneratedCodeInfo"
146
+ end
147
+ # Sync with code_generator.h.
148
+ m.enum "Feature" do |e|
149
+ e.value :FEATURE_NONE, 0
150
+ e.value :FEATURE_PROTO3_OPTIONAL, 1
151
+ e.value :FEATURE_SUPPORTS_EDITIONS, 2
152
+ end
153
+ end
154
+ end
155
+
156
+ module Protostar
157
+ module Google
158
+ module Protobuf
159
+ module Compiler
160
+ Version = Protostar::DSL.message("google.protobuf.compiler.Version")
161
+ CodeGeneratorRequest = Protostar::DSL.message("google.protobuf.compiler.CodeGeneratorRequest")
162
+ CodeGeneratorResponse = Protostar::DSL.message("google.protobuf.compiler.CodeGeneratorResponse")
163
+ CodeGeneratorResponse::File = Protostar::DSL.message("google.protobuf.compiler.CodeGeneratorResponse.File")
164
+ CodeGeneratorResponse::Feature = Protostar::DSL.enum("google.protobuf.compiler.CodeGeneratorResponse.Feature")
165
+ end
166
+ end
167
+ end
168
+ end