Class: A2A::Proto::Operation
- Inherits:
-
Object
- Object
- A2A::Proto::Operation
- Defined in:
- lib/a2a/proto.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::Schema[].
- #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.
34 35 36 37 38 39 40 41 |
# File 'lib/a2a/proto.rb', line 34 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.
31 32 33 |
# File 'lib/a2a/proto.rb', line 31 def http_bindings @http_bindings end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/a2a/proto.rb', line 31 def name @name end |
#request_type ⇒ Object (readonly)
Returns the value of attribute request_type.
31 32 33 |
# File 'lib/a2a/proto.rb', line 31 def request_type @request_type end |
#response_type ⇒ Object (readonly)
Returns the value of attribute response_type.
31 32 33 |
# File 'lib/a2a/proto.rb', line 31 def response_type @response_type end |
#server_streaming ⇒ Object (readonly)
Returns the value of attribute server_streaming.
31 32 33 |
# File 'lib/a2a/proto.rb', line 31 def server_streaming @server_streaming end |
Instance Method Details
#grpc_method ⇒ Object
61 |
# File 'lib/a2a/proto.rb', line 61 def grpc_method = name |
#inspect ⇒ Object
67 68 69 |
# File 'lib/a2a/proto.rb', line 67 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.
60 |
# File 'lib/a2a/proto.rb', line 60 def json_rpc_method = name |
#request_schema ⇒ Object
Bridge to Schema: convert proto PascalCase type name to the JSON schema title used by A2A::Schema[].
"SendMessageRequest" => Schema["Send Message Request"]
50 51 52 |
# File 'lib/a2a/proto.rb', line 50 def request_schema A2A::Schema[pascal_to_title(request_type)] end |
#response_schema ⇒ Object
54 55 56 57 |
# File 'lib/a2a/proto.rb', line 54 def response_schema return nil if response_type.include?(".") # google.protobuf.Empty A2A::Schema[pascal_to_title(response_type)] end |
#rest_path ⇒ Object
65 |
# File 'lib/a2a/proto.rb', line 65 def rest_path = http_bindings.first.path |
#rest_verb ⇒ Object
REST binding from the primary (non-tenant) HTTP annotation.
64 |
# File 'lib/a2a/proto.rb', line 64 def rest_verb = http_bindings.first.verb |
#server_streaming? ⇒ Boolean
43 |
# File 'lib/a2a/proto.rb', line 43 def server_streaming? = @server_streaming |