Class: Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb

Overview

REST client for the DeveloperConnect service.

Service describing handlers for resources

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#connection_path, #crypto_key_path, #git_repository_link_path, #location_path, #secret_version_path, #service_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new DeveloperConnect REST client object.

Examples:


# 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

Yields:

  • (config)

    Configure the DeveloperConnect client.

Yield Parameters:



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 187

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @developer_connect_stub = ::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @developer_connect_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @developer_connect_stub.endpoint
    config.universe_domain = @developer_connect_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @developer_connect_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

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

Returns:

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


257
258
259
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 257

def location_client
  @location_client
end

#operations_client::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Operations (readonly)

Get the associated client for long-running operations.



250
251
252
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 250

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the DeveloperConnect Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all DeveloperConnect clients
::Google::Cloud::DeveloperConnect::V1::DeveloperConnect::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 65

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "DeveloperConnect", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.list_connections.timeout = 60.0
    default_config.rpcs.list_connections.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_connection.timeout = 60.0
    default_config.rpcs.get_connection.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_connection.timeout = 60.0
    default_config.rpcs.create_connection.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.update_connection.timeout = 60.0
    default_config.rpcs.update_connection.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.delete_connection.timeout = 60.0
    default_config.rpcs.delete_connection.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_git_repository_link.timeout = 60.0
    default_config.rpcs.create_git_repository_link.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.delete_git_repository_link.timeout = 60.0
    default_config.rpcs.delete_git_repository_link.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_git_repository_link.timeout = 60.0
    default_config.rpcs.get_git_repository_link.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.fetch_read_write_token.timeout = 60.0
    default_config.rpcs.fetch_read_write_token.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.fetch_read_token.timeout = 60.0
    default_config.rpcs.fetch_read_token.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.fetch_linkable_git_repositories.timeout = 60.0
    default_config.rpcs.fetch_linkable_git_repositories.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.fetch_git_hub_installations.timeout = 60.0
    default_config.rpcs.fetch_git_hub_installations.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



157
158
159
160
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 157

def configure
  yield @config if block_given?
  @config
end

#create_connection(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Value for parent.

    • connection_id (::String) (defaults to: nil)

      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) (defaults to: nil)

      Required. The resource being created

    • request_id (::String) (defaults to: nil)

      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) (defaults to: nil)

      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.



513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 513

def create_connection request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::CreateConnectionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_connection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_connection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_connection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.create_connection request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Value for parent.

    • git_repository_link (::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink, ::Hash) (defaults to: nil)

      Required. The resource being created

    • git_repository_link_id (::String) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 849

def create_git_repository_link request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::CreateGitRepositoryLinkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_git_repository_link..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_git_repository_link.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_git_repository_link.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.create_git_repository_link request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_connection(request, options = nil) ⇒ ::Gapic::Operation #delete_connection(name: nil, request_id: nil, validate_only: nil, etag: nil) ⇒ ::Gapic::Operation

Deletes a single Connection.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Name of the resource

    • request_id (::String) (defaults to: nil)

      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) (defaults to: nil)

      Optional. If set, validate the request, but do not actually post it.

    • etag (::String) (defaults to: nil)

      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.



735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 735

def delete_connection request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::DeleteConnectionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_connection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_connection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_connection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.delete_connection request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

Deletes a single GitRepositoryLink.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Name of the resource

    • request_id (::String) (defaults to: nil)

      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) (defaults to: nil)

      Optional. If set, validate the request, but do not actually post it.

    • etag (::String) (defaults to: nil)

      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.



956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 956

def delete_git_repository_link request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::DeleteGitRepositoryLinkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_git_repository_link..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_git_repository_link.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_git_repository_link.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.delete_git_repository_link request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_git_hub_installations(request, options = nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsResponse #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.

Examples:

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

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 1459

def fetch_git_hub_installations request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::FetchGitHubInstallationsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_git_hub_installations..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_git_hub_installations.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_git_hub_installations.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.fetch_git_hub_installations request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_git_refs(request, options = nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::FetchGitRefsResponse #fetch_git_refs(git_repository_link: nil, ref_type: nil, page_size: nil, page_token: nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::FetchGitRefsResponse

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

Examples:

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

Overloads:

  • #fetch_git_refs(request, options = nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::FetchGitRefsResponse

    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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #fetch_git_refs(git_repository_link: nil, ref_type: nil, page_size: nil, page_token: nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::FetchGitRefsResponse

    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) (defaults to: nil)

      Required. The resource name of GitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.

    • ref_type (::Google::Cloud::DeveloperConnect::V1::FetchGitRefsRequest::RefType) (defaults to: nil)

      Required. Type of refs to fetch.

    • page_size (::Integer) (defaults to: nil)

      Optional. Number of results to return in the list. Default to 20.

    • page_token (::String) (defaults to: nil)

      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.



1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 1544

def fetch_git_refs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::FetchGitRefsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_git_refs..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_git_refs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_git_refs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.fetch_git_refs request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_linkable_git_repositories(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::LinkableGitRepository> #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. The name of the Connection. Format: projects/*/locations/*/connections/*.

    • page_size (::Integer) (defaults to: nil)

      Optional. Number of results to return in the list. Defaults to 20.

    • page_token (::String) (defaults to: nil)

      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.



1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 1375

def fetch_linkable_git_repositories request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::FetchLinkableGitRepositoriesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_linkable_git_repositories..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_linkable_git_repositories.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_linkable_git_repositories.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.fetch_linkable_git_repositories request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @developer_connect_stub, :fetch_linkable_git_repositories, "linkable_git_repositories", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_read_token(request, options = nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse #fetch_read_token(git_repository_link: nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::FetchReadTokenResponse

Fetches read token of a given gitRepositoryLink.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • git_repository_link (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 1287

def fetch_read_token request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::FetchReadTokenRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_read_token..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_read_token.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_read_token.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.fetch_read_token request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_read_write_token(request, options = nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse #fetch_read_write_token(git_repository_link: nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenResponse

Fetches read/write token of a given gitRepositoryLink.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • git_repository_link (::String) (defaults to: nil)

      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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 1208

def fetch_read_write_token request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::FetchReadWriteTokenRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.fetch_read_write_token..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.fetch_read_write_token.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_read_write_token.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.fetch_read_write_token request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_connection(request, options = nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::Connection #get_connection(name: nil) ⇒ ::Google::Cloud::DeveloperConnect::V1::Connection

Gets details of a single Connection.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 406

def get_connection request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::GetConnectionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_connection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_connection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_connection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.get_connection request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

Gets details of a single GitRepositoryLink.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 1129

def get_git_repository_link request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::GetGitRepositoryLinkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_git_repository_link..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_git_repository_link.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_git_repository_link.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.get_git_repository_link request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_connections(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::Connection> #list_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::Connection>

Lists Connections in a given project and location.

Examples:

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

Overloads:

  • #list_connections(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::Connection>

    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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::Connection>

    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) (defaults to: nil)

      Required. Parent value for ListConnectionsRequest

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results

    • order_by (::String) (defaults to: nil)

      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.



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 326

def list_connections request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::ListConnectionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_connections..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_connections.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_connections.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.list_connections request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @developer_connect_stub, :list_connections, "connections", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Examples:

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

Overloads:

  • #list_git_repository_links(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink>

    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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_git_repository_links(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeveloperConnect::V1::GitRepositoryLink>

    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) (defaults to: nil)

      Required. Parent value for ListGitRepositoryLinksRequest

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results

    • order_by (::String) (defaults to: nil)

      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.



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 1049

def list_git_repository_links request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::ListGitRepositoryLinksRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_git_repository_links..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_git_repository_links.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_git_repository_links.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.list_git_repository_links request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @developer_connect_stub, :list_git_repository_links, "git_repository_links", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


264
265
266
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 264

def logger
  @developer_connect_stub.logger
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


167
168
169
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 167

def universe_domain
  @developer_connect_stub.universe_domain
end

#update_connection(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      Required. The resource being updated

    • request_id (::String) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.



628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
# File 'lib/google/cloud/developer_connect/v1/developer_connect/rest/client.rb', line 628

def update_connection request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DeveloperConnect::V1::UpdateConnectionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_connection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::DeveloperConnect::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_connection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_connection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @developer_connect_stub.update_connection request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end