Skip to content

Commit 2694190

Browse files
docs: Updated docs for the APIs (#33882)
* docs: Updated docs for the APIs feat: Adding client libraries for Deployment API Compliance Manager Service PiperOrigin-RevId: 903655636 Source-Link: googleapis/googleapis@e9975a3 Source-Link: googleapis/googleapis-gen@8a09aec Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNsb3VkX3NlY3VyaXR5X2NvbXBsaWFuY2UtdjEvLk93bEJvdC55YW1sIiwiaCI6IjhhMDlhZWNlMGEzY2Q0OGNlOGRiMDE1OTg4N2ZlMDBiMmY5NTgzYWMifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent dda588a commit 2694190

26 files changed

Lines changed: 881 additions & 147 deletions

File tree

google-cloud-cloud_security_compliance-v1/lib/google/cloud/cloud_security_compliance/v1/audit/rest/operations.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,13 @@ def self.transcode_list_operations_request request_pb
850850
["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false]
851851
]
852852
)
853+
.with_bindings(
854+
uri_method: :get,
855+
uri_template: "/v1/{name}/operations",
856+
matches: [
857+
["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
858+
]
859+
)
853860
transcoder.transcode request_pb
854861
end
855862

@@ -871,6 +878,13 @@ def self.transcode_get_operation_request request_pb
871878
["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
872879
]
873880
)
881+
.with_bindings(
882+
uri_method: :get,
883+
uri_template: "/v1/{name}",
884+
matches: [
885+
["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
886+
]
887+
)
874888
transcoder.transcode request_pb
875889
end
876890

@@ -892,6 +906,13 @@ def self.transcode_delete_operation_request request_pb
892906
["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
893907
]
894908
)
909+
.with_bindings(
910+
uri_method: :delete,
911+
uri_template: "/v1/{name}",
912+
matches: [
913+
["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
914+
]
915+
)
895916
transcoder.transcode request_pb
896917
end
897918

@@ -914,6 +935,14 @@ def self.transcode_cancel_operation_request request_pb
914935
["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
915936
]
916937
)
938+
.with_bindings(
939+
uri_method: :post,
940+
uri_template: "/v1/{name}:cancel",
941+
body: "*",
942+
matches: [
943+
["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false]
944+
]
945+
)
917946
transcoder.transcode request_pb
918947
end
919948
end

google-cloud-cloud_security_compliance-v1/lib/google/cloud/cloud_security_compliance/v1/bindings_override.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ def self.configure
5151
["name", %r{^organizations/[^/]+/locations/[^/]+/?$}, false]
5252
],
5353
body: nil
54+
),
55+
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
56+
uri_method: :get,
57+
uri_template: "/v1/{name}",
58+
matches: [
59+
["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
60+
],
61+
body: nil
5462
)
5563
]
5664
default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
@@ -62,6 +70,14 @@ def self.configure
6270
["name", %r{^organizations/[^/]+/?$}, false]
6371
],
6472
body: nil
73+
),
74+
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
75+
uri_method: :get,
76+
uri_template: "/v1/{name}/locations",
77+
matches: [
78+
["name", %r{^projects/[^/]+/?$}, false]
79+
],
80+
body: nil
6581
)
6682
]
6783
default_config

google-cloud-cloud_security_compliance-v1/lib/google/cloud/cloud_security_compliance/v1/config/client.rb

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,10 @@ def logger
254254
# the default parameter values, pass an empty Hash as a request object (see above).
255255
#
256256
# @param parent [::String]
257-
# Required. The parent resource name, in the format
258-
# `organizations/{organization}/locations/{location}`.
257+
# Required. The parent resource name, in one of the following formats:
258+
# - `organizations/{organization}/locations/{location}`
259+
# - `projects/{project}/locations/{location}`.
260+
#
259261
# The only supported location is `global`.
260262
# @param page_size [::Integer]
261263
# Optional. The maximum number of frameworks to return. The default value is
@@ -360,8 +362,12 @@ def list_frameworks request, options = nil
360362
# the default parameter values, pass an empty Hash as a request object (see above).
361363
#
362364
# @param name [::String]
363-
# Required. The name of the framework to retrieve, in the format
364-
# `organizations/{organization}/locations/{location}/frameworks/{framework_id}`
365+
# Required. The name of the framework to retrieve, in one of the following
366+
# formats:
367+
# `organizations/{organization}/locations/{location}/frameworks/{framework}`
368+
# or
369+
# `projects/{project}/locations/{location}/frameworks/{framework}`.
370+
#
365371
# The only supported location is `global`.
366372
# @param major_revision_id [::Integer]
367373
# Optional. The framework major version to retrieve. If not specified, the
@@ -452,8 +458,10 @@ def get_framework request, options = nil
452458
# the default parameter values, pass an empty Hash as a request object (see above).
453459
#
454460
# @param parent [::String]
455-
# Required. The parent resource name, in the format
456-
# `organizations/{organization}/locations/{location}`.
461+
# Required. The parent resource name, in one of the following formats:
462+
# - `organizations/{organization}/locations/{location}`
463+
# - `projects/{project}/locations/{location}`.
464+
#
457465
# The only supported location is `global`.
458466
# @param framework_id [::String]
459467
# Required. The identifier (ID) of the framework. The ID is not the full name
@@ -654,8 +662,11 @@ def update_framework request, options = nil
654662
# the default parameter values, pass an empty Hash as a request object (see above).
655663
#
656664
# @param name [::String]
657-
# Required. The name of the resource, in the format
658-
# `organizations/{organization}/locations/{location}/frameworks/{framework}`.
665+
# Required. The name of the resource, in one of the following formats:
666+
# `organizations/{organization}/locations/{location}/frameworks/{framework}`
667+
# or
668+
# `projects/{project}/locations/{location}/frameworks/{framework}`.
669+
#
659670
# The only supported location is `global`.
660671
#
661672
# @yield [response, operation] Access the result along with the RPC operation
@@ -744,8 +755,10 @@ def delete_framework request, options = nil
744755
# the default parameter values, pass an empty Hash as a request object (see above).
745756
#
746757
# @param parent [::String]
747-
# Required. The parent resource name, in the format
748-
# `organizations/{organization}/locations/{location}`.
758+
# Required. The parent resource name, in one of the following formats:
759+
# - `organizations/{organization}/locations/{location}`
760+
# - `projects/{project}/locations/{location}`.
761+
#
749762
# The only supported location is `global`.
750763
# @param page_size [::Integer]
751764
# Optional. The maximum number of cloud controls to return. The default value
@@ -857,8 +870,12 @@ def list_cloud_controls request, options = nil
857870
# the default parameter values, pass an empty Hash as a request object (see above).
858871
#
859872
# @param name [::String]
860-
# Required. The name of the cloud control to retrieve, in the format
861-
# `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`.
873+
# Required. The name of the cloud control to retrieve, in one of the
874+
# following formats:
875+
# `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`
876+
# or
877+
# `projects/{project}/locations/{location}/cloudControls/{cloud_control}`.
878+
#
862879
# The only supported location is `global`.
863880
# @param major_revision_id [::Integer]
864881
# Optional. The major version of the cloud control to retrieve. If not
@@ -950,8 +967,10 @@ def get_cloud_control request, options = nil
950967
# the default parameter values, pass an empty Hash as a request object (see above).
951968
#
952969
# @param parent [::String]
953-
# Required. The parent resource name, in the format
954-
# `organizations/{organization}/locations/{location}`.
970+
# Required. The parent resource name, in one of the following formats:
971+
# - `organizations/{organization}/locations/{location}`.
972+
# - `projects/{project}/locations/{location}`.
973+
#
955974
# The only supported location is `global`.
956975
# @param cloud_control_id [::String]
957976
# Required. The identifier for the cloud control, which is the last segment
@@ -1161,8 +1180,12 @@ def update_cloud_control request, options = nil
11611180
# the default parameter values, pass an empty Hash as a request object (see above).
11621181
#
11631182
# @param name [::String]
1164-
# Required. The name of the cloud control to delete, in the format
1165-
# `organizations/{organization}/locations/{location}/CloudControls/{CloudControl}`.
1183+
# Required. The name of the cloud control to delete, in one of the following
1184+
# formats:
1185+
# `organizations/{organization}/locations/{location}/CloudControls/{CloudControl}`
1186+
# or
1187+
# `projects/{project}/locations/{location}/CloudControls/{CloudControl}`.
1188+
#
11661189
# The only supported location is `global`.
11671190
#
11681191
# @yield [response, operation] Access the result along with the RPC operation

google-cloud-cloud_security_compliance-v1/lib/google/cloud/cloud_security_compliance/v1/config/paths.rb

Lines changed: 81 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,104 @@ module Paths
2727
##
2828
# Create a fully-qualified CloudControl resource string.
2929
#
30-
# The resource will be in the following format:
30+
# @overload cloud_control_path(organization:, location:, cloud_control:)
31+
# The resource will be in the following format:
3132
#
32-
# `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`
33+
# `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`
3334
#
34-
# @param organization [String]
35-
# @param location [String]
36-
# @param cloud_control [String]
35+
# @param organization [String]
36+
# @param location [String]
37+
# @param cloud_control [String]
38+
#
39+
# @overload cloud_control_path(project:, location:, cloud_control:)
40+
# The resource will be in the following format:
41+
#
42+
# `projects/{project}/locations/{location}/cloudControls/{cloud_control}`
43+
#
44+
# @param project [String]
45+
# @param location [String]
46+
# @param cloud_control [String]
3747
#
3848
# @return [::String]
39-
def cloud_control_path organization:, location:, cloud_control:
40-
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
41-
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
49+
def cloud_control_path **args
50+
resources = {
51+
"cloud_control:location:organization" => (proc do |organization:, location:, cloud_control:|
52+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
53+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
4254

43-
"organizations/#{organization}/locations/#{location}/cloudControls/#{cloud_control}"
55+
"organizations/#{organization}/locations/#{location}/cloudControls/#{cloud_control}"
56+
end),
57+
"cloud_control:location:project" => (proc do |project:, location:, cloud_control:|
58+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
59+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
60+
61+
"projects/#{project}/locations/#{location}/cloudControls/#{cloud_control}"
62+
end)
63+
}
64+
65+
resource = resources[args.keys.sort.join(":")]
66+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
67+
resource.call(**args)
4468
end
4569

4670
##
4771
# Create a fully-qualified Framework resource string.
4872
#
73+
# @overload framework_path(organization:, location:, framework:)
74+
# The resource will be in the following format:
75+
#
76+
# `organizations/{organization}/locations/{location}/frameworks/{framework}`
77+
#
78+
# @param organization [String]
79+
# @param location [String]
80+
# @param framework [String]
81+
#
82+
# @overload framework_path(project:, location:, framework:)
83+
# The resource will be in the following format:
84+
#
85+
# `projects/{project}/locations/{location}/frameworks/{framework}`
86+
#
87+
# @param project [String]
88+
# @param location [String]
89+
# @param framework [String]
90+
#
91+
# @return [::String]
92+
def framework_path **args
93+
resources = {
94+
"framework:location:organization" => (proc do |organization:, location:, framework:|
95+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
96+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
97+
98+
"organizations/#{organization}/locations/#{location}/frameworks/#{framework}"
99+
end),
100+
"framework:location:project" => (proc do |project:, location:, framework:|
101+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
102+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
103+
104+
"projects/#{project}/locations/#{location}/frameworks/#{framework}"
105+
end)
106+
}
107+
108+
resource = resources[args.keys.sort.join(":")]
109+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
110+
resource.call(**args)
111+
end
112+
113+
##
114+
# Create a fully-qualified Location resource string.
115+
#
49116
# The resource will be in the following format:
50117
#
51-
# `organizations/{organization}/locations/{location}/frameworks/{framework}`
118+
# `projects/{project}/locations/{location}`
52119
#
53-
# @param organization [String]
120+
# @param project [String]
54121
# @param location [String]
55-
# @param framework [String]
56122
#
57123
# @return [::String]
58-
def framework_path organization:, location:, framework:
59-
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
60-
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
124+
def location_path project:, location:
125+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
61126

62-
"organizations/#{organization}/locations/#{location}/frameworks/#{framework}"
127+
"projects/#{project}/locations/#{location}"
63128
end
64129

65130
##

0 commit comments

Comments
 (0)