Class: A2A::Protocol::Protobuf::Operation
- Inherits:
-
Object
- Object
- A2A::Protocol::Protobuf::Operation
- Defined in:
- lib/a2a/protocol/protobuf.rb
Instance Attribute Summary collapse
-
#http_bindings ⇒ Object
readonly
Returns the value of attribute http_bindings.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#request_type ⇒ Object
readonly
Returns the value of attribute request_type.
-
#response_type ⇒ Object
readonly
Returns the value of attribute response_type.
-
#server_streaming ⇒ Object
readonly
Returns the value of attribute server_streaming.
Instance Method Summary collapse
- #grpc_method ⇒ Object
-
#initialize(name:, request_type:, response_type:, server_streaming:, http_bindings:) ⇒ Operation
constructor
A new instance of Operation.
- #inspect ⇒ Object
-
#json_rpc_method ⇒ Object
JSON-RPC and gRPC method names are identical to the RPC name.
-
#request_schema ⇒ Object
Bridge to Schema: convert proto PascalCase type name to the JSON schema title used by A2A::Protocol::JsonSchema.
- #response_schema ⇒ Object
- #rest_path ⇒ Object
-
#rest_verb ⇒ Object
REST binding from the primary (non-tenant) HTTP annotation.
- #server_streaming? ⇒ Boolean
Constructor Details
#initialize(name:, request_type:, response_type:, server_streaming:, http_bindings:) ⇒ Operation
Returns a new instance of Operation.
35 36 37 38 39 40 41 42 |
# File 'lib/a2a/protocol/protobuf.rb', line 35 def initialize(name:, request_type:, response_type:, server_streaming:, http_bindings:) @name = name @request_type = request_type @response_type = response_type @server_streaming = server_streaming @http_bindings = http_bindings end |
Instance Attribute Details
#http_bindings ⇒ Object (readonly)
Returns the value of attribute http_bindings.
32 33 34 |
# File 'lib/a2a/protocol/protobuf.rb', line 32 def http_bindings @http_bindings end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
32 33 34 |
# File 'lib/a2a/protocol/protobuf.rb', line 32 def name @name end |
#request_type ⇒ Object (readonly)
Returns the value of attribute request_type.
32 33 34 |
# File 'lib/a2a/protocol/protobuf.rb', line 32 def request_type @request_type end |
#response_type ⇒ Object (readonly)
Returns the value of attribute response_type.
32 33 34 |
# File 'lib/a2a/protocol/protobuf.rb', line 32 def response_type @response_type end |
#server_streaming ⇒ Object (readonly)
Returns the value of attribute server_streaming.
32 33 34 |
# File 'lib/a2a/protocol/protobuf.rb', line 32 def server_streaming @server_streaming end |
Instance Method Details
#grpc_method ⇒ Object
62 |
# File 'lib/a2a/protocol/protobuf.rb', line 62 def grpc_method = name |
#inspect ⇒ Object
68 69 70 |
# File 'lib/a2a/protocol/protobuf.rb', line 68 def inspect "#<Proto::Operation #{name} #{rest_verb.upcase} #{rest_path}>" end |
#json_rpc_method ⇒ Object
JSON-RPC and gRPC method names are identical to the RPC name.
61 |
# File 'lib/a2a/protocol/protobuf.rb', line 61 def json_rpc_method = name |
#request_schema ⇒ Object
Bridge to Schema: convert proto PascalCase type name to the JSON schema title used by A2A::Protocol::JsonSchema.
"SendMessageRequest" => Schema["Send Message Request"]
51 52 53 |
# File 'lib/a2a/protocol/protobuf.rb', line 51 def request_schema A2A::Protocol::JsonSchema[pascal_to_title(request_type)] end |
#response_schema ⇒ Object
55 56 57 58 |
# File 'lib/a2a/protocol/protobuf.rb', line 55 def response_schema return nil if response_type.include?(".") # google.protobuf.Empty A2A::Protocol::JsonSchema[pascal_to_title(response_type)] end |
#rest_path ⇒ Object
66 |
# File 'lib/a2a/protocol/protobuf.rb', line 66 def rest_path = http_bindings.first.path |
#rest_verb ⇒ Object
REST binding from the primary (non-tenant) HTTP annotation.
65 |
# File 'lib/a2a/protocol/protobuf.rb', line 65 def rest_verb = http_bindings.first.verb |
#server_streaming? ⇒ Boolean
44 |
# File 'lib/a2a/protocol/protobuf.rb', line 44 def server_streaming? = @server_streaming |