google-cloud-security_center-v1p1beta1 0.3.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +188 -190
- data/README.md +66 -2
- data/lib/google/cloud/security_center/v1p1beta1.rb +3 -0
- data/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb +100 -97
- data/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb +95 -10
- data/lib/google/cloud/security_center/v1p1beta1/security_center/paths.rb +1 -1
- data/lib/google/cloud/security_center/v1p1beta1/version.rb +1 -1
- data/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb +9 -0
- data/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb +1 -0
- data/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb +23 -25
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/api/resource.rb +50 -14
- data/proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb +28 -3
- data/proto_docs/google/cloud/securitycenter/v1p1beta1/securitycenter_service.rb +34 -37
- data/proto_docs/google/longrunning/operations.rb +17 -3
- data/proto_docs/google/protobuf/any.rb +5 -2
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- metadata +10 -7
@@ -60,7 +60,7 @@ module Google
|
|
60
60
|
parent_config = while namespace.any?
|
61
61
|
parent_name = namespace.join "::"
|
62
62
|
parent_const = const_get parent_name
|
63
|
-
break parent_const.configure if parent_const
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
64
|
namespace.pop
|
65
65
|
end
|
66
66
|
default_config = Client::Configuration.new parent_config
|
@@ -76,81 +76,81 @@ module Google
|
|
76
76
|
default_config.rpcs.get_iam_policy.timeout = 60.0
|
77
77
|
default_config.rpcs.get_iam_policy.retry_policy = {
|
78
78
|
initial_delay: 0.1,
|
79
|
-
|
80
|
-
|
81
|
-
|
79
|
+
max_delay: 60.0,
|
80
|
+
multiplier: 1.3,
|
81
|
+
retry_codes: [4, 14]
|
82
82
|
}
|
83
83
|
|
84
84
|
default_config.rpcs.get_notification_config.timeout = 60.0
|
85
85
|
default_config.rpcs.get_notification_config.retry_policy = {
|
86
86
|
initial_delay: 0.1,
|
87
|
-
|
88
|
-
|
89
|
-
|
87
|
+
max_delay: 60.0,
|
88
|
+
multiplier: 1.3,
|
89
|
+
retry_codes: [4, 14]
|
90
90
|
}
|
91
91
|
|
92
92
|
default_config.rpcs.get_organization_settings.timeout = 60.0
|
93
93
|
default_config.rpcs.get_organization_settings.retry_policy = {
|
94
94
|
initial_delay: 0.1,
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
max_delay: 60.0,
|
96
|
+
multiplier: 1.3,
|
97
|
+
retry_codes: [4, 14]
|
98
98
|
}
|
99
99
|
|
100
100
|
default_config.rpcs.get_source.timeout = 60.0
|
101
101
|
default_config.rpcs.get_source.retry_policy = {
|
102
102
|
initial_delay: 0.1,
|
103
|
-
|
104
|
-
|
105
|
-
|
103
|
+
max_delay: 60.0,
|
104
|
+
multiplier: 1.3,
|
105
|
+
retry_codes: [4, 14]
|
106
106
|
}
|
107
107
|
|
108
108
|
default_config.rpcs.group_assets.timeout = 480.0
|
109
109
|
default_config.rpcs.group_assets.retry_policy = {
|
110
110
|
initial_delay: 0.1,
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
max_delay: 60.0,
|
112
|
+
multiplier: 1.3,
|
113
|
+
retry_codes: [4, 14]
|
114
114
|
}
|
115
115
|
|
116
116
|
default_config.rpcs.group_findings.timeout = 480.0
|
117
117
|
default_config.rpcs.group_findings.retry_policy = {
|
118
118
|
initial_delay: 0.1,
|
119
|
-
|
120
|
-
|
121
|
-
|
119
|
+
max_delay: 60.0,
|
120
|
+
multiplier: 1.3,
|
121
|
+
retry_codes: [4, 14]
|
122
122
|
}
|
123
123
|
|
124
124
|
default_config.rpcs.list_assets.timeout = 480.0
|
125
125
|
default_config.rpcs.list_assets.retry_policy = {
|
126
126
|
initial_delay: 0.1,
|
127
|
-
|
128
|
-
|
129
|
-
|
127
|
+
max_delay: 60.0,
|
128
|
+
multiplier: 1.3,
|
129
|
+
retry_codes: [4, 14]
|
130
130
|
}
|
131
131
|
|
132
132
|
default_config.rpcs.list_findings.timeout = 480.0
|
133
133
|
default_config.rpcs.list_findings.retry_policy = {
|
134
134
|
initial_delay: 0.1,
|
135
|
-
|
136
|
-
|
137
|
-
|
135
|
+
max_delay: 60.0,
|
136
|
+
multiplier: 1.3,
|
137
|
+
retry_codes: [4, 14]
|
138
138
|
}
|
139
139
|
|
140
140
|
default_config.rpcs.list_notification_configs.timeout = 60.0
|
141
141
|
default_config.rpcs.list_notification_configs.retry_policy = {
|
142
142
|
initial_delay: 0.1,
|
143
|
-
|
144
|
-
|
145
|
-
|
143
|
+
max_delay: 60.0,
|
144
|
+
multiplier: 1.3,
|
145
|
+
retry_codes: [4, 14]
|
146
146
|
}
|
147
147
|
|
148
148
|
default_config.rpcs.list_sources.timeout = 60.0
|
149
149
|
default_config.rpcs.list_sources.retry_policy = {
|
150
150
|
initial_delay: 0.1,
|
151
|
-
|
152
|
-
|
153
|
-
|
151
|
+
max_delay: 60.0,
|
152
|
+
multiplier: 1.3,
|
153
|
+
retry_codes: [4, 14]
|
154
154
|
}
|
155
155
|
|
156
156
|
default_config.rpcs.run_asset_discovery.timeout = 60.0
|
@@ -162,9 +162,9 @@ module Google
|
|
162
162
|
default_config.rpcs.test_iam_permissions.timeout = 60.0
|
163
163
|
default_config.rpcs.test_iam_permissions.retry_policy = {
|
164
164
|
initial_delay: 0.1,
|
165
|
-
|
166
|
-
|
167
|
-
|
165
|
+
max_delay: 60.0,
|
166
|
+
multiplier: 1.3,
|
167
|
+
retry_codes: [4, 14]
|
168
168
|
}
|
169
169
|
|
170
170
|
default_config.rpcs.update_finding.timeout = 60.0
|
@@ -238,7 +238,13 @@ module Google
|
|
238
238
|
|
239
239
|
# Create credentials
|
240
240
|
credentials = @config.credentials
|
241
|
-
|
241
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
242
|
+
# but only if the default endpoint does not have a region prefix.
|
243
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
244
|
+
@config.endpoint == Client.configure.endpoint &&
|
245
|
+
!@config.endpoint.split(".").first.include?("-")
|
246
|
+
credentials ||= Credentials.default scope: @config.scope,
|
247
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
242
248
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
243
249
|
credentials = Credentials.new credentials, scope: @config.scope
|
244
250
|
end
|
@@ -290,8 +296,8 @@ module Google
|
|
290
296
|
# Required. Resource name of the new source's parent. Its format should be
|
291
297
|
# "organizations/[organization_id]".
|
292
298
|
# @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash]
|
293
|
-
# Required. The Source being created, only the display_name and description
|
294
|
-
#
|
299
|
+
# Required. The Source being created, only the display_name and description will be
|
300
|
+
# used. All other fields will be ignored.
|
295
301
|
#
|
296
302
|
# @yield [response, operation] Access the result along with the RPC operation
|
297
303
|
# @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Source]
|
@@ -362,11 +368,9 @@ module Google
|
|
362
368
|
# "organizations/[organization_id]/sources/[source_id]".
|
363
369
|
# @param finding_id [::String]
|
364
370
|
# Required. Unique identifier provided by the client within the parent scope.
|
365
|
-
# It must be alphanumeric and less than or equal to 32 characters and
|
366
|
-
# greater than 0 characters in length.
|
367
371
|
# @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash]
|
368
|
-
# Required. The Finding being created. The name and security_marks will be
|
369
|
-
#
|
372
|
+
# Required. The Finding being created. The name and security_marks will be ignored as
|
373
|
+
# they are both output only fields on this resource.
|
370
374
|
#
|
371
375
|
# @yield [response, operation] Access the result along with the RPC operation
|
372
376
|
# @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::Finding]
|
@@ -432,17 +436,15 @@ module Google
|
|
432
436
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
433
437
|
#
|
434
438
|
# @param parent [::String]
|
435
|
-
# Required. Resource name of the new notification config's parent. Its format
|
436
|
-
#
|
439
|
+
# Required. Resource name of the new notification config's parent. Its format is
|
440
|
+
# "organizations/[organization_id]".
|
437
441
|
# @param config_id [::String]
|
438
|
-
# Required.
|
439
|
-
# Unique identifier provided by the client within the parent scope.
|
442
|
+
# Required. Unique identifier provided by the client within the parent scope.
|
440
443
|
# It must be between 1 and 128 characters, and contains alphanumeric
|
441
444
|
# characters, underscores or hyphens only.
|
442
445
|
# @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash]
|
443
|
-
# Required. The notification config being created. The name and the service
|
444
|
-
#
|
445
|
-
# resource.
|
446
|
+
# Required. The notification config being created. The name and the service account
|
447
|
+
# will be ignored as they are both output only fields on this resource.
|
446
448
|
#
|
447
449
|
# @yield [response, operation] Access the result along with the RPC operation
|
448
450
|
# @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig]
|
@@ -712,8 +714,8 @@ module Google
|
|
712
714
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
713
715
|
#
|
714
716
|
# @param name [::String]
|
715
|
-
# Required. Name of the organization to get organization settings for. Its
|
716
|
-
#
|
717
|
+
# Required. Name of the organization to get organization settings for. Its format is
|
718
|
+
# "organizations/[organization_id]/organizationSettings".
|
717
719
|
#
|
718
720
|
# @yield [response, operation] Access the result along with the RPC operation
|
719
721
|
# @yieldparam response [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings]
|
@@ -913,9 +915,9 @@ module Google
|
|
913
915
|
# Use a negated partial match on the empty string to filter based on a
|
914
916
|
# property not existing: `-resource_properties.my_property : ""`
|
915
917
|
# @param group_by [::String]
|
916
|
-
# Required. Expression that defines what assets fields to use for grouping.
|
917
|
-
#
|
918
|
-
#
|
918
|
+
# Required. Expression that defines what assets fields to use for grouping. The string
|
919
|
+
# value should follow SQL syntax: comma separated list of fields. For
|
920
|
+
# example:
|
919
921
|
# "security_center_properties.resource_project,security_center_properties.project".
|
920
922
|
#
|
921
923
|
# The following fields are supported when compare_duration is not set:
|
@@ -1079,6 +1081,7 @@ module Google
|
|
1079
1081
|
# * category: `=`, `:`
|
1080
1082
|
# * external_uri: `=`, `:`
|
1081
1083
|
# * event_time: `=`, `>`, `<`, `>=`, `<=`
|
1084
|
+
# * severity: `=`, `:`
|
1082
1085
|
#
|
1083
1086
|
# Usage: This should be milliseconds since epoch or an RFC3339 string.
|
1084
1087
|
# Examples:
|
@@ -1096,9 +1099,9 @@ module Google
|
|
1096
1099
|
# Use a negated partial match on the empty string to filter based on a
|
1097
1100
|
# property not existing: `-source_properties.my_property : ""`
|
1098
1101
|
# @param group_by [::String]
|
1099
|
-
# Required. Expression that defines what assets fields to use for grouping
|
1100
|
-
#
|
1101
|
-
#
|
1102
|
+
# Required. Expression that defines what assets fields to use for grouping (including
|
1103
|
+
# `state_change`). The string value should follow SQL syntax: comma separated
|
1104
|
+
# list of fields. For example: "parent,resource_name".
|
1102
1105
|
#
|
1103
1106
|
# The following fields are supported:
|
1104
1107
|
#
|
@@ -1106,6 +1109,7 @@ module Google
|
|
1106
1109
|
# * category
|
1107
1110
|
# * state
|
1108
1111
|
# * parent
|
1112
|
+
# * severity
|
1109
1113
|
#
|
1110
1114
|
# The following fields are supported when compare_duration is set:
|
1111
1115
|
#
|
@@ -1339,7 +1343,6 @@ module Google
|
|
1339
1343
|
# is "UNUSED", which will be the state_change set for all assets present at
|
1340
1344
|
# read_time.
|
1341
1345
|
# @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1342
|
-
# Optional.
|
1343
1346
|
# A field mask to specify the ListAssetsResult fields to be listed in the
|
1344
1347
|
# response.
|
1345
1348
|
# An empty field mask will list all fields.
|
@@ -1450,13 +1453,14 @@ module Google
|
|
1450
1453
|
#
|
1451
1454
|
# The following field and operator combinations are supported:
|
1452
1455
|
#
|
1453
|
-
# name: `=`
|
1454
|
-
# parent: `=`, `:`
|
1455
|
-
# resource_name: `=`, `:`
|
1456
|
-
# state: `=`, `:`
|
1457
|
-
# category: `=`, `:`
|
1458
|
-
# external_uri: `=`, `:`
|
1459
|
-
# event_time: `=`, `>`, `<`, `>=`, `<=`
|
1456
|
+
# * name: `=`
|
1457
|
+
# * parent: `=`, `:`
|
1458
|
+
# * resource_name: `=`, `:`
|
1459
|
+
# * state: `=`, `:`
|
1460
|
+
# * category: `=`, `:`
|
1461
|
+
# * external_uri: `=`, `:`
|
1462
|
+
# * event_time: `=`, `>`, `<`, `>=`, `<=`
|
1463
|
+
# * severity: `=`, `:`
|
1460
1464
|
#
|
1461
1465
|
# Usage: This should be milliseconds since epoch or an RFC3339 string.
|
1462
1466
|
# Examples:
|
@@ -1529,7 +1533,6 @@ module Google
|
|
1529
1533
|
# is "UNUSED", which will be the state_change set for all findings present at
|
1530
1534
|
# read_time.
|
1531
1535
|
# @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1532
|
-
# Optional.
|
1533
1536
|
# A field mask to specify the Finding fields to be listed in the response.
|
1534
1537
|
# An empty field mask will list all fields.
|
1535
1538
|
# @param page_token [::String]
|
@@ -1680,8 +1683,8 @@ module Google
|
|
1680
1683
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1681
1684
|
#
|
1682
1685
|
# @param parent [::String]
|
1683
|
-
# Required. Resource name of the parent of sources to list. Its format should
|
1684
|
-
#
|
1686
|
+
# Required. Resource name of the parent of sources to list. Its format should be
|
1687
|
+
# "organizations/[organization_id]".
|
1685
1688
|
# @param page_token [::String]
|
1686
1689
|
# The value returned by the last `ListSourcesResponse`; indicates
|
1687
1690
|
# that this is a continuation of a prior `ListSources` call, and
|
@@ -1760,8 +1763,8 @@ module Google
|
|
1760
1763
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1761
1764
|
#
|
1762
1765
|
# @param parent [::String]
|
1763
|
-
# Required. Name of the organization to run asset discovery for. Its format
|
1764
|
-
#
|
1766
|
+
# Required. Name of the organization to run asset discovery for. Its format is
|
1767
|
+
# "organizations/[organization_id]".
|
1765
1768
|
#
|
1766
1769
|
# @yield [response, operation] Access the result along with the RPC operation
|
1767
1770
|
# @yieldparam response [::Gapic::Operation]
|
@@ -2046,8 +2049,8 @@ module Google
|
|
2046
2049
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
2047
2050
|
#
|
2048
2051
|
# @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash]
|
2049
|
-
# Required. The finding resource to update or create if it does not already
|
2050
|
-
#
|
2052
|
+
# Required. The finding resource to update or create if it does not already exist.
|
2053
|
+
# parent, security_marks, and update_time will be ignored.
|
2051
2054
|
#
|
2052
2055
|
# In the case of creation, the finding id portion of the name must be
|
2053
2056
|
# alphanumeric and less than or equal to 32 characters and greater than 0
|
@@ -2485,7 +2488,7 @@ module Google
|
|
2485
2488
|
config_attr :scope, nil, ::String, ::Array, nil
|
2486
2489
|
config_attr :lib_name, nil, ::String, nil
|
2487
2490
|
config_attr :lib_version, nil, ::String, nil
|
2488
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
2491
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
2489
2492
|
config_attr :interceptors, nil, ::Array, nil
|
2490
2493
|
config_attr :timeout, nil, ::Numeric, nil
|
2491
2494
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -2506,7 +2509,7 @@ module Google
|
|
2506
2509
|
def rpcs
|
2507
2510
|
@rpcs ||= begin
|
2508
2511
|
parent_rpcs = nil
|
2509
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
2512
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
2510
2513
|
Rpcs.new parent_rpcs
|
2511
2514
|
end
|
2512
2515
|
end
|
@@ -2518,7 +2521,7 @@ module Google
|
|
2518
2521
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
2519
2522
|
# the following configuration fields:
|
2520
2523
|
#
|
2521
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
2524
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
2522
2525
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
2523
2526
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
2524
2527
|
# include the following keys:
|
@@ -2647,51 +2650,51 @@ module Google
|
|
2647
2650
|
|
2648
2651
|
# @private
|
2649
2652
|
def initialize parent_rpcs = nil
|
2650
|
-
create_source_config = parent_rpcs
|
2653
|
+
create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source
|
2651
2654
|
@create_source = ::Gapic::Config::Method.new create_source_config
|
2652
|
-
create_finding_config = parent_rpcs
|
2655
|
+
create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding
|
2653
2656
|
@create_finding = ::Gapic::Config::Method.new create_finding_config
|
2654
|
-
create_notification_config_config = parent_rpcs
|
2657
|
+
create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config
|
2655
2658
|
@create_notification_config = ::Gapic::Config::Method.new create_notification_config_config
|
2656
|
-
delete_notification_config_config = parent_rpcs
|
2659
|
+
delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config
|
2657
2660
|
@delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config
|
2658
|
-
get_iam_policy_config = parent_rpcs
|
2661
|
+
get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
|
2659
2662
|
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
2660
|
-
get_notification_config_config = parent_rpcs
|
2663
|
+
get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config
|
2661
2664
|
@get_notification_config = ::Gapic::Config::Method.new get_notification_config_config
|
2662
|
-
get_organization_settings_config = parent_rpcs
|
2665
|
+
get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings
|
2663
2666
|
@get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config
|
2664
|
-
get_source_config = parent_rpcs
|
2667
|
+
get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source
|
2665
2668
|
@get_source = ::Gapic::Config::Method.new get_source_config
|
2666
|
-
group_assets_config = parent_rpcs
|
2669
|
+
group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets
|
2667
2670
|
@group_assets = ::Gapic::Config::Method.new group_assets_config
|
2668
|
-
group_findings_config = parent_rpcs
|
2671
|
+
group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings
|
2669
2672
|
@group_findings = ::Gapic::Config::Method.new group_findings_config
|
2670
|
-
list_assets_config = parent_rpcs
|
2673
|
+
list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets
|
2671
2674
|
@list_assets = ::Gapic::Config::Method.new list_assets_config
|
2672
|
-
list_findings_config = parent_rpcs
|
2675
|
+
list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings
|
2673
2676
|
@list_findings = ::Gapic::Config::Method.new list_findings_config
|
2674
|
-
list_notification_configs_config = parent_rpcs
|
2677
|
+
list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs
|
2675
2678
|
@list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config
|
2676
|
-
list_sources_config = parent_rpcs
|
2679
|
+
list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources
|
2677
2680
|
@list_sources = ::Gapic::Config::Method.new list_sources_config
|
2678
|
-
run_asset_discovery_config = parent_rpcs
|
2681
|
+
run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery
|
2679
2682
|
@run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config
|
2680
|
-
set_finding_state_config = parent_rpcs
|
2683
|
+
set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state
|
2681
2684
|
@set_finding_state = ::Gapic::Config::Method.new set_finding_state_config
|
2682
|
-
set_iam_policy_config = parent_rpcs
|
2685
|
+
set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
|
2683
2686
|
@set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
|
2684
|
-
test_iam_permissions_config = parent_rpcs
|
2687
|
+
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
|
2685
2688
|
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
2686
|
-
update_finding_config = parent_rpcs
|
2689
|
+
update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding
|
2687
2690
|
@update_finding = ::Gapic::Config::Method.new update_finding_config
|
2688
|
-
update_notification_config_config = parent_rpcs
|
2691
|
+
update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config
|
2689
2692
|
@update_notification_config = ::Gapic::Config::Method.new update_notification_config_config
|
2690
|
-
update_organization_settings_config = parent_rpcs
|
2693
|
+
update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings
|
2691
2694
|
@update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config
|
2692
|
-
update_source_config = parent_rpcs
|
2695
|
+
update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source
|
2693
2696
|
@update_source = ::Gapic::Config::Method.new update_source_config
|
2694
|
-
update_security_marks_config = parent_rpcs
|
2697
|
+
update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks
|
2695
2698
|
@update_security_marks = ::Gapic::Config::Method.new update_security_marks_config
|
2696
2699
|
|
2697
2700
|
yield self if block_given?
|
@@ -103,8 +103,13 @@ module Google
|
|
103
103
|
# Lists operations that match the specified filter in the request. If the
|
104
104
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
105
105
|
#
|
106
|
-
# NOTE: the `name` binding
|
107
|
-
# to use different resource name schemes, such as `users/*/operations`.
|
106
|
+
# NOTE: the `name` binding allows API services to override the binding
|
107
|
+
# to use different resource name schemes, such as `users/*/operations`. To
|
108
|
+
# override the binding, API services can add a binding such as
|
109
|
+
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
110
|
+
# For backwards compatibility, the default name includes the operations
|
111
|
+
# collection id, however overriding users must ensure the name binding
|
112
|
+
# is the parent resource, without the operations collection id.
|
108
113
|
#
|
109
114
|
# @overload list_operations(request, options = nil)
|
110
115
|
# Pass arguments to `list_operations` via a request object, either of type
|
@@ -122,7 +127,7 @@ module Google
|
|
122
127
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
123
128
|
#
|
124
129
|
# @param name [::String]
|
125
|
-
# The name of the operation
|
130
|
+
# The name of the operation's parent resource.
|
126
131
|
# @param filter [::String]
|
127
132
|
# The standard list filter.
|
128
133
|
# @param page_size [::Integer]
|
@@ -390,6 +395,79 @@ module Google
|
|
390
395
|
raise ::Google::Cloud::Error.from_error(e)
|
391
396
|
end
|
392
397
|
|
398
|
+
##
|
399
|
+
# Waits for the specified long-running operation until it is done or reaches
|
400
|
+
# at most a specified timeout, returning the latest state. If the operation
|
401
|
+
# is already done, the latest state is immediately returned. If the timeout
|
402
|
+
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
|
+
# timeout is used. If the server does not support this method, it returns
|
404
|
+
# `google.rpc.Code.UNIMPLEMENTED`.
|
405
|
+
# Note that this method is on a best-effort basis. It may return the latest
|
406
|
+
# state before the specified timeout (including immediately), meaning even an
|
407
|
+
# immediate response is no guarantee that the operation is done.
|
408
|
+
#
|
409
|
+
# @overload wait_operation(request, options = nil)
|
410
|
+
# Pass arguments to `wait_operation` via a request object, either of type
|
411
|
+
# {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
|
412
|
+
#
|
413
|
+
# @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
|
414
|
+
# A request object representing the call parameters. Required. To specify no
|
415
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
416
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
417
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
418
|
+
#
|
419
|
+
# @overload wait_operation(name: nil, timeout: nil)
|
420
|
+
# Pass arguments to `wait_operation` via keyword arguments. Note that at
|
421
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
422
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
423
|
+
#
|
424
|
+
# @param name [::String]
|
425
|
+
# The name of the operation resource to wait on.
|
426
|
+
# @param timeout [::Google::Protobuf::Duration, ::Hash]
|
427
|
+
# The maximum duration to wait before timing out. If left blank, the wait
|
428
|
+
# will be at most the time permitted by the underlying HTTP/RPC protocol.
|
429
|
+
# If RPC context deadline is also specified, the shorter one will be used.
|
430
|
+
#
|
431
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
432
|
+
# @yieldparam response [::Gapic::Operation]
|
433
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
434
|
+
#
|
435
|
+
# @return [::Gapic::Operation]
|
436
|
+
#
|
437
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
438
|
+
#
|
439
|
+
def wait_operation request, options = nil
|
440
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
441
|
+
|
442
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
|
443
|
+
|
444
|
+
# Converts hash and nil to an options object
|
445
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
446
|
+
|
447
|
+
# Customize the options with defaults
|
448
|
+
metadata = @config.rpcs.wait_operation.metadata.to_h
|
449
|
+
|
450
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
451
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
452
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
453
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION
|
454
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
455
|
+
|
456
|
+
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
|
+
metadata: metadata,
|
458
|
+
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
+
options.apply_defaults metadata: @config.metadata,
|
460
|
+
retry_policy: @config.retry_policy
|
461
|
+
|
462
|
+
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
463
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
464
|
+
yield response, operation if block_given?
|
465
|
+
return response
|
466
|
+
end
|
467
|
+
rescue ::GRPC::BadStatus => e
|
468
|
+
raise ::Google::Cloud::Error.from_error(e)
|
469
|
+
end
|
470
|
+
|
393
471
|
##
|
394
472
|
# Configuration class for the Operations API.
|
395
473
|
#
|
@@ -482,7 +560,7 @@ module Google
|
|
482
560
|
config_attr :scope, nil, ::String, ::Array, nil
|
483
561
|
config_attr :lib_name, nil, ::String, nil
|
484
562
|
config_attr :lib_version, nil, ::String, nil
|
485
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
563
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
486
564
|
config_attr :interceptors, nil, ::Array, nil
|
487
565
|
config_attr :timeout, nil, ::Numeric, nil
|
488
566
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -503,7 +581,7 @@ module Google
|
|
503
581
|
def rpcs
|
504
582
|
@rpcs ||= begin
|
505
583
|
parent_rpcs = nil
|
506
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
584
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
507
585
|
Rpcs.new parent_rpcs
|
508
586
|
end
|
509
587
|
end
|
@@ -515,7 +593,7 @@ module Google
|
|
515
593
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
516
594
|
# the following configuration fields:
|
517
595
|
#
|
518
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
596
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
519
597
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
520
598
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
521
599
|
# include the following keys:
|
@@ -546,17 +624,24 @@ module Google
|
|
546
624
|
# @return [::Gapic::Config::Method]
|
547
625
|
#
|
548
626
|
attr_reader :cancel_operation
|
627
|
+
##
|
628
|
+
# RPC-specific configuration for `wait_operation`
|
629
|
+
# @return [::Gapic::Config::Method]
|
630
|
+
#
|
631
|
+
attr_reader :wait_operation
|
549
632
|
|
550
633
|
# @private
|
551
634
|
def initialize parent_rpcs = nil
|
552
|
-
list_operations_config = parent_rpcs
|
635
|
+
list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
|
553
636
|
@list_operations = ::Gapic::Config::Method.new list_operations_config
|
554
|
-
get_operation_config = parent_rpcs
|
637
|
+
get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
|
555
638
|
@get_operation = ::Gapic::Config::Method.new get_operation_config
|
556
|
-
delete_operation_config = parent_rpcs
|
639
|
+
delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
|
557
640
|
@delete_operation = ::Gapic::Config::Method.new delete_operation_config
|
558
|
-
cancel_operation_config = parent_rpcs
|
641
|
+
cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
|
559
642
|
@cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
|
643
|
+
wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
|
644
|
+
@wait_operation = ::Gapic::Config::Method.new wait_operation_config
|
560
645
|
|
561
646
|
yield self if block_given?
|
562
647
|
end
|