google-cloud-billing-budgets-v1beta1 0.6.0 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +15 -33
- data/README.md +1 -1
- data/lib/google/cloud/billing/budgets/v1beta1/budget_model_pb.rb +2 -2
- data/lib/google/cloud/billing/budgets/v1beta1/budget_service/client.rb +155 -73
- data/lib/google/cloud/billing/budgets/v1beta1/budget_service_pb.rb +2 -2
- data/lib/google/cloud/billing/budgets/v1beta1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/type/date.rb +14 -11
- data/proto_docs/google/type/money.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51738fac34fba568f584c1c5896fd786f647d3f83abfa2684a1f538b1af1f559
|
4
|
+
data.tar.gz: f41c5f641222e19c3394bb8ae12e1c3a924062e433b0e09c66cd44ec23a3f126
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d05cb40402d815f5c2b68146861ee9fd91ecb46f807d358519fc5b9bbc0c289c01ec08996eee25dea00b01faac8444dc2d7212d7f2253bc657c62ee008e3c7b1
|
7
|
+
data.tar.gz: 746353a8592e6f81e7dfe9bdab859b4b9a6eff26083778a3e8d9141990b0bb3860a2128668cf6817555694a9d44cd7d2d45d5b3d2be22b4b01dde862e01f5b03
|
data/.yardopts
CHANGED
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
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
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
|
86
|
-
environment
|
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
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/billing/budgets/v1beta1"
|
@@ -120,15 +120,6 @@ To configure your system for this, simply:
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
121
121
|
*should* only be used during development.
|
122
122
|
|
123
|
-
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
124
|
-
[dev-console]: https://console.cloud.google.com/project
|
125
|
-
|
126
|
-
[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
|
127
|
-
|
128
|
-
[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
|
129
|
-
[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
|
130
|
-
[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
|
131
|
-
|
132
123
|
## Creating a Service Account
|
133
124
|
|
134
125
|
Google Cloud requires **Service Account Credentials** to
|
@@ -139,31 +130,22 @@ If you are not running this client within
|
|
139
130
|
[Google Cloud Platform environments](#google-cloud-platform-environments), you
|
140
131
|
need a Google Developers service account.
|
141
132
|
|
142
|
-
1. Visit the [Google
|
133
|
+
1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
|
143
134
|
2. Create a new project or click on an existing project.
|
144
|
-
3. Activate the
|
135
|
+
3. Activate the menu in the upper left and select **APIs & Services**. From
|
145
136
|
here, you will enable the APIs that your application requires.
|
146
137
|
|
147
|
-
![Enable the APIs that your application requires][enable-apis]
|
148
|
-
|
149
138
|
*Note: You may need to enable billing in order to use these services.*
|
150
139
|
|
151
140
|
4. Select **Credentials** from the side navigation.
|
152
141
|
|
153
|
-
|
154
|
-
|
155
|
-
![Create a new service account][create-new-service-account]
|
156
|
-
|
157
|
-
![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
|
158
|
-
|
159
|
-
Find the "Add credentials" drop down and select "Service account" to be
|
160
|
-
guided through downloading a new JSON key file.
|
142
|
+
Find the "Create credentials" drop down near the top of the page, and select
|
143
|
+
"Service account" to be guided through downloading a new JSON key file.
|
161
144
|
|
162
145
|
If you want to re-use an existing service account, you can easily generate a
|
163
|
-
new key file. Just select the account you wish to re-use,
|
164
|
-
|
165
|
-
|
166
|
-
![Re-use an existing service account][reuse-service-account]
|
146
|
+
new key file. Just select the account you wish to re-use, click the pencil
|
147
|
+
tool on the right side to edit the service account, select the **Keys** tab,
|
148
|
+
and then select **Add Key**.
|
167
149
|
|
168
150
|
The key file you download will be used by this library to authenticate API
|
169
151
|
requests and should be stored in a secure location.
|
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 =
|
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,13 +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'
|
9
7
|
require 'google/type/date_pb'
|
10
8
|
require 'google/type/money_pb'
|
9
|
+
require 'google/protobuf'
|
10
|
+
|
11
11
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
12
12
|
add_file("google/cloud/billing/budgets/v1beta1/budget_model.proto", :syntax => :proto3) do
|
13
13
|
add_message "google.cloud.billing.budgets.v1beta1.Budget" do
|
@@ -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
|
-
#
|
46
|
+
# @example
|
47
47
|
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
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
|
-
#
|
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
|
-
#
|
141
|
-
#
|
122
|
+
# # Create a client using the default configuration
|
123
|
+
# client = ::Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new
|
142
124
|
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
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
|
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.
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
#
|
571
|
-
#
|
572
|
-
#
|
573
|
-
# to 20 seconds,
|
574
|
-
#
|
575
|
-
#
|
576
|
-
#
|
577
|
-
#
|
578
|
-
#
|
579
|
-
#
|
580
|
-
#
|
581
|
-
#
|
582
|
-
#
|
583
|
-
#
|
584
|
-
#
|
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
|
@@ -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
|
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
|
@@ -33,11 +33,7 @@ module Google
|
|
33
33
|
# // For Kubernetes resources, the format is {api group}/{kind}.
|
34
34
|
# option (google.api.resource) = {
|
35
35
|
# type: "pubsub.googleapis.com/Topic"
|
36
|
-
#
|
37
|
-
# pattern: "projects/{project}/topics/{topic}"
|
38
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
39
|
-
# parent_name_extractor: "projects/{project}"
|
40
|
-
# }
|
36
|
+
# pattern: "projects/{project}/topics/{topic}"
|
41
37
|
# };
|
42
38
|
# }
|
43
39
|
#
|
@@ -45,10 +41,7 @@ module Google
|
|
45
41
|
#
|
46
42
|
# resources:
|
47
43
|
# - type: "pubsub.googleapis.com/Topic"
|
48
|
-
#
|
49
|
-
# - pattern: "projects/{project}/topics/{topic}"
|
50
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
51
|
-
# parent_name_extractor: "projects/{project}"
|
44
|
+
# pattern: "projects/{project}/topics/{topic}"
|
52
45
|
#
|
53
46
|
# Sometimes, resources have multiple patterns, typically because they can
|
54
47
|
# live under multiple parents.
|
@@ -58,26 +51,10 @@ module Google
|
|
58
51
|
# message LogEntry {
|
59
52
|
# option (google.api.resource) = {
|
60
53
|
# type: "logging.googleapis.com/LogEntry"
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
# }
|
66
|
-
# name_descriptor: {
|
67
|
-
# pattern: "folders/{folder}/logs/{log}"
|
68
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
69
|
-
# parent_name_extractor: "folders/{folder}"
|
70
|
-
# }
|
71
|
-
# name_descriptor: {
|
72
|
-
# pattern: "organizations/{organization}/logs/{log}"
|
73
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Organization"
|
74
|
-
# parent_name_extractor: "organizations/{organization}"
|
75
|
-
# }
|
76
|
-
# name_descriptor: {
|
77
|
-
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
78
|
-
# parent_type: "billing.googleapis.com/BillingAccount"
|
79
|
-
# parent_name_extractor: "billingAccounts/{billing_account}"
|
80
|
-
# }
|
54
|
+
# pattern: "projects/{project}/logs/{log}"
|
55
|
+
# pattern: "folders/{folder}/logs/{log}"
|
56
|
+
# pattern: "organizations/{organization}/logs/{log}"
|
57
|
+
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
81
58
|
# };
|
82
59
|
# }
|
83
60
|
#
|
@@ -85,48 +62,10 @@ module Google
|
|
85
62
|
#
|
86
63
|
# resources:
|
87
64
|
# - type: 'logging.googleapis.com/LogEntry'
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
# - pattern: "folders/{folder}/logs/{log}"
|
93
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
94
|
-
# parent_name_extractor: "folders/{folder}"
|
95
|
-
# - pattern: "organizations/{organization}/logs/{log}"
|
96
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Organization"
|
97
|
-
# parent_name_extractor: "organizations/{organization}"
|
98
|
-
# - pattern: "billingAccounts/{billing_account}/logs/{log}"
|
99
|
-
# parent_type: "billing.googleapis.com/BillingAccount"
|
100
|
-
# parent_name_extractor: "billingAccounts/{billing_account}"
|
101
|
-
#
|
102
|
-
# For flexible resources, the resource name doesn't contain parent names, but
|
103
|
-
# the resource itself has parents for policy evaluation.
|
104
|
-
#
|
105
|
-
# Example:
|
106
|
-
#
|
107
|
-
# message Shelf {
|
108
|
-
# option (google.api.resource) = {
|
109
|
-
# type: "library.googleapis.com/Shelf"
|
110
|
-
# name_descriptor: {
|
111
|
-
# pattern: "shelves/{shelf}"
|
112
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
113
|
-
# }
|
114
|
-
# name_descriptor: {
|
115
|
-
# pattern: "shelves/{shelf}"
|
116
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
117
|
-
# }
|
118
|
-
# };
|
119
|
-
# }
|
120
|
-
#
|
121
|
-
# The ResourceDescriptor Yaml config will look like:
|
122
|
-
#
|
123
|
-
# resources:
|
124
|
-
# - type: 'library.googleapis.com/Shelf'
|
125
|
-
# name_descriptor:
|
126
|
-
# - pattern: "shelves/{shelf}"
|
127
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
128
|
-
# - pattern: "shelves/{shelf}"
|
129
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
65
|
+
# pattern: "projects/{project}/logs/{log}"
|
66
|
+
# pattern: "folders/{folder}/logs/{log}"
|
67
|
+
# pattern: "organizations/{organization}/logs/{log}"
|
68
|
+
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
130
69
|
# @!attribute [rw] type
|
131
70
|
# @return [::String]
|
132
71
|
# The resource type. It must be in the format of
|
@@ -19,28 +19,31 @@
|
|
19
19
|
|
20
20
|
module Google
|
21
21
|
module Type
|
22
|
-
# Represents a whole or partial calendar date,
|
23
|
-
# and time zone are either specified elsewhere or are
|
24
|
-
# is relative to the
|
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:
|
25
26
|
#
|
26
|
-
# * A full date, with non-zero year, month and day values
|
27
|
-
# * A month and day value, with a zero year,
|
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
|
28
29
|
# * A year on its own, with zero month and day values
|
29
|
-
# * A year and month value, with a zero day,
|
30
|
+
# * A year and month value, with a zero day, such as a credit card expiration
|
31
|
+
# date
|
30
32
|
#
|
31
|
-
# Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and
|
33
|
+
# Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and
|
34
|
+
# `google.protobuf.Timestamp`.
|
32
35
|
# @!attribute [rw] year
|
33
36
|
# @return [::Integer]
|
34
|
-
# Year of date. Must be from 1 to 9999, or 0
|
37
|
+
# Year of the date. Must be from 1 to 9999, or 0 to specify a date without
|
35
38
|
# a year.
|
36
39
|
# @!attribute [rw] month
|
37
40
|
# @return [::Integer]
|
38
|
-
# Month of year. Must be from 1 to 12, or 0
|
41
|
+
# Month of a year. Must be from 1 to 12, or 0 to specify a year without a
|
39
42
|
# month and day.
|
40
43
|
# @!attribute [rw] day
|
41
44
|
# @return [::Integer]
|
42
|
-
# Day of month. Must be from 1 to 31 and valid for the year and month, or 0
|
43
|
-
#
|
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
|
44
47
|
# significant.
|
45
48
|
class Date
|
46
49
|
include ::Google::Protobuf::MessageExts
|
@@ -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
|
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,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.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-11 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.
|
19
|
+
version: '0.7'
|
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.
|
29
|
+
version: '0.7'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
- !ruby/object:Gem::Version
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
|
-
rubygems_version: 3.
|
211
|
+
rubygems_version: 3.3.4
|
212
212
|
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: API Client library for the Billing Budgets V1beta1 API
|