google-cloud-binary_authorization-v1beta1 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +3 -3
  4. data/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/client.rb +10 -10
  5. data/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/rest/client.rb +837 -0
  6. data/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/rest/service_stub.rb +464 -0
  7. data/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service/rest.rb +58 -0
  8. data/lib/google/cloud/binary_authorization/v1beta1/binauthz_management_service.rb +7 -1
  9. data/lib/google/cloud/binary_authorization/v1beta1/rest.rb +38 -0
  10. data/lib/google/cloud/binary_authorization/v1beta1/system_policy/client.rb +6 -4
  11. data/lib/google/cloud/binary_authorization/v1beta1/system_policy/rest/client.rb +347 -0
  12. data/lib/google/cloud/binary_authorization/v1beta1/system_policy/rest/service_stub.rb +107 -0
  13. data/lib/google/cloud/binary_authorization/v1beta1/system_policy/rest.rb +52 -0
  14. data/lib/google/cloud/binary_authorization/v1beta1/system_policy.rb +7 -1
  15. data/lib/google/cloud/binary_authorization/v1beta1/version.rb +1 -1
  16. data/lib/google/cloud/binary_authorization/v1beta1.rb +7 -2
  17. data/lib/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging_pb.rb +25 -32
  18. data/lib/google/cloud/binaryauthorization/v1beta1/resources_pb.rb +25 -80
  19. data/lib/google/cloud/binaryauthorization/v1beta1/service_pb.rb +25 -33
  20. data/proto_docs/google/api/client.rb +381 -0
  21. data/proto_docs/google/api/launch_stage.rb +71 -0
  22. data/proto_docs/google/protobuf/duration.rb +98 -0
  23. data/proto_docs/google/protobuf/empty.rb +0 -2
  24. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  25. metadata +20 -8
@@ -0,0 +1,347 @@
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/v1beta1/service_pb"
21
+ require "google/cloud/binary_authorization/v1beta1/system_policy/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module BinaryAuthorization
26
+ module V1beta1
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::V1beta1::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::V1beta1::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", "V1beta1"]
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::V1beta1::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::V1beta1::SystemPolicy::Rest::Client.new
102
+ #
103
+ # # Create a client using a custom configuration
104
+ # client = ::Google::Cloud::BinaryAuthorization::V1beta1::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 == Configuration::DEFAULT_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::V1beta1::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::V1beta1::GetSystemPolicyRequest} or an equivalent Hash.
144
+ #
145
+ # @param request [::Google::Cloud::BinaryAuthorization::V1beta1::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::V1beta1::Policy]
161
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
162
+ #
163
+ # @return [::Google::Cloud::BinaryAuthorization::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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::V1beta1::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://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
240
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
241
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
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
+ DEFAULT_ENDPOINT = "binaryauthorization.googleapis.com"
275
+
276
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
277
+ config_attr :credentials, nil do |value|
278
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
279
+ allowed.any? { |klass| klass === value }
280
+ end
281
+ config_attr :scope, nil, ::String, ::Array, nil
282
+ config_attr :lib_name, nil, ::String, nil
283
+ config_attr :lib_version, nil, ::String, nil
284
+ config_attr :timeout, nil, ::Numeric, nil
285
+ config_attr :metadata, nil, ::Hash, nil
286
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
287
+ config_attr :quota_project, nil, ::String, nil
288
+
289
+ # @private
290
+ def initialize parent_config = nil
291
+ @parent_config = parent_config unless parent_config.nil?
292
+
293
+ yield self if block_given?
294
+ end
295
+
296
+ ##
297
+ # Configurations for individual RPCs
298
+ # @return [Rpcs]
299
+ #
300
+ def rpcs
301
+ @rpcs ||= begin
302
+ parent_rpcs = nil
303
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
304
+ Rpcs.new parent_rpcs
305
+ end
306
+ end
307
+
308
+ ##
309
+ # Configuration RPC class for the SystemPolicy API.
310
+ #
311
+ # Includes fields providing the configuration for each RPC in this service.
312
+ # Each configuration object is of type `Gapic::Config::Method` and includes
313
+ # the following configuration fields:
314
+ #
315
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
316
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
317
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
318
+ # include the following keys:
319
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
320
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
321
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
322
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
323
+ # trigger a retry.
324
+ #
325
+ class Rpcs
326
+ ##
327
+ # RPC-specific configuration for `get_system_policy`
328
+ # @return [::Gapic::Config::Method]
329
+ #
330
+ attr_reader :get_system_policy
331
+
332
+ # @private
333
+ def initialize parent_rpcs = nil
334
+ get_system_policy_config = parent_rpcs.get_system_policy if parent_rpcs.respond_to? :get_system_policy
335
+ @get_system_policy = ::Gapic::Config::Method.new get_system_policy_config
336
+
337
+ yield self if block_given?
338
+ end
339
+ end
340
+ end
341
+ end
342
+ end
343
+ end
344
+ end
345
+ end
346
+ end
347
+ 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/v1beta1/service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module BinaryAuthorization
24
+ module V1beta1
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::V1beta1::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::V1beta1::Policy]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::BinaryAuthorization::V1beta1::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::V1beta1::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::V1beta1::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: "/v1beta1/{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/v1beta1/version"
24
+
25
+ require "google/cloud/binary_authorization/v1beta1/system_policy/credentials"
26
+ require "google/cloud/binary_authorization/v1beta1/system_policy/paths"
27
+ require "google/cloud/binary_authorization/v1beta1/system_policy/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module BinaryAuthorization
32
+ module V1beta1
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/v1beta1/system_policy/rest"
39
+ # client = ::Google::Cloud::BinaryAuthorization::V1beta1::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/v1beta1/system_policy/rest/helpers" if ::File.file? helper_path
@@ -25,6 +25,7 @@ require "google/cloud/binary_authorization/v1beta1/version"
25
25
  require "google/cloud/binary_authorization/v1beta1/system_policy/credentials"
26
26
  require "google/cloud/binary_authorization/v1beta1/system_policy/paths"
27
27
  require "google/cloud/binary_authorization/v1beta1/system_policy/client"
28
+ require "google/cloud/binary_authorization/v1beta1/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
- # To load this service and instantiate a client:
37
+ # @example Load this service and instantiate a gRPC client
37
38
  #
38
39
  # require "google/cloud/binary_authorization/v1beta1/system_policy"
39
40
  # client = ::Google::Cloud::BinaryAuthorization::V1beta1::SystemPolicy::Client.new
40
41
  #
42
+ # @example Load this service and instantiate a REST client
43
+ #
44
+ # require "google/cloud/binary_authorization/v1beta1/system_policy/rest"
45
+ # client = ::Google::Cloud::BinaryAuthorization::V1beta1::SystemPolicy::Rest::Client.new
46
+ #
41
47
  module SystemPolicy
42
48
  end
43
49
  end
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module BinaryAuthorization
23
23
  module V1beta1
24
- VERSION = "0.6.0"
24
+ VERSION = "0.8.0"
25
25
  end
26
26
  end
27
27
  end
@@ -24,13 +24,18 @@ module Google
24
24
  module Cloud
25
25
  module BinaryAuthorization
26
26
  ##
27
- # To load this package, including all its services, and instantiate a client:
27
+ # API client module.
28
28
  #
29
- # @example
29
+ # @example Load this package, including all its services, and instantiate a gRPC client
30
30
  #
31
31
  # require "google/cloud/binary_authorization/v1beta1"
32
32
  # client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new
33
33
  #
34
+ # @example Load this package, including all its services, and instantiate a REST client
35
+ #
36
+ # require "google/cloud/binary_authorization/v1beta1"
37
+ # client = ::Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Rest::Client.new
38
+ #
34
39
  module V1beta1
35
40
  end
36
41
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto
3
4
 
@@ -5,40 +6,32 @@ require 'google/protobuf'
5
6
 
6
7
  require 'google/protobuf/timestamp_pb'
7
8
 
8
- Google::Protobuf::DescriptorPool.generated_pool.build do
9
- add_file("google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto", :syntax => :proto3) do
10
- add_message "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent" do
11
- oneof :event_type do
12
- optional :pod_event, :message, 1, "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent"
13
- optional :unsupported_policy_event, :message, 2, "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent"
14
- end
15
- end
16
- add_message "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent" do
17
- optional :pod_namespace, :string, 7
18
- optional :pod, :string, 1
19
- optional :deploy_time, :message, 2, "google.protobuf.Timestamp"
20
- optional :end_time, :message, 3, "google.protobuf.Timestamp"
21
- optional :verdict, :enum, 4, "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict"
22
- repeated :images, :message, 5, "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails"
23
- end
24
- add_message "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails" do
25
- optional :image, :string, 1
26
- optional :result, :enum, 2, "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult"
27
- optional :description, :string, 3
28
- end
29
- add_enum "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult" do
30
- value :AUDIT_RESULT_UNSPECIFIED, 0
31
- value :ALLOW, 1
32
- value :DENY, 2
33
- end
34
- add_enum "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict" do
35
- value :POLICY_CONFORMANCE_VERDICT_UNSPECIFIED, 0
36
- value :VIOLATES_POLICY, 1
37
- end
38
- add_message "google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent" do
39
- optional :description, :string, 1
9
+
10
+ descriptor_data = "\nLgoogle/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto\x12(google.cloud.binaryauthorization.v1beta1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdf\x08\n\x19\x43ontinuousValidationEvent\x12u\n\tpod_event\x18\x01 \x01(\x0b\x32`.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEventH\x00\x12~\n\x18unsupported_policy_event\x18\x02 \x01(\x0b\x32Z.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEventH\x00\x1a\x8d\x06\n\x1c\x43ontinuousValidationPodEvent\x12\x15\n\rpod_namespace\x18\x07 \x01(\t\x12\x0b\n\x03pod\x18\x01 \x01(\t\x12/\n\x0b\x64\x65ploy_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x8a\x01\n\x07verdict\x18\x04 \x01(\x0e\x32y.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict\x12}\n\x06images\x18\x05 \x03(\x0b\x32m.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails\x1a\x80\x02\n\x0cImageDetails\x12\r\n\x05image\x18\x01 \x01(\t\x12\x89\x01\n\x06result\x18\x02 \x01(\x0e\x32y.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"@\n\x0b\x41uditResult\x12\x1c\n\x18\x41UDIT_RESULT_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x08\n\x04\x44\x45NY\x10\x02\"[\n\x18PolicyConformanceVerdict\x12*\n&POLICY_CONFORMANCE_VERDICT_UNSPECIFIED\x10\x00\x12\x13\n\x0fVIOLATES_POLICY\x10\x01\x1a-\n\x16UnsupportedPolicyEvent\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x0c\n\nevent_typeB\xb9\x02\n,com.google.cloud.binaryauthorization.v1beta1B ContinuousValidationLoggingProtoP\x01Z^cloud.google.com/go/binaryauthorization/apiv1beta1/binaryauthorizationpb;binaryauthorizationpb\xf8\x01\x01\xaa\x02(Google.Cloud.BinaryAuthorization.V1Beta1\xca\x02(Google\\Cloud\\BinaryAuthorization\\V1beta1\xea\x02+Google::Cloud::BinaryAuthorization::V1beta1b\x06proto3"
11
+
12
+ pool = Google::Protobuf::DescriptorPool.generated_pool
13
+
14
+ begin
15
+ pool.add_serialized_file(descriptor_data)
16
+ rescue TypeError => e
17
+ # Compatibility code: will be removed in the next major version.
18
+ require 'google/protobuf/descriptor_pb'
19
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
20
+ parsed.clear_dependency
21
+ serialized = parsed.class.encode(parsed)
22
+ file = pool.add_serialized_file(serialized)
23
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
24
+ imports = [
25
+ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
26
+ ]
27
+ imports.each do |type_name, expected_filename|
28
+ import_file = pool.lookup(type_name).file_descriptor
29
+ if import_file.name != expected_filename
30
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
40
31
  end
41
32
  end
33
+ warn "Each proto file must use a consistent fully-qualified name."
34
+ warn "This will become an error in the next major version."
42
35
  end
43
36
 
44
37
  module Google