twirbet 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +20 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +28 -0
- data/Gemfile.lock +127 -0
- data/LICENSE.txt +21 -0
- data/README.md +144 -0
- data/Rakefile +17 -0
- data/examples/clientcompat/client +28 -0
- data/examples/clientcompat/clientcompat.proto +29 -0
- data/examples/clientcompat/clientcompat_pb.rb +36 -0
- data/examples/clientcompat/clientcompat_twirbet.rb +57 -0
- data/examples/ping/Gemfile +11 -0
- data/examples/ping/Gemfile.lock +69 -0
- data/examples/ping/bin/puma +27 -0
- data/examples/ping/bin/pumactl +27 -0
- data/examples/ping/bin/srb +27 -0
- data/examples/ping/bin/srb-rbi +27 -0
- data/examples/ping/bin/tapioca +27 -0
- data/examples/ping/client.rb +14 -0
- data/examples/ping/config/application.rb +13 -0
- data/examples/ping/config/environment.rb +6 -0
- data/examples/ping/config.ru +8 -0
- data/examples/ping/proto/ping.proto +15 -0
- data/examples/ping/proto/ping_pb.rb +20 -0
- data/examples/ping/proto/ping_twirbet.rb +47 -0
- data/examples/ping/sorbet/config +4 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/descriptor_proto/extension_range.rbi +34 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/descriptor_proto/reserved_range.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/descriptor_proto.rbi +83 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_descriptor_proto/enum_reserved_range.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_descriptor_proto.rbi +48 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_options.rbi +34 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_value_descriptor_proto.rbi +34 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_value_options.rbi +27 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/extension_range_options.rbi +20 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_descriptor_proto/label.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_descriptor_proto/type.rbi +37 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_descriptor_proto.rbi +90 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_options/c_type.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_options/js_type.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_options.rbi +69 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_descriptor_proto.rbi +97 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_descriptor_set.rbi +20 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_options/optimize_mode.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_options.rbi +160 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/generated_code_info/annotation.rbi +41 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/generated_code_info.rbi +20 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/map.rbi +12 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/message_options.rbi +48 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/method_descriptor_proto.rbi +55 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/method_options/idempotency_level.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/method_options.rbi +34 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/oneof_descriptor_proto.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/oneof_options.rbi +20 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/repeated_field.rbi +11 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/service_descriptor_proto.rbi +34 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/service_options.rbi +27 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/source_code_info/location.rbi +48 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/source_code_info.rbi +20 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/uninterpreted_option/name_part.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/uninterpreted_option.rbi +62 -0
- data/examples/ping/sorbet/rbi/dsl/ping/ping_request.rbi +16 -0
- data/examples/ping/sorbet/rbi/dsl/ping/ping_response.rbi +16 -0
- data/examples/ping/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/examples/ping/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +8 -0
- data/examples/ping/sorbet/rbi/gems/google-protobuf@3.21.12.rbi +1645 -0
- data/examples/ping/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/examples/ping/sorbet/rbi/gems/nio4r@2.5.8.rbi +8 -0
- data/examples/ping/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/examples/ping/sorbet/rbi/gems/parser@3.1.3.0.rbi +5076 -0
- data/examples/ping/sorbet/rbi/gems/puma@6.0.0.rbi +4177 -0
- data/examples/ping/sorbet/rbi/gems/rack@3.0.2.rbi +5016 -0
- data/examples/ping/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
- data/examples/ping/sorbet/rbi/gems/spoom@1.1.15.rbi +2383 -0
- data/examples/ping/sorbet/rbi/gems/tapioca@0.10.3.rbi +3032 -0
- data/examples/ping/sorbet/rbi/gems/thor@1.2.1.rbi +3919 -0
- data/examples/ping/sorbet/rbi/gems/twirbet@0.1.0.rbi +528 -0
- data/examples/ping/sorbet/rbi/gems/unparser@0.6.5.rbi +8 -0
- data/examples/ping/sorbet/rbi/gems/webrick@1.7.0.rbi +2498 -0
- data/examples/ping/sorbet/rbi/gems/yard-sorbet@0.7.0.rbi +391 -0
- data/examples/ping/sorbet/rbi/gems/yard@0.9.28.rbi +17022 -0
- data/examples/ping/sorbet/tapioca/config.yml +13 -0
- data/examples/ping/sorbet/tapioca/require.rb +5 -0
- data/lib/twirbet/client.rb +45 -0
- data/lib/twirbet/dsl.rb +84 -0
- data/lib/twirbet/encoding.rb +52 -0
- data/lib/twirbet/errors.rb +375 -0
- data/lib/twirbet/method.rb +34 -0
- data/lib/twirbet/service.rb +85 -0
- data/lib/twirbet/transport.rb +55 -0
- data/lib/twirbet/transports/fake_transport.rb +32 -0
- data/lib/twirbet/transports/net_http_transport.rb +20 -0
- data/lib/twirbet/version.rb +6 -0
- data/lib/twirbet.rb +11 -0
- data/sorbet/config +5 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/custom/ping.rbi +23 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1064 -0
- data/sorbet/rbi/gems/google-protobuf@3.21.12.rbi +1645 -0
- data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/sorbet/rbi/gems/parser@3.1.3.0.rbi +6878 -0
- data/sorbet/rbi/gems/rack@3.0.2.rbi +5163 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +397 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +2946 -0
- data/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
- data/sorbet/rbi/gems/regexp_parser@2.6.1.rbi +3126 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +4660 -0
- data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10492 -0
- data/sorbet/rbi/gems/rspec-expectations@3.12.1.rbi +7817 -0
- data/sorbet/rbi/gems/rspec-mocks@3.12.1.rbi +4994 -0
- data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1477 -0
- data/sorbet/rbi/gems/rspec@3.12.0.rbi +10 -0
- data/sorbet/rbi/gems/rubocop-ast@1.24.0.rbi +6790 -0
- data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +354 -0
- data/sorbet/rbi/gems/rubocop-rspec@2.16.0.rbi +7650 -0
- data/sorbet/rbi/gems/rubocop-shopify@2.10.1.rbi +8 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +1014 -0
- data/sorbet/rbi/gems/rubocop@1.40.0.rbi +51560 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +1212 -0
- data/sorbet/rbi/gems/spoom@1.1.15.rbi +2383 -0
- data/sorbet/rbi/gems/tapioca@0.10.3.rbi +3032 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3950 -0
- data/sorbet/rbi/gems/unicode-display_width@2.3.0.rbi +46 -0
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +4265 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +2498 -0
- data/sorbet/rbi/gems/yard-sorbet@0.7.0.rbi +391 -0
- data/sorbet/rbi/gems/yard@0.9.28.rbi +17033 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- data/twirbet.gemspec +36 -0
- metadata +223 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'srb' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
12
|
+
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
14
|
+
|
15
|
+
if File.file?(bundle_binstub)
|
16
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
17
|
+
load(bundle_binstub)
|
18
|
+
else
|
19
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
require "rubygems"
|
25
|
+
require "bundler/setup"
|
26
|
+
|
27
|
+
load Gem.bin_path("sorbet", "srb")
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'srb-rbi' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
12
|
+
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
14
|
+
|
15
|
+
if File.file?(bundle_binstub)
|
16
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
17
|
+
load(bundle_binstub)
|
18
|
+
else
|
19
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
require "rubygems"
|
25
|
+
require "bundler/setup"
|
26
|
+
|
27
|
+
load Gem.bin_path("sorbet", "srb-rbi")
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'tapioca' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
12
|
+
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
14
|
+
|
15
|
+
if File.file?(bundle_binstub)
|
16
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
17
|
+
load(bundle_binstub)
|
18
|
+
else
|
19
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
20
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
require "rubygems"
|
25
|
+
require "bundler/setup"
|
26
|
+
|
27
|
+
load Gem.bin_path("tapioca", "tapioca")
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
require_relative "config/environment"
|
4
|
+
|
5
|
+
client = Ping::PingService::Client.new("http://localhost:9292")
|
6
|
+
|
7
|
+
time_start = Time.now
|
8
|
+
|
9
|
+
response = client.ping(Ping::PingRequest.new(message: "Hello, world!"))
|
10
|
+
|
11
|
+
time_finish = Time.now
|
12
|
+
|
13
|
+
puts "Response: #{response.inspect}"
|
14
|
+
puts "Time elapsed: #{((time_finish - time_start) * 1000).round(2)}ms"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
require_relative "environment"
|
4
|
+
|
5
|
+
class Application
|
6
|
+
extend T::Sig
|
7
|
+
include Ping::PingService::Handler
|
8
|
+
|
9
|
+
sig { override.params(request: Ping::PingRequest).returns(Ping::PingResponse) }
|
10
|
+
def ping(request)
|
11
|
+
Ping::PingResponse.new(message: "Pong!")
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: proto/ping.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_file("proto/ping.proto", :syntax => :proto3) do
|
8
|
+
add_message "ping.PingRequest" do
|
9
|
+
optional :message, :string, 1
|
10
|
+
end
|
11
|
+
add_message "ping.PingResponse" do
|
12
|
+
optional :message, :string, 1
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
module Ping
|
18
|
+
PingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("ping.PingRequest").msgclass
|
19
|
+
PingResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("ping.PingResponse").msgclass
|
20
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
require "twirbet"
|
4
|
+
require_relative "ping_pb"
|
5
|
+
|
6
|
+
module Ping
|
7
|
+
module PingService
|
8
|
+
module Handler
|
9
|
+
extend T::Sig
|
10
|
+
extend T::Helpers
|
11
|
+
|
12
|
+
interface!
|
13
|
+
|
14
|
+
sig { abstract.params(request: PingRequest).returns(PingResponse) }
|
15
|
+
def ping(request); end
|
16
|
+
end
|
17
|
+
|
18
|
+
class Service < Twirbet::Service
|
19
|
+
extend T::Sig
|
20
|
+
|
21
|
+
package "ping"
|
22
|
+
service "PingService"
|
23
|
+
|
24
|
+
rpc "Ping", PingRequest, PingResponse, ruby_method: :ping
|
25
|
+
|
26
|
+
sig { params(handler: Handler).void }
|
27
|
+
def initialize(handler)
|
28
|
+
super(handler)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class Client < Twirbet::Client
|
33
|
+
extend T::Sig
|
34
|
+
include Handler
|
35
|
+
|
36
|
+
package "ping"
|
37
|
+
service "PingService"
|
38
|
+
|
39
|
+
rpc "Ping", PingRequest, PingResponse, ruby_method: :ping
|
40
|
+
|
41
|
+
sig { override.params(request: PingRequest, headers: T::Hash[String, String]).returns(PingResponse) }
|
42
|
+
def ping(request, headers = {})
|
43
|
+
call("Ping", request, headers)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::DescriptorProto::ExtensionRange`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::DescriptorProto::ExtensionRange`.
|
6
|
+
|
7
|
+
class Google::Protobuf::DescriptorProto::ExtensionRange
|
8
|
+
sig do
|
9
|
+
params(
|
10
|
+
end: T.nilable(Integer),
|
11
|
+
options: T.nilable(Google::Protobuf::ExtensionRangeOptions),
|
12
|
+
start: T.nilable(Integer)
|
13
|
+
).void
|
14
|
+
end
|
15
|
+
def initialize(end: nil, options: nil, start: nil); end
|
16
|
+
|
17
|
+
sig { returns(Integer) }
|
18
|
+
def end; end
|
19
|
+
|
20
|
+
sig { params(value: Integer).void }
|
21
|
+
def end=(value); end
|
22
|
+
|
23
|
+
sig { returns(T.nilable(Google::Protobuf::ExtensionRangeOptions)) }
|
24
|
+
def options; end
|
25
|
+
|
26
|
+
sig { params(value: T.nilable(Google::Protobuf::ExtensionRangeOptions)).void }
|
27
|
+
def options=(value); end
|
28
|
+
|
29
|
+
sig { returns(Integer) }
|
30
|
+
def start; end
|
31
|
+
|
32
|
+
sig { params(value: Integer).void }
|
33
|
+
def start=(value); end
|
34
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::DescriptorProto::ReservedRange`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::DescriptorProto::ReservedRange`.
|
6
|
+
|
7
|
+
class Google::Protobuf::DescriptorProto::ReservedRange
|
8
|
+
sig { params(end: T.nilable(Integer), start: T.nilable(Integer)).void }
|
9
|
+
def initialize(end: nil, start: nil); end
|
10
|
+
|
11
|
+
sig { returns(Integer) }
|
12
|
+
def end; end
|
13
|
+
|
14
|
+
sig { params(value: Integer).void }
|
15
|
+
def end=(value); end
|
16
|
+
|
17
|
+
sig { returns(Integer) }
|
18
|
+
def start; end
|
19
|
+
|
20
|
+
sig { params(value: Integer).void }
|
21
|
+
def start=(value); end
|
22
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::DescriptorProto`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::DescriptorProto`.
|
6
|
+
|
7
|
+
class Google::Protobuf::DescriptorProto
|
8
|
+
sig do
|
9
|
+
params(
|
10
|
+
enum_type: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::EnumDescriptorProto], T::Array[Google::Protobuf::EnumDescriptorProto])),
|
11
|
+
extension: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::FieldDescriptorProto], T::Array[Google::Protobuf::FieldDescriptorProto])),
|
12
|
+
extension_range: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::DescriptorProto::ExtensionRange], T::Array[Google::Protobuf::DescriptorProto::ExtensionRange])),
|
13
|
+
field: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::FieldDescriptorProto], T::Array[Google::Protobuf::FieldDescriptorProto])),
|
14
|
+
name: T.nilable(String),
|
15
|
+
nested_type: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::DescriptorProto], T::Array[Google::Protobuf::DescriptorProto])),
|
16
|
+
oneof_decl: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::OneofDescriptorProto], T::Array[Google::Protobuf::OneofDescriptorProto])),
|
17
|
+
options: T.nilable(Google::Protobuf::MessageOptions),
|
18
|
+
reserved_name: T.nilable(T.any(Google::Protobuf::RepeatedField[String], T::Array[String])),
|
19
|
+
reserved_range: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::DescriptorProto::ReservedRange], T::Array[Google::Protobuf::DescriptorProto::ReservedRange]))
|
20
|
+
).void
|
21
|
+
end
|
22
|
+
def initialize(enum_type: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::EnumDescriptorProto), extension: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::FieldDescriptorProto), extension_range: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::DescriptorProto::ExtensionRange), field: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::FieldDescriptorProto), name: nil, nested_type: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::DescriptorProto), oneof_decl: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::OneofDescriptorProto), options: nil, reserved_name: Google::Protobuf::RepeatedField.new(:string), reserved_range: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::DescriptorProto::ReservedRange)); end
|
23
|
+
|
24
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::EnumDescriptorProto]) }
|
25
|
+
def enum_type; end
|
26
|
+
|
27
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::EnumDescriptorProto]).void }
|
28
|
+
def enum_type=(value); end
|
29
|
+
|
30
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::FieldDescriptorProto]) }
|
31
|
+
def extension; end
|
32
|
+
|
33
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::FieldDescriptorProto]).void }
|
34
|
+
def extension=(value); end
|
35
|
+
|
36
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::DescriptorProto::ExtensionRange]) }
|
37
|
+
def extension_range; end
|
38
|
+
|
39
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::DescriptorProto::ExtensionRange]).void }
|
40
|
+
def extension_range=(value); end
|
41
|
+
|
42
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::FieldDescriptorProto]) }
|
43
|
+
def field; end
|
44
|
+
|
45
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::FieldDescriptorProto]).void }
|
46
|
+
def field=(value); end
|
47
|
+
|
48
|
+
sig { returns(String) }
|
49
|
+
def name; end
|
50
|
+
|
51
|
+
sig { params(value: String).void }
|
52
|
+
def name=(value); end
|
53
|
+
|
54
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::DescriptorProto]) }
|
55
|
+
def nested_type; end
|
56
|
+
|
57
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::DescriptorProto]).void }
|
58
|
+
def nested_type=(value); end
|
59
|
+
|
60
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::OneofDescriptorProto]) }
|
61
|
+
def oneof_decl; end
|
62
|
+
|
63
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::OneofDescriptorProto]).void }
|
64
|
+
def oneof_decl=(value); end
|
65
|
+
|
66
|
+
sig { returns(T.nilable(Google::Protobuf::MessageOptions)) }
|
67
|
+
def options; end
|
68
|
+
|
69
|
+
sig { params(value: T.nilable(Google::Protobuf::MessageOptions)).void }
|
70
|
+
def options=(value); end
|
71
|
+
|
72
|
+
sig { returns(Google::Protobuf::RepeatedField[String]) }
|
73
|
+
def reserved_name; end
|
74
|
+
|
75
|
+
sig { params(value: Google::Protobuf::RepeatedField[String]).void }
|
76
|
+
def reserved_name=(value); end
|
77
|
+
|
78
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::DescriptorProto::ReservedRange]) }
|
79
|
+
def reserved_range; end
|
80
|
+
|
81
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::DescriptorProto::ReservedRange]).void }
|
82
|
+
def reserved_range=(value); end
|
83
|
+
end
|
data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_descriptor_proto/enum_reserved_range.rbi
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::EnumDescriptorProto::EnumReservedRange`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::EnumDescriptorProto::EnumReservedRange`.
|
6
|
+
|
7
|
+
class Google::Protobuf::EnumDescriptorProto::EnumReservedRange
|
8
|
+
sig { params(end: T.nilable(Integer), start: T.nilable(Integer)).void }
|
9
|
+
def initialize(end: nil, start: nil); end
|
10
|
+
|
11
|
+
sig { returns(Integer) }
|
12
|
+
def end; end
|
13
|
+
|
14
|
+
sig { params(value: Integer).void }
|
15
|
+
def end=(value); end
|
16
|
+
|
17
|
+
sig { returns(Integer) }
|
18
|
+
def start; end
|
19
|
+
|
20
|
+
sig { params(value: Integer).void }
|
21
|
+
def start=(value); end
|
22
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::EnumDescriptorProto`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::EnumDescriptorProto`.
|
6
|
+
|
7
|
+
class Google::Protobuf::EnumDescriptorProto
|
8
|
+
sig do
|
9
|
+
params(
|
10
|
+
name: T.nilable(String),
|
11
|
+
options: T.nilable(Google::Protobuf::EnumOptions),
|
12
|
+
reserved_name: T.nilable(T.any(Google::Protobuf::RepeatedField[String], T::Array[String])),
|
13
|
+
reserved_range: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::EnumDescriptorProto::EnumReservedRange], T::Array[Google::Protobuf::EnumDescriptorProto::EnumReservedRange])),
|
14
|
+
value: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::EnumValueDescriptorProto], T::Array[Google::Protobuf::EnumValueDescriptorProto]))
|
15
|
+
).void
|
16
|
+
end
|
17
|
+
def initialize(name: nil, options: nil, reserved_name: Google::Protobuf::RepeatedField.new(:string), reserved_range: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::EnumDescriptorProto::EnumReservedRange), value: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::EnumValueDescriptorProto)); end
|
18
|
+
|
19
|
+
sig { returns(String) }
|
20
|
+
def name; end
|
21
|
+
|
22
|
+
sig { params(value: String).void }
|
23
|
+
def name=(value); end
|
24
|
+
|
25
|
+
sig { returns(T.nilable(Google::Protobuf::EnumOptions)) }
|
26
|
+
def options; end
|
27
|
+
|
28
|
+
sig { params(value: T.nilable(Google::Protobuf::EnumOptions)).void }
|
29
|
+
def options=(value); end
|
30
|
+
|
31
|
+
sig { returns(Google::Protobuf::RepeatedField[String]) }
|
32
|
+
def reserved_name; end
|
33
|
+
|
34
|
+
sig { params(value: Google::Protobuf::RepeatedField[String]).void }
|
35
|
+
def reserved_name=(value); end
|
36
|
+
|
37
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::EnumDescriptorProto::EnumReservedRange]) }
|
38
|
+
def reserved_range; end
|
39
|
+
|
40
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::EnumDescriptorProto::EnumReservedRange]).void }
|
41
|
+
def reserved_range=(value); end
|
42
|
+
|
43
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::EnumValueDescriptorProto]) }
|
44
|
+
def value; end
|
45
|
+
|
46
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::EnumValueDescriptorProto]).void }
|
47
|
+
def value=(value); end
|
48
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::EnumOptions`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::EnumOptions`.
|
6
|
+
|
7
|
+
class Google::Protobuf::EnumOptions
|
8
|
+
sig do
|
9
|
+
params(
|
10
|
+
allow_alias: T.nilable(T::Boolean),
|
11
|
+
deprecated: T.nilable(T::Boolean),
|
12
|
+
uninterpreted_option: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::UninterpretedOption], T::Array[Google::Protobuf::UninterpretedOption]))
|
13
|
+
).void
|
14
|
+
end
|
15
|
+
def initialize(allow_alias: nil, deprecated: nil, uninterpreted_option: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::UninterpretedOption)); end
|
16
|
+
|
17
|
+
sig { returns(T::Boolean) }
|
18
|
+
def allow_alias; end
|
19
|
+
|
20
|
+
sig { params(value: T::Boolean).void }
|
21
|
+
def allow_alias=(value); end
|
22
|
+
|
23
|
+
sig { returns(T::Boolean) }
|
24
|
+
def deprecated; end
|
25
|
+
|
26
|
+
sig { params(value: T::Boolean).void }
|
27
|
+
def deprecated=(value); end
|
28
|
+
|
29
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::UninterpretedOption]) }
|
30
|
+
def uninterpreted_option; end
|
31
|
+
|
32
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::UninterpretedOption]).void }
|
33
|
+
def uninterpreted_option=(value); end
|
34
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::EnumValueDescriptorProto`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::EnumValueDescriptorProto`.
|
6
|
+
|
7
|
+
class Google::Protobuf::EnumValueDescriptorProto
|
8
|
+
sig do
|
9
|
+
params(
|
10
|
+
name: T.nilable(String),
|
11
|
+
number: T.nilable(Integer),
|
12
|
+
options: T.nilable(Google::Protobuf::EnumValueOptions)
|
13
|
+
).void
|
14
|
+
end
|
15
|
+
def initialize(name: nil, number: nil, options: nil); end
|
16
|
+
|
17
|
+
sig { returns(String) }
|
18
|
+
def name; end
|
19
|
+
|
20
|
+
sig { params(value: String).void }
|
21
|
+
def name=(value); end
|
22
|
+
|
23
|
+
sig { returns(Integer) }
|
24
|
+
def number; end
|
25
|
+
|
26
|
+
sig { params(value: Integer).void }
|
27
|
+
def number=(value); end
|
28
|
+
|
29
|
+
sig { returns(T.nilable(Google::Protobuf::EnumValueOptions)) }
|
30
|
+
def options; end
|
31
|
+
|
32
|
+
sig { params(value: T.nilable(Google::Protobuf::EnumValueOptions)).void }
|
33
|
+
def options=(value); end
|
34
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::EnumValueOptions`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::EnumValueOptions`.
|
6
|
+
|
7
|
+
class Google::Protobuf::EnumValueOptions
|
8
|
+
sig do
|
9
|
+
params(
|
10
|
+
deprecated: T.nilable(T::Boolean),
|
11
|
+
uninterpreted_option: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::UninterpretedOption], T::Array[Google::Protobuf::UninterpretedOption]))
|
12
|
+
).void
|
13
|
+
end
|
14
|
+
def initialize(deprecated: nil, uninterpreted_option: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::UninterpretedOption)); end
|
15
|
+
|
16
|
+
sig { returns(T::Boolean) }
|
17
|
+
def deprecated; end
|
18
|
+
|
19
|
+
sig { params(value: T::Boolean).void }
|
20
|
+
def deprecated=(value); end
|
21
|
+
|
22
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::UninterpretedOption]) }
|
23
|
+
def uninterpreted_option; end
|
24
|
+
|
25
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::UninterpretedOption]).void }
|
26
|
+
def uninterpreted_option=(value); end
|
27
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::ExtensionRangeOptions`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::ExtensionRangeOptions`.
|
6
|
+
|
7
|
+
class Google::Protobuf::ExtensionRangeOptions
|
8
|
+
sig do
|
9
|
+
params(
|
10
|
+
uninterpreted_option: T.nilable(T.any(Google::Protobuf::RepeatedField[Google::Protobuf::UninterpretedOption], T::Array[Google::Protobuf::UninterpretedOption]))
|
11
|
+
).void
|
12
|
+
end
|
13
|
+
def initialize(uninterpreted_option: Google::Protobuf::RepeatedField.new(:message, Google::Protobuf::UninterpretedOption)); end
|
14
|
+
|
15
|
+
sig { returns(Google::Protobuf::RepeatedField[Google::Protobuf::UninterpretedOption]) }
|
16
|
+
def uninterpreted_option; end
|
17
|
+
|
18
|
+
sig { params(value: Google::Protobuf::RepeatedField[Google::Protobuf::UninterpretedOption]).void }
|
19
|
+
def uninterpreted_option=(value); end
|
20
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::FieldDescriptorProto::Label`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::FieldDescriptorProto::Label`.
|
6
|
+
|
7
|
+
module Google::Protobuf::FieldDescriptorProto::Label
|
8
|
+
class << self
|
9
|
+
sig { returns(Google::Protobuf::EnumDescriptor) }
|
10
|
+
def descriptor; end
|
11
|
+
|
12
|
+
sig { params(number: Integer).returns(T.nilable(Symbol)) }
|
13
|
+
def lookup(number); end
|
14
|
+
|
15
|
+
sig { params(symbol: Symbol).returns(T.nilable(Integer)) }
|
16
|
+
def resolve(symbol); end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
Google::Protobuf::FieldDescriptorProto::Label::LABEL_OPTIONAL = 1
|
21
|
+
Google::Protobuf::FieldDescriptorProto::Label::LABEL_REPEATED = 3
|
22
|
+
Google::Protobuf::FieldDescriptorProto::Label::LABEL_REQUIRED = 2
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for dynamic methods in `Google::Protobuf::FieldDescriptorProto::Type`.
|
5
|
+
# Please instead update this file by running `bin/tapioca dsl Google::Protobuf::FieldDescriptorProto::Type`.
|
6
|
+
|
7
|
+
module Google::Protobuf::FieldDescriptorProto::Type
|
8
|
+
class << self
|
9
|
+
sig { returns(Google::Protobuf::EnumDescriptor) }
|
10
|
+
def descriptor; end
|
11
|
+
|
12
|
+
sig { params(number: Integer).returns(T.nilable(Symbol)) }
|
13
|
+
def lookup(number); end
|
14
|
+
|
15
|
+
sig { params(symbol: Symbol).returns(T.nilable(Integer)) }
|
16
|
+
def resolve(symbol); end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_BOOL = 8
|
21
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_BYTES = 12
|
22
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_DOUBLE = 1
|
23
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_ENUM = 14
|
24
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_FIXED32 = 7
|
25
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_FIXED64 = 6
|
26
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_FLOAT = 2
|
27
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_GROUP = 10
|
28
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_INT32 = 5
|
29
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_INT64 = 3
|
30
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_MESSAGE = 11
|
31
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_SFIXED32 = 15
|
32
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_SFIXED64 = 16
|
33
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_SINT32 = 17
|
34
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_SINT64 = 18
|
35
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_STRING = 9
|
36
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_UINT32 = 13
|
37
|
+
Google::Protobuf::FieldDescriptorProto::Type::TYPE_UINT64 = 4
|