google-cloud-billing-v1 1.0.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/billing/v1/cloud_billing/client.rb +29 -12
- data/lib/google/cloud/billing/v1/cloud_billing/rest/client.rb +29 -12
- data/lib/google/cloud/billing/v1/cloud_billing/rest/service_stub.rb +102 -68
- data/lib/google/cloud/billing/v1/cloud_billing_pb.rb +1 -1
- data/lib/google/cloud/billing/v1/cloud_catalog/client.rb +29 -3
- data/lib/google/cloud/billing/v1/cloud_catalog/rest/client.rb +29 -3
- data/lib/google/cloud/billing/v1/cloud_catalog/rest/service_stub.rb +30 -14
- data/lib/google/cloud/billing/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/billing/v1/cloud_billing.rb +11 -0
- 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: 5b0dcc332f66bdb3529ed00bbd8ff00a152f58ece3d881a797c1ccb7f58535ea
|
4
|
+
data.tar.gz: f9a7307219b411a50e4909a67ba2fd807361f72a1e43fff83a26f83b2961fa62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11fe57ed6370052eee3a3638f783e0984b95f56bef48d29e224ec4e4118a5cfa5ffe48dceb8a481a1740e04cf84788969a70c34090e7d360d62d8a127b2bb415
|
7
|
+
data.tar.gz: e50a6931c8b0f08e5b46f01512d6436760835a7156cb0185fa18f965b7915d4dd8ff6981148cd9d837a667bcb7c259d77d5bde7f0ced67d4af6627e553057660
|
data/README.md
CHANGED
@@ -42,33 +42,43 @@ for class and method documentation.
|
|
42
42
|
See also the [Product Documentation](https://cloud.google.com/billing)
|
43
43
|
for general usage information.
|
44
44
|
|
45
|
-
##
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
45
|
+
## Debug Logging
|
46
|
+
|
47
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
48
|
+
your application's integration with the API. When logging is activated, key
|
49
|
+
events such as requests and responses, along with data payloads and metadata
|
50
|
+
such as headers and client configuration, are logged to the standard error
|
51
|
+
stream.
|
52
|
+
|
53
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
54
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
55
|
+
customers, private keys, or other security data that could be compromising if
|
56
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
57
|
+
the principle of least access. Google also recommends that Client Library Debug
|
58
|
+
Logging be enabled only temporarily during active debugging, and not used
|
59
|
+
permanently in production.
|
60
|
+
|
61
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
62
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
63
|
+
list of client library gem names. This will select the default logging behavior,
|
64
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
65
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
66
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
67
|
+
results in logs appearing alongside your application logs in the
|
68
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
69
|
+
|
70
|
+
You can customize logging by modifying the `logger` configuration when
|
71
|
+
constructing a client object. For example:
|
54
72
|
|
55
73
|
```ruby
|
74
|
+
require "google/cloud/billing/v1"
|
56
75
|
require "logger"
|
57
76
|
|
58
|
-
|
59
|
-
|
60
|
-
def logger
|
61
|
-
LOGGER
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
66
|
-
module GRPC
|
67
|
-
extend MyLogger
|
77
|
+
client = ::Google::Cloud::Billing::V1::CloudBilling::Client.new do |config|
|
78
|
+
config.logger = Logger.new "my-app.log"
|
68
79
|
end
|
69
80
|
```
|
70
81
|
|
71
|
-
|
72
82
|
## Google Cloud Samples
|
73
83
|
|
74
84
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
@@ -205,8 +205,28 @@ module Google
|
|
205
205
|
universe_domain: @config.universe_domain,
|
206
206
|
channel_args: @config.channel_args,
|
207
207
|
interceptors: @config.interceptors,
|
208
|
-
channel_pool_config: @config.channel_pool
|
208
|
+
channel_pool_config: @config.channel_pool,
|
209
|
+
logger: @config.logger
|
209
210
|
)
|
211
|
+
|
212
|
+
@cloud_billing_stub.stub_logger&.info do |entry|
|
213
|
+
entry.set_system_name
|
214
|
+
entry.set_service
|
215
|
+
entry.message = "Created client for #{entry.service}"
|
216
|
+
entry.set_credentials_fields credentials
|
217
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
218
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
219
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
##
|
224
|
+
# The logger used for request/response debug logging.
|
225
|
+
#
|
226
|
+
# @return [Logger]
|
227
|
+
#
|
228
|
+
def logger
|
229
|
+
@cloud_billing_stub.logger
|
210
230
|
end
|
211
231
|
|
212
232
|
# Service calls
|
@@ -294,7 +314,6 @@ module Google
|
|
294
314
|
|
295
315
|
@cloud_billing_stub.call_rpc :get_billing_account, request, options: options do |response, operation|
|
296
316
|
yield response, operation if block_given?
|
297
|
-
return response
|
298
317
|
end
|
299
318
|
rescue ::GRPC::BadStatus => e
|
300
319
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -399,7 +418,7 @@ module Google
|
|
399
418
|
@cloud_billing_stub.call_rpc :list_billing_accounts, request, options: options do |response, operation|
|
400
419
|
response = ::Gapic::PagedEnumerable.new @cloud_billing_stub, :list_billing_accounts, request, response, operation, options
|
401
420
|
yield response, operation if block_given?
|
402
|
-
|
421
|
+
throw :response, response
|
403
422
|
end
|
404
423
|
rescue ::GRPC::BadStatus => e
|
405
424
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -496,7 +515,6 @@ module Google
|
|
496
515
|
|
497
516
|
@cloud_billing_stub.call_rpc :update_billing_account, request, options: options do |response, operation|
|
498
517
|
yield response, operation if block_given?
|
499
|
-
return response
|
500
518
|
end
|
501
519
|
rescue ::GRPC::BadStatus => e
|
502
520
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -596,7 +614,6 @@ module Google
|
|
596
614
|
|
597
615
|
@cloud_billing_stub.call_rpc :create_billing_account, request, options: options do |response, operation|
|
598
616
|
yield response, operation if block_given?
|
599
|
-
return response
|
600
617
|
end
|
601
618
|
rescue ::GRPC::BadStatus => e
|
602
619
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -699,7 +716,7 @@ module Google
|
|
699
716
|
@cloud_billing_stub.call_rpc :list_project_billing_info, request, options: options do |response, operation|
|
700
717
|
response = ::Gapic::PagedEnumerable.new @cloud_billing_stub, :list_project_billing_info, request, response, operation, options
|
701
718
|
yield response, operation if block_given?
|
702
|
-
|
719
|
+
throw :response, response
|
703
720
|
end
|
704
721
|
rescue ::GRPC::BadStatus => e
|
705
722
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -790,7 +807,6 @@ module Google
|
|
790
807
|
|
791
808
|
@cloud_billing_stub.call_rpc :get_project_billing_info, request, options: options do |response, operation|
|
792
809
|
yield response, operation if block_given?
|
793
|
-
return response
|
794
810
|
end
|
795
811
|
rescue ::GRPC::BadStatus => e
|
796
812
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -913,7 +929,6 @@ module Google
|
|
913
929
|
|
914
930
|
@cloud_billing_stub.call_rpc :update_project_billing_info, request, options: options do |response, operation|
|
915
931
|
yield response, operation if block_given?
|
916
|
-
return response
|
917
932
|
end
|
918
933
|
rescue ::GRPC::BadStatus => e
|
919
934
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1006,7 +1021,6 @@ module Google
|
|
1006
1021
|
|
1007
1022
|
@cloud_billing_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
|
1008
1023
|
yield response, operation if block_given?
|
1009
|
-
return response
|
1010
1024
|
end
|
1011
1025
|
rescue ::GRPC::BadStatus => e
|
1012
1026
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1108,7 +1122,6 @@ module Google
|
|
1108
1122
|
|
1109
1123
|
@cloud_billing_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
|
1110
1124
|
yield response, operation if block_given?
|
1111
|
-
return response
|
1112
1125
|
end
|
1113
1126
|
rescue ::GRPC::BadStatus => e
|
1114
1127
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1202,7 +1215,6 @@ module Google
|
|
1202
1215
|
|
1203
1216
|
@cloud_billing_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
|
1204
1217
|
yield response, operation if block_given?
|
1205
|
-
return response
|
1206
1218
|
end
|
1207
1219
|
rescue ::GRPC::BadStatus => e
|
1208
1220
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1295,7 +1307,6 @@ module Google
|
|
1295
1307
|
|
1296
1308
|
@cloud_billing_stub.call_rpc :move_billing_account, request, options: options do |response, operation|
|
1297
1309
|
yield response, operation if block_given?
|
1298
|
-
return response
|
1299
1310
|
end
|
1300
1311
|
rescue ::GRPC::BadStatus => e
|
1301
1312
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1384,6 +1395,11 @@ module Google
|
|
1384
1395
|
# default endpoint URL. The default value of nil uses the environment
|
1385
1396
|
# universe (usually the default "googleapis.com" universe).
|
1386
1397
|
# @return [::String,nil]
|
1398
|
+
# @!attribute [rw] logger
|
1399
|
+
# A custom logger to use for request/response debug logging, or the value
|
1400
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1401
|
+
# explicitly disable logging.
|
1402
|
+
# @return [::Logger,:default,nil]
|
1387
1403
|
#
|
1388
1404
|
class Configuration
|
1389
1405
|
extend ::Gapic::Config
|
@@ -1408,6 +1424,7 @@ module Google
|
|
1408
1424
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1409
1425
|
config_attr :quota_project, nil, ::String, nil
|
1410
1426
|
config_attr :universe_domain, nil, ::String, nil
|
1427
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1411
1428
|
|
1412
1429
|
# @private
|
1413
1430
|
def initialize parent_config = nil
|
@@ -198,8 +198,28 @@ module Google
|
|
198
198
|
endpoint: @config.endpoint,
|
199
199
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
200
200
|
universe_domain: @config.universe_domain,
|
201
|
-
credentials: credentials
|
201
|
+
credentials: credentials,
|
202
|
+
logger: @config.logger
|
202
203
|
)
|
204
|
+
|
205
|
+
@cloud_billing_stub.logger(stub: true)&.info do |entry|
|
206
|
+
entry.set_system_name
|
207
|
+
entry.set_service
|
208
|
+
entry.message = "Created client for #{entry.service}"
|
209
|
+
entry.set_credentials_fields credentials
|
210
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
211
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
212
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# The logger used for request/response debug logging.
|
218
|
+
#
|
219
|
+
# @return [Logger]
|
220
|
+
#
|
221
|
+
def logger
|
222
|
+
@cloud_billing_stub.logger
|
203
223
|
end
|
204
224
|
|
205
225
|
# Service calls
|
@@ -280,7 +300,6 @@ module Google
|
|
280
300
|
|
281
301
|
@cloud_billing_stub.get_billing_account request, options do |result, operation|
|
282
302
|
yield result, operation if block_given?
|
283
|
-
return result
|
284
303
|
end
|
285
304
|
rescue ::Gapic::Rest::Error => e
|
286
305
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -386,7 +405,7 @@ module Google
|
|
386
405
|
@cloud_billing_stub.list_billing_accounts request, options do |result, operation|
|
387
406
|
result = ::Gapic::Rest::PagedEnumerable.new @cloud_billing_stub, :list_billing_accounts, "billing_accounts", request, result, options
|
388
407
|
yield result, operation if block_given?
|
389
|
-
|
408
|
+
throw :response, result
|
390
409
|
end
|
391
410
|
rescue ::Gapic::Rest::Error => e
|
392
411
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -476,7 +495,6 @@ module Google
|
|
476
495
|
|
477
496
|
@cloud_billing_stub.update_billing_account request, options do |result, operation|
|
478
497
|
yield result, operation if block_given?
|
479
|
-
return result
|
480
498
|
end
|
481
499
|
rescue ::Gapic::Rest::Error => e
|
482
500
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -577,7 +595,6 @@ module Google
|
|
577
595
|
|
578
596
|
@cloud_billing_stub.create_billing_account request, options do |result, operation|
|
579
597
|
yield result, operation if block_given?
|
580
|
-
return result
|
581
598
|
end
|
582
599
|
rescue ::Gapic::Rest::Error => e
|
583
600
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -673,7 +690,7 @@ module Google
|
|
673
690
|
@cloud_billing_stub.list_project_billing_info request, options do |result, operation|
|
674
691
|
result = ::Gapic::Rest::PagedEnumerable.new @cloud_billing_stub, :list_project_billing_info, "project_billing_info", request, result, options
|
675
692
|
yield result, operation if block_given?
|
676
|
-
|
693
|
+
throw :response, result
|
677
694
|
end
|
678
695
|
rescue ::Gapic::Rest::Error => e
|
679
696
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -757,7 +774,6 @@ module Google
|
|
757
774
|
|
758
775
|
@cloud_billing_stub.get_project_billing_info request, options do |result, operation|
|
759
776
|
yield result, operation if block_given?
|
760
|
-
return result
|
761
777
|
end
|
762
778
|
rescue ::Gapic::Rest::Error => e
|
763
779
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -873,7 +889,6 @@ module Google
|
|
873
889
|
|
874
890
|
@cloud_billing_stub.update_project_billing_info request, options do |result, operation|
|
875
891
|
yield result, operation if block_given?
|
876
|
-
return result
|
877
892
|
end
|
878
893
|
rescue ::Gapic::Rest::Error => e
|
879
894
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -959,7 +974,6 @@ module Google
|
|
959
974
|
|
960
975
|
@cloud_billing_stub.get_iam_policy request, options do |result, operation|
|
961
976
|
yield result, operation if block_given?
|
962
|
-
return result
|
963
977
|
end
|
964
978
|
rescue ::Gapic::Rest::Error => e
|
965
979
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1054,7 +1068,6 @@ module Google
|
|
1054
1068
|
|
1055
1069
|
@cloud_billing_stub.set_iam_policy request, options do |result, operation|
|
1056
1070
|
yield result, operation if block_given?
|
1057
|
-
return result
|
1058
1071
|
end
|
1059
1072
|
rescue ::Gapic::Rest::Error => e
|
1060
1073
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1141,7 +1154,6 @@ module Google
|
|
1141
1154
|
|
1142
1155
|
@cloud_billing_stub.test_iam_permissions request, options do |result, operation|
|
1143
1156
|
yield result, operation if block_given?
|
1144
|
-
return result
|
1145
1157
|
end
|
1146
1158
|
rescue ::Gapic::Rest::Error => e
|
1147
1159
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1227,7 +1239,6 @@ module Google
|
|
1227
1239
|
|
1228
1240
|
@cloud_billing_stub.move_billing_account request, options do |result, operation|
|
1229
1241
|
yield result, operation if block_given?
|
1230
|
-
return result
|
1231
1242
|
end
|
1232
1243
|
rescue ::Gapic::Rest::Error => e
|
1233
1244
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1307,6 +1318,11 @@ module Google
|
|
1307
1318
|
# default endpoint URL. The default value of nil uses the environment
|
1308
1319
|
# universe (usually the default "googleapis.com" universe).
|
1309
1320
|
# @return [::String,nil]
|
1321
|
+
# @!attribute [rw] logger
|
1322
|
+
# A custom logger to use for request/response debug logging, or the value
|
1323
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1324
|
+
# explicitly disable logging.
|
1325
|
+
# @return [::Logger,:default,nil]
|
1310
1326
|
#
|
1311
1327
|
class Configuration
|
1312
1328
|
extend ::Gapic::Config
|
@@ -1328,6 +1344,7 @@ module Google
|
|
1328
1344
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1329
1345
|
config_attr :quota_project, nil, ::String, nil
|
1330
1346
|
config_attr :universe_domain, nil, ::String, nil
|
1347
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1331
1348
|
|
1332
1349
|
# @private
|
1333
1350
|
def initialize parent_config = nil
|
@@ -30,7 +30,8 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
|
33
|
+
# @private
|
34
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
34
35
|
# These require statements are intentionally placed here to initialize
|
35
36
|
# the REST modules only when it's required.
|
36
37
|
require "gapic/rest"
|
@@ -40,7 +41,9 @@ module Google
|
|
40
41
|
universe_domain: universe_domain,
|
41
42
|
credentials: credentials,
|
42
43
|
numeric_enums: true,
|
43
|
-
|
44
|
+
service_name: self.class,
|
45
|
+
raise_faraday_errors: false,
|
46
|
+
logger: logger
|
44
47
|
end
|
45
48
|
|
46
49
|
##
|
@@ -61,6 +64,15 @@ module Google
|
|
61
64
|
@client_stub.endpoint
|
62
65
|
end
|
63
66
|
|
67
|
+
##
|
68
|
+
# The logger used for request/response debug logging.
|
69
|
+
#
|
70
|
+
# @return [Logger]
|
71
|
+
#
|
72
|
+
def logger stub: false
|
73
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
74
|
+
end
|
75
|
+
|
64
76
|
##
|
65
77
|
# Baseline implementation for the get_billing_account REST call
|
66
78
|
#
|
@@ -87,16 +99,18 @@ module Google
|
|
87
99
|
|
88
100
|
response = @client_stub.make_http_request(
|
89
101
|
verb,
|
90
|
-
uri:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "get_billing_account",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::Billing::V1::BillingAccount.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
110
|
+
catch :response do
|
111
|
+
yield result, operation if block_given?
|
112
|
+
result
|
113
|
+
end
|
100
114
|
end
|
101
115
|
|
102
116
|
##
|
@@ -125,16 +139,18 @@ module Google
|
|
125
139
|
|
126
140
|
response = @client_stub.make_http_request(
|
127
141
|
verb,
|
128
|
-
uri:
|
129
|
-
body:
|
130
|
-
params:
|
142
|
+
uri: uri,
|
143
|
+
body: body || "",
|
144
|
+
params: query_string_params,
|
145
|
+
method_name: "list_billing_accounts",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Cloud::Billing::V1::ListBillingAccountsResponse.decode_json response.body, ignore_unknown_fields: true
|
135
|
-
|
136
|
-
|
137
|
-
|
150
|
+
catch :response do
|
151
|
+
yield result, operation if block_given?
|
152
|
+
result
|
153
|
+
end
|
138
154
|
end
|
139
155
|
|
140
156
|
##
|
@@ -163,16 +179,18 @@ module Google
|
|
163
179
|
|
164
180
|
response = @client_stub.make_http_request(
|
165
181
|
verb,
|
166
|
-
uri:
|
167
|
-
body:
|
168
|
-
params:
|
182
|
+
uri: uri,
|
183
|
+
body: body || "",
|
184
|
+
params: query_string_params,
|
185
|
+
method_name: "update_billing_account",
|
169
186
|
options: options
|
170
187
|
)
|
171
188
|
operation = ::Gapic::Rest::TransportOperation.new response
|
172
189
|
result = ::Google::Cloud::Billing::V1::BillingAccount.decode_json response.body, ignore_unknown_fields: true
|
173
|
-
|
174
|
-
|
175
|
-
|
190
|
+
catch :response do
|
191
|
+
yield result, operation if block_given?
|
192
|
+
result
|
193
|
+
end
|
176
194
|
end
|
177
195
|
|
178
196
|
##
|
@@ -201,16 +219,18 @@ module Google
|
|
201
219
|
|
202
220
|
response = @client_stub.make_http_request(
|
203
221
|
verb,
|
204
|
-
uri:
|
205
|
-
body:
|
206
|
-
params:
|
222
|
+
uri: uri,
|
223
|
+
body: body || "",
|
224
|
+
params: query_string_params,
|
225
|
+
method_name: "create_billing_account",
|
207
226
|
options: options
|
208
227
|
)
|
209
228
|
operation = ::Gapic::Rest::TransportOperation.new response
|
210
229
|
result = ::Google::Cloud::Billing::V1::BillingAccount.decode_json response.body, ignore_unknown_fields: true
|
211
|
-
|
212
|
-
|
213
|
-
|
230
|
+
catch :response do
|
231
|
+
yield result, operation if block_given?
|
232
|
+
result
|
233
|
+
end
|
214
234
|
end
|
215
235
|
|
216
236
|
##
|
@@ -239,16 +259,18 @@ module Google
|
|
239
259
|
|
240
260
|
response = @client_stub.make_http_request(
|
241
261
|
verb,
|
242
|
-
uri:
|
243
|
-
body:
|
244
|
-
params:
|
262
|
+
uri: uri,
|
263
|
+
body: body || "",
|
264
|
+
params: query_string_params,
|
265
|
+
method_name: "list_project_billing_info",
|
245
266
|
options: options
|
246
267
|
)
|
247
268
|
operation = ::Gapic::Rest::TransportOperation.new response
|
248
269
|
result = ::Google::Cloud::Billing::V1::ListProjectBillingInfoResponse.decode_json response.body, ignore_unknown_fields: true
|
249
|
-
|
250
|
-
|
251
|
-
|
270
|
+
catch :response do
|
271
|
+
yield result, operation if block_given?
|
272
|
+
result
|
273
|
+
end
|
252
274
|
end
|
253
275
|
|
254
276
|
##
|
@@ -277,16 +299,18 @@ module Google
|
|
277
299
|
|
278
300
|
response = @client_stub.make_http_request(
|
279
301
|
verb,
|
280
|
-
uri:
|
281
|
-
body:
|
282
|
-
params:
|
302
|
+
uri: uri,
|
303
|
+
body: body || "",
|
304
|
+
params: query_string_params,
|
305
|
+
method_name: "get_project_billing_info",
|
283
306
|
options: options
|
284
307
|
)
|
285
308
|
operation = ::Gapic::Rest::TransportOperation.new response
|
286
309
|
result = ::Google::Cloud::Billing::V1::ProjectBillingInfo.decode_json response.body, ignore_unknown_fields: true
|
287
|
-
|
288
|
-
|
289
|
-
|
310
|
+
catch :response do
|
311
|
+
yield result, operation if block_given?
|
312
|
+
result
|
313
|
+
end
|
290
314
|
end
|
291
315
|
|
292
316
|
##
|
@@ -315,16 +339,18 @@ module Google
|
|
315
339
|
|
316
340
|
response = @client_stub.make_http_request(
|
317
341
|
verb,
|
318
|
-
uri:
|
319
|
-
body:
|
320
|
-
params:
|
342
|
+
uri: uri,
|
343
|
+
body: body || "",
|
344
|
+
params: query_string_params,
|
345
|
+
method_name: "update_project_billing_info",
|
321
346
|
options: options
|
322
347
|
)
|
323
348
|
operation = ::Gapic::Rest::TransportOperation.new response
|
324
349
|
result = ::Google::Cloud::Billing::V1::ProjectBillingInfo.decode_json response.body, ignore_unknown_fields: true
|
325
|
-
|
326
|
-
|
327
|
-
|
350
|
+
catch :response do
|
351
|
+
yield result, operation if block_given?
|
352
|
+
result
|
353
|
+
end
|
328
354
|
end
|
329
355
|
|
330
356
|
##
|
@@ -353,16 +379,18 @@ module Google
|
|
353
379
|
|
354
380
|
response = @client_stub.make_http_request(
|
355
381
|
verb,
|
356
|
-
uri:
|
357
|
-
body:
|
358
|
-
params:
|
382
|
+
uri: uri,
|
383
|
+
body: body || "",
|
384
|
+
params: query_string_params,
|
385
|
+
method_name: "get_iam_policy",
|
359
386
|
options: options
|
360
387
|
)
|
361
388
|
operation = ::Gapic::Rest::TransportOperation.new response
|
362
389
|
result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
|
363
|
-
|
364
|
-
|
365
|
-
|
390
|
+
catch :response do
|
391
|
+
yield result, operation if block_given?
|
392
|
+
result
|
393
|
+
end
|
366
394
|
end
|
367
395
|
|
368
396
|
##
|
@@ -391,16 +419,18 @@ module Google
|
|
391
419
|
|
392
420
|
response = @client_stub.make_http_request(
|
393
421
|
verb,
|
394
|
-
uri:
|
395
|
-
body:
|
396
|
-
params:
|
422
|
+
uri: uri,
|
423
|
+
body: body || "",
|
424
|
+
params: query_string_params,
|
425
|
+
method_name: "set_iam_policy",
|
397
426
|
options: options
|
398
427
|
)
|
399
428
|
operation = ::Gapic::Rest::TransportOperation.new response
|
400
429
|
result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
|
401
|
-
|
402
|
-
|
403
|
-
|
430
|
+
catch :response do
|
431
|
+
yield result, operation if block_given?
|
432
|
+
result
|
433
|
+
end
|
404
434
|
end
|
405
435
|
|
406
436
|
##
|
@@ -429,16 +459,18 @@ module Google
|
|
429
459
|
|
430
460
|
response = @client_stub.make_http_request(
|
431
461
|
verb,
|
432
|
-
uri:
|
433
|
-
body:
|
434
|
-
params:
|
462
|
+
uri: uri,
|
463
|
+
body: body || "",
|
464
|
+
params: query_string_params,
|
465
|
+
method_name: "test_iam_permissions",
|
435
466
|
options: options
|
436
467
|
)
|
437
468
|
operation = ::Gapic::Rest::TransportOperation.new response
|
438
469
|
result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
|
439
|
-
|
440
|
-
|
441
|
-
|
470
|
+
catch :response do
|
471
|
+
yield result, operation if block_given?
|
472
|
+
result
|
473
|
+
end
|
442
474
|
end
|
443
475
|
|
444
476
|
##
|
@@ -467,16 +499,18 @@ module Google
|
|
467
499
|
|
468
500
|
response = @client_stub.make_http_request(
|
469
501
|
verb,
|
470
|
-
uri:
|
471
|
-
body:
|
472
|
-
params:
|
502
|
+
uri: uri,
|
503
|
+
body: body || "",
|
504
|
+
params: query_string_params,
|
505
|
+
method_name: "move_billing_account",
|
473
506
|
options: options
|
474
507
|
)
|
475
508
|
operation = ::Gapic::Rest::TransportOperation.new response
|
476
509
|
result = ::Google::Cloud::Billing::V1::BillingAccount.decode_json response.body, ignore_unknown_fields: true
|
477
|
-
|
478
|
-
|
479
|
-
|
510
|
+
catch :response do
|
511
|
+
yield result, operation if block_given?
|
512
|
+
result
|
513
|
+
end
|
480
514
|
end
|
481
515
|
|
482
516
|
##
|
@@ -13,7 +13,7 @@ require 'google/iam/v1/policy_pb'
|
|
13
13
|
require 'google/protobuf/field_mask_pb'
|
14
14
|
|
15
15
|
|
16
|
-
descriptor_data = "\n+google/cloud/billing/v1/cloud_billing.proto\x12\x17google.cloud.billing.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a google/protobuf/field_mask.proto\"\
|
16
|
+
descriptor_data = "\n+google/cloud/billing/v1/cloud_billing.proto\x12\x17google.cloud.billing.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a google/protobuf/field_mask.proto\"\x83\x03\n\x0e\x42illingAccount\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x03\xfa\x41,\n*cloudbilling.googleapis.com/BillingAccount\x12\x11\n\x04open\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x1e\n\x16master_billing_account\x18\x04 \x01(\t\x12\x13\n\x06parent\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rcurrency_code\x18\x07 \x01(\tB\x03\xe0\x41\x01:\xb4\x01\xea\x41\xb0\x01\n*cloudbilling.googleapis.com/BillingAccount\x12!billingAccounts/{billing_account}\x12>organizations/{organization}/billingAccounts/{billing_account}*\x0f\x62illingAccounts2\x0e\x62illingAccount\"\xd1\x01\n\x12ProjectBillingInfo\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nproject_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x14\x62illing_account_name\x18\x03 \x01(\t\x12\x1c\n\x0f\x62illing_enabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03:S\xea\x41P\n.cloudbilling.googleapis.com/ProjectBillingInfo\x12\x1eprojects/{project}/billingInfo\"\\\n\x18GetBillingAccountRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudbilling.googleapis.com/BillingAccount\"h\n\x1aListBillingAccountsRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x03 \x01(\t\x12\x13\n\x06parent\x18\x04 \x01(\tB\x03\xe0\x41\x01\"y\n\x1bListBillingAccountsResponse\x12\x41\n\x10\x62illing_accounts\x18\x01 \x03(\x0b\x32\'.google.cloud.billing.v1.BillingAccount\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"y\n\x1b\x43reateBillingAccountRequest\x12\x45\n\x0f\x62illing_account\x18\x01 \x01(\x0b\x32\'.google.cloud.billing.v1.BillingAccountB\x03\xe0\x41\x02\x12\x13\n\x06parent\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xcf\x01\n\x1bUpdateBillingAccountRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudbilling.googleapis.com/BillingAccount\x12=\n\x07\x61\x63\x63ount\x18\x02 \x01(\x0b\x32\'.google.cloud.billing.v1.BillingAccountB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\x88\x01\n\x1dListProjectBillingInfoRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudbilling.googleapis.com/BillingAccount\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x84\x01\n\x1eListProjectBillingInfoResponse\x12I\n\x14project_billing_info\x18\x01 \x03(\x0b\x32+.google.cloud.billing.v1.ProjectBillingInfo\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x1cGetProjectBillingInfoRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\"\x7f\n\x1fUpdateProjectBillingInfoRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12I\n\x14project_billing_info\x18\x02 \x01(\x0b\x32+.google.cloud.billing.v1.ProjectBillingInfo\"\xb3\x01\n\x19MoveBillingAccountRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*cloudbilling.googleapis.com/BillingAccount\x12T\n\x12\x64\x65stination_parent\x18\x02 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization2\xa1\x13\n\x0c\x43loudBilling\x12\x9c\x01\n\x11GetBillingAccount\x12\x31.google.cloud.billing.v1.GetBillingAccountRequest\x1a\'.google.cloud.billing.v1.BillingAccount\"+\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{name=billingAccounts/*}\x12\x88\x02\n\x13ListBillingAccounts\x12\x33.google.cloud.billing.v1.ListBillingAccountsRequest\x1a\x34.google.cloud.billing.v1.ListBillingAccountsResponse\"\x85\x01\xda\x41\x00\xda\x41\x06parent\x82\xd3\xe4\x93\x02s\x12\x13/v1/billingAccountsZ.\x12,/v1/{parent=organizations/*}/billingAccountsZ,\x12*/v1/{parent=billingAccounts/*}/subAccounts\x12\xb3\x01\n\x14UpdateBillingAccount\x12\x34.google.cloud.billing.v1.UpdateBillingAccountRequest\x1a\'.google.cloud.billing.v1.BillingAccount\"<\xda\x41\x0cname,account\x82\xd3\xe4\x93\x02\'2\x1c/v1/{name=billingAccounts/*}:\x07\x61\x63\x63ount\x12\xd0\x02\n\x14\x43reateBillingAccount\x12\x34.google.cloud.billing.v1.CreateBillingAccountRequest\x1a\'.google.cloud.billing.v1.BillingAccount\"\xd8\x01\xda\x41\x0f\x62illing_account\xda\x41\x16\x62illing_account,parent\x82\xd3\xe4\x93\x02\xa6\x01\"\x13/v1/billingAccounts:\x0f\x62illing_accountZ?\",/v1/{parent=organizations/*}/billingAccounts:\x0f\x62illing_accountZ=\"*/v1/{parent=billingAccounts/*}/subAccounts:\x0f\x62illing_account\x12\xbf\x01\n\x16ListProjectBillingInfo\x12\x36.google.cloud.billing.v1.ListProjectBillingInfoRequest\x1a\x37.google.cloud.billing.v1.ListProjectBillingInfoResponse\"4\xda\x41\x04name\x82\xd3\xe4\x93\x02\'\x12%/v1/{name=billingAccounts/*}/projects\x12\xad\x01\n\x15GetProjectBillingInfo\x12\x35.google.cloud.billing.v1.GetProjectBillingInfoRequest\x1a+.google.cloud.billing.v1.ProjectBillingInfo\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=projects/*}/billingInfo\x12\xde\x01\n\x18UpdateProjectBillingInfo\x12\x38.google.cloud.billing.v1.UpdateProjectBillingInfoRequest\x1a+.google.cloud.billing.v1.ProjectBillingInfo\"[\xda\x41\x19name,project_billing_info\x82\xd3\xe4\x93\x02\x39\x1a!/v1/{name=projects/*}/billingInfo:\x14project_billing_info\x12\x8b\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"@\xda\x41\x08resource\x82\xd3\xe4\x93\x02/\x12-/v1/{resource=billingAccounts/*}:getIamPolicy\x12\x95\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"J\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x32\"-/v1/{resource=billingAccounts/*}:setIamPolicy:\x01*\x12\xc0\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"U\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x38\"3/v1/{resource=billingAccounts/*}:testIamPermissions:\x01*\x12\xe9\x01\n\x12MoveBillingAccount\x12\x32.google.cloud.billing.v1.MoveBillingAccountRequest\x1a\'.google.cloud.billing.v1.BillingAccount\"v\x82\xd3\xe4\x93\x02p\"!/v1/{name=billingAccounts/*}:move:\x01*ZH\x12\x46/v1/{destination_parent=organizations/*}/{name=billingAccounts/*}:move\x1a\xb5\x01\xca\x41\x1b\x63loudbilling.googleapis.com\xd2\x41\x93\x01https://www.googleapis.com/auth/cloud-billing,https://www.googleapis.com/auth/cloud-billing.readonly,https://www.googleapis.com/auth/cloud-platformB\x80\x02\n\x1b\x63om.google.cloud.billing.v1B\x11\x43loudBillingProtoP\x01Z5cloud.google.com/go/billing/apiv1/billingpb;billingpb\xea\x41\x41\n+cloudresourcemanager.googleapis.com/Project\x12\x12projects/{project}\xea\x41P\n0cloudresourcemanager.googleapis.com/Organization\x12\x1corganizations/{organization}b\x06proto3"
|
17
17
|
|
18
18
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
19
19
|
|
@@ -163,8 +163,28 @@ module Google
|
|
163
163
|
universe_domain: @config.universe_domain,
|
164
164
|
channel_args: @config.channel_args,
|
165
165
|
interceptors: @config.interceptors,
|
166
|
-
channel_pool_config: @config.channel_pool
|
166
|
+
channel_pool_config: @config.channel_pool,
|
167
|
+
logger: @config.logger
|
167
168
|
)
|
169
|
+
|
170
|
+
@cloud_catalog_stub.stub_logger&.info do |entry|
|
171
|
+
entry.set_system_name
|
172
|
+
entry.set_service
|
173
|
+
entry.message = "Created client for #{entry.service}"
|
174
|
+
entry.set_credentials_fields credentials
|
175
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
176
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
177
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
##
|
182
|
+
# The logger used for request/response debug logging.
|
183
|
+
#
|
184
|
+
# @return [Logger]
|
185
|
+
#
|
186
|
+
def logger
|
187
|
+
@cloud_catalog_stub.logger
|
168
188
|
end
|
169
189
|
|
170
190
|
# Service calls
|
@@ -250,7 +270,7 @@ module Google
|
|
250
270
|
@cloud_catalog_stub.call_rpc :list_services, request, options: options do |response, operation|
|
251
271
|
response = ::Gapic::PagedEnumerable.new @cloud_catalog_stub, :list_services, request, response, operation, options
|
252
272
|
yield response, operation if block_given?
|
253
|
-
|
273
|
+
throw :response, response
|
254
274
|
end
|
255
275
|
rescue ::GRPC::BadStatus => e
|
256
276
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -366,7 +386,7 @@ module Google
|
|
366
386
|
@cloud_catalog_stub.call_rpc :list_skus, request, options: options do |response, operation|
|
367
387
|
response = ::Gapic::PagedEnumerable.new @cloud_catalog_stub, :list_skus, request, response, operation, options
|
368
388
|
yield response, operation if block_given?
|
369
|
-
|
389
|
+
throw :response, response
|
370
390
|
end
|
371
391
|
rescue ::GRPC::BadStatus => e
|
372
392
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -455,6 +475,11 @@ module Google
|
|
455
475
|
# default endpoint URL. The default value of nil uses the environment
|
456
476
|
# universe (usually the default "googleapis.com" universe).
|
457
477
|
# @return [::String,nil]
|
478
|
+
# @!attribute [rw] logger
|
479
|
+
# A custom logger to use for request/response debug logging, or the value
|
480
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
481
|
+
# explicitly disable logging.
|
482
|
+
# @return [::Logger,:default,nil]
|
458
483
|
#
|
459
484
|
class Configuration
|
460
485
|
extend ::Gapic::Config
|
@@ -479,6 +504,7 @@ module Google
|
|
479
504
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
480
505
|
config_attr :quota_project, nil, ::String, nil
|
481
506
|
config_attr :universe_domain, nil, ::String, nil
|
507
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
482
508
|
|
483
509
|
# @private
|
484
510
|
def initialize parent_config = nil
|
@@ -156,8 +156,28 @@ module Google
|
|
156
156
|
endpoint: @config.endpoint,
|
157
157
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
158
158
|
universe_domain: @config.universe_domain,
|
159
|
-
credentials: credentials
|
159
|
+
credentials: credentials,
|
160
|
+
logger: @config.logger
|
160
161
|
)
|
162
|
+
|
163
|
+
@cloud_catalog_stub.logger(stub: true)&.info do |entry|
|
164
|
+
entry.set_system_name
|
165
|
+
entry.set_service
|
166
|
+
entry.message = "Created client for #{entry.service}"
|
167
|
+
entry.set_credentials_fields credentials
|
168
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
169
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
170
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
##
|
175
|
+
# The logger used for request/response debug logging.
|
176
|
+
#
|
177
|
+
# @return [Logger]
|
178
|
+
#
|
179
|
+
def logger
|
180
|
+
@cloud_catalog_stub.logger
|
161
181
|
end
|
162
182
|
|
163
183
|
# Service calls
|
@@ -244,7 +264,7 @@ module Google
|
|
244
264
|
@cloud_catalog_stub.list_services request, options do |result, operation|
|
245
265
|
result = ::Gapic::Rest::PagedEnumerable.new @cloud_catalog_stub, :list_services, "services", request, result, options
|
246
266
|
yield result, operation if block_given?
|
247
|
-
|
267
|
+
throw :response, result
|
248
268
|
end
|
249
269
|
rescue ::Gapic::Rest::Error => e
|
250
270
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -353,7 +373,7 @@ module Google
|
|
353
373
|
@cloud_catalog_stub.list_skus request, options do |result, operation|
|
354
374
|
result = ::Gapic::Rest::PagedEnumerable.new @cloud_catalog_stub, :list_skus, "skus", request, result, options
|
355
375
|
yield result, operation if block_given?
|
356
|
-
|
376
|
+
throw :response, result
|
357
377
|
end
|
358
378
|
rescue ::Gapic::Rest::Error => e
|
359
379
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -433,6 +453,11 @@ module Google
|
|
433
453
|
# default endpoint URL. The default value of nil uses the environment
|
434
454
|
# universe (usually the default "googleapis.com" universe).
|
435
455
|
# @return [::String,nil]
|
456
|
+
# @!attribute [rw] logger
|
457
|
+
# A custom logger to use for request/response debug logging, or the value
|
458
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
459
|
+
# explicitly disable logging.
|
460
|
+
# @return [::Logger,:default,nil]
|
436
461
|
#
|
437
462
|
class Configuration
|
438
463
|
extend ::Gapic::Config
|
@@ -454,6 +479,7 @@ module Google
|
|
454
479
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
455
480
|
config_attr :quota_project, nil, ::String, nil
|
456
481
|
config_attr :universe_domain, nil, ::String, nil
|
482
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
457
483
|
|
458
484
|
# @private
|
459
485
|
def initialize parent_config = nil
|
@@ -30,7 +30,8 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
|
33
|
+
# @private
|
34
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
|
34
35
|
# These require statements are intentionally placed here to initialize
|
35
36
|
# the REST modules only when it's required.
|
36
37
|
require "gapic/rest"
|
@@ -40,7 +41,9 @@ module Google
|
|
40
41
|
universe_domain: universe_domain,
|
41
42
|
credentials: credentials,
|
42
43
|
numeric_enums: true,
|
43
|
-
|
44
|
+
service_name: self.class,
|
45
|
+
raise_faraday_errors: false,
|
46
|
+
logger: logger
|
44
47
|
end
|
45
48
|
|
46
49
|
##
|
@@ -61,6 +64,15 @@ module Google
|
|
61
64
|
@client_stub.endpoint
|
62
65
|
end
|
63
66
|
|
67
|
+
##
|
68
|
+
# The logger used for request/response debug logging.
|
69
|
+
#
|
70
|
+
# @return [Logger]
|
71
|
+
#
|
72
|
+
def logger stub: false
|
73
|
+
stub ? @client_stub.stub_logger : @client_stub.logger
|
74
|
+
end
|
75
|
+
|
64
76
|
##
|
65
77
|
# Baseline implementation for the list_services REST call
|
66
78
|
#
|
@@ -87,16 +99,18 @@ module Google
|
|
87
99
|
|
88
100
|
response = @client_stub.make_http_request(
|
89
101
|
verb,
|
90
|
-
uri:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "list_services",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::Billing::V1::ListServicesResponse.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
110
|
+
catch :response do
|
111
|
+
yield result, operation if block_given?
|
112
|
+
result
|
113
|
+
end
|
100
114
|
end
|
101
115
|
|
102
116
|
##
|
@@ -125,16 +139,18 @@ module Google
|
|
125
139
|
|
126
140
|
response = @client_stub.make_http_request(
|
127
141
|
verb,
|
128
|
-
uri:
|
129
|
-
body:
|
130
|
-
params:
|
142
|
+
uri: uri,
|
143
|
+
body: body || "",
|
144
|
+
params: query_string_params,
|
145
|
+
method_name: "list_skus",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Cloud::Billing::V1::ListSkusResponse.decode_json response.body, ignore_unknown_fields: true
|
135
|
-
|
136
|
-
|
137
|
-
|
150
|
+
catch :response do
|
151
|
+
yield result, operation if block_given?
|
152
|
+
result
|
153
|
+
end
|
138
154
|
end
|
139
155
|
|
140
156
|
##
|
@@ -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
|
@@ -212,6 +215,12 @@ module Google
|
|
212
215
|
# enabled. By default, asynchronous REST clients will not be generated.
|
213
216
|
# This feature will be enabled by default 1 month after launching the
|
214
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.
|
215
224
|
class ExperimentalFeatures
|
216
225
|
include ::Google::Protobuf::MessageExts
|
217
226
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -297,9 +306,28 @@ module Google
|
|
297
306
|
# @!attribute [rw] common
|
298
307
|
# @return [::Google::Api::CommonLanguageSettings]
|
299
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
|
300
319
|
class GoSettings
|
301
320
|
include ::Google::Protobuf::MessageExts
|
302
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
|
303
331
|
end
|
304
332
|
|
305
333
|
# Describes the generator configuration for a method.
|
@@ -375,6 +403,17 @@ module Google
|
|
375
403
|
end
|
376
404
|
end
|
377
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
|
+
|
378
417
|
# The organization for which the client libraries are being published.
|
379
418
|
# Affects the url where generated docs are published, etc.
|
380
419
|
module ClientLibraryOrganization
|
@@ -57,6 +57,17 @@ module Google
|
|
57
57
|
# `organizations/12345678`
|
58
58
|
# - `billingAccounts/{billing_account_id}`, for example,
|
59
59
|
# `billingAccounts/012345-567890-ABCDEF`
|
60
|
+
# @!attribute [rw] currency_code
|
61
|
+
# @return [::String]
|
62
|
+
# Optional. The currency in which the billing account is billed and charged,
|
63
|
+
# represented as an ISO 4217 code such as `USD`.
|
64
|
+
#
|
65
|
+
# Billing account currency is determined at the time of billing account
|
66
|
+
# creation and cannot be updated subsequently, so this field should not be
|
67
|
+
# set on update requests. In addition, a subaccount always matches the
|
68
|
+
# currency of its parent billing account, so this field should not be set on
|
69
|
+
# subaccount creation requests. Clients can read this field to determine the
|
70
|
+
# currency of an existing billing account.
|
60
71
|
class BillingAccount
|
61
72
|
include ::Google::Protobuf::MessageExts
|
62
73
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-billing-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.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-
|
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.
|
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.
|
29
|
+
version: 0.24.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
|
-
rubygems_version: 3.5.
|
130
|
+
rubygems_version: 3.5.23
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: Allows developers to manage billing for their Google Cloud Platform projects
|