class Gapic::Schema::Service
Wrapper for a protobuf service.
@!attribute [r] methods
@ return [Enumerable<Method>] The methods of this service.
Attributes
methods[R]
Public Class Methods
new(descriptor, address, docs, methods)
click to toggle source
Initializes a Service
object. @param descriptor [Google::Protobuf::ServiceDescriptorProto] 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 methods [Enumerable<Method>] The methods of this service.
Calls superclass method
Gapic::Schema::Proto::new
# File lib/gapic/schema/wrappers.rb, line 246 def initialize descriptor, address, docs, methods super descriptor, address, docs @methods = methods || [] @methods.each { |m| m.parent = self } end
Public Instance Methods
host()
click to toggle source
@return [String] The hostname for this service
(e.g. "foo.googleapis.com"). This should be specified with no prefix.
# File lib/gapic/schema/wrappers.rb, line 255 def host options[:".google.api.default_host"] if options end
is_deprecated?()
click to toggle source
@return [Boolean] True if this service is marked as deprecated, false otherwise.
# File lib/gapic/schema/wrappers.rb, line 273 def is_deprecated? options[:deprecated] if options end
resources()
click to toggle source
@return [Array<Google::Api::ResourceDescriptor>] A representation of the resource.
This is generally intended to be attached to the "name" field. See `google/api/resource.proto`.
# File lib/gapic/schema/wrappers.rb, line 280 def resources require "gapic/resource_lookup" @resources ||= Gapic::ResourceLookup.for_service self end
ruby_package()
click to toggle source
@return [String] Ruby Package
# File lib/gapic/schema/wrappers.rb, line 265 def ruby_package return nil if parent.nil? parent.ruby_package end
scopes()
click to toggle source
@return [Array<String>] The OAuth scopes information for the client.
# File lib/gapic/schema/wrappers.rb, line 260 def scopes String(options[:".google.api.oauth_scopes"]).split "," if options end