Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,13 @@ def self.transcode_list_operations_request request_pb
["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false]
]
)
.with_bindings(
uri_method: :get,
uri_template: "/v1/{name}/operations",
matches: [
["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
]
)
transcoder.transcode request_pb
end

Expand All @@ -871,6 +878,13 @@ def self.transcode_get_operation_request request_pb
["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
]
)
.with_bindings(
uri_method: :get,
uri_template: "/v1/{name}",
matches: [
["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
]
)
transcoder.transcode request_pb
end

Expand All @@ -892,6 +906,13 @@ def self.transcode_delete_operation_request request_pb
["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
]
)
.with_bindings(
uri_method: :delete,
uri_template: "/v1/{name}",
matches: [
["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
]
)
transcoder.transcode request_pb
end

Expand All @@ -914,6 +935,14 @@ def self.transcode_cancel_operation_request request_pb
["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
]
)
.with_bindings(
uri_method: :post,
uri_template: "/v1/{name}:cancel",
body: "*",
matches: [
["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
]
)
transcoder.transcode request_pb
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ def self.configure
["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false]
],
body: nil
),
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
uri_method: :get,
uri_template: "/v1/{name}",
matches: [
["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
],
body: nil
)
]
default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
Expand All @@ -62,6 +70,14 @@ def self.configure
["name", %r{^organizations/[^/]+/?$}, false]
],
body: nil
),
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
uri_method: :get,
uri_template: "/v1/{name}/locations",
matches: [
["name", %r{^projects/[^/]+/?$}, false]
],
body: nil
)
]
default_config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ def logger
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param parent [::String]
# Required. The parent resource name, in the format
# `organizations/{organization}/locations/{location}`.
# Required. The parent resource name, in one of the following formats:
# - `organizations/{organization}/locations/{location}`
# - `projects/{project}/locations/{location}`.
#
# The only supported location is `global`.
# @param page_size [::Integer]
# Optional. The maximum number of frameworks to return. The default value is
Expand Down Expand Up @@ -360,8 +362,12 @@ def list_frameworks request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param name [::String]
# Required. The name of the framework to retrieve, in the format
# `organizations/{organization}/locations/{location}/frameworks/{framework_id}`
# Required. The name of the framework to retrieve, in one of the following
# formats:
# `organizations/{organization}/locations/{location}/frameworks/{framework}`
# or
# `projects/{project}/locations/{location}/frameworks/{framework}`.
#
# The only supported location is `global`.
# @param major_revision_id [::Integer]
# Optional. The framework major version to retrieve. If not specified, the
Expand Down Expand Up @@ -452,8 +458,10 @@ def get_framework request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param parent [::String]
# Required. The parent resource name, in the format
# `organizations/{organization}/locations/{location}`.
# Required. The parent resource name, in one of the following formats:
# - `organizations/{organization}/locations/{location}`
# - `projects/{project}/locations/{location}`.
#
# The only supported location is `global`.
# @param framework_id [::String]
# Required. The identifier (ID) of the framework. The ID is not the full name
Expand Down Expand Up @@ -654,8 +662,11 @@ def update_framework request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param name [::String]
# Required. The name of the resource, in the format
# `organizations/{organization}/locations/{location}/frameworks/{framework}`.
# Required. The name of the resource, in one of the following formats:
# `organizations/{organization}/locations/{location}/frameworks/{framework}`
# or
# `projects/{project}/locations/{location}/frameworks/{framework}`.
#
# The only supported location is `global`.
#
# @yield [response, operation] Access the result along with the RPC operation
Expand Down Expand Up @@ -744,8 +755,10 @@ def delete_framework request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param parent [::String]
# Required. The parent resource name, in the format
# `organizations/{organization}/locations/{location}`.
# Required. The parent resource name, in one of the following formats:
# - `organizations/{organization}/locations/{location}`
# - `projects/{project}/locations/{location}`.
#
# The only supported location is `global`.
# @param page_size [::Integer]
# Optional. The maximum number of cloud controls to return. The default value
Expand Down Expand Up @@ -857,8 +870,12 @@ def list_cloud_controls request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param name [::String]
# Required. The name of the cloud control to retrieve, in the format
# `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`.
# Required. The name of the cloud control to retrieve, in one of the
# following formats:
# `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`
# or
# `projects/{project}/locations/{location}/cloudControls/{cloud_control}`.
#
# The only supported location is `global`.
# @param major_revision_id [::Integer]
# Optional. The major version of the cloud control to retrieve. If not
Expand Down Expand Up @@ -950,8 +967,10 @@ def get_cloud_control request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param parent [::String]
# Required. The parent resource name, in the format
# `organizations/{organization}/locations/{location}`.
# Required. The parent resource name, in one of the following formats:
# - `organizations/{organization}/locations/{location}`.
# - `projects/{project}/locations/{location}`.
#
# The only supported location is `global`.
# @param cloud_control_id [::String]
# Required. The identifier for the cloud control, which is the last segment
Expand Down Expand Up @@ -1161,8 +1180,12 @@ def update_cloud_control request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param name [::String]
# Required. The name of the cloud control to delete, in the format
# `organizations/{organization}/locations/{location}/CloudControls/{CloudControl}`.
# Required. The name of the cloud control to delete, in one of the following
# formats:
# `organizations/{organization}/locations/{location}/CloudControls/{CloudControl}`
# or
# `projects/{project}/locations/{location}/CloudControls/{CloudControl}`.
#
# The only supported location is `global`.
#
# @yield [response, operation] Access the result along with the RPC operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,104 @@ module Paths
##
# Create a fully-qualified CloudControl resource string.
#
# The resource will be in the following format:
# @overload cloud_control_path(organization:, location:, cloud_control:)
# The resource will be in the following format:
#
# `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`
# `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`
#
# @param organization [String]
# @param location [String]
# @param cloud_control [String]
# @param organization [String]
# @param location [String]
# @param cloud_control [String]
#
# @overload cloud_control_path(project:, location:, cloud_control:)
# The resource will be in the following format:
#
# `projects/{project}/locations/{location}/cloudControls/{cloud_control}`
#
# @param project [String]
# @param location [String]
# @param cloud_control [String]
#
# @return [::String]
def cloud_control_path organization:, location:, cloud_control:
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
def cloud_control_path **args
resources = {
"cloud_control:location:organization" => (proc do |organization:, location:, cloud_control:|
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

"organizations/#{organization}/locations/#{location}/cloudControls/#{cloud_control}"
"organizations/#{organization}/locations/#{location}/cloudControls/#{cloud_control}"
end),
"cloud_control:location:project" => (proc do |project:, location:, cloud_control:|
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

"projects/#{project}/locations/#{location}/cloudControls/#{cloud_control}"
end)
}

resource = resources[args.keys.sort.join(":")]
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
resource.call(**args)
end

##
# Create a fully-qualified Framework resource string.
#
# @overload framework_path(organization:, location:, framework:)
# The resource will be in the following format:
#
# `organizations/{organization}/locations/{location}/frameworks/{framework}`
#
# @param organization [String]
# @param location [String]
# @param framework [String]
#
# @overload framework_path(project:, location:, framework:)
# The resource will be in the following format:
#
# `projects/{project}/locations/{location}/frameworks/{framework}`
#
# @param project [String]
# @param location [String]
# @param framework [String]
#
# @return [::String]
def framework_path **args
resources = {
"framework:location:organization" => (proc do |organization:, location:, framework:|
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

"organizations/#{organization}/locations/#{location}/frameworks/#{framework}"
end),
"framework:location:project" => (proc do |project:, location:, framework:|
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

"projects/#{project}/locations/#{location}/frameworks/#{framework}"
end)
}

resource = resources[args.keys.sort.join(":")]
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
resource.call(**args)
end

##
# Create a fully-qualified Location resource string.
#
# The resource will be in the following format:
#
# `organizations/{organization}/locations/{location}/frameworks/{framework}`
# `projects/{project}/locations/{location}`
#
# @param organization [String]
# @param project [String]
# @param location [String]
# @param framework [String]
#
# @return [::String]
def framework_path organization:, location:, framework:
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
def location_path project:, location:
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

"organizations/#{organization}/locations/#{location}/frameworks/#{framework}"
"projects/#{project}/locations/#{location}"
end

##
Expand Down
Loading
Loading