Developer Connect V1 API - Class Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client (v0.4.0)

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

REST client for the DeveloperConnect service.

Service describing handlers for resources

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the DeveloperConnect 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_connection

def create_connection(request, options = nil) -> ::Gapic::Operation
def create_connection(parent: nil, connection_id: nil, connection: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new Connection in a given project and location.

Overloads
def create_connection(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_connection via a request object, either of type CreateConnectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::CreateConnectionRequest, ::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_connection(parent: nil, connection_id: nil, connection: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_connection 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.
  • connection_id (::String) — Required. Id of the requesting object If auto-generating Id server-side, remove this field and connection_id from the method_signature of Create RPC
  • connection (::Google::Cloud::DeveloperConnect::V1::Connection, ::Hash) — Required. The resource being created
  • 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 since 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.
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::DeveloperConnect::Rest::Client.new

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

# Call the create_connection method.
result = client.create_connection 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
def create_git_repository_link(request, options = nil) -> ::Gapic::Operation
def create_git_repository_link(parent: nil, git_repository_link: nil, git_repository_link_id: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation

Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.

Overloads
def create_git_repository_link(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_git_repository_link via a request object, either of type CreateGitRepositoryLinkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::CreateGitRepositoryLinkRequest, ::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_git_repository_link(parent: nil, git_repository_link: nil, git_repository_link_id: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_git_repository_link 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.
  • git_repository_link (::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink, ::Hash) — Required. The resource being created
  • git_repository_link_id (::String) — Required. The ID to use for the repository, which will become the final component of the repository's resource name. This ID should be unique in the connection. Allows alphanumeric characters and any of -._~%!$&'()*+,;=@.
  • 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 since 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.
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::DeveloperConnect::Rest::Client.new

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

# Call the create_git_repository_link method.
result = client.create_git_repository_link 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_connection

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

Deletes a single Connection.

Overloads
def delete_connection(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_connection via a request object, either of type Google::Cloud::DeveloperConnect::V1::DeleteConnectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::DeleteConnectionRequest, ::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_connection(name: nil, request_id: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation
Pass arguments to delete_connection 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. Name of the resource
  • 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. The current etag of the Connection. If an etag is provided and does not match the current etag of the Connection, deletion will be blocked and an ABORTED error will be returned.
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::DeveloperConnect::Rest::Client.new

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

# Call the delete_connection method.
result = client.delete_connection 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
def delete_git_repository_link(request, options = nil) -> ::Gapic::Operation
def delete_git_repository_link(name: nil, request_id: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation

Deletes a single GitRepositoryLink.

Overloads
def delete_git_repository_link(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_git_repository_link via a request object, either of type Google::Cloud::DeveloperConnect::V1::DeleteGitRepositoryLinkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::DeleteGitRepositoryLinkRequest, ::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_git_repository_link(name: nil, request_id: nil, validate_only: nil, etag: nil) -> ::Gapic::Operation
Pass arguments to delete_git_repository_link 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. Name of the resource
  • 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::DeveloperConnect::Rest::Client.new

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

# Call the delete_git_repository_link method.
result = client.delete_git_repository_link 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

#fetch_git_hub_installations

def fetch_git_hub_installations(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsResponse
def fetch_git_hub_installations(connection: nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsResponse

FetchGitHubInstallations returns the list of GitHub Installations that are available to be added to a Connection. For github.com, only installations accessible to the authorizer token are returned. For GitHub Enterprise, all installations are returned.

Overloads
def fetch_git_hub_installations(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsResponse
Pass arguments to fetch_git_hub_installations via a request object, either of type FetchGitHubInstallationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsRequest, ::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 fetch_git_hub_installations(connection: nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsResponse
Pass arguments to fetch_git_hub_installations 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
  • connection (::String) — Required. The resource name of the connection in the format projects/*/locations/*/connections/*.
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::DeveloperConnect::Rest::Client.new

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

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

# The returned object is of type Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsResponse.
p result

#fetch_git_refs

def fetch_git_refs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::String>
def fetch_git_refs(git_repository_link: nil, ref_type: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::String>

Fetch the list of branches or tags for a given repository.

Overloads
def fetch_git_refs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::String>
Pass arguments to fetch_git_refs via a request object, either of type FetchGitRefsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::FetchGitRefsRequest, ::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 fetch_git_refs(git_repository_link: nil, ref_type: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::String>
Pass arguments to fetch_git_refs 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
  • git_repository_link (::String) — Required. The resource name of GitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.
  • ref_type (::Google::Cloud::DeveloperConnect::V1::FetchGitRefsRequest::RefType) — Required. Type of refs to fetch.
  • page_size (::Integer) — Optional. Number of results to return in the list. Default to 20.
  • page_token (::String) — Optional. Page start.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Rest::PagedEnumerable<::String>)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Rest::PagedEnumerable<::String>)
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::DeveloperConnect::Rest::Client.new

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

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

# The returned object is of type Google::Cloud::DeveloperConnect::V1::FetchGitRefsResponse.
p result

#fetch_linkable_git_repositories

def fetch_linkable_git_repositories(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::LinkableGitRepository>
def fetch_linkable_git_repositories(connection: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::LinkableGitRepository>

FetchLinkableGitRepositories returns a list of git repositories from an SCM that are available to be added to a Connection.

Overloads
def fetch_linkable_git_repositories(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::LinkableGitRepository>
Pass arguments to fetch_linkable_git_repositories via a request object, either of type FetchLinkableGitRepositoriesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::FetchLinkableGitRepositoriesRequest, ::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 fetch_linkable_git_repositories(connection: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::LinkableGitRepository>
Pass arguments to fetch_linkable_git_repositories 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
  • connection (::String) — Required. The name of the Connection. Format: projects/*/locations/*/connections/*.
  • page_size (::Integer) — Optional. Number of results to return in the list. Defaults to 20.
  • page_token (::String) — Optional. Page start.
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::DeveloperConnect::Rest::Client.new

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

# Call the fetch_linkable_git_repositories method.
result = client.fetch_linkable_git_repositories 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::LinkableGitRepository.
  p item
end

#fetch_read_token

def fetch_read_token(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse
def fetch_read_token(git_repository_link: nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse

Fetches read token of a given gitRepositoryLink.

Overloads
def fetch_read_token(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse
Pass arguments to fetch_read_token via a request object, either of type FetchReadTokenRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::FetchReadTokenRequest, ::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 fetch_read_token(git_repository_link: nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse
Pass arguments to fetch_read_token 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
  • git_repository_link (::String) — Required. The resource name of the gitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.
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::DeveloperConnect::Rest::Client.new

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

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

# The returned object is of type Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse.
p result

#fetch_read_write_token

def fetch_read_write_token(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse
def fetch_read_write_token(git_repository_link: nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse

Fetches read/write token of a given gitRepositoryLink.

Overloads
def fetch_read_write_token(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse
Pass arguments to fetch_read_write_token via a request object, either of type FetchReadWriteTokenRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenRequest, ::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 fetch_read_write_token(git_repository_link: nil) -> ::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse
Pass arguments to fetch_read_write_token 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
  • git_repository_link (::String) — Required. The resource name of the gitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.
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::DeveloperConnect::Rest::Client.new

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

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

# The returned object is of type Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse.
p result

#get_connection

def get_connection(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::Connection
def get_connection(name: nil) -> ::Google::Cloud::DeveloperConnect::V1::Connection

Gets details of a single Connection.

Overloads
def get_connection(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::Connection
Pass arguments to get_connection via a request object, either of type GetConnectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::GetConnectionRequest, ::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_connection(name: nil) -> ::Google::Cloud::DeveloperConnect::V1::Connection
Pass arguments to get_connection 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::DeveloperConnect::Rest::Client.new

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

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

# The returned object is of type Google::Cloud::DeveloperConnect::V1::Connection.
p result
def get_git_repository_link(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink
def get_git_repository_link(name: nil) -> ::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink

Gets details of a single GitRepositoryLink.

Overloads
def get_git_repository_link(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink
Pass arguments to get_git_repository_link via a request object, either of type GetGitRepositoryLinkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::GetGitRepositoryLinkRequest, ::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_git_repository_link(name: nil) -> ::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink
Pass arguments to get_git_repository_link 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::DeveloperConnect::Rest::Client.new

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

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

# The returned object is of type Google::Cloud::DeveloperConnect::V1::GitRepositoryLink.
p result

#initialize

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

Create a new DeveloperConnect REST client object.

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

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

#list_connections

def list_connections(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::ListConnectionsResponse
def list_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Google::Cloud::DeveloperConnect::V1::ListConnectionsResponse

Lists Connections in a given project and location.

Overloads
def list_connections(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::ListConnectionsResponse
Pass arguments to list_connections via a request object, either of type ListConnectionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::ListConnectionsRequest, ::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_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Google::Cloud::DeveloperConnect::V1::ListConnectionsResponse
Pass arguments to list_connections 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 ListConnectionsRequest
  • 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
  • order_by (::String) — Optional. Hint for how to order the results
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::DeveloperConnect::Rest::Client.new

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

# Call the list_connections method.
result = client.list_connections 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::Connection.
  p item
end
def list_git_repository_links(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksResponse
def list_git_repository_links(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksResponse

Lists GitRepositoryLinks in a given project, location, and connection.

Overloads
def list_git_repository_links(request, options = nil) -> ::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksResponse
Pass arguments to list_git_repository_links via a request object, either of type ListGitRepositoryLinksRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksRequest, ::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_git_repository_links(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksResponse
Pass arguments to list_git_repository_links 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 ListGitRepositoryLinksRequest
  • 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
  • order_by (::String) — Optional. Hint for how to order the results
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::DeveloperConnect::Rest::Client.new

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

# Call the list_git_repository_links method.
result = client.list_git_repository_links 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::GitRepositoryLink.
  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::DeveloperConnect::Rest::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_connection

def update_connection(request, options = nil) -> ::Gapic::Operation
def update_connection(update_mask: nil, connection: nil, request_id: nil, allow_missing: nil, validate_only: nil) -> ::Gapic::Operation

Updates the parameters of a single Connection.

Overloads
def update_connection(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_connection via a request object, either of type UpdateConnectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DeveloperConnect::V1::UpdateConnectionRequest, ::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_connection(update_mask: nil, connection: nil, request_id: nil, allow_missing: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to update_connection 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
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask is used to specify the fields to be overwritten in the Connection resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
  • connection (::Google::Cloud::DeveloperConnect::V1::Connection, ::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 since 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 connection is not found a new connection will be created. In this situation update_mask is ignored. The creation will succeed only if the input connection 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::DeveloperConnect::Rest::Client.new

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

# Call the update_connection method.
result = client.update_connection 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