google-cloud-binary_authorization-v1 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +2 -2
- data/lib/google/cloud/binary_authorization/v1/binauthz_management_service/client.rb +4 -6
- data/lib/google/cloud/binary_authorization/v1/binauthz_management_service/rest/client.rb +835 -0
- data/lib/google/cloud/binary_authorization/v1/binauthz_management_service/rest/service_stub.rb +464 -0
- data/lib/google/cloud/binary_authorization/v1/binauthz_management_service/rest.rb +58 -0
- data/lib/google/cloud/binary_authorization/v1/binauthz_management_service.rb +7 -1
- data/lib/google/cloud/binary_authorization/v1/rest.rb +39 -0
- data/lib/google/cloud/binary_authorization/v1/system_policy/rest/client.rb +345 -0
- data/lib/google/cloud/binary_authorization/v1/system_policy/rest/service_stub.rb +107 -0
- data/lib/google/cloud/binary_authorization/v1/system_policy/rest.rb +52 -0
- data/lib/google/cloud/binary_authorization/v1/system_policy.rb +7 -1
- data/lib/google/cloud/binary_authorization/v1/validation_helper/rest/client.rb +356 -0
- data/lib/google/cloud/binary_authorization/v1/validation_helper/rest/service_stub.rb +108 -0
- data/lib/google/cloud/binary_authorization/v1/validation_helper/rest.rb +51 -0
- data/lib/google/cloud/binary_authorization/v1/validation_helper.rb +7 -1
- data/lib/google/cloud/binary_authorization/v1/version.rb +1 -1
- data/lib/google/cloud/binary_authorization/v1.rb +7 -2
- data/lib/google/cloud/binaryauthorization/v1/resources_pb.rb +0 -1
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/cloud/binaryauthorization/v1/service.rb +2 -2
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +0 -2
- metadata +23 -8
@@ -0,0 +1,345 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/v1/service_pb"
|
21
|
+
require "google/cloud/binary_authorization/v1/system_policy/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module BinaryAuthorization
|
26
|
+
module V1
|
27
|
+
module SystemPolicy
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the SystemPolicy service.
|
31
|
+
#
|
32
|
+
# API for working with the system policy.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
include Paths
|
36
|
+
|
37
|
+
# @private
|
38
|
+
attr_reader :system_policy_stub
|
39
|
+
|
40
|
+
##
|
41
|
+
# Configure the SystemPolicy Client class.
|
42
|
+
#
|
43
|
+
# See {::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client::Configuration}
|
44
|
+
# for a description of the configuration fields.
|
45
|
+
#
|
46
|
+
# @example
|
47
|
+
#
|
48
|
+
# # Modify the configuration for all SystemPolicy clients
|
49
|
+
# ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client.configure do |config|
|
50
|
+
# config.timeout = 10.0
|
51
|
+
# end
|
52
|
+
#
|
53
|
+
# @yield [config] Configure the Client client.
|
54
|
+
# @yieldparam config [Client::Configuration]
|
55
|
+
#
|
56
|
+
# @return [Client::Configuration]
|
57
|
+
#
|
58
|
+
def self.configure
|
59
|
+
@configure ||= begin
|
60
|
+
namespace = ["Google", "Cloud", "BinaryAuthorization", "V1"]
|
61
|
+
parent_config = while namespace.any?
|
62
|
+
parent_name = namespace.join "::"
|
63
|
+
parent_const = const_get parent_name
|
64
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
65
|
+
namespace.pop
|
66
|
+
end
|
67
|
+
default_config = Client::Configuration.new parent_config
|
68
|
+
|
69
|
+
default_config
|
70
|
+
end
|
71
|
+
yield @configure if block_given?
|
72
|
+
@configure
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Configure the SystemPolicy Client instance.
|
77
|
+
#
|
78
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
79
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
80
|
+
# should be made on {Client.configure}.
|
81
|
+
#
|
82
|
+
# See {::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client::Configuration}
|
83
|
+
# for a description of the configuration fields.
|
84
|
+
#
|
85
|
+
# @yield [config] Configure the Client client.
|
86
|
+
# @yieldparam config [Client::Configuration]
|
87
|
+
#
|
88
|
+
# @return [Client::Configuration]
|
89
|
+
#
|
90
|
+
def configure
|
91
|
+
yield @config if block_given?
|
92
|
+
@config
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Create a new SystemPolicy REST client object.
|
97
|
+
#
|
98
|
+
# @example
|
99
|
+
#
|
100
|
+
# # Create a client using the default configuration
|
101
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client.new
|
102
|
+
#
|
103
|
+
# # Create a client using a custom configuration
|
104
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client.new do |config|
|
105
|
+
# config.timeout = 10.0
|
106
|
+
# end
|
107
|
+
#
|
108
|
+
# @yield [config] Configure the SystemPolicy client.
|
109
|
+
# @yieldparam config [Client::Configuration]
|
110
|
+
#
|
111
|
+
def initialize
|
112
|
+
# Create the configuration object
|
113
|
+
@config = Configuration.new Client.configure
|
114
|
+
|
115
|
+
# Yield the configuration if needed
|
116
|
+
yield @config if block_given?
|
117
|
+
|
118
|
+
# Create credentials
|
119
|
+
credentials = @config.credentials
|
120
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
121
|
+
# but only if the default endpoint does not have a region prefix.
|
122
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
123
|
+
!@config.endpoint.split(".").first.include?("-")
|
124
|
+
credentials ||= Credentials.default scope: @config.scope,
|
125
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
126
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
127
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
128
|
+
end
|
129
|
+
|
130
|
+
@quota_project_id = @config.quota_project
|
131
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
132
|
+
|
133
|
+
@system_policy_stub = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
134
|
+
end
|
135
|
+
|
136
|
+
# Service calls
|
137
|
+
|
138
|
+
##
|
139
|
+
# Gets the current system policy in the specified location.
|
140
|
+
#
|
141
|
+
# @overload get_system_policy(request, options = nil)
|
142
|
+
# Pass arguments to `get_system_policy` via a request object, either of type
|
143
|
+
# {::Google::Cloud::BinaryAuthorization::V1::GetSystemPolicyRequest} or an equivalent Hash.
|
144
|
+
#
|
145
|
+
# @param request [::Google::Cloud::BinaryAuthorization::V1::GetSystemPolicyRequest, ::Hash]
|
146
|
+
# A request object representing the call parameters. Required. To specify no
|
147
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
148
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
149
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
150
|
+
#
|
151
|
+
# @overload get_system_policy(name: nil)
|
152
|
+
# Pass arguments to `get_system_policy` via keyword arguments. Note that at
|
153
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
154
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
155
|
+
#
|
156
|
+
# @param name [::String]
|
157
|
+
# Required. The resource name, in the format `locations/*/policy`.
|
158
|
+
# Note that the system policy is not associated with a project.
|
159
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
160
|
+
# @yieldparam result [::Google::Cloud::BinaryAuthorization::V1::Policy]
|
161
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
162
|
+
#
|
163
|
+
# @return [::Google::Cloud::BinaryAuthorization::V1::Policy]
|
164
|
+
#
|
165
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
166
|
+
def get_system_policy request, options = nil
|
167
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
168
|
+
|
169
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BinaryAuthorization::V1::GetSystemPolicyRequest
|
170
|
+
|
171
|
+
# Converts hash and nil to an options object
|
172
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
173
|
+
|
174
|
+
# Customize the options with defaults
|
175
|
+
call_metadata = @config.rpcs.get_system_policy.metadata.to_h
|
176
|
+
|
177
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
178
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
179
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
180
|
+
gapic_version: ::Google::Cloud::BinaryAuthorization::V1::VERSION,
|
181
|
+
transports_version_send: [:rest]
|
182
|
+
|
183
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
184
|
+
|
185
|
+
options.apply_defaults timeout: @config.rpcs.get_system_policy.timeout,
|
186
|
+
metadata: call_metadata,
|
187
|
+
retry_policy: @config.rpcs.get_system_policy.retry_policy
|
188
|
+
|
189
|
+
options.apply_defaults timeout: @config.timeout,
|
190
|
+
metadata: @config.metadata,
|
191
|
+
retry_policy: @config.retry_policy
|
192
|
+
|
193
|
+
@system_policy_stub.get_system_policy request, options do |result, operation|
|
194
|
+
yield result, operation if block_given?
|
195
|
+
return result
|
196
|
+
end
|
197
|
+
rescue ::Gapic::Rest::Error => e
|
198
|
+
raise ::Google::Cloud::Error.from_error(e)
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# Configuration class for the SystemPolicy REST API.
|
203
|
+
#
|
204
|
+
# This class represents the configuration for SystemPolicy REST,
|
205
|
+
# providing control over timeouts, retry behavior, logging, transport
|
206
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
207
|
+
# applied individually to specific RPCs. See
|
208
|
+
# {::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client::Configuration::Rpcs}
|
209
|
+
# for a list of RPCs that can be configured independently.
|
210
|
+
#
|
211
|
+
# Configuration can be applied globally to all clients, or to a single client
|
212
|
+
# on construction.
|
213
|
+
#
|
214
|
+
# @example
|
215
|
+
#
|
216
|
+
# # Modify the global config, setting the timeout for
|
217
|
+
# # get_system_policy to 20 seconds,
|
218
|
+
# # and all remaining timeouts to 10 seconds.
|
219
|
+
# ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client.configure do |config|
|
220
|
+
# config.timeout = 10.0
|
221
|
+
# config.rpcs.get_system_policy.timeout = 20.0
|
222
|
+
# end
|
223
|
+
#
|
224
|
+
# # Apply the above configuration only to a new client.
|
225
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client.new do |config|
|
226
|
+
# config.timeout = 10.0
|
227
|
+
# config.rpcs.get_system_policy.timeout = 20.0
|
228
|
+
# end
|
229
|
+
#
|
230
|
+
# @!attribute [rw] endpoint
|
231
|
+
# The hostname or hostname:port of the service endpoint.
|
232
|
+
# Defaults to `"binaryauthorization.googleapis.com"`.
|
233
|
+
# @return [::String]
|
234
|
+
# @!attribute [rw] credentials
|
235
|
+
# Credentials to send with calls. You may provide any of the following types:
|
236
|
+
# * (`String`) The path to a service account key file in JSON format
|
237
|
+
# * (`Hash`) A service account key as a Hash
|
238
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
239
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
240
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
241
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
242
|
+
# * (`nil`) indicating no credentials
|
243
|
+
# @return [::Object]
|
244
|
+
# @!attribute [rw] scope
|
245
|
+
# The OAuth scopes
|
246
|
+
# @return [::Array<::String>]
|
247
|
+
# @!attribute [rw] lib_name
|
248
|
+
# The library name as recorded in instrumentation and logging
|
249
|
+
# @return [::String]
|
250
|
+
# @!attribute [rw] lib_version
|
251
|
+
# The library version as recorded in instrumentation and logging
|
252
|
+
# @return [::String]
|
253
|
+
# @!attribute [rw] timeout
|
254
|
+
# The call timeout in seconds.
|
255
|
+
# @return [::Numeric]
|
256
|
+
# @!attribute [rw] metadata
|
257
|
+
# Additional headers to be sent with the call.
|
258
|
+
# @return [::Hash{::Symbol=>::String}]
|
259
|
+
# @!attribute [rw] retry_policy
|
260
|
+
# The retry policy. The value is a hash with the following keys:
|
261
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
262
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
263
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
264
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
265
|
+
# trigger a retry.
|
266
|
+
# @return [::Hash]
|
267
|
+
# @!attribute [rw] quota_project
|
268
|
+
# A separate project against which to charge quota.
|
269
|
+
# @return [::String]
|
270
|
+
#
|
271
|
+
class Configuration
|
272
|
+
extend ::Gapic::Config
|
273
|
+
|
274
|
+
config_attr :endpoint, "binaryauthorization.googleapis.com", ::String
|
275
|
+
config_attr :credentials, nil do |value|
|
276
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
277
|
+
allowed.any? { |klass| klass === value }
|
278
|
+
end
|
279
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
280
|
+
config_attr :lib_name, nil, ::String, nil
|
281
|
+
config_attr :lib_version, nil, ::String, nil
|
282
|
+
config_attr :timeout, nil, ::Numeric, nil
|
283
|
+
config_attr :metadata, nil, ::Hash, nil
|
284
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
285
|
+
config_attr :quota_project, nil, ::String, nil
|
286
|
+
|
287
|
+
# @private
|
288
|
+
def initialize parent_config = nil
|
289
|
+
@parent_config = parent_config unless parent_config.nil?
|
290
|
+
|
291
|
+
yield self if block_given?
|
292
|
+
end
|
293
|
+
|
294
|
+
##
|
295
|
+
# Configurations for individual RPCs
|
296
|
+
# @return [Rpcs]
|
297
|
+
#
|
298
|
+
def rpcs
|
299
|
+
@rpcs ||= begin
|
300
|
+
parent_rpcs = nil
|
301
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
302
|
+
Rpcs.new parent_rpcs
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# Configuration RPC class for the SystemPolicy API.
|
308
|
+
#
|
309
|
+
# Includes fields providing the configuration for each RPC in this service.
|
310
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
311
|
+
# the following configuration fields:
|
312
|
+
#
|
313
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
314
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
315
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
316
|
+
# include the following keys:
|
317
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
318
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
319
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
320
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
321
|
+
# trigger a retry.
|
322
|
+
#
|
323
|
+
class Rpcs
|
324
|
+
##
|
325
|
+
# RPC-specific configuration for `get_system_policy`
|
326
|
+
# @return [::Gapic::Config::Method]
|
327
|
+
#
|
328
|
+
attr_reader :get_system_policy
|
329
|
+
|
330
|
+
# @private
|
331
|
+
def initialize parent_rpcs = nil
|
332
|
+
get_system_policy_config = parent_rpcs.get_system_policy if parent_rpcs.respond_to? :get_system_policy
|
333
|
+
@get_system_policy = ::Gapic::Config::Method.new get_system_policy_config
|
334
|
+
|
335
|
+
yield self if block_given?
|
336
|
+
end
|
337
|
+
end
|
338
|
+
end
|
339
|
+
end
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
end
|
344
|
+
end
|
345
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/binaryauthorization/v1/service_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module BinaryAuthorization
|
24
|
+
module V1
|
25
|
+
module SystemPolicy
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the SystemPolicy service.
|
29
|
+
# Service stub contains baseline method implementations
|
30
|
+
# including transcoding, making the REST call, and deserialing the response.
|
31
|
+
#
|
32
|
+
class ServiceStub
|
33
|
+
def initialize endpoint:, credentials:
|
34
|
+
# These require statements are intentionally placed here to initialize
|
35
|
+
# the REST modules only when it's required.
|
36
|
+
require "gapic/rest"
|
37
|
+
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
39
|
+
numeric_enums: true,
|
40
|
+
raise_faraday_errors: false
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Baseline implementation for the get_system_policy REST call
|
45
|
+
#
|
46
|
+
# @param request_pb [::Google::Cloud::BinaryAuthorization::V1::GetSystemPolicyRequest]
|
47
|
+
# A request object representing the call parameters. Required.
|
48
|
+
# @param options [::Gapic::CallOptions]
|
49
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
50
|
+
#
|
51
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
52
|
+
# @yieldparam result [::Google::Cloud::BinaryAuthorization::V1::Policy]
|
53
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
54
|
+
#
|
55
|
+
# @return [::Google::Cloud::BinaryAuthorization::V1::Policy]
|
56
|
+
# A result object deserialized from the server's reply
|
57
|
+
def get_system_policy request_pb, options = nil
|
58
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
59
|
+
|
60
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_system_policy_request request_pb
|
61
|
+
query_string_params = if query_string_params.any?
|
62
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
63
|
+
else
|
64
|
+
{}
|
65
|
+
end
|
66
|
+
|
67
|
+
response = @client_stub.make_http_request(
|
68
|
+
verb,
|
69
|
+
uri: uri,
|
70
|
+
body: body || "",
|
71
|
+
params: query_string_params,
|
72
|
+
options: options
|
73
|
+
)
|
74
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
75
|
+
result = ::Google::Cloud::BinaryAuthorization::V1::Policy.decode_json response.body, ignore_unknown_fields: true
|
76
|
+
|
77
|
+
yield result, operation if block_given?
|
78
|
+
result
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# @private
|
83
|
+
#
|
84
|
+
# GRPC transcoding helper method for the get_system_policy REST call
|
85
|
+
#
|
86
|
+
# @param request_pb [::Google::Cloud::BinaryAuthorization::V1::GetSystemPolicyRequest]
|
87
|
+
# A request object representing the call parameters. Required.
|
88
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
89
|
+
# Uri, Body, Query string parameters
|
90
|
+
def self.transcode_get_system_policy_request request_pb
|
91
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
92
|
+
.with_bindings(
|
93
|
+
uri_method: :get,
|
94
|
+
uri_template: "/v1/{name}",
|
95
|
+
matches: [
|
96
|
+
["name", %r{^locations/[^/]+/policy/?$}, false]
|
97
|
+
]
|
98
|
+
)
|
99
|
+
transcoder.transcode request_pb
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/binary_authorization/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/binary_authorization/v1/system_policy/credentials"
|
26
|
+
require "google/cloud/binary_authorization/v1/system_policy/paths"
|
27
|
+
require "google/cloud/binary_authorization/v1/system_policy/rest/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module BinaryAuthorization
|
32
|
+
module V1
|
33
|
+
##
|
34
|
+
# API for working with the system policy.
|
35
|
+
#
|
36
|
+
# To load this service and instantiate a REST client:
|
37
|
+
#
|
38
|
+
# require "google/cloud/binary_authorization/v1/system_policy/rest"
|
39
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client.new
|
40
|
+
#
|
41
|
+
module SystemPolicy
|
42
|
+
# Client for the REST transport
|
43
|
+
module Rest
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
52
|
+
require "google/cloud/binary_authorization/v1/system_policy/rest/helpers" if ::File.file? helper_path
|
@@ -25,6 +25,7 @@ require "google/cloud/binary_authorization/v1/version"
|
|
25
25
|
require "google/cloud/binary_authorization/v1/system_policy/credentials"
|
26
26
|
require "google/cloud/binary_authorization/v1/system_policy/paths"
|
27
27
|
require "google/cloud/binary_authorization/v1/system_policy/client"
|
28
|
+
require "google/cloud/binary_authorization/v1/system_policy/rest"
|
28
29
|
|
29
30
|
module Google
|
30
31
|
module Cloud
|
@@ -33,11 +34,16 @@ module Google
|
|
33
34
|
##
|
34
35
|
# API for working with the system policy.
|
35
36
|
#
|
36
|
-
#
|
37
|
+
# @example Load this service and instantiate a gRPC client
|
37
38
|
#
|
38
39
|
# require "google/cloud/binary_authorization/v1/system_policy"
|
39
40
|
# client = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Client.new
|
40
41
|
#
|
42
|
+
# @example Load this service and instantiate a REST client
|
43
|
+
#
|
44
|
+
# require "google/cloud/binary_authorization/v1/system_policy/rest"
|
45
|
+
# client = ::Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Rest::Client.new
|
46
|
+
#
|
41
47
|
module SystemPolicy
|
42
48
|
end
|
43
49
|
end
|