Developer Connect V1 API - Class Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client (v1.2.0)

Reference documentation and code samples for the Developer Connect V1 API class Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.

REST client for the InsightsConfigService service.

Creates and manages InsightsConfigs.

The InsightsConfig resource is the core configuration object to capture events from your Software Development Lifecycle. It acts as the central hub for managing how Developer connect understands your application, its runtime environments, and the artifacts deployed within them. A user can create an InsightsConfig, list previously-requested InsightsConfigs or get InsightsConfigs by their ID to determine the status of the InsightsConfig.

Inherits

  • Object

Methods

.configure

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

Configure the InsightsConfigService 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 InsightsConfigService clients
::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the InsightsConfigService 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

#create_insights_config

def create_insights_config(request, options = nil) -> ::Gapic::Operation
def create_insights_config(parent: nil, insights_config_id: nil, insights_config: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new InsightsConfig in a given project and location.

Overloads
def create_insights_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_insights_config via a request object, either of type CreateInsightsConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Developerconnect::V1::CreateInsightsConfigRequest, ::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 create_insights_config(parent: nil, insights_config_id: nil, insights_config: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_insights_config 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
  • parent (::String) — Required. Value for parent.
  • insights_config_id (::String) — Required. ID of the requesting InsightsConfig.
  • insights_config (::Google::Cloud::Developerconnect::V1::InsightsConfig, ::Hash) — Required. The resource being created.
  • validate_only (::Boolean) — Optional. If set, validate the request, but do not actually post it.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/developer_connect/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_insights_config

def delete_insights_config(request, options = nil) -> ::Gapic::Operation
def delete_insights_config(name: nil, request_id: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Delete a single Insight.

Overloads
def delete_insights_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_insights_config via a request object, either of type DeleteInsightsConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Developerconnect::V1::DeleteInsightsConfigRequest, ::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 delete_insights_config(name: nil, request_id: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation
Pass arguments to delete_insights_config 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
  • name (::String) — Required. Value for parent.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

  • validate_only (::Boolean) — Optional. If set, validate the request, but do not actually post it.
  • etag (::String) — Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/developer_connect/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#get_insights_config

def get_insights_config(request, options = nil) -> ::Google::Cloud::Developerconnect::V1::InsightsConfig
def get_insights_config(name: nil) -> ::Google::Cloud::Developerconnect::V1::InsightsConfig

Gets details of a single Insight.

Overloads
def get_insights_config(request, options = nil) -> ::Google::Cloud::Developerconnect::V1::InsightsConfig
Pass arguments to get_insights_config via a request object, either of type GetInsightsConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Developerconnect::V1::GetInsightsConfigRequest, ::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_insights_config(name: nil) -> ::Google::Cloud::Developerconnect::V1::InsightsConfig
Pass arguments to get_insights_config 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. Name of the resource.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/developer_connect/v1"

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

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

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

# The returned object is of type Google::Cloud::Developerconnect::V1::InsightsConfig.
p result

#initialize

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

Create a new InsightsConfigService REST client object.

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

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

#list_insights_configs

def list_insights_configs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Developerconnect::V1::InsightsConfig>
def list_insights_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Developerconnect::V1::InsightsConfig>

Lists InsightsConfigs in a given project and location.

Overloads
def list_insights_configs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Developerconnect::V1::InsightsConfig>
Pass arguments to list_insights_configs via a request object, either of type ListInsightsConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Developerconnect::V1::ListInsightsConfigsRequest, ::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 list_insights_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Developerconnect::V1::InsightsConfig>
Pass arguments to list_insights_configs 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
  • parent (::String) — Required. Parent value for ListInsightsConfigsRequest.
  • page_size (::Integer) — Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — Optional. A token identifying a page of results the server should return.
  • filter (::String) — Optional. Filtering results. See https://google.aip.dev/160 for more details. Filter string, adhering to the rules in https://google.aip.dev/160. List only InsightsConfigs matching the filter. If filter is empty, all InsightsConfigs are listed.
  • order_by (::String) — Optional. Hint for how to order the results.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/developer_connect/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Developerconnect::V1::InsightsConfig.
  p item
end

#location_client

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

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

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

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::Developerconnect::V1::InsightsConfigService::Rest::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_insights_config

def update_insights_config(request, options = nil) -> ::Gapic::Operation
def update_insights_config(insights_config: nil, request_id: nil, allow_missing: nil, validate_only: nil) -> ::Gapic::Operation

Updates the parameters of a single InsightsConfig.

Overloads
def update_insights_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_insights_config via a request object, either of type UpdateInsightsConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Developerconnect::V1::UpdateInsightsConfigRequest, ::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_insights_config(insights_config: nil, request_id: nil, allow_missing: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to update_insights_config 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
  • insights_config (::Google::Cloud::Developerconnect::V1::InsightsConfig, ::Hash) — Required. The resource being updated.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

  • allow_missing (::Boolean) — Optional. If set to true, and the insightsConfig is not found a new insightsConfig will be created. In this situation update_mask is ignored. The creation will succeed only if the input insightsConfig has all the necessary information (e.g a github_config with both user_oauth_token and installation_id properties).
  • validate_only (::Boolean) — Optional. If set, validate the request, but do not actually post it.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/developer_connect/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end