Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions google-cloud-config_service-v1/.owlbot-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"snippets/config/export_lock_info.rb",
"snippets/config/export_preview_result.rb",
"snippets/config/export_revision_statefile.rb",
"snippets/config/get_auto_migration_config.rb",
"snippets/config/get_deployment.rb",
"snippets/config/get_preview.rb",
"snippets/config/get_resource.rb",
Expand All @@ -72,6 +73,7 @@
"snippets/config/list_terraform_versions.rb",
"snippets/config/lock_deployment.rb",
"snippets/config/unlock_deployment.rb",
"snippets/config/update_auto_migration_config.rb",
"snippets/config/update_deployment.rb",
"snippets/snippet_metadata_google.cloud.config.v1.json",
"test/google/cloud/config_service/v1/config_operations_test.rb",
Expand Down
10 changes: 10 additions & 0 deletions google-cloud-config_service-v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@
"methods": [
"get_resource_drift"
]
},
"GetAutoMigrationConfig": {
"methods": [
"get_auto_migration_config"
]
},
"UpdateAutoMigrationConfig": {
"methods": [
"update_auto_migration_config"
]
}
}
}
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2977,6 +2977,190 @@ def get_resource_drift request, options = nil
raise ::Google::Cloud::Error.from_error(e)
end

##
# Get the AutoMigrationConfig for a given project and location.
#
# @overload get_auto_migration_config(request, options = nil)
# Pass arguments to `get_auto_migration_config` via a request object, either of type
# {::Google::Cloud::ConfigService::V1::GetAutoMigrationConfigRequest} or an equivalent Hash.
#
# @param request [::Google::Cloud::ConfigService::V1::GetAutoMigrationConfigRequest, ::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.
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
#
# @overload get_auto_migration_config(name: nil)
# Pass arguments to `get_auto_migration_config` 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).
#
# @param name [::String]
# Required. The name of the AutoMigrationConfig.
# Format:
# 'projects/\\{project_id}/locations/\\{location}/AutoMigrationConfig'.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::ConfigService::V1::AutoMigrationConfig]
# @yieldparam operation [::GRPC::ActiveCall::Operation]
#
# @return [::Google::Cloud::ConfigService::V1::AutoMigrationConfig]
#
# @raise [::Google::Cloud::Error] if the RPC is aborted.
#
# @example Basic example
# require "google/cloud/config_service/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Cloud::ConfigService::V1::Config::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Cloud::ConfigService::V1::GetAutoMigrationConfigRequest.new
#
# # Call the get_auto_migration_config method.
# result = client.get_auto_migration_config request
#
# # The returned object is of type Google::Cloud::ConfigService::V1::AutoMigrationConfig.
# p result
#
def get_auto_migration_config request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::V1::GetAutoMigrationConfigRequest

# 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
metadata = @config.rpcs.get_auto_migration_config.metadata.to_h

# 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 = {}
if request.name
header_params["name"] = request.name
end

request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
metadata[:"x-goog-request-params"] ||= request_params_header

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

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

@config_stub.call_rpc :get_auto_migration_config, request, options: options do |response, operation|
yield response, operation if block_given?
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end

##
# Updates the AutoMigrationConfig for a given project and location.
#
# @overload update_auto_migration_config(request, options = nil)
# Pass arguments to `update_auto_migration_config` via a request object, either of type
# {::Google::Cloud::ConfigService::V1::UpdateAutoMigrationConfigRequest} or an equivalent Hash.
#
# @param request [::Google::Cloud::ConfigService::V1::UpdateAutoMigrationConfigRequest, ::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.
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
#
# @overload update_auto_migration_config(update_mask: nil, auto_migration_config: nil)
# Pass arguments to `update_auto_migration_config` 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).
#
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
# Optional. The update mask applies to the resource. See
# {::Google::Protobuf::FieldMask google.protobuf.FieldMask}.
# @param auto_migration_config [::Google::Cloud::ConfigService::V1::AutoMigrationConfig, ::Hash]
# Required. The AutoMigrationConfig to update.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Gapic::Operation]
# @yieldparam operation [::GRPC::ActiveCall::Operation]
#
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the RPC is aborted.
#
# @example Basic example
# require "google/cloud/config_service/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Cloud::ConfigService::V1::Config::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Cloud::ConfigService::V1::UpdateAutoMigrationConfigRequest.new
#
# # Call the update_auto_migration_config method.
# result = client.update_auto_migration_config request
#
# # The returned object is of type Gapic::Operation. You can use it to
# # check the status of an operation, cancel it, or wait for results.
# # Here is how to wait for a response.
# result.wait_until_done! timeout: 60
# if result.response?
# p result.response
# else
# puts "No response received."
# end
#
def update_auto_migration_config request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::V1::UpdateAutoMigrationConfigRequest

# 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
metadata = @config.rpcs.update_auto_migration_config.metadata.to_h

# 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 = {}
if request.auto_migration_config&.name
header_params["auto_migration_config.name"] = request.auto_migration_config.name
end

request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
metadata[:"x-goog-request-params"] ||= request_params_header

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

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

@config_stub.call_rpc :update_auto_migration_config, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end

##
# Configuration class for the Config API.
#
Expand Down Expand Up @@ -3295,6 +3479,16 @@ class Rpcs
# @return [::Gapic::Config::Method]
#
attr_reader :get_resource_drift
##
# RPC-specific configuration for `get_auto_migration_config`
# @return [::Gapic::Config::Method]
#
attr_reader :get_auto_migration_config
##
# RPC-specific configuration for `update_auto_migration_config`
# @return [::Gapic::Config::Method]
#
attr_reader :update_auto_migration_config

# @private
def initialize parent_rpcs = nil
Expand Down Expand Up @@ -3352,6 +3546,10 @@ def initialize parent_rpcs = nil
@list_resource_drifts = ::Gapic::Config::Method.new list_resource_drifts_config
get_resource_drift_config = parent_rpcs.get_resource_drift if parent_rpcs.respond_to? :get_resource_drift
@get_resource_drift = ::Gapic::Config::Method.new get_resource_drift_config
get_auto_migration_config_config = parent_rpcs.get_auto_migration_config if parent_rpcs.respond_to? :get_auto_migration_config
@get_auto_migration_config = ::Gapic::Config::Method.new get_auto_migration_config_config
update_auto_migration_config_config = parent_rpcs.update_auto_migration_config if parent_rpcs.respond_to? :update_auto_migration_config
@update_auto_migration_config = ::Gapic::Config::Method.new update_auto_migration_config_config

yield self if block_given?
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ module V1
module Config
# Path helper methods for the Config API.
module Paths
##
# Create a fully-qualified AutoMigrationConfig resource string.
#
# The resource will be in the following format:
#
# `projects/{project}/locations/{location}/autoMigrationConfig`
#
# @param project [String]
# @param location [String]
#
# @return [::String]
def auto_migration_config_path project:, location:
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

"projects/#{project}/locations/#{location}/autoMigrationConfig"
end

##
# Create a fully-qualified Deployment resource string.
#
Expand Down
Loading
Loading