Class: Gapic::Schema::Method
- Extended by:
- Forwardable
- Defined in:
- lib/gapic/schema/wrappers.rb
Overview
Wrapper for a protobuf method.
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
@ return [Message] The input message of this method.
-
#output ⇒ Object
readonly
@ return [Message] The output message of this method.
Attributes inherited from Proto
#address, #descriptor, #docs, #parent
Instance Method Summary collapse
-
#client_streaming ⇒ Boolean
Identifies if client streams multiple client messages.
-
#full_name ⇒ String
The full name for this method (e.g.
google.example.Service.Rpc). -
#http ⇒ Google::Api::HttpRule
The HTTP bindings for this method.
-
#initialize(descriptor, address, docs, input, output) ⇒ Method
constructor
Initializes a method object.
-
#is_deprecated? ⇒ Boolean
True if this method is marked as deprecated, false otherwise.
-
#name ⇒ String
The unqualified name of the method.
-
#operation_info ⇒ Google::Longrunning::OperationInfo
Additional information regarding long-running operations.
-
#operation_service ⇒ String
Nonstandard LRO annotation.
-
#options ⇒ Google::Protobuf::MethodOptions
The options of this method.
-
#polling_method ⇒ Boolean
Nonstandard LRO annotation.
-
#routing ⇒ Google::Api::RoutingRule
The Routing bindings for this method.
-
#server_streaming ⇒ Boolean
Identifies if server streams multiple server messages.
-
#signatures ⇒ Array<Array<String>>
The parameter lists defined for this method.
Methods inherited from Proto
#containing_api, #containing_file, #docs_leading_comments, #leading_comments, #leading_detached_comments, #path, #span, #trailing_comments
Constructor Details
#initialize(descriptor, address, docs, input, output) ⇒ Method
Initializes a method object.
328 329 330 331 332 |
# File 'lib/gapic/schema/wrappers.rb', line 328 def initialize descriptor, address, docs, input, output super descriptor, address, docs @input = input @output = output end |
Instance Attribute Details
#input ⇒ Object (readonly)
@ return [Message] The input message of this method.
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
# File 'lib/gapic/schema/wrappers.rb', line 313 class Method < Proto extend Forwardable attr_reader :input attr_reader :output # Initializes a method object. # @param descriptor [Google::Protobuf::MethodDescriptorProto] the # protobuf representation of this service. # @param address [Enumerable<String>] The address of the proto. See # #address for more info. # @param docs [Google::Protobuf::SourceCodeInfo::Location] The docs # of the proto. See #docs for more info. # @param input [Message] The input message of this method. # @param output [Message] The output message of this method. def initialize descriptor, address, docs, input, output super descriptor, address, docs @input = input @output = output end # @return [Array<Array<String>>] The parameter lists # defined for this method. See `google/api/client.proto`. def signatures return [] if .nil? Array([:".google.api.method_signature"]).map do |sig| String(sig).split "," end end # @return [Google::Longrunning::OperationInfo] Additional information # regarding long-running operations. # In particular, this specifies the types that are returned from # long-running operations. # Required for methods that return `google.longrunning.Operation`; # invalid otherwise. def operation_info [:".google.longrunning.operation_info"] if end # @return [Boolean] True if this method is marked as deprecated, false # otherwise. def is_deprecated? [:deprecated] if end # @return [Google::Api::HttpRule] The HTTP bindings for this method. See # `google/api/http.proto`. def http [:".google.api.http"] if end # @return [Google::Api::RoutingRule] The Routing bindings for this method. See # `google/api/routing.proto`. def routing [:".google.api.routing"] if end # @return [String] The full name for this method # (e.g. `google.example.Service.Rpc`). # Useful when matching against other pieces of information # which also reference full proto name. def full_name @address.join "." end # Nonstandard LRO annotation. # @return [String] Name of the nonstandard LRO service # that should be used for polling the operation object # that this method returns def operation_service [:".google.cloud.operation_service"] if end # Nonstandard LRO annotation. # @return [Boolean] Whether this method is a polling method # for a nonstandard LRO service def polling_method [:".google.cloud.operation_polling_method"] if end # @!method name # @return [String] the unqualified name of the method. # @!method options # @return [Google::Protobuf::MethodOptions] the options of this # method. # @!method client_streaming # @return [Boolean] # Identifies if client streams multiple client messages. # @!method server_streaming # @return [Boolean] # Identifies if server streams multiple server messages. def_delegators( :descriptor, :name, :options, :client_streaming, :server_streaming ) end |
#output ⇒ Object (readonly)
@ return [Message] The output message of this method.
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
# File 'lib/gapic/schema/wrappers.rb', line 313 class Method < Proto extend Forwardable attr_reader :input attr_reader :output # Initializes a method object. # @param descriptor [Google::Protobuf::MethodDescriptorProto] the # protobuf representation of this service. # @param address [Enumerable<String>] The address of the proto. See # #address for more info. # @param docs [Google::Protobuf::SourceCodeInfo::Location] The docs # of the proto. See #docs for more info. # @param input [Message] The input message of this method. # @param output [Message] The output message of this method. def initialize descriptor, address, docs, input, output super descriptor, address, docs @input = input @output = output end # @return [Array<Array<String>>] The parameter lists # defined for this method. See `google/api/client.proto`. def signatures return [] if .nil? Array([:".google.api.method_signature"]).map do |sig| String(sig).split "," end end # @return [Google::Longrunning::OperationInfo] Additional information # regarding long-running operations. # In particular, this specifies the types that are returned from # long-running operations. # Required for methods that return `google.longrunning.Operation`; # invalid otherwise. def operation_info [:".google.longrunning.operation_info"] if end # @return [Boolean] True if this method is marked as deprecated, false # otherwise. def is_deprecated? [:deprecated] if end # @return [Google::Api::HttpRule] The HTTP bindings for this method. See # `google/api/http.proto`. def http [:".google.api.http"] if end # @return [Google::Api::RoutingRule] The Routing bindings for this method. See # `google/api/routing.proto`. def routing [:".google.api.routing"] if end # @return [String] The full name for this method # (e.g. `google.example.Service.Rpc`). # Useful when matching against other pieces of information # which also reference full proto name. def full_name @address.join "." end # Nonstandard LRO annotation. # @return [String] Name of the nonstandard LRO service # that should be used for polling the operation object # that this method returns def operation_service [:".google.cloud.operation_service"] if end # Nonstandard LRO annotation. # @return [Boolean] Whether this method is a polling method # for a nonstandard LRO service def polling_method [:".google.cloud.operation_polling_method"] if end # @!method name # @return [String] the unqualified name of the method. # @!method options # @return [Google::Protobuf::MethodOptions] the options of this # method. # @!method client_streaming # @return [Boolean] # Identifies if client streams multiple client messages. # @!method server_streaming # @return [Boolean] # Identifies if server streams multiple server messages. def_delegators( :descriptor, :name, :options, :client_streaming, :server_streaming ) end |
Instance Method Details
#client_streaming ⇒ Boolean
Returns Identifies if client streams multiple client messages.
406 407 408 409 410 411 412 |
# File 'lib/gapic/schema/wrappers.rb', line 406 def_delegators( :descriptor, :name, :options, :client_streaming, :server_streaming ) |
#full_name ⇒ String
Returns The full name for this method
(e.g. google.example.Service.Rpc).
Useful when matching against other pieces of information
which also reference full proto name.
376 377 378 |
# File 'lib/gapic/schema/wrappers.rb', line 376 def full_name @address.join "." end |
#http ⇒ Google::Api::HttpRule
Returns The HTTP bindings for this method. See
google/api/http.proto.
362 363 364 |
# File 'lib/gapic/schema/wrappers.rb', line 362 def http [:".google.api.http"] if end |
#is_deprecated? ⇒ Boolean
Returns True if this method is marked as deprecated, false otherwise.
356 357 358 |
# File 'lib/gapic/schema/wrappers.rb', line 356 def is_deprecated? [:deprecated] if end |
#name ⇒ String
Returns the unqualified name of the method.
406 407 408 409 410 411 412 |
# File 'lib/gapic/schema/wrappers.rb', line 406 def_delegators( :descriptor, :name, :options, :client_streaming, :server_streaming ) |
#operation_info ⇒ Google::Longrunning::OperationInfo
Returns Additional information
regarding long-running operations.
In particular, this specifies the types that are returned from
long-running operations.
Required for methods that return google.longrunning.Operation;
invalid otherwise.
350 351 352 |
# File 'lib/gapic/schema/wrappers.rb', line 350 def operation_info [:".google.longrunning.operation_info"] if end |
#operation_service ⇒ String
Nonstandard LRO annotation.
384 385 386 |
# File 'lib/gapic/schema/wrappers.rb', line 384 def operation_service [:".google.cloud.operation_service"] if end |
#options ⇒ Google::Protobuf::MethodOptions
Returns the options of this method.
406 407 408 409 410 411 412 |
# File 'lib/gapic/schema/wrappers.rb', line 406 def_delegators( :descriptor, :name, :options, :client_streaming, :server_streaming ) |
#polling_method ⇒ Boolean
Nonstandard LRO annotation.
391 392 393 |
# File 'lib/gapic/schema/wrappers.rb', line 391 def polling_method [:".google.cloud.operation_polling_method"] if end |
#routing ⇒ Google::Api::RoutingRule
Returns The Routing bindings for this method. See
google/api/routing.proto.
368 369 370 |
# File 'lib/gapic/schema/wrappers.rb', line 368 def routing [:".google.api.routing"] if end |
#server_streaming ⇒ Boolean
Returns Identifies if server streams multiple server messages.
406 407 408 409 410 411 412 |
# File 'lib/gapic/schema/wrappers.rb', line 406 def_delegators( :descriptor, :name, :options, :client_streaming, :server_streaming ) |
#signatures ⇒ Array<Array<String>>
Returns The parameter lists
defined for this method. See google/api/client.proto.
336 337 338 339 340 341 342 |
# File 'lib/gapic/schema/wrappers.rb', line 336 def signatures return [] if .nil? Array([:".google.api.method_signature"]).map do |sig| String(sig).split "," end end |