class Gapic::Presenters::ServiceRestPresenter

A presenter for proto service (REST submethods)

Attributes

api[R]

@return [Gapic::Schema::Api]

main_service[R]

@return [Gapic::Presenters::ServicePresenter]

Public Class Methods

new(main_service, api) click to toggle source

@param main_service [Gapic::Presenters::ServicePresenter] @param api [Gapic::Schema::Api]

# File lib/gapic/presenters/service_rest_presenter.rb, line 34
def initialize main_service, api
  @main_service = main_service
  @api = api
end

Public Instance Methods

client_file_path() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 98
def client_file_path
  "#{client_require}.rb"
end
client_name() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 77
def client_name
  main_service.client_name
end
client_name_full() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 84
def client_name_full
  fix_namespace api, "#{service_name_full}::#{client_name}"
end
client_require() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 91
def client_require
  ruby_file_path api, client_name_full
end
configure_client_call() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 140
def configure_client_call
  "#{client_name_full}.configure"
end
create_client_call() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 105
def create_client_call
  "#{client_name_full}.new"
end
credentials_class_xref() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 133
def credentials_class_xref
  main_service.credentials_class_xref
end
quick_start_method() click to toggle source

The method to use for quick start samples. Normally this is simply the first non-client-streaming method defined, but it can be overridden via a gem config.

@return [Gapic::Presenters::MethodRestPresenter] if there is a method

appropriatke for quick start

@return [nil] if there is no method appropriate for quick start

# File lib/gapic/presenters/service_rest_presenter.rb, line 153
def quick_start_method
  main_service.quick_start_method&.rest
end
service_name_full() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 42
def service_name_full
  fix_namespace api, "#{main_service.service_name_full}::Rest"
end
service_rest_file_path() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 119
def service_rest_file_path
  "#{service_rest_require}.rb"
end
service_rest_require() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 112
def service_rest_require
  ruby_file_path api, service_name_full
end
service_stub_file_path() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 70
def service_stub_file_path
  "#{service_stub_require}.rb"
end
service_stub_name() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 49
def service_stub_name
  "ServiceStub"
end
service_stub_name_full() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 56
def service_stub_name_full
  fix_namespace api, "#{service_name_full}::#{service_stub_name}"
end
service_stub_require() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 63
def service_stub_require
  ruby_file_path api, service_stub_name_full
end
test_client_file_path() click to toggle source

@return [String]

# File lib/gapic/presenters/service_rest_presenter.rb, line 126
def test_client_file_path
  main_service.service_file_path.sub ".rb", "_test.rb"
end