lib/google/cloud/run/v2/services/client.rb in google-cloud-run-v2-0.1.0 vs lib/google/cloud/run/v2/services/client.rb in google-cloud-run-v2-0.2.0
- old
+ new
@@ -250,14 +250,17 @@
gapic_version: ::Google::Cloud::Run::V2::VERSION
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
header_params = {}
if request.parent
- header_params["parent"] = request.parent
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
+ if regex_match
+ header_params["location"] = regex_match["location".to_s]
+ end
end
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
+ request_params_header = URI.encode_www_form header_params
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.create_service.timeout,
metadata: metadata,
retry_policy: @config.rpcs.create_service.retry_policy
@@ -337,14 +340,17 @@
gapic_version: ::Google::Cloud::Run::V2::VERSION
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
header_params = {}
if request.name
- header_params["name"] = request.name
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?$}.match request.name
+ if regex_match
+ header_params["location"] = regex_match["location".to_s]
+ end
end
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
+ request_params_header = URI.encode_www_form header_params
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.get_service.timeout,
metadata: metadata,
retry_policy: @config.rpcs.get_service.retry_policy
@@ -437,14 +443,17 @@
gapic_version: ::Google::Cloud::Run::V2::VERSION
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
header_params = {}
if request.parent
- header_params["parent"] = request.parent
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
+ if regex_match
+ header_params["location"] = regex_match["location".to_s]
+ end
end
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
+ request_params_header = URI.encode_www_form header_params
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.list_services.timeout,
metadata: metadata,
retry_policy: @config.rpcs.list_services.retry_policy
@@ -473,19 +482,17 @@
# 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_service(service: nil, update_mask: nil, validate_only: nil, allow_missing: nil)
+ # @overload update_service(service: nil, validate_only: nil, allow_missing: nil)
# Pass arguments to `update_service` 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 service [::Google::Cloud::Run::V2::Service, ::Hash]
# Required. The Service to be updated.
- # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
- # The list of fields to be updated.
# @param validate_only [::Boolean]
# Indicates that the request should be validated and default values
# populated, without persisting the request or updating any resources.
# @param allow_missing [::Boolean]
# If set to true, and if the Service does not exist, it will create a new
@@ -539,14 +546,17 @@
gapic_version: ::Google::Cloud::Run::V2::VERSION
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
header_params = {}
if request.service&.name
- header_params["service.name"] = request.service.name
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?$}.match request.service.name
+ if regex_match
+ header_params["location"] = regex_match["location".to_s]
+ end
end
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
+ request_params_header = URI.encode_www_form header_params
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.update_service.timeout,
metadata: metadata,
retry_policy: @config.rpcs.update_service.retry_policy
@@ -641,13 +651,16 @@
gapic_version: ::Google::Cloud::Run::V2::VERSION
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
header_params = {}
if request.name
- header_params["name"] = request.name
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)(?:/.*)?$}.match request.name
+ if regex_match
+ header_params["location"] = regex_match["location".to_s]
+ end
end
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
+ request_params_header = URI.encode_www_form header_params
metadata[:"x-goog-request-params"] ||= request_params_header
options.apply_defaults timeout: @config.rpcs.delete_service.timeout,
metadata: metadata,
retry_policy: @config.rpcs.delete_service.retry_policy