Skip to content

Commit

Permalink
chore(multi): Add api-version boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] authored May 14, 2024
1 parent d253461 commit c450235
Show file tree
Hide file tree
Showing 84 changed files with 1,476 additions and 612 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ module V1
module InstanceAdmin
# Service that implements Longrunning Operations API.
class Operations
# @private
API_VERSION = ""

# @private
DEFAULT_ENDPOINT_TEMPLATE = "spanner.$UNIVERSE_DOMAIN$"

Expand Down Expand Up @@ -193,10 +196,11 @@ def list_operations request, options = nil
# Customize the options with defaults
metadata = @config.rpcs.list_operations.metadata.to_h

# Set x-goog-api-client and x-goog-user-project headers
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

header_params = {}
Expand Down Expand Up @@ -289,10 +293,11 @@ def get_operation request, options = nil
# Customize the options with defaults
metadata = @config.rpcs.get_operation.metadata.to_h

# Set x-goog-api-client and x-goog-user-project headers
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

header_params = {}
Expand Down Expand Up @@ -378,10 +383,11 @@ def delete_operation request, options = nil
# Customize the options with defaults
metadata = @config.rpcs.delete_operation.metadata.to_h

# Set x-goog-api-client and x-goog-user-project headers
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

header_params = {}
Expand Down Expand Up @@ -472,10 +478,11 @@ def cancel_operation request, options = nil
# Customize the options with defaults
metadata = @config.rpcs.cancel_operation.metadata.to_h

# Set x-goog-api-client and x-goog-user-project headers
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

header_params = {}
Expand Down Expand Up @@ -576,10 +583,11 @@ def wait_operation request, options = nil
# Customize the options with defaults
metadata = @config.rpcs.wait_operation.metadata.to_h

# Set x-goog-api-client and x-goog-user-project headers
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
Expand Down
Loading

0 comments on commit c450235

Please sign in to comment.