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 2a8baa6 commit 164ed9b
Show file tree
Hide file tree
Showing 117 changed files with 2,879 additions and 1,264 deletions.

Large diffs are not rendered by default.

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

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

Expand Down Expand Up @@ -191,10 +194,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::ConfigService::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 @@ -287,10 +291,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::ConfigService::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 @@ -376,10 +381,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::ConfigService::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 @@ -470,10 +476,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::ConfigService::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 @@ -574,10 +581,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::ConfigService::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

Large diffs are not rendered by default.

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

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

Expand Down Expand Up @@ -181,12 +184,13 @@ def list_operations request, options = nil
# Customize the options with defaults
call_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
call_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::ConfigService::V1::VERSION,
transports_version_send: [:rest]

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

options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
Expand Down Expand Up @@ -269,12 +273,13 @@ def get_operation request, options = nil
# Customize the options with defaults
call_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
call_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::ConfigService::V1::VERSION,
transports_version_send: [:rest]

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

options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
Expand Down Expand Up @@ -351,12 +356,13 @@ def delete_operation request, options = nil
# Customize the options with defaults
call_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
call_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::ConfigService::V1::VERSION,
transports_version_send: [:rest]

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

options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
Expand Down Expand Up @@ -438,12 +444,13 @@ def cancel_operation request, options = nil
# Customize the options with defaults
call_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
call_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::ConfigService::V1::VERSION,
transports_version_send: [:rest]

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

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

0 comments on commit 164ed9b

Please sign in to comment.