google-cloud-billing-budgets-v1beta1 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac413997a5db38cc8f07c1ef163a1840aee67e06d297379618cb19515e008b7f
4
- data.tar.gz: a32ee7cefeaec2b8945b538651ff382ccb5d23947ef6218ca9f22d2b016f70d8
3
+ metadata.gz: c4badac2138751dfb6780b92528c27c252a048de5cd554984be203077a6405f7
4
+ data.tar.gz: 99177c43d56b0a34d29a78c13515dbfb9831b668013588714be4536e6c6bb709
5
5
  SHA512:
6
- metadata.gz: 6a6a063becdc430df8fdd892f9872b749e48eec7e0241dc4667b0439b97ff8cf6776a6b9e72ed8feefc2eecec83955e0fd066f89e231a2863f8b4fa769e4b590
7
- data.tar.gz: 944244f816c745c1bb6da34655f9c8c24c56daf4da431ab2640f15c95011419104de8451bea5dde822313e675e58b22dd002ea59b7aca7890a819da03ce4cc72
6
+ metadata.gz: 206e09bc98dbc34cb97c0b7b4f6daf9f5a3126067a71261c142a1112f65b8ed70f90c747a987e4cab170cdbd86528813a08c262130be04b62c23064e68c0ef45
7
+ data.tar.gz: aab230497608c4ec1ce5142e4316720dc0f5273fb9fdc24941daa9ee6316943fbaef8aa907ef68dfeb6f3a660a7244e7ffc514fc18e15af3fdc0d8d9b00aa878
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/billing/docs/how-to/budget-api-overview)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/billing/budgets/v1beta1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -32,6 +32,9 @@ module Google
32
32
  # budget plan and rules to execute as we track spend against that plan.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
35
38
  # @private
36
39
  DEFAULT_ENDPOINT_TEMPLATE = "billingbudgets.$UNIVERSE_DOMAIN$"
37
40
 
@@ -178,8 +181,28 @@ module Google
178
181
  universe_domain: @config.universe_domain,
179
182
  channel_args: @config.channel_args,
180
183
  interceptors: @config.interceptors,
181
- channel_pool_config: @config.channel_pool
184
+ channel_pool_config: @config.channel_pool,
185
+ logger: @config.logger
182
186
  )
187
+
188
+ @budget_service_stub.stub_logger&.info do |entry|
189
+ entry.set_system_name
190
+ entry.set_service
191
+ entry.message = "Created client for #{entry.service}"
192
+ entry.set_credentials_fields credentials
193
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
194
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
195
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
196
+ end
197
+ end
198
+
199
+ ##
200
+ # The logger used for request/response debug logging.
201
+ #
202
+ # @return [Logger]
203
+ #
204
+ def logger
205
+ @budget_service_stub.logger
183
206
  end
184
207
 
185
208
  # Service calls
@@ -244,10 +267,11 @@ module Google
244
267
  # Customize the options with defaults
245
268
  metadata = @config.rpcs.create_budget.metadata.to_h
246
269
 
247
- # Set x-goog-api-client and x-goog-user-project headers
270
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
248
271
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
249
272
  lib_name: @config.lib_name, lib_version: @config.lib_version,
250
273
  gapic_version: ::Google::Cloud::Billing::Budgets::V1beta1::VERSION
274
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
251
275
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
252
276
 
253
277
  header_params = {}
@@ -268,7 +292,6 @@ module Google
268
292
 
269
293
  @budget_service_stub.call_rpc :create_budget, request, options: options do |response, operation|
270
294
  yield response, operation if block_given?
271
- return response
272
295
  end
273
296
  rescue ::GRPC::BadStatus => e
274
297
  raise ::Google::Cloud::Error.from_error(e)
@@ -341,10 +364,11 @@ module Google
341
364
  # Customize the options with defaults
342
365
  metadata = @config.rpcs.update_budget.metadata.to_h
343
366
 
344
- # Set x-goog-api-client and x-goog-user-project headers
367
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
345
368
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
346
369
  lib_name: @config.lib_name, lib_version: @config.lib_version,
347
370
  gapic_version: ::Google::Cloud::Billing::Budgets::V1beta1::VERSION
371
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
348
372
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
349
373
 
350
374
  header_params = {}
@@ -365,7 +389,6 @@ module Google
365
389
 
366
390
  @budget_service_stub.call_rpc :update_budget, request, options: options do |response, operation|
367
391
  yield response, operation if block_given?
368
- return response
369
392
  end
370
393
  rescue ::GRPC::BadStatus => e
371
394
  raise ::Google::Cloud::Error.from_error(e)
@@ -432,10 +455,11 @@ module Google
432
455
  # Customize the options with defaults
433
456
  metadata = @config.rpcs.get_budget.metadata.to_h
434
457
 
435
- # Set x-goog-api-client and x-goog-user-project headers
458
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
436
459
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
437
460
  lib_name: @config.lib_name, lib_version: @config.lib_version,
438
461
  gapic_version: ::Google::Cloud::Billing::Budgets::V1beta1::VERSION
462
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
439
463
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
440
464
 
441
465
  header_params = {}
@@ -456,7 +480,6 @@ module Google
456
480
 
457
481
  @budget_service_stub.call_rpc :get_budget, request, options: options do |response, operation|
458
482
  yield response, operation if block_given?
459
- return response
460
483
  end
461
484
  rescue ::GRPC::BadStatus => e
462
485
  raise ::Google::Cloud::Error.from_error(e)
@@ -541,10 +564,11 @@ module Google
541
564
  # Customize the options with defaults
542
565
  metadata = @config.rpcs.list_budgets.metadata.to_h
543
566
 
544
- # Set x-goog-api-client and x-goog-user-project headers
567
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
545
568
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
546
569
  lib_name: @config.lib_name, lib_version: @config.lib_version,
547
570
  gapic_version: ::Google::Cloud::Billing::Budgets::V1beta1::VERSION
571
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
548
572
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
549
573
 
550
574
  header_params = {}
@@ -566,7 +590,7 @@ module Google
566
590
  @budget_service_stub.call_rpc :list_budgets, request, options: options do |response, operation|
567
591
  response = ::Gapic::PagedEnumerable.new @budget_service_stub, :list_budgets, request, response, operation, options
568
592
  yield response, operation if block_given?
569
- return response
593
+ throw :response, response
570
594
  end
571
595
  rescue ::GRPC::BadStatus => e
572
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -628,10 +652,11 @@ module Google
628
652
  # Customize the options with defaults
629
653
  metadata = @config.rpcs.delete_budget.metadata.to_h
630
654
 
631
- # Set x-goog-api-client and x-goog-user-project headers
655
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
632
656
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
633
657
  lib_name: @config.lib_name, lib_version: @config.lib_version,
634
658
  gapic_version: ::Google::Cloud::Billing::Budgets::V1beta1::VERSION
659
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
635
660
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
636
661
 
637
662
  header_params = {}
@@ -652,7 +677,6 @@ module Google
652
677
 
653
678
  @budget_service_stub.call_rpc :delete_budget, request, options: options do |response, operation|
654
679
  yield response, operation if block_given?
655
- return response
656
680
  end
657
681
  rescue ::GRPC::BadStatus => e
658
682
  raise ::Google::Cloud::Error.from_error(e)
@@ -741,6 +765,11 @@ module Google
741
765
  # default endpoint URL. The default value of nil uses the environment
742
766
  # universe (usually the default "googleapis.com" universe).
743
767
  # @return [::String,nil]
768
+ # @!attribute [rw] logger
769
+ # A custom logger to use for request/response debug logging, or the value
770
+ # `:default` (the default) to construct a default logger, or `nil` to
771
+ # explicitly disable logging.
772
+ # @return [::Logger,:default,nil]
744
773
  #
745
774
  class Configuration
746
775
  extend ::Gapic::Config
@@ -765,6 +794,7 @@ module Google
765
794
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
766
795
  config_attr :quota_project, nil, ::String, nil
767
796
  config_attr :universe_domain, nil, ::String, nil
797
+ config_attr :logger, :default, ::Logger, nil, :default
768
798
 
769
799
  # @private
770
800
  def initialize parent_config = nil
@@ -22,7 +22,7 @@ module Google
22
22
  module Billing
23
23
  module Budgets
24
24
  module V1beta1
25
- VERSION = "0.12.0"
25
+ VERSION = "0.13.0"
26
26
  end
27
27
  end
28
28
  end
@@ -28,6 +28,9 @@ module Google
28
28
  # @!attribute [rw] destinations
29
29
  # @return [::Array<::Google::Api::ClientLibraryDestination>]
30
30
  # The destination where API teams want this client library to be published.
31
+ # @!attribute [rw] selective_gapic_generation
32
+ # @return [::Google::Api::SelectiveGapicGeneration]
33
+ # Configuration for which RPCs should be generated in the GAPIC client.
31
34
  class CommonLanguageSettings
32
35
  include ::Google::Protobuf::MessageExts
33
36
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -118,6 +121,10 @@ module Google
118
121
  # @return [::String]
119
122
  # Optional link to proto reference documentation. Example:
120
123
  # https://cloud.google.com/pubsub/lite/docs/reference/rpc
124
+ # @!attribute [rw] rest_reference_documentation_uri
125
+ # @return [::String]
126
+ # Optional link to REST reference documentation. Example:
127
+ # https://cloud.google.com/pubsub/lite/docs/reference/rest
121
128
  class Publishing
122
129
  include ::Google::Protobuf::MessageExts
123
130
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -192,9 +199,32 @@ module Google
192
199
  # @!attribute [rw] common
193
200
  # @return [::Google::Api::CommonLanguageSettings]
194
201
  # Some settings.
202
+ # @!attribute [rw] experimental_features
203
+ # @return [::Google::Api::PythonSettings::ExperimentalFeatures]
204
+ # Experimental features to be included during client library generation.
195
205
  class PythonSettings
196
206
  include ::Google::Protobuf::MessageExts
197
207
  extend ::Google::Protobuf::MessageExts::ClassMethods
208
+
209
+ # Experimental features to be included during client library generation.
210
+ # These fields will be deprecated once the feature graduates and is enabled
211
+ # by default.
212
+ # @!attribute [rw] rest_async_io_enabled
213
+ # @return [::Boolean]
214
+ # Enables generation of asynchronous REST clients if `rest` transport is
215
+ # enabled. By default, asynchronous REST clients will not be generated.
216
+ # This feature will be enabled by default 1 month after launching the
217
+ # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
224
+ class ExperimentalFeatures
225
+ include ::Google::Protobuf::MessageExts
226
+ extend ::Google::Protobuf::MessageExts::ClassMethods
227
+ end
198
228
  end
199
229
 
200
230
  # Settings for Node client libraries.
@@ -276,9 +306,28 @@ module Google
276
306
  # @!attribute [rw] common
277
307
  # @return [::Google::Api::CommonLanguageSettings]
278
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
279
319
  class GoSettings
280
320
  include ::Google::Protobuf::MessageExts
281
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
282
331
  end
283
332
 
284
333
  # Describes the generator configuration for a method.
@@ -286,6 +335,13 @@ module Google
286
335
  # @return [::String]
287
336
  # The fully qualified name of the method, for which the options below apply.
288
337
  # This is used to find the method to apply the options.
338
+ #
339
+ # Example:
340
+ #
341
+ # publishing:
342
+ # method_settings:
343
+ # - selector: google.storage.control.v2.StorageControl.CreateFolder
344
+ # # method settings for CreateFolder...
289
345
  # @!attribute [rw] long_running
290
346
  # @return [::Google::Api::MethodSettings::LongRunning]
291
347
  # Describes settings to use for long-running operations when generating
@@ -294,17 +350,14 @@ module Google
294
350
  #
295
351
  # Example of a YAML configuration::
296
352
  #
297
- # publishing:
298
- # method_settings:
353
+ # publishing:
354
+ # method_settings:
299
355
  # - selector: google.cloud.speech.v2.Speech.BatchRecognize
300
356
  # long_running:
301
- # initial_poll_delay:
302
- # seconds: 60 # 1 minute
357
+ # initial_poll_delay: 60s # 1 minute
303
358
  # poll_delay_multiplier: 1.5
304
- # max_poll_delay:
305
- # seconds: 360 # 6 minutes
306
- # total_poll_timeout:
307
- # seconds: 54000 # 90 minutes
359
+ # max_poll_delay: 360s # 6 minutes
360
+ # total_poll_timeout: 54000s # 90 minutes
308
361
  # @!attribute [rw] auto_populated_fields
309
362
  # @return [::Array<::String>]
310
363
  # List of top-level fields of the request message, that should be
@@ -313,8 +366,8 @@ module Google
313
366
  #
314
367
  # Example of a YAML configuration:
315
368
  #
316
- # publishing:
317
- # method_settings:
369
+ # publishing:
370
+ # method_settings:
318
371
  # - selector: google.example.v1.ExampleService.CreateExample
319
372
  # auto_populated_fields:
320
373
  # - request_id
@@ -350,6 +403,17 @@ module Google
350
403
  end
351
404
  end
352
405
 
406
+ # This message is used to configure the generation of a subset of the RPCs in
407
+ # a service for client libraries.
408
+ # @!attribute [rw] methods
409
+ # @return [::Array<::String>]
410
+ # An allowlist of the fully qualified names of RPCs that should be included
411
+ # on public client surfaces.
412
+ class SelectiveGapicGeneration
413
+ include ::Google::Protobuf::MessageExts
414
+ extend ::Google::Protobuf::MessageExts::ClassMethods
415
+ end
416
+
353
417
  # The organization for which the client libraries are being published.
354
418
  # Affects the url where generated docs are published, etc.
355
419
  module ClientLibraryOrganization
@@ -124,8 +124,13 @@ module Google
124
124
  # @return [::String]
125
125
  # The plural name used in the resource name and permission names, such as
126
126
  # 'projects' for the resource name of 'projects/\\{project}' and the permission
127
- # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
128
- # concept of the `plural` field in k8s CRD spec
127
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
128
+ # to this is for Nested Collections that have stuttering names, as defined
129
+ # in [AIP-122](https://google.aip.dev/122#nested-collections), where the
130
+ # collection ID in the resource name pattern does not necessarily directly
131
+ # match the `plural` value.
132
+ #
133
+ # It is the same concept of the `plural` field in k8s CRD spec
129
134
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
130
135
  #
131
136
  # Note: The plural form is required even for singleton resources. See
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-billing-budgets-v1beta1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-26 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.1
19
+ version: 0.24.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.21.1
29
+ version: 0.24.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  requirements: []
102
- rubygems_version: 3.5.6
102
+ rubygems_version: 3.5.23
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: The Cloud Billing Budget API stores Cloud Billing budgets, which define a