google-cloud-binary_authorization-v1beta1 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +75 -0
- data/lib/google-cloud-binary_authorization-v1beta1.rb +21 -0
- data/lib/google/cloud/binary_authorization/v1beta1.rb +35 -0
- data/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service.rb +55 -0
- data/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/client.rb +902 -0
- data/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/credentials.rb +51 -0
- data/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/paths.rb +78 -0
- data/lib/google/cloud/binary_authorization/v1beta1/version.rb +28 -0
- data/lib/google/cloud/binaryauthorization/v1beta1/resources_pb.rb +105 -0
- data/lib/google/cloud/binaryauthorization/v1beta1/service_pb.rb +61 -0
- data/lib/google/cloud/binaryauthorization/v1beta1/service_services_pb.rb +83 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +283 -0
- data/proto_docs/google/cloud/binaryauthorization/v1beta1/resources.rb +317 -0
- data/proto_docs/google/cloud/binaryauthorization/v1beta1/service.rb +128 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- metadata +205 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
# This gem does not autoload during Bundler.require. To load this gem,
|
20
|
+
# issue explicit require statements for the packages desired, e.g.:
|
21
|
+
# require "google/cloud/binary_authorization/v1beta1"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/binary_authorization/v1beta1/binauthz_management_service"
|
20
|
+
require "google/cloud/binary_authorization/v1beta1/version"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module BinaryAuthorization
|
25
|
+
##
|
26
|
+
# To load this package, including all its services, and instantiate a client:
|
27
|
+
#
|
28
|
+
# require "google/cloud/binary_authorization/v1beta1"
|
29
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
|
30
|
+
#
|
31
|
+
module V1beta1
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/binary_authorization/v1beta1/version"
|
24
|
+
|
25
|
+
require "google/cloud/binary_authorization/v1beta1/binauthz_management_service/credentials"
|
26
|
+
require "google/cloud/binary_authorization/v1beta1/binauthz_management_service/paths"
|
27
|
+
require "google/cloud/binary_authorization/v1beta1/binauthz_management_service/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module BinaryAuthorization
|
32
|
+
module V1beta1
|
33
|
+
##
|
34
|
+
# Google Cloud Management Service for Binary Authorization admission policies
|
35
|
+
# and attestation authorities.
|
36
|
+
#
|
37
|
+
# This API implements a REST model with the following objects:
|
38
|
+
#
|
39
|
+
# * {::Google::Cloud::BinaryAuthorization::V1beta1::Policy Policy}
|
40
|
+
# * {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor Attestor}
|
41
|
+
#
|
42
|
+
# To load this service and instantiate a client:
|
43
|
+
#
|
44
|
+
# require "google/cloud/binary_authorization/v1beta1/binauthz_management_service"
|
45
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
|
46
|
+
#
|
47
|
+
module BinauthzManagementService
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
helper_path = ::File.join __dir__, "binauthz_management_service", "helpers.rb"
|
55
|
+
require "google/cloud/binary_authorization/v1beta1/binauthz_management_service/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,902 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/binaryauthorization/v1beta1/service_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module BinaryAuthorization
|
25
|
+
module V1beta1
|
26
|
+
module BinauthzManagementService
|
27
|
+
##
|
28
|
+
# Client for the BinauthzManagementService service.
|
29
|
+
#
|
30
|
+
# Google Cloud Management Service for Binary Authorization admission policies
|
31
|
+
# and attestation authorities.
|
32
|
+
#
|
33
|
+
# This API implements a REST model with the following objects:
|
34
|
+
#
|
35
|
+
# * {::Google::Cloud::BinaryAuthorization::V1beta1::Policy Policy}
|
36
|
+
# * {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor Attestor}
|
37
|
+
#
|
38
|
+
class Client
|
39
|
+
include Paths
|
40
|
+
|
41
|
+
# @private
|
42
|
+
attr_reader :binauthz_management_service_stub
|
43
|
+
|
44
|
+
##
|
45
|
+
# Configure the BinauthzManagementService Client class.
|
46
|
+
#
|
47
|
+
# See {::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client::Configuration}
|
48
|
+
# for a description of the configuration fields.
|
49
|
+
#
|
50
|
+
# ## Example
|
51
|
+
#
|
52
|
+
# To modify the configuration for all BinauthzManagementService clients:
|
53
|
+
#
|
54
|
+
# ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.configure do |config|
|
55
|
+
# config.timeout = 10.0
|
56
|
+
# end
|
57
|
+
#
|
58
|
+
# @yield [config] Configure the Client client.
|
59
|
+
# @yieldparam config [Client::Configuration]
|
60
|
+
#
|
61
|
+
# @return [Client::Configuration]
|
62
|
+
#
|
63
|
+
def self.configure
|
64
|
+
@configure ||= begin
|
65
|
+
namespace = ["Google", "Cloud", "BinaryAuthorization", "V1beta1"]
|
66
|
+
parent_config = while namespace.any?
|
67
|
+
parent_name = namespace.join "::"
|
68
|
+
parent_const = const_get parent_name
|
69
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
70
|
+
namespace.pop
|
71
|
+
end
|
72
|
+
default_config = Client::Configuration.new parent_config
|
73
|
+
|
74
|
+
default_config.rpcs.get_policy.timeout = 600.0
|
75
|
+
default_config.rpcs.get_policy.retry_policy = {
|
76
|
+
initial_delay: 0.1,
|
77
|
+
max_delay: 60.0,
|
78
|
+
multiplier: 1.3,
|
79
|
+
retry_codes: [4, 14]
|
80
|
+
}
|
81
|
+
|
82
|
+
default_config.rpcs.update_policy.timeout = 600.0
|
83
|
+
default_config.rpcs.update_policy.retry_policy = {
|
84
|
+
initial_delay: 0.1,
|
85
|
+
max_delay: 60.0,
|
86
|
+
multiplier: 1.3,
|
87
|
+
retry_codes: [4, 14]
|
88
|
+
}
|
89
|
+
|
90
|
+
default_config.rpcs.create_attestor.timeout = 600.0
|
91
|
+
|
92
|
+
default_config.rpcs.get_attestor.timeout = 600.0
|
93
|
+
default_config.rpcs.get_attestor.retry_policy = {
|
94
|
+
initial_delay: 0.1,
|
95
|
+
max_delay: 60.0,
|
96
|
+
multiplier: 1.3,
|
97
|
+
retry_codes: [4, 14]
|
98
|
+
}
|
99
|
+
|
100
|
+
default_config.rpcs.update_attestor.timeout = 600.0
|
101
|
+
default_config.rpcs.update_attestor.retry_policy = {
|
102
|
+
initial_delay: 0.1,
|
103
|
+
max_delay: 60.0,
|
104
|
+
multiplier: 1.3,
|
105
|
+
retry_codes: [4, 14]
|
106
|
+
}
|
107
|
+
|
108
|
+
default_config.rpcs.list_attestors.timeout = 600.0
|
109
|
+
default_config.rpcs.list_attestors.retry_policy = {
|
110
|
+
initial_delay: 0.1,
|
111
|
+
max_delay: 60.0,
|
112
|
+
multiplier: 1.3,
|
113
|
+
retry_codes: [4, 14]
|
114
|
+
}
|
115
|
+
|
116
|
+
default_config.rpcs.delete_attestor.timeout = 600.0
|
117
|
+
default_config.rpcs.delete_attestor.retry_policy = {
|
118
|
+
initial_delay: 0.1,
|
119
|
+
max_delay: 60.0,
|
120
|
+
multiplier: 1.3,
|
121
|
+
retry_codes: [4, 14]
|
122
|
+
}
|
123
|
+
|
124
|
+
default_config
|
125
|
+
end
|
126
|
+
yield @configure if block_given?
|
127
|
+
@configure
|
128
|
+
end
|
129
|
+
|
130
|
+
##
|
131
|
+
# Configure the BinauthzManagementService Client instance.
|
132
|
+
#
|
133
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
134
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
135
|
+
# should be made on {Client.configure}.
|
136
|
+
#
|
137
|
+
# See {::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client::Configuration}
|
138
|
+
# for a description of the configuration fields.
|
139
|
+
#
|
140
|
+
# @yield [config] Configure the Client client.
|
141
|
+
# @yieldparam config [Client::Configuration]
|
142
|
+
#
|
143
|
+
# @return [Client::Configuration]
|
144
|
+
#
|
145
|
+
def configure
|
146
|
+
yield @config if block_given?
|
147
|
+
@config
|
148
|
+
end
|
149
|
+
|
150
|
+
##
|
151
|
+
# Create a new BinauthzManagementService client object.
|
152
|
+
#
|
153
|
+
# ## Examples
|
154
|
+
#
|
155
|
+
# To create a new BinauthzManagementService client with the default
|
156
|
+
# configuration:
|
157
|
+
#
|
158
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
|
159
|
+
#
|
160
|
+
# To create a new BinauthzManagementService client with a custom
|
161
|
+
# configuration:
|
162
|
+
#
|
163
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new do |config|
|
164
|
+
# config.timeout = 10.0
|
165
|
+
# end
|
166
|
+
#
|
167
|
+
# @yield [config] Configure the BinauthzManagementService client.
|
168
|
+
# @yieldparam config [Client::Configuration]
|
169
|
+
#
|
170
|
+
def initialize
|
171
|
+
# These require statements are intentionally placed here to initialize
|
172
|
+
# the gRPC module only when it's required.
|
173
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
174
|
+
require "gapic/grpc"
|
175
|
+
require "google/cloud/binaryauthorization/v1beta1/service_services_pb"
|
176
|
+
|
177
|
+
# Create the configuration object
|
178
|
+
@config = Configuration.new Client.configure
|
179
|
+
|
180
|
+
# Yield the configuration if needed
|
181
|
+
yield @config if block_given?
|
182
|
+
|
183
|
+
# Create credentials
|
184
|
+
credentials = @config.credentials
|
185
|
+
credentials ||= Credentials.default scope: @config.scope
|
186
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
187
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
188
|
+
end
|
189
|
+
@quota_project_id = @config.quota_project
|
190
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
191
|
+
|
192
|
+
@binauthz_management_service_stub = ::Gapic::ServiceStub.new(
|
193
|
+
::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementServiceV1Beta1::Stub,
|
194
|
+
credentials: credentials,
|
195
|
+
endpoint: @config.endpoint,
|
196
|
+
channel_args: @config.channel_args,
|
197
|
+
interceptors: @config.interceptors
|
198
|
+
)
|
199
|
+
end
|
200
|
+
|
201
|
+
# Service calls
|
202
|
+
|
203
|
+
##
|
204
|
+
# A {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} specifies the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} that must attest to
|
205
|
+
# a container image, before the project is allowed to deploy that
|
206
|
+
# image. There is at most one policy per project. All image admission
|
207
|
+
# requests are permitted if a project has no policy.
|
208
|
+
#
|
209
|
+
# Gets the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} for this project. Returns a default
|
210
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} if the project does not have one.
|
211
|
+
#
|
212
|
+
# @overload get_policy(request, options = nil)
|
213
|
+
# Pass arguments to `get_policy` via a request object, either of type
|
214
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::GetPolicyRequest} or an equivalent Hash.
|
215
|
+
#
|
216
|
+
# @param request [::Google::Cloud::BinaryAuthorization::V1beta1::GetPolicyRequest, ::Hash]
|
217
|
+
# A request object representing the call parameters. Required. To specify no
|
218
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
219
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
220
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
221
|
+
#
|
222
|
+
# @overload get_policy(name: nil)
|
223
|
+
# Pass arguments to `get_policy` via keyword arguments. Note that at
|
224
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
225
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
226
|
+
#
|
227
|
+
# @param name [::String]
|
228
|
+
# Required. The resource name of the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} to retrieve,
|
229
|
+
# in the format `projects/*/policy`.
|
230
|
+
#
|
231
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
232
|
+
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Policy]
|
233
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
234
|
+
#
|
235
|
+
# @return [::Google::Cloud::BinaryAuthorization::V1beta1::Policy]
|
236
|
+
#
|
237
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
238
|
+
#
|
239
|
+
def get_policy request, options = nil
|
240
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
241
|
+
|
242
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BinaryAuthorization::V1beta1::GetPolicyRequest
|
243
|
+
|
244
|
+
# Converts hash and nil to an options object
|
245
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
246
|
+
|
247
|
+
# Customize the options with defaults
|
248
|
+
metadata = @config.rpcs.get_policy.metadata.to_h
|
249
|
+
|
250
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
251
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
252
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
253
|
+
gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
|
254
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
255
|
+
|
256
|
+
header_params = {
|
257
|
+
"name" => request.name
|
258
|
+
}
|
259
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
260
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
261
|
+
|
262
|
+
options.apply_defaults timeout: @config.rpcs.get_policy.timeout,
|
263
|
+
metadata: metadata,
|
264
|
+
retry_policy: @config.rpcs.get_policy.retry_policy
|
265
|
+
options.apply_defaults metadata: @config.metadata,
|
266
|
+
retry_policy: @config.retry_policy
|
267
|
+
|
268
|
+
@binauthz_management_service_stub.call_rpc :get_policy, request, options: options do |response, operation|
|
269
|
+
yield response, operation if block_given?
|
270
|
+
return response
|
271
|
+
end
|
272
|
+
rescue ::GRPC::BadStatus => e
|
273
|
+
raise ::Google::Cloud::Error.from_error(e)
|
274
|
+
end
|
275
|
+
|
276
|
+
##
|
277
|
+
# Creates or updates a project's {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy}, and returns a copy of the
|
278
|
+
# new {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy}. A policy is always updated as a whole, to avoid race
|
279
|
+
# conditions with concurrent policy enforcement (or management!)
|
280
|
+
# requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT
|
281
|
+
# if the request is malformed.
|
282
|
+
#
|
283
|
+
# @overload update_policy(request, options = nil)
|
284
|
+
# Pass arguments to `update_policy` via a request object, either of type
|
285
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::UpdatePolicyRequest} or an equivalent Hash.
|
286
|
+
#
|
287
|
+
# @param request [::Google::Cloud::BinaryAuthorization::V1beta1::UpdatePolicyRequest, ::Hash]
|
288
|
+
# A request object representing the call parameters. Required. To specify no
|
289
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
290
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
291
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
292
|
+
#
|
293
|
+
# @overload update_policy(policy: nil)
|
294
|
+
# Pass arguments to `update_policy` via keyword arguments. Note that at
|
295
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
296
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
297
|
+
#
|
298
|
+
# @param policy [::Google::Cloud::BinaryAuthorization::V1beta1::Policy, ::Hash]
|
299
|
+
# Required. A new or updated {::Google::Cloud::BinaryAuthorization::V1beta1::Policy policy} value. The service will
|
300
|
+
# overwrite the {::Google::Cloud::BinaryAuthorization::V1beta1::Policy#name policy name} field with the resource name in
|
301
|
+
# the request URL, in the format `projects/*/policy`.
|
302
|
+
#
|
303
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
304
|
+
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Policy]
|
305
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
306
|
+
#
|
307
|
+
# @return [::Google::Cloud::BinaryAuthorization::V1beta1::Policy]
|
308
|
+
#
|
309
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
310
|
+
#
|
311
|
+
def update_policy request, options = nil
|
312
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
313
|
+
|
314
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BinaryAuthorization::V1beta1::UpdatePolicyRequest
|
315
|
+
|
316
|
+
# Converts hash and nil to an options object
|
317
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
318
|
+
|
319
|
+
# Customize the options with defaults
|
320
|
+
metadata = @config.rpcs.update_policy.metadata.to_h
|
321
|
+
|
322
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
323
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
324
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
325
|
+
gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
|
326
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
327
|
+
|
328
|
+
header_params = {
|
329
|
+
"policy.name" => request.policy.name
|
330
|
+
}
|
331
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
332
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
333
|
+
|
334
|
+
options.apply_defaults timeout: @config.rpcs.update_policy.timeout,
|
335
|
+
metadata: metadata,
|
336
|
+
retry_policy: @config.rpcs.update_policy.retry_policy
|
337
|
+
options.apply_defaults metadata: @config.metadata,
|
338
|
+
retry_policy: @config.retry_policy
|
339
|
+
|
340
|
+
@binauthz_management_service_stub.call_rpc :update_policy, request, options: options do |response, operation|
|
341
|
+
yield response, operation if block_given?
|
342
|
+
return response
|
343
|
+
end
|
344
|
+
rescue ::GRPC::BadStatus => e
|
345
|
+
raise ::Google::Cloud::Error.from_error(e)
|
346
|
+
end
|
347
|
+
|
348
|
+
##
|
349
|
+
# Creates an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}, and returns a copy of the new
|
350
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}. Returns NOT_FOUND if the project does not exist,
|
351
|
+
# INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the
|
352
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} already exists.
|
353
|
+
#
|
354
|
+
# @overload create_attestor(request, options = nil)
|
355
|
+
# Pass arguments to `create_attestor` via a request object, either of type
|
356
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::CreateAttestorRequest} or an equivalent Hash.
|
357
|
+
#
|
358
|
+
# @param request [::Google::Cloud::BinaryAuthorization::V1beta1::CreateAttestorRequest, ::Hash]
|
359
|
+
# A request object representing the call parameters. Required. To specify no
|
360
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
361
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
362
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
363
|
+
#
|
364
|
+
# @overload create_attestor(parent: nil, attestor_id: nil, attestor: nil)
|
365
|
+
# Pass arguments to `create_attestor` via keyword arguments. Note that at
|
366
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
367
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
368
|
+
#
|
369
|
+
# @param parent [::String]
|
370
|
+
# Required. The parent of this {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
|
371
|
+
# @param attestor_id [::String]
|
372
|
+
# Required. The {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} ID.
|
373
|
+
# @param attestor [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor, ::Hash]
|
374
|
+
# Required. The initial {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} value. The service will
|
375
|
+
# overwrite the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor#name attestor name} field with the resource name,
|
376
|
+
# in the format `projects/*/attestors/*`.
|
377
|
+
#
|
378
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
379
|
+
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
|
380
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
381
|
+
#
|
382
|
+
# @return [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
|
383
|
+
#
|
384
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
385
|
+
#
|
386
|
+
def create_attestor request, options = nil
|
387
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
388
|
+
|
389
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BinaryAuthorization::V1beta1::CreateAttestorRequest
|
390
|
+
|
391
|
+
# Converts hash and nil to an options object
|
392
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
393
|
+
|
394
|
+
# Customize the options with defaults
|
395
|
+
metadata = @config.rpcs.create_attestor.metadata.to_h
|
396
|
+
|
397
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
398
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
399
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
400
|
+
gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
|
401
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
402
|
+
|
403
|
+
header_params = {
|
404
|
+
"parent" => request.parent
|
405
|
+
}
|
406
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
407
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
408
|
+
|
409
|
+
options.apply_defaults timeout: @config.rpcs.create_attestor.timeout,
|
410
|
+
metadata: metadata,
|
411
|
+
retry_policy: @config.rpcs.create_attestor.retry_policy
|
412
|
+
options.apply_defaults metadata: @config.metadata,
|
413
|
+
retry_policy: @config.retry_policy
|
414
|
+
|
415
|
+
@binauthz_management_service_stub.call_rpc :create_attestor, request, options: options do |response, operation|
|
416
|
+
yield response, operation if block_given?
|
417
|
+
return response
|
418
|
+
end
|
419
|
+
rescue ::GRPC::BadStatus => e
|
420
|
+
raise ::Google::Cloud::Error.from_error(e)
|
421
|
+
end
|
422
|
+
|
423
|
+
##
|
424
|
+
# Gets an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
|
425
|
+
# Returns NOT_FOUND if the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not exist.
|
426
|
+
#
|
427
|
+
# @overload get_attestor(request, options = nil)
|
428
|
+
# Pass arguments to `get_attestor` via a request object, either of type
|
429
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::GetAttestorRequest} or an equivalent Hash.
|
430
|
+
#
|
431
|
+
# @param request [::Google::Cloud::BinaryAuthorization::V1beta1::GetAttestorRequest, ::Hash]
|
432
|
+
# A request object representing the call parameters. Required. To specify no
|
433
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
434
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
435
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
436
|
+
#
|
437
|
+
# @overload get_attestor(name: nil)
|
438
|
+
# Pass arguments to `get_attestor` via keyword arguments. Note that at
|
439
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
440
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
441
|
+
#
|
442
|
+
# @param name [::String]
|
443
|
+
# Required. The name of the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} to retrieve, in the format
|
444
|
+
# `projects/*/attestors/*`.
|
445
|
+
#
|
446
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
447
|
+
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
|
448
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
449
|
+
#
|
450
|
+
# @return [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
|
451
|
+
#
|
452
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
453
|
+
#
|
454
|
+
def get_attestor request, options = nil
|
455
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
456
|
+
|
457
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BinaryAuthorization::V1beta1::GetAttestorRequest
|
458
|
+
|
459
|
+
# Converts hash and nil to an options object
|
460
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
461
|
+
|
462
|
+
# Customize the options with defaults
|
463
|
+
metadata = @config.rpcs.get_attestor.metadata.to_h
|
464
|
+
|
465
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
466
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
467
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
468
|
+
gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
|
469
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
470
|
+
|
471
|
+
header_params = {
|
472
|
+
"name" => request.name
|
473
|
+
}
|
474
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
475
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
476
|
+
|
477
|
+
options.apply_defaults timeout: @config.rpcs.get_attestor.timeout,
|
478
|
+
metadata: metadata,
|
479
|
+
retry_policy: @config.rpcs.get_attestor.retry_policy
|
480
|
+
options.apply_defaults metadata: @config.metadata,
|
481
|
+
retry_policy: @config.retry_policy
|
482
|
+
|
483
|
+
@binauthz_management_service_stub.call_rpc :get_attestor, request, options: options do |response, operation|
|
484
|
+
yield response, operation if block_given?
|
485
|
+
return response
|
486
|
+
end
|
487
|
+
rescue ::GRPC::BadStatus => e
|
488
|
+
raise ::Google::Cloud::Error.from_error(e)
|
489
|
+
end
|
490
|
+
|
491
|
+
##
|
492
|
+
# Updates an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}.
|
493
|
+
# Returns NOT_FOUND if the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not exist.
|
494
|
+
#
|
495
|
+
# @overload update_attestor(request, options = nil)
|
496
|
+
# Pass arguments to `update_attestor` via a request object, either of type
|
497
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::UpdateAttestorRequest} or an equivalent Hash.
|
498
|
+
#
|
499
|
+
# @param request [::Google::Cloud::BinaryAuthorization::V1beta1::UpdateAttestorRequest, ::Hash]
|
500
|
+
# A request object representing the call parameters. Required. To specify no
|
501
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
502
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
503
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
504
|
+
#
|
505
|
+
# @overload update_attestor(attestor: nil)
|
506
|
+
# Pass arguments to `update_attestor` via keyword arguments. Note that at
|
507
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
508
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
509
|
+
#
|
510
|
+
# @param attestor [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor, ::Hash]
|
511
|
+
# Required. The updated {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} value. The service will
|
512
|
+
# overwrite the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor#name attestor name} field with the resource name
|
513
|
+
# in the request URL, in the format `projects/*/attestors/*`.
|
514
|
+
#
|
515
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
516
|
+
# @yieldparam response [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
|
517
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
518
|
+
#
|
519
|
+
# @return [::Google::Cloud::BinaryAuthorization::V1beta1::Attestor]
|
520
|
+
#
|
521
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
522
|
+
#
|
523
|
+
def update_attestor request, options = nil
|
524
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
525
|
+
|
526
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BinaryAuthorization::V1beta1::UpdateAttestorRequest
|
527
|
+
|
528
|
+
# Converts hash and nil to an options object
|
529
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
530
|
+
|
531
|
+
# Customize the options with defaults
|
532
|
+
metadata = @config.rpcs.update_attestor.metadata.to_h
|
533
|
+
|
534
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
535
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
536
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
537
|
+
gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
|
538
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
539
|
+
|
540
|
+
header_params = {
|
541
|
+
"attestor.name" => request.attestor.name
|
542
|
+
}
|
543
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
544
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
545
|
+
|
546
|
+
options.apply_defaults timeout: @config.rpcs.update_attestor.timeout,
|
547
|
+
metadata: metadata,
|
548
|
+
retry_policy: @config.rpcs.update_attestor.retry_policy
|
549
|
+
options.apply_defaults metadata: @config.metadata,
|
550
|
+
retry_policy: @config.retry_policy
|
551
|
+
|
552
|
+
@binauthz_management_service_stub.call_rpc :update_attestor, request, options: options do |response, operation|
|
553
|
+
yield response, operation if block_given?
|
554
|
+
return response
|
555
|
+
end
|
556
|
+
rescue ::GRPC::BadStatus => e
|
557
|
+
raise ::Google::Cloud::Error.from_error(e)
|
558
|
+
end
|
559
|
+
|
560
|
+
##
|
561
|
+
# Lists {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors}.
|
562
|
+
# Returns INVALID_ARGUMENT if the project does not exist.
|
563
|
+
#
|
564
|
+
# @overload list_attestors(request, options = nil)
|
565
|
+
# Pass arguments to `list_attestors` via a request object, either of type
|
566
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsRequest} or an equivalent Hash.
|
567
|
+
#
|
568
|
+
# @param request [::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsRequest, ::Hash]
|
569
|
+
# A request object representing the call parameters. Required. To specify no
|
570
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
571
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
572
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
573
|
+
#
|
574
|
+
# @overload list_attestors(parent: nil, page_size: nil, page_token: nil)
|
575
|
+
# Pass arguments to `list_attestors` via keyword arguments. Note that at
|
576
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
577
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
578
|
+
#
|
579
|
+
# @param parent [::String]
|
580
|
+
# Required. The resource name of the project associated with the
|
581
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors}, in the format `projects/*`.
|
582
|
+
# @param page_size [::Integer]
|
583
|
+
# Requested page size. The server may return fewer results than requested. If
|
584
|
+
# unspecified, the server will pick an appropriate default.
|
585
|
+
# @param page_token [::String]
|
586
|
+
# A token identifying a page of results the server should return. Typically,
|
587
|
+
# this is the value of {::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsResponse#next_page_token ListAttestorsResponse.next_page_token} returned
|
588
|
+
# from the previous call to the `ListAttestors` method.
|
589
|
+
#
|
590
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
591
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>]
|
592
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
593
|
+
#
|
594
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::BinaryAuthorization::V1beta1::Attestor>]
|
595
|
+
#
|
596
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
597
|
+
#
|
598
|
+
def list_attestors request, options = nil
|
599
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
600
|
+
|
601
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsRequest
|
602
|
+
|
603
|
+
# Converts hash and nil to an options object
|
604
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
605
|
+
|
606
|
+
# Customize the options with defaults
|
607
|
+
metadata = @config.rpcs.list_attestors.metadata.to_h
|
608
|
+
|
609
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
610
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
611
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
612
|
+
gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
|
613
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
614
|
+
|
615
|
+
header_params = {
|
616
|
+
"parent" => request.parent
|
617
|
+
}
|
618
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
619
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
620
|
+
|
621
|
+
options.apply_defaults timeout: @config.rpcs.list_attestors.timeout,
|
622
|
+
metadata: metadata,
|
623
|
+
retry_policy: @config.rpcs.list_attestors.retry_policy
|
624
|
+
options.apply_defaults metadata: @config.metadata,
|
625
|
+
retry_policy: @config.retry_policy
|
626
|
+
|
627
|
+
@binauthz_management_service_stub.call_rpc :list_attestors, request, options: options do |response, operation|
|
628
|
+
response = ::Gapic::PagedEnumerable.new @binauthz_management_service_stub, :list_attestors, request, response, operation, options
|
629
|
+
yield response, operation if block_given?
|
630
|
+
return response
|
631
|
+
end
|
632
|
+
rescue ::GRPC::BadStatus => e
|
633
|
+
raise ::Google::Cloud::Error.from_error(e)
|
634
|
+
end
|
635
|
+
|
636
|
+
##
|
637
|
+
# Deletes an {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor}. Returns NOT_FOUND if the
|
638
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestor} does not exist.
|
639
|
+
#
|
640
|
+
# @overload delete_attestor(request, options = nil)
|
641
|
+
# Pass arguments to `delete_attestor` via a request object, either of type
|
642
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::DeleteAttestorRequest} or an equivalent Hash.
|
643
|
+
#
|
644
|
+
# @param request [::Google::Cloud::BinaryAuthorization::V1beta1::DeleteAttestorRequest, ::Hash]
|
645
|
+
# A request object representing the call parameters. Required. To specify no
|
646
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
647
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
648
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
649
|
+
#
|
650
|
+
# @overload delete_attestor(name: nil)
|
651
|
+
# Pass arguments to `delete_attestor` via keyword arguments. Note that at
|
652
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
653
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
654
|
+
#
|
655
|
+
# @param name [::String]
|
656
|
+
# Required. The name of the {::Google::Cloud::BinaryAuthorization::V1beta1::Attestor attestors} to delete, in the format
|
657
|
+
# `projects/*/attestors/*`.
|
658
|
+
#
|
659
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
660
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
661
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
662
|
+
#
|
663
|
+
# @return [::Google::Protobuf::Empty]
|
664
|
+
#
|
665
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
666
|
+
#
|
667
|
+
def delete_attestor request, options = nil
|
668
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
669
|
+
|
670
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BinaryAuthorization::V1beta1::DeleteAttestorRequest
|
671
|
+
|
672
|
+
# Converts hash and nil to an options object
|
673
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
674
|
+
|
675
|
+
# Customize the options with defaults
|
676
|
+
metadata = @config.rpcs.delete_attestor.metadata.to_h
|
677
|
+
|
678
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
679
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
680
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
681
|
+
gapic_version: ::Google::Cloud::BinaryAuthorization::V1beta1::VERSION
|
682
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
683
|
+
|
684
|
+
header_params = {
|
685
|
+
"name" => request.name
|
686
|
+
}
|
687
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
688
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
689
|
+
|
690
|
+
options.apply_defaults timeout: @config.rpcs.delete_attestor.timeout,
|
691
|
+
metadata: metadata,
|
692
|
+
retry_policy: @config.rpcs.delete_attestor.retry_policy
|
693
|
+
options.apply_defaults metadata: @config.metadata,
|
694
|
+
retry_policy: @config.retry_policy
|
695
|
+
|
696
|
+
@binauthz_management_service_stub.call_rpc :delete_attestor, request, options: options do |response, operation|
|
697
|
+
yield response, operation if block_given?
|
698
|
+
return response
|
699
|
+
end
|
700
|
+
rescue ::GRPC::BadStatus => e
|
701
|
+
raise ::Google::Cloud::Error.from_error(e)
|
702
|
+
end
|
703
|
+
|
704
|
+
##
|
705
|
+
# Configuration class for the BinauthzManagementService API.
|
706
|
+
#
|
707
|
+
# This class represents the configuration for BinauthzManagementService,
|
708
|
+
# providing control over timeouts, retry behavior, logging, transport
|
709
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
710
|
+
# applied individually to specific RPCs. See
|
711
|
+
# {::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client::Configuration::Rpcs}
|
712
|
+
# for a list of RPCs that can be configured independently.
|
713
|
+
#
|
714
|
+
# Configuration can be applied globally to all clients, or to a single client
|
715
|
+
# on construction.
|
716
|
+
#
|
717
|
+
# # Examples
|
718
|
+
#
|
719
|
+
# To modify the global config, setting the timeout for get_policy
|
720
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
721
|
+
#
|
722
|
+
# ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.configure do |config|
|
723
|
+
# config.timeout = 10.0
|
724
|
+
# config.rpcs.get_policy.timeout = 20.0
|
725
|
+
# end
|
726
|
+
#
|
727
|
+
# To apply the above configuration only to a new client:
|
728
|
+
#
|
729
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new do |config|
|
730
|
+
# config.timeout = 10.0
|
731
|
+
# config.rpcs.get_policy.timeout = 20.0
|
732
|
+
# end
|
733
|
+
#
|
734
|
+
# @!attribute [rw] endpoint
|
735
|
+
# The hostname or hostname:port of the service endpoint.
|
736
|
+
# Defaults to `"binaryauthorization.googleapis.com"`.
|
737
|
+
# @return [::String]
|
738
|
+
# @!attribute [rw] credentials
|
739
|
+
# Credentials to send with calls. You may provide any of the following types:
|
740
|
+
# * (`String`) The path to a service account key file in JSON format
|
741
|
+
# * (`Hash`) A service account key as a Hash
|
742
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
743
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
744
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
745
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
746
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
747
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
748
|
+
# * (`nil`) indicating no credentials
|
749
|
+
# @return [::Object]
|
750
|
+
# @!attribute [rw] scope
|
751
|
+
# The OAuth scopes
|
752
|
+
# @return [::Array<::String>]
|
753
|
+
# @!attribute [rw] lib_name
|
754
|
+
# The library name as recorded in instrumentation and logging
|
755
|
+
# @return [::String]
|
756
|
+
# @!attribute [rw] lib_version
|
757
|
+
# The library version as recorded in instrumentation and logging
|
758
|
+
# @return [::String]
|
759
|
+
# @!attribute [rw] channel_args
|
760
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
761
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
762
|
+
# @return [::Hash]
|
763
|
+
# @!attribute [rw] interceptors
|
764
|
+
# An array of interceptors that are run before calls are executed.
|
765
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
766
|
+
# @!attribute [rw] timeout
|
767
|
+
# The call timeout in seconds.
|
768
|
+
# @return [::Numeric]
|
769
|
+
# @!attribute [rw] metadata
|
770
|
+
# Additional gRPC headers to be sent with the call.
|
771
|
+
# @return [::Hash{::Symbol=>::String}]
|
772
|
+
# @!attribute [rw] retry_policy
|
773
|
+
# The retry policy. The value is a hash with the following keys:
|
774
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
775
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
776
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
777
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
778
|
+
# trigger a retry.
|
779
|
+
# @return [::Hash]
|
780
|
+
# @!attribute [rw] quota_project
|
781
|
+
# A separate project against which to charge quota.
|
782
|
+
# @return [::String]
|
783
|
+
#
|
784
|
+
class Configuration
|
785
|
+
extend ::Gapic::Config
|
786
|
+
|
787
|
+
config_attr :endpoint, "binaryauthorization.googleapis.com", ::String
|
788
|
+
config_attr :credentials, nil do |value|
|
789
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
790
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
791
|
+
allowed.any? { |klass| klass === value }
|
792
|
+
end
|
793
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
794
|
+
config_attr :lib_name, nil, ::String, nil
|
795
|
+
config_attr :lib_version, nil, ::String, nil
|
796
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
797
|
+
config_attr :interceptors, nil, ::Array, nil
|
798
|
+
config_attr :timeout, nil, ::Numeric, nil
|
799
|
+
config_attr :metadata, nil, ::Hash, nil
|
800
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
801
|
+
config_attr :quota_project, nil, ::String, nil
|
802
|
+
|
803
|
+
# @private
|
804
|
+
def initialize parent_config = nil
|
805
|
+
@parent_config = parent_config unless parent_config.nil?
|
806
|
+
|
807
|
+
yield self if block_given?
|
808
|
+
end
|
809
|
+
|
810
|
+
##
|
811
|
+
# Configurations for individual RPCs
|
812
|
+
# @return [Rpcs]
|
813
|
+
#
|
814
|
+
def rpcs
|
815
|
+
@rpcs ||= begin
|
816
|
+
parent_rpcs = nil
|
817
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
818
|
+
Rpcs.new parent_rpcs
|
819
|
+
end
|
820
|
+
end
|
821
|
+
|
822
|
+
##
|
823
|
+
# Configuration RPC class for the BinauthzManagementService API.
|
824
|
+
#
|
825
|
+
# Includes fields providing the configuration for each RPC in this service.
|
826
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
827
|
+
# the following configuration fields:
|
828
|
+
#
|
829
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
830
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
831
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
832
|
+
# include the following keys:
|
833
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
834
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
835
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
836
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
837
|
+
# trigger a retry.
|
838
|
+
#
|
839
|
+
class Rpcs
|
840
|
+
##
|
841
|
+
# RPC-specific configuration for `get_policy`
|
842
|
+
# @return [::Gapic::Config::Method]
|
843
|
+
#
|
844
|
+
attr_reader :get_policy
|
845
|
+
##
|
846
|
+
# RPC-specific configuration for `update_policy`
|
847
|
+
# @return [::Gapic::Config::Method]
|
848
|
+
#
|
849
|
+
attr_reader :update_policy
|
850
|
+
##
|
851
|
+
# RPC-specific configuration for `create_attestor`
|
852
|
+
# @return [::Gapic::Config::Method]
|
853
|
+
#
|
854
|
+
attr_reader :create_attestor
|
855
|
+
##
|
856
|
+
# RPC-specific configuration for `get_attestor`
|
857
|
+
# @return [::Gapic::Config::Method]
|
858
|
+
#
|
859
|
+
attr_reader :get_attestor
|
860
|
+
##
|
861
|
+
# RPC-specific configuration for `update_attestor`
|
862
|
+
# @return [::Gapic::Config::Method]
|
863
|
+
#
|
864
|
+
attr_reader :update_attestor
|
865
|
+
##
|
866
|
+
# RPC-specific configuration for `list_attestors`
|
867
|
+
# @return [::Gapic::Config::Method]
|
868
|
+
#
|
869
|
+
attr_reader :list_attestors
|
870
|
+
##
|
871
|
+
# RPC-specific configuration for `delete_attestor`
|
872
|
+
# @return [::Gapic::Config::Method]
|
873
|
+
#
|
874
|
+
attr_reader :delete_attestor
|
875
|
+
|
876
|
+
# @private
|
877
|
+
def initialize parent_rpcs = nil
|
878
|
+
get_policy_config = parent_rpcs&.get_policy if parent_rpcs&.respond_to? :get_policy
|
879
|
+
@get_policy = ::Gapic::Config::Method.new get_policy_config
|
880
|
+
update_policy_config = parent_rpcs&.update_policy if parent_rpcs&.respond_to? :update_policy
|
881
|
+
@update_policy = ::Gapic::Config::Method.new update_policy_config
|
882
|
+
create_attestor_config = parent_rpcs&.create_attestor if parent_rpcs&.respond_to? :create_attestor
|
883
|
+
@create_attestor = ::Gapic::Config::Method.new create_attestor_config
|
884
|
+
get_attestor_config = parent_rpcs&.get_attestor if parent_rpcs&.respond_to? :get_attestor
|
885
|
+
@get_attestor = ::Gapic::Config::Method.new get_attestor_config
|
886
|
+
update_attestor_config = parent_rpcs&.update_attestor if parent_rpcs&.respond_to? :update_attestor
|
887
|
+
@update_attestor = ::Gapic::Config::Method.new update_attestor_config
|
888
|
+
list_attestors_config = parent_rpcs&.list_attestors if parent_rpcs&.respond_to? :list_attestors
|
889
|
+
@list_attestors = ::Gapic::Config::Method.new list_attestors_config
|
890
|
+
delete_attestor_config = parent_rpcs&.delete_attestor if parent_rpcs&.respond_to? :delete_attestor
|
891
|
+
@delete_attestor = ::Gapic::Config::Method.new delete_attestor_config
|
892
|
+
|
893
|
+
yield self if block_given?
|
894
|
+
end
|
895
|
+
end
|
896
|
+
end
|
897
|
+
end
|
898
|
+
end
|
899
|
+
end
|
900
|
+
end
|
901
|
+
end
|
902
|
+
end
|