google-cloud-billing-budgets-v1beta1 0.5.0 → 0.6.3

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: 8b29b0eec5f8684e7a46dbd8cfed7cf761669abd1d9cf1e5a7f9c74900b7dfd2
4
- data.tar.gz: 2728272dae7981e0223524967184928c14f82cc99eae310774e49ba4c75fd9cc
3
+ metadata.gz: f61b90907e8f6657d0ff0fa4ca319f8891697c149953328e5a758de53a2968dd
4
+ data.tar.gz: f821c2fcaaa363b15818f8b3e54245cf7c2d7b899c88a2613729d0caf752b56d
5
5
  SHA512:
6
- metadata.gz: 1c6b468271b79eba0862a14d414bfd2892ed6f1408519aa16ec9b749f928aa2d57067f4c1c227ad523bbc029cc4b938e5021086e8e8248e44f7764b80b793ea7
7
- data.tar.gz: f9122d34bee7eae3bf6ae43cc54670de56fcdefd115193d35be63589cab8cac48cad3b91fcc0f4858f717ecd1a1a6bd8d1e710eaf97653c484cbaef8db19e0c4
6
+ metadata.gz: e05e9c4062902b494ae679597d535fd73f8d82f7ef62c8eb2e8b050d397554f808d2b2e8728d2b9510d5b2fa8799efbcfd0c4f8d3ddc84f3998d04fd5a58213b
7
+ data.tar.gz: 38e15bc18d8f793aaf45217d637126cb733bf0bd2172be666cf667204498e8e52bc0a2608a2130d7bbc68a0b01b5e2094941affe6d155885eda3e066442e36c9
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-billing-budgets-v1beta1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Credentials}):
68
68
 
69
- 1. `BILLING_BUDGETS_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `BILLING_BUDGETS_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `BILLING_BUDGETS_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `BILLING_BUDGETS_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/billing/budgets/v1beta1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/billing/budgets/v1beta1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new d
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/billing/budgets/v1beta1"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/billing/budgets/v1beta1"
34
34
 
35
35
  client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::Billing::Budgets::V1beta1::CreateBudgetRequest.new # (request fields as keyword arguments...)
37
37
  response = client.create_budget request
38
38
  ```
39
39
 
@@ -1,12 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/billing/budgets/v1beta1/budget_model.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/field_behavior_pb'
7
5
  require 'google/api/resource_pb'
8
6
  require 'google/protobuf/struct_pb'
7
+ require 'google/type/date_pb'
9
8
  require 'google/type/money_pb'
9
+ require 'google/protobuf'
10
+
10
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
12
  add_file("google/cloud/billing/budgets/v1beta1/budget_model.proto", :syntax => :proto3) do
12
13
  add_message "google.cloud.billing.budgets.v1beta1.Budget" do
@@ -48,6 +49,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
48
49
  repeated :services, :string, 3
49
50
  repeated :subaccounts, :string, 5
50
51
  map :labels, :string, :message, 6, "google.protobuf.ListValue"
52
+ oneof :usage_period do
53
+ optional :calendar_period, :enum, 8, "google.cloud.billing.budgets.v1beta1.CalendarPeriod"
54
+ optional :custom_period, :message, 9, "google.cloud.billing.budgets.v1beta1.CustomPeriod"
55
+ end
51
56
  end
52
57
  add_enum "google.cloud.billing.budgets.v1beta1.Filter.CreditTypesTreatment" do
53
58
  value :CREDIT_TYPES_TREATMENT_UNSPECIFIED, 0
@@ -55,6 +60,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
55
60
  value :EXCLUDE_ALL_CREDITS, 2
56
61
  value :INCLUDE_SPECIFIED_CREDITS, 3
57
62
  end
63
+ add_message "google.cloud.billing.budgets.v1beta1.CustomPeriod" do
64
+ optional :start_date, :message, 1, "google.type.Date"
65
+ optional :end_date, :message, 2, "google.type.Date"
66
+ end
67
+ add_enum "google.cloud.billing.budgets.v1beta1.CalendarPeriod" do
68
+ value :CALENDAR_PERIOD_UNSPECIFIED, 0
69
+ value :MONTH, 1
70
+ value :QUARTER, 2
71
+ value :YEAR, 3
72
+ end
58
73
  end
59
74
  end
60
75
 
@@ -71,6 +86,8 @@ module Google
71
86
  AllUpdatesRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.budgets.v1beta1.AllUpdatesRule").msgclass
72
87
  Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.budgets.v1beta1.Filter").msgclass
73
88
  Filter::CreditTypesTreatment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.budgets.v1beta1.Filter.CreditTypesTreatment").enummodule
89
+ CustomPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.budgets.v1beta1.CustomPeriod").msgclass
90
+ CalendarPeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.budgets.v1beta1.CalendarPeriod").enummodule
74
91
  end
75
92
  end
76
93
  end
@@ -43,13 +43,12 @@ module Google
43
43
  # See {::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client::Configuration}
44
44
  # for a description of the configuration fields.
45
45
  #
46
- # ## Example
46
+ # @example
47
47
  #
48
- # To modify the configuration for all BudgetService clients:
49
- #
50
- # ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.configure do |config|
51
- # config.timeout = 10.0
52
- # end
48
+ # # Modify the configuration for all BudgetService clients
49
+ # ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
53
52
  #
54
53
  # @yield [config] Configure the Client client.
55
54
  # @yieldparam config [Client::Configuration]
@@ -71,34 +70,22 @@ module Google
71
70
 
72
71
  default_config.rpcs.update_budget.timeout = 60.0
73
72
  default_config.rpcs.update_budget.retry_policy = {
74
- initial_delay: 0.1,
75
- max_delay: 60.0,
76
- multiplier: 1.3,
77
- retry_codes: [4, 14]
73
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
78
74
  }
79
75
 
80
76
  default_config.rpcs.get_budget.timeout = 60.0
81
77
  default_config.rpcs.get_budget.retry_policy = {
82
- initial_delay: 0.1,
83
- max_delay: 60.0,
84
- multiplier: 1.3,
85
- retry_codes: [4, 14]
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
79
  }
87
80
 
88
81
  default_config.rpcs.list_budgets.timeout = 60.0
89
82
  default_config.rpcs.list_budgets.retry_policy = {
90
- initial_delay: 0.1,
91
- max_delay: 60.0,
92
- multiplier: 1.3,
93
- retry_codes: [4, 14]
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
94
84
  }
95
85
 
96
86
  default_config.rpcs.delete_budget.timeout = 60.0
97
87
  default_config.rpcs.delete_budget.retry_policy = {
98
- initial_delay: 0.1,
99
- max_delay: 60.0,
100
- multiplier: 1.3,
101
- retry_codes: [4, 14]
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
102
89
  }
103
90
 
104
91
  default_config
@@ -130,19 +117,15 @@ module Google
130
117
  ##
131
118
  # Create a new BudgetService client object.
132
119
  #
133
- # ## Examples
134
- #
135
- # To create a new BudgetService client with the default
136
- # configuration:
137
- #
138
- # client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new
120
+ # @example
139
121
  #
140
- # To create a new BudgetService client with a custom
141
- # configuration:
122
+ # # Create a client using the default configuration
123
+ # client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new
142
124
  #
143
- # client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new do |config|
144
- # config.timeout = 10.0
145
- # end
125
+ # # Create a client using a custom configuration
126
+ # client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new do |config|
127
+ # config.timeout = 10.0
128
+ # end
146
129
  #
147
130
  # @yield [config] Configure the BudgetService client.
148
131
  # @yieldparam config [Client::Configuration]
@@ -162,14 +145,13 @@ module Google
162
145
 
163
146
  # Create credentials
164
147
  credentials = @config.credentials
165
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
148
+ # Use self-signed JWT if the endpoint is unchanged from default,
166
149
  # but only if the default endpoint does not have a region prefix.
167
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
168
- @config.endpoint == Client.configure.endpoint &&
150
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
169
151
  !@config.endpoint.split(".").first.include?("-")
170
152
  credentials ||= Credentials.default scope: @config.scope,
171
153
  enable_self_signed_jwt: enable_self_signed_jwt
172
- if credentials.is_a?(String) || credentials.is_a?(Hash)
154
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
173
155
  credentials = Credentials.new credentials, scope: @config.scope
174
156
  end
175
157
  @quota_project_id = @config.quota_project
@@ -220,6 +202,21 @@ module Google
220
202
  #
221
203
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
222
204
  #
205
+ # @example Basic example
206
+ # require "google/cloud/billing/budgets/v1beta1"
207
+ #
208
+ # # Create a client object. The client can be reused for multiple calls.
209
+ # client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new
210
+ #
211
+ # # Create a request. To set request fields, pass in keyword arguments.
212
+ # request = Google::Cloud::Billing::Budgets::V1beta1::CreateBudgetRequest.new
213
+ #
214
+ # # Call the create_budget method.
215
+ # result = client.create_budget request
216
+ #
217
+ # # The returned object is of type Google::Cloud::Billing::Budgets::V1beta1::Budget.
218
+ # p result
219
+ #
223
220
  def create_budget request, options = nil
224
221
  raise ::ArgumentError, "request must be provided" if request.nil?
225
222
 
@@ -237,16 +234,20 @@ module Google
237
234
  gapic_version: ::Google::Cloud::Billing::Budgets::V1beta1::VERSION
238
235
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
239
236
 
240
- header_params = {
241
- "parent" => request.parent
242
- }
237
+ header_params = {}
238
+ if request.parent
239
+ header_params["parent"] = request.parent
240
+ end
241
+
243
242
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
244
243
  metadata[:"x-goog-request-params"] ||= request_params_header
245
244
 
246
245
  options.apply_defaults timeout: @config.rpcs.create_budget.timeout,
247
246
  metadata: metadata,
248
247
  retry_policy: @config.rpcs.create_budget.retry_policy
249
- options.apply_defaults metadata: @config.metadata,
248
+
249
+ options.apply_defaults timeout: @config.timeout,
250
+ metadata: @config.metadata,
250
251
  retry_policy: @config.retry_policy
251
252
 
252
253
  @budget_service_stub.call_rpc :create_budget, request, options: options do |response, operation|
@@ -298,6 +299,21 @@ module Google
298
299
  #
299
300
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
300
301
  #
302
+ # @example Basic example
303
+ # require "google/cloud/billing/budgets/v1beta1"
304
+ #
305
+ # # Create a client object. The client can be reused for multiple calls.
306
+ # client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new
307
+ #
308
+ # # Create a request. To set request fields, pass in keyword arguments.
309
+ # request = Google::Cloud::Billing::Budgets::V1beta1::UpdateBudgetRequest.new
310
+ #
311
+ # # Call the update_budget method.
312
+ # result = client.update_budget request
313
+ #
314
+ # # The returned object is of type Google::Cloud::Billing::Budgets::V1beta1::Budget.
315
+ # p result
316
+ #
301
317
  def update_budget request, options = nil
302
318
  raise ::ArgumentError, "request must be provided" if request.nil?
303
319
 
@@ -315,16 +331,20 @@ module Google
315
331
  gapic_version: ::Google::Cloud::Billing::Budgets::V1beta1::VERSION
316
332
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
317
333
 
318
- header_params = {
319
- "budget.name" => request.budget.name
320
- }
334
+ header_params = {}
335
+ if request.budget&.name
336
+ header_params["budget.name"] = request.budget.name
337
+ end
338
+
321
339
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
322
340
  metadata[:"x-goog-request-params"] ||= request_params_header
323
341
 
324
342
  options.apply_defaults timeout: @config.rpcs.update_budget.timeout,
325
343
  metadata: metadata,
326
344
  retry_policy: @config.rpcs.update_budget.retry_policy
327
- options.apply_defaults metadata: @config.metadata,
345
+
346
+ options.apply_defaults timeout: @config.timeout,
347
+ metadata: @config.metadata,
328
348
  retry_policy: @config.retry_policy
329
349
 
330
350
  @budget_service_stub.call_rpc :update_budget, request, options: options do |response, operation|
@@ -370,6 +390,21 @@ module Google
370
390
  #
371
391
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
372
392
  #
393
+ # @example Basic example
394
+ # require "google/cloud/billing/budgets/v1beta1"
395
+ #
396
+ # # Create a client object. The client can be reused for multiple calls.
397
+ # client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new
398
+ #
399
+ # # Create a request. To set request fields, pass in keyword arguments.
400
+ # request = Google::Cloud::Billing::Budgets::V1beta1::GetBudgetRequest.new
401
+ #
402
+ # # Call the get_budget method.
403
+ # result = client.get_budget request
404
+ #
405
+ # # The returned object is of type Google::Cloud::Billing::Budgets::V1beta1::Budget.
406
+ # p result
407
+ #
373
408
  def get_budget request, options = nil
374
409
  raise ::ArgumentError, "request must be provided" if request.nil?
375
410
 
@@ -387,16 +422,20 @@ module Google
387
422
  gapic_version: ::Google::Cloud::Billing::Budgets::V1beta1::VERSION
388
423
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
389
424
 
390
- header_params = {
391
- "name" => request.name
392
- }
425
+ header_params = {}
426
+ if request.name
427
+ header_params["name"] = request.name
428
+ end
429
+
393
430
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
394
431
  metadata[:"x-goog-request-params"] ||= request_params_header
395
432
 
396
433
  options.apply_defaults timeout: @config.rpcs.get_budget.timeout,
397
434
  metadata: metadata,
398
435
  retry_policy: @config.rpcs.get_budget.retry_policy
399
- options.apply_defaults metadata: @config.metadata,
436
+
437
+ options.apply_defaults timeout: @config.timeout,
438
+ metadata: @config.metadata,
400
439
  retry_policy: @config.retry_policy
401
440
 
402
441
  @budget_service_stub.call_rpc :get_budget, request, options: options do |response, operation|
@@ -449,6 +488,27 @@ module Google
449
488
  #
450
489
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
451
490
  #
491
+ # @example Basic example
492
+ # require "google/cloud/billing/budgets/v1beta1"
493
+ #
494
+ # # Create a client object. The client can be reused for multiple calls.
495
+ # client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new
496
+ #
497
+ # # Create a request. To set request fields, pass in keyword arguments.
498
+ # request = Google::Cloud::Billing::Budgets::V1beta1::ListBudgetsRequest.new
499
+ #
500
+ # # Call the list_budgets method.
501
+ # result = client.list_budgets request
502
+ #
503
+ # # The returned object is of type Gapic::PagedEnumerable. You can
504
+ # # iterate over all elements by calling #each, and the enumerable
505
+ # # will lazily make API calls to fetch subsequent pages. Other
506
+ # # methods are also available for managing paging directly.
507
+ # result.each do |response|
508
+ # # Each element is of type ::Google::Cloud::Billing::Budgets::V1beta1::Budget.
509
+ # p response
510
+ # end
511
+ #
452
512
  def list_budgets request, options = nil
453
513
  raise ::ArgumentError, "request must be provided" if request.nil?
454
514
 
@@ -466,16 +526,20 @@ module Google
466
526
  gapic_version: ::Google::Cloud::Billing::Budgets::V1beta1::VERSION
467
527
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
468
528
 
469
- header_params = {
470
- "parent" => request.parent
471
- }
529
+ header_params = {}
530
+ if request.parent
531
+ header_params["parent"] = request.parent
532
+ end
533
+
472
534
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
473
535
  metadata[:"x-goog-request-params"] ||= request_params_header
474
536
 
475
537
  options.apply_defaults timeout: @config.rpcs.list_budgets.timeout,
476
538
  metadata: metadata,
477
539
  retry_policy: @config.rpcs.list_budgets.retry_policy
478
- options.apply_defaults metadata: @config.metadata,
540
+
541
+ options.apply_defaults timeout: @config.timeout,
542
+ metadata: @config.metadata,
479
543
  retry_policy: @config.retry_policy
480
544
 
481
545
  @budget_service_stub.call_rpc :list_budgets, request, options: options do |response, operation|
@@ -517,6 +581,21 @@ module Google
517
581
  #
518
582
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
519
583
  #
584
+ # @example Basic example
585
+ # require "google/cloud/billing/budgets/v1beta1"
586
+ #
587
+ # # Create a client object. The client can be reused for multiple calls.
588
+ # client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new
589
+ #
590
+ # # Create a request. To set request fields, pass in keyword arguments.
591
+ # request = Google::Cloud::Billing::Budgets::V1beta1::DeleteBudgetRequest.new
592
+ #
593
+ # # Call the delete_budget method.
594
+ # result = client.delete_budget request
595
+ #
596
+ # # The returned object is of type Google::Protobuf::Empty.
597
+ # p result
598
+ #
520
599
  def delete_budget request, options = nil
521
600
  raise ::ArgumentError, "request must be provided" if request.nil?
522
601
 
@@ -534,16 +613,20 @@ module Google
534
613
  gapic_version: ::Google::Cloud::Billing::Budgets::V1beta1::VERSION
535
614
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
536
615
 
537
- header_params = {
538
- "name" => request.name
539
- }
616
+ header_params = {}
617
+ if request.name
618
+ header_params["name"] = request.name
619
+ end
620
+
540
621
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
541
622
  metadata[:"x-goog-request-params"] ||= request_params_header
542
623
 
543
624
  options.apply_defaults timeout: @config.rpcs.delete_budget.timeout,
544
625
  metadata: metadata,
545
626
  retry_policy: @config.rpcs.delete_budget.retry_policy
546
- options.apply_defaults metadata: @config.metadata,
627
+
628
+ options.apply_defaults timeout: @config.timeout,
629
+ metadata: @config.metadata,
547
630
  retry_policy: @config.retry_policy
548
631
 
549
632
  @budget_service_stub.call_rpc :delete_budget, request, options: options do |response, operation|
@@ -567,22 +650,21 @@ module Google
567
650
  # Configuration can be applied globally to all clients, or to a single client
568
651
  # on construction.
569
652
  #
570
- # # Examples
571
- #
572
- # To modify the global config, setting the timeout for create_budget
573
- # to 20 seconds, and all remaining timeouts to 10 seconds:
574
- #
575
- # ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.configure do |config|
576
- # config.timeout = 10.0
577
- # config.rpcs.create_budget.timeout = 20.0
578
- # end
579
- #
580
- # To apply the above configuration only to a new client:
581
- #
582
- # client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new do |config|
583
- # config.timeout = 10.0
584
- # config.rpcs.create_budget.timeout = 20.0
585
- # end
653
+ # @example
654
+ #
655
+ # # Modify the global config, setting the timeout for
656
+ # # create_budget to 20 seconds,
657
+ # # and all remaining timeouts to 10 seconds.
658
+ # ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.configure do |config|
659
+ # config.timeout = 10.0
660
+ # config.rpcs.create_budget.timeout = 20.0
661
+ # end
662
+ #
663
+ # # Apply the above configuration only to a new client.
664
+ # client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new do |config|
665
+ # config.timeout = 10.0
666
+ # config.rpcs.create_budget.timeout = 20.0
667
+ # end
586
668
  #
587
669
  # @!attribute [rw] endpoint
588
670
  # The hostname or hostname:port of the service endpoint.
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/billing/budgets/v1beta1/budget_service.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -10,6 +8,8 @@ require 'google/api/resource_pb'
10
8
  require 'google/cloud/billing/budgets/v1beta1/budget_model_pb'
11
9
  require 'google/protobuf/empty_pb'
12
10
  require 'google/protobuf/field_mask_pb'
11
+ require 'google/protobuf'
12
+
13
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_file("google/cloud/billing/budgets/v1beta1/budget_service.proto", :syntax => :proto3) do
15
15
  add_message "google.cloud.billing.budgets.v1beta1.CreateBudgetRequest" do
@@ -29,7 +29,7 @@ module Google
29
29
  # budget plan and rules to execute as we track spend against that plan.
30
30
  class Service
31
31
 
32
- include GRPC::GenericService
32
+ include ::GRPC::GenericService
33
33
 
34
34
  self.marshal_class_method = :encode
35
35
  self.unmarshal_class_method = :decode
@@ -22,7 +22,7 @@ module Google
22
22
  module Billing
23
23
  module Budgets
24
24
  module V1beta1
25
- VERSION = "0.5.0"
25
+ VERSION = "0.6.3"
26
26
  end
27
27
  end
28
28
  end
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
@@ -25,8 +25,8 @@ module Google
25
25
  # A budget is a plan that describes what you expect to spend on Cloud
26
26
  # projects, plus the rules to execute as spend is tracked against that plan,
27
27
  # (for example, send an alert when 90% of the target spend is met).
28
- # Currently all plans are monthly budgets so the usage period(s) tracked are
29
- # implied (calendar months of usage back-to-back).
28
+ # The budget time period is configurable, with options such as month (default),
29
+ # quarter, year, or custom time period.
30
30
  # @!attribute [r] name
31
31
  # @return [::String]
32
32
  # Output only. Resource name of the budget.
@@ -38,8 +38,9 @@ module Google
38
38
  # Validation: <= 60 chars.
39
39
  # @!attribute [rw] budget_filter
40
40
  # @return [::Google::Cloud::Billing::Budgets::V1beta1::Filter]
41
- # Optional. Filters that define which resources are used to compute
42
- # the actual spend against the budget.
41
+ # Optional. Filters that define which resources are used to compute the
42
+ # actual spend against the budget amount, such as projects, services, and the
43
+ # budget's time period, as well as other filters.
43
44
  # @!attribute [rw] amount
44
45
  # @return [::Google::Cloud::Billing::Budgets::V1beta1::BudgetAmount]
45
46
  # Required. Budgeted amount.
@@ -67,21 +68,29 @@ module Google
67
68
  # A specified amount to use as the budget.
68
69
  # `currency_code` is optional. If specified when creating a budget, it must
69
70
  # match the currency of the billing account. If specified when updating a
70
- # budget, it must match the existing budget currency_code.
71
+ # budget, it must match the currency_code of the existing budget.
71
72
  # The `currency_code` is provided on output.
72
73
  # @!attribute [rw] last_period_amount
73
74
  # @return [::Google::Cloud::Billing::Budgets::V1beta1::LastPeriodAmount]
74
75
  # Use the last period's actual spend as the budget for the present period.
76
+ # LastPeriodAmount can only be set when the budget's time period is a
77
+ # {::Google::Cloud::Billing::Budgets::V1beta1::Filter#calendar_period Filter.calendar_period}.
78
+ # It cannot be set in combination with
79
+ # {::Google::Cloud::Billing::Budgets::V1beta1::Filter#custom_period Filter.custom_period}.
75
80
  class BudgetAmount
76
81
  include ::Google::Protobuf::MessageExts
77
82
  extend ::Google::Protobuf::MessageExts::ClassMethods
78
83
  end
79
84
 
80
- # Describes a budget amount targeted to last period's spend.
81
- # At this time, the amount is automatically 100% of last period's spend;
82
- # that is, there are no other options yet.
83
- # Future configuration will be described here (for example, configuring a
84
- # percentage of last period's spend).
85
+ # Describes a budget amount targeted to the last
86
+ # {::Google::Cloud::Billing::Budgets::V1beta1::Filter#calendar_period Filter.calendar_period}
87
+ # spend. At this time, the amount is automatically 100% of the last calendar
88
+ # period's spend; that is, there are no other options yet.
89
+ # Future configuration options will be described here (for example, configuring
90
+ # a percentage of last period's spend).
91
+ # LastPeriodAmount cannot be set for a budget configured with
92
+ # a
93
+ # {::Google::Cloud::Billing::Budgets::V1beta1::Filter#custom_period Filter.custom_period}.
85
94
  class LastPeriodAmount
86
95
  include ::Google::Protobuf::MessageExts
87
96
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -117,6 +126,10 @@ module Google
117
126
 
118
127
  # Use forecasted spend for the period as the basis for comparison against
119
128
  # the threshold.
129
+ # FORECASTED_SPEND can only be set when the budget's time period is a
130
+ # {::Google::Cloud::Billing::Budgets::V1beta1::Filter#calendar_period Filter.calendar_period}.
131
+ # It cannot be set in combination with
132
+ # {::Google::Cloud::Billing::Budgets::V1beta1::Filter#custom_period Filter.custom_period}.
120
133
  FORECASTED_SPEND = 2
121
134
  end
122
135
  end
@@ -129,12 +142,12 @@ module Google
129
142
  # be published, in the form `projects/{project_id}/topics/{topic_id}`.
130
143
  # Updates are sent at regular intervals to the topic. The topic needs to be
131
144
  # created before the budget is created; see
132
- # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
145
+ # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
133
146
  # for more details.
134
147
  # Caller is expected to have
135
148
  # `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
136
149
  # budget, otherwise, the API call will fail with PERMISSION_DENIED. See
137
- # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
150
+ # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#permissions_required_for_this_task
138
151
  # for more details on Pub/Sub roles and permissions.
139
152
  # @!attribute [rw] schema_version
140
153
  # @return [::String]
@@ -179,13 +192,12 @@ module Google
179
192
  # {::Google::Cloud::Billing::Budgets::V1beta1::Filter#credit_types_treatment Filter.credit_types_treatment}
180
193
  # is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be
181
194
  # subtracted from gross cost to determine the spend for threshold
182
- # calculations.
195
+ # calculations. See [a list of acceptable credit type
196
+ # values](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type).
183
197
  #
184
198
  # If
185
199
  # {::Google::Cloud::Billing::Budgets::V1beta1::Filter#credit_types_treatment Filter.credit_types_treatment}
186
- # is **not** INCLUDE_SPECIFIED_CREDITS, this field must be empty. See [a list
187
- # of acceptable credit type
188
- # values](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type).
200
+ # is **not** INCLUDE_SPECIFIED_CREDITS, this field must be empty.
189
201
  # @!attribute [rw] credit_types_treatment
190
202
  # @return [::Google::Cloud::Billing::Budgets::V1beta1::Filter::CreditTypesTreatment]
191
203
  # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
@@ -211,6 +223,18 @@ module Google
211
223
  # this set of labeled resources should be included in the budget. Currently,
212
224
  # multiple entries or multiple values per entry are not allowed. If omitted,
213
225
  # the report will include all labeled and unlabeled usage.
226
+ # @!attribute [rw] calendar_period
227
+ # @return [::Google::Cloud::Billing::Budgets::V1beta1::CalendarPeriod]
228
+ # Optional. Specifies to track usage for recurring calendar period.
229
+ # For example, assume that CalendarPeriod.QUARTER is set. The budget will
230
+ # track usage from April 1 to June 30, when the current calendar month is
231
+ # April, May, June. After that, it will track usage from July 1 to
232
+ # September 30 when the current calendar month is July, August, September,
233
+ # so on.
234
+ # @!attribute [rw] custom_period
235
+ # @return [::Google::Cloud::Billing::Budgets::V1beta1::CustomPeriod]
236
+ # Optional. Specifies to track usage from any start date (required) to any
237
+ # end date (optional). This time period is static, it does not recur.
214
238
  class Filter
215
239
  include ::Google::Protobuf::MessageExts
216
240
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -224,8 +248,11 @@ module Google
224
248
  extend ::Google::Protobuf::MessageExts::ClassMethods
225
249
  end
226
250
 
227
- # Specifies how credits should be treated when determining spend for
228
- # threshold calculations.
251
+ # Specifies how credits are applied when determining the spend for
252
+ # threshold calculations. Budgets track the total cost minus any applicable
253
+ # selected credits.
254
+ # [See the documentation for a list of credit
255
+ # types](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type).
229
256
  module CreditTypesTreatment
230
257
  CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0
231
258
 
@@ -237,11 +264,46 @@ module Google
237
264
  # threshold calculations.
238
265
  EXCLUDE_ALL_CREDITS = 2
239
266
 
240
- # Credit types specified in the credit_types field are subtracted from the
267
+ # [Credit
268
+ # types](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type)
269
+ # specified in the credit_types field are subtracted from the
241
270
  # gross cost to determine the spend for threshold calculations.
242
271
  INCLUDE_SPECIFIED_CREDITS = 3
243
272
  end
244
273
  end
274
+
275
+ # All date times begin at 12 AM US and Canadian Pacific Time (UTC-8).
276
+ # @!attribute [rw] start_date
277
+ # @return [::Google::Type::Date]
278
+ # Required. The start date must be after January 1, 2017.
279
+ # @!attribute [rw] end_date
280
+ # @return [::Google::Type::Date]
281
+ # Optional. The end date of the time period. Budgets with elapsed end date
282
+ # won't be processed. If unset, specifies to track all usage incurred since
283
+ # the start_date.
284
+ class CustomPeriod
285
+ include ::Google::Protobuf::MessageExts
286
+ extend ::Google::Protobuf::MessageExts::ClassMethods
287
+ end
288
+
289
+ # A `CalendarPeriod` represents the abstract concept of a time period that
290
+ # has a canonical start. Grammatically, "the start of the current
291
+ # `CalendarPeriod`". All calendar times begin at 12 AM US and Canadian
292
+ # Pacific Time (UTC-8).
293
+ module CalendarPeriod
294
+ CALENDAR_PERIOD_UNSPECIFIED = 0
295
+
296
+ # A month. Month starts on the first day of each month, such as January 1,
297
+ # February 1, March 1, and so on.
298
+ MONTH = 1
299
+
300
+ # A quarter. Quarters start on dates January 1, April 1, July 1, and October
301
+ # 1 of each year.
302
+ QUARTER = 2
303
+
304
+ # A year. Year starts on January 1.
305
+ YEAR = 3
306
+ end
245
307
  end
246
308
  end
247
309
  end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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
+
20
+ module Google
21
+ module Type
22
+ # Represents a whole or partial calendar date, such as a birthday. The time of
23
+ # day and time zone are either specified elsewhere or are insignificant. The
24
+ # date is relative to the Gregorian Calendar. This can represent one of the
25
+ # following:
26
+ #
27
+ # * A full date, with non-zero year, month, and day values
28
+ # * A month and day value, with a zero year, such as an anniversary
29
+ # * A year on its own, with zero month and day values
30
+ # * A year and month value, with a zero day, such as a credit card expiration
31
+ # date
32
+ #
33
+ # Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and
34
+ # `google.protobuf.Timestamp`.
35
+ # @!attribute [rw] year
36
+ # @return [::Integer]
37
+ # Year of the date. Must be from 1 to 9999, or 0 to specify a date without
38
+ # a year.
39
+ # @!attribute [rw] month
40
+ # @return [::Integer]
41
+ # Month of a year. Must be from 1 to 12, or 0 to specify a year without a
42
+ # month and day.
43
+ # @!attribute [rw] day
44
+ # @return [::Integer]
45
+ # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0
46
+ # to specify a year by itself or a year and month where the day isn't
47
+ # significant.
48
+ class Date
49
+ include ::Google::Protobuf::MessageExts
50
+ extend ::Google::Protobuf::MessageExts::ClassMethods
51
+ end
52
+ end
53
+ end
@@ -22,7 +22,7 @@ module Google
22
22
  # Represents an amount of money with its currency type.
23
23
  # @!attribute [rw] currency_code
24
24
  # @return [::String]
25
- # The 3-letter currency code defined in ISO 4217.
25
+ # The three-letter currency code defined in ISO 4217.
26
26
  # @!attribute [rw] units
27
27
  # @return [::Integer]
28
28
  # The whole units of the amount.
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-billing-budgets-v1beta1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-09 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.7'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.3'
22
+ version: 2.a
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.7'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.3'
32
+ version: 2.a
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: google-cloud-errors
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -181,6 +187,7 @@ files:
181
187
  - proto_docs/google/protobuf/empty.rb
182
188
  - proto_docs/google/protobuf/field_mask.rb
183
189
  - proto_docs/google/protobuf/struct.rb
190
+ - proto_docs/google/type/date.rb
184
191
  - proto_docs/google/type/money.rb
185
192
  homepage: https://github.com/googleapis/google-cloud-ruby
186
193
  licenses:
@@ -201,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
208
  - !ruby/object:Gem::Version
202
209
  version: '0'
203
210
  requirements: []
204
- rubygems_version: 3.2.13
211
+ rubygems_version: 3.2.17
205
212
  signing_key:
206
213
  specification_version: 4
207
214
  summary: API Client library for the Billing Budgets V1beta1 API