API hub V1 API - Class Google::Cloud::ApiHub::V1::LintingService::Client (v0.1.1)

Reference documentation and code samples for the API hub V1 API class Google::Cloud::ApiHub::V1::LintingService::Client.

Client for the LintingService service.

This service provides all methods related to the 1p Linter.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the LintingService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all LintingService clients
::Google::Cloud::ApiHub::V1::LintingService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the LintingService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#get_style_guide

def get_style_guide(request, options = nil) -> ::Google::Cloud::ApiHub::V1::StyleGuide
def get_style_guide(name: nil) -> ::Google::Cloud::ApiHub::V1::StyleGuide

Get the style guide being used for linting.

Overloads
def get_style_guide(request, options = nil) -> ::Google::Cloud::ApiHub::V1::StyleGuide
Pass arguments to get_style_guide via a request object, either of type GetStyleGuideRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ApiHub::V1::GetStyleGuideRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_style_guide(name: nil) -> ::Google::Cloud::ApiHub::V1::StyleGuide
Pass arguments to get_style_guide via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the spec to retrieve. Format: projects/{project}/locations/{location}/plugins/{plugin}/styleGuide.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/api_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ApiHub::V1::LintingService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ApiHub::V1::GetStyleGuideRequest.new

# Call the get_style_guide method.
result = client.get_style_guide request

# The returned object is of type Google::Cloud::ApiHub::V1::StyleGuide.
p result

#get_style_guide_contents

def get_style_guide_contents(request, options = nil) -> ::Google::Cloud::ApiHub::V1::StyleGuideContents
def get_style_guide_contents(name: nil) -> ::Google::Cloud::ApiHub::V1::StyleGuideContents

Get the contents of the style guide.

Overloads
def get_style_guide_contents(request, options = nil) -> ::Google::Cloud::ApiHub::V1::StyleGuideContents
Pass arguments to get_style_guide_contents via a request object, either of type GetStyleGuideContentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ApiHub::V1::GetStyleGuideContentsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_style_guide_contents(name: nil) -> ::Google::Cloud::ApiHub::V1::StyleGuideContents
Pass arguments to get_style_guide_contents via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the StyleGuide whose contents need to be retrieved. There is exactly one style guide resource per project per location. The expected format is projects/{project}/locations/{location}/plugins/{plugin}/styleGuide.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/api_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ApiHub::V1::LintingService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ApiHub::V1::GetStyleGuideContentsRequest.new

# Call the get_style_guide_contents method.
result = client.get_style_guide_contents request

# The returned object is of type Google::Cloud::ApiHub::V1::StyleGuideContents.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new LintingService client object.

Yields
  • (config) — Configure the LintingService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::ApiHub::V1::LintingService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::ApiHub::V1::LintingService::Client.new do |config|
  config.timeout = 10.0
end

#lint_spec

def lint_spec(request, options = nil) -> ::Google::Protobuf::Empty
def lint_spec(name: nil) -> ::Google::Protobuf::Empty

Lints the requested spec and updates the corresponding API Spec with the lint response. This lint response will be available in all subsequent Get and List Spec calls to Core service.

Overloads
def lint_spec(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to lint_spec via a request object, either of type Google::Cloud::ApiHub::V1::LintSpecRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ApiHub::V1::LintSpecRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def lint_spec(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to lint_spec via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the spec to be linted. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/api_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ApiHub::V1::LintingService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ApiHub::V1::LintSpecRequest.new

# Call the lint_spec method.
result = client.lint_spec request

# The returned object is of type Google::Protobuf::Empty.
p result

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_style_guide

def update_style_guide(request, options = nil) -> ::Google::Cloud::ApiHub::V1::StyleGuide
def update_style_guide(style_guide: nil, update_mask: nil) -> ::Google::Cloud::ApiHub::V1::StyleGuide

Update the styleGuide to be used for liniting in by API hub.

Overloads
def update_style_guide(request, options = nil) -> ::Google::Cloud::ApiHub::V1::StyleGuide
Pass arguments to update_style_guide via a request object, either of type UpdateStyleGuideRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ApiHub::V1::UpdateStyleGuideRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_style_guide(style_guide: nil, update_mask: nil) -> ::Google::Cloud::ApiHub::V1::StyleGuide
Pass arguments to update_style_guide via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/api_hub/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ApiHub::V1::LintingService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ApiHub::V1::UpdateStyleGuideRequest.new

# Call the update_style_guide method.
result = client.update_style_guide request

# The returned object is of type Google::Cloud::ApiHub::V1::StyleGuide.
p result