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 4fc8978 commit 15199ca
Show file tree
Hide file tree
Showing 130 changed files with 1,786 additions and 698 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ module PhishingProtectionService
# Service to report phishing URIs.
#
class Client
# @private
API_VERSION = ""

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

Expand Down Expand Up @@ -226,10 +229,11 @@ def report_phishing request, options = nil
# Customize the options with defaults
metadata = @config.rpcs.report_phishing.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::PhishingProtection::V1beta1::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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ module Rest
# Service to report phishing URIs.
#
class Client
# @private
API_VERSION = ""

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

Expand Down Expand Up @@ -218,12 +221,13 @@ def report_phishing request, options = nil
# Customize the options with defaults
call_metadata = @config.rpcs.report_phishing.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::PhishingProtection::V1beta1::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.report_phishing.timeout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ module Simulator
# principals' access might change under the proposed policy.
#
class Client
# @private
API_VERSION = ""

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

Expand Down Expand Up @@ -261,10 +264,11 @@ def get_replay request, options = nil
# Customize the options with defaults
metadata = @config.rpcs.get_replay.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::PolicySimulator::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 @@ -361,10 +365,11 @@ def create_replay request, options = nil
# Customize the options with defaults
metadata = @config.rpcs.create_replay.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::PolicySimulator::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 +477,11 @@ def list_replay_results request, options = nil
# Customize the options with defaults
metadata = @config.rpcs.list_replay_results.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::PolicySimulator::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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ module V1
module Simulator
# Service that implements Longrunning Operations API.
class Operations
# @private
API_VERSION = ""

# @private
DEFAULT_ENDPOINT_TEMPLATE = "policysimulator.$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::PolicySimulator::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::PolicySimulator::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::PolicySimulator::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::PolicySimulator::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::PolicySimulator::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
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ module Rest
# principals' access might change under the proposed policy.
#
class Client
# @private
API_VERSION = ""

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

Expand Down Expand Up @@ -253,12 +256,13 @@ def get_replay request, options = nil
# Customize the options with defaults
call_metadata = @config.rpcs.get_replay.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::PolicySimulator::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_replay.timeout,
Expand Down Expand Up @@ -346,12 +350,13 @@ def create_replay request, options = nil
# Customize the options with defaults
call_metadata = @config.rpcs.create_replay.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::PolicySimulator::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.create_replay.timeout,
Expand Down Expand Up @@ -450,12 +455,13 @@ def list_replay_results request, options = nil
# Customize the options with defaults
call_metadata = @config.rpcs.list_replay_results.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::PolicySimulator::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_replay_results.timeout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ module Simulator
module Rest
# Service that implements Longrunning Operations API.
class Operations
# @private
API_VERSION = ""

# @private
DEFAULT_ENDPOINT_TEMPLATE = "policysimulator.$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::PolicySimulator::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::PolicySimulator::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::PolicySimulator::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::PolicySimulator::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
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ module PolicyTroubleshooter
# This service helps you troubleshoot access issues for Google Cloud resources.
#
class Client
# @private
API_VERSION = ""

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

Expand Down Expand Up @@ -224,10 +227,11 @@ def troubleshoot_iam_policy request, options = nil
# Customize the options with defaults
metadata = @config.rpcs.troubleshoot_iam_policy.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::PolicyTroubleshooter::Iam::V3::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.troubleshoot_iam_policy.timeout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ module Rest
# This service helps you troubleshoot access issues for Google Cloud resources.
#
class Client
# @private
API_VERSION = ""

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

Expand Down Expand Up @@ -216,12 +219,13 @@ def troubleshoot_iam_policy request, options = nil
# Customize the options with defaults
call_metadata = @config.rpcs.troubleshoot_iam_policy.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::PolicyTroubleshooter::Iam::V3::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.troubleshoot_iam_policy.timeout,
Expand Down
Loading

0 comments on commit 15199ca

Please sign in to comment.