OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.pubsub.v1; | 3 library googleapis.pubsub.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:crypto/crypto.dart' as crypto; | |
11 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
12 | 11 |
13 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
14 ApiRequestError, DetailedApiRequestError; | 13 ApiRequestError, DetailedApiRequestError; |
15 | 14 |
16 const core.String USER_AGENT = 'dart-api-client pubsub/v1'; | 15 const core.String USER_AGENT = 'dart-api-client pubsub/v1'; |
17 | 16 |
18 /** | 17 /** |
19 * Provides reliable, many-to-many, asynchronous messaging between applications. | 18 * Provides reliable, many-to-many, asynchronous messaging between applications. |
20 */ | 19 */ |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 * strongly suggested that systems make use of the `etag` in the | 1315 * strongly suggested that systems make use of the `etag` in the |
1317 * read-modify-write cycle to perform policy updates in order to avoid race | 1316 * read-modify-write cycle to perform policy updates in order to avoid race |
1318 * conditions: An `etag` is returned in the response to `getIamPolicy`, and | 1317 * conditions: An `etag` is returned in the response to `getIamPolicy`, and |
1319 * systems are expected to put that etag in the request to `setIamPolicy` to | 1318 * systems are expected to put that etag in the request to `setIamPolicy` to |
1320 * ensure that their change will be applied to the same version of the policy. | 1319 * ensure that their change will be applied to the same version of the policy. |
1321 * If no `etag` is provided in the call to `setIamPolicy`, then the existing | 1320 * If no `etag` is provided in the call to `setIamPolicy`, then the existing |
1322 * policy is overwritten blindly. | 1321 * policy is overwritten blindly. |
1323 */ | 1322 */ |
1324 core.String etag; | 1323 core.String etag; |
1325 core.List<core.int> get etagAsBytes { | 1324 core.List<core.int> get etagAsBytes { |
1326 return crypto.CryptoUtils.base64StringToBytes(etag); | 1325 return convert.BASE64.decode(etag); |
1327 } | 1326 } |
1328 | 1327 |
1329 void set etagAsBytes(core.List<core.int> _bytes) { | 1328 void set etagAsBytes(core.List<core.int> _bytes) { |
1330 etag = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 1329 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
1331 } | 1330 } |
1332 /** Version of the `Policy`. The default version is 0. */ | 1331 /** Version of the `Policy`. The default version is 0. */ |
1333 core.int version; | 1332 core.int version; |
1334 | 1333 |
1335 Policy(); | 1334 Policy(); |
1336 | 1335 |
1337 Policy.fromJson(core.Map _json) { | 1336 Policy.fromJson(core.Map _json) { |
1338 if (_json.containsKey("bindings")) { | 1337 if (_json.containsKey("bindings")) { |
1339 bindings = _json["bindings"].map((value) => new Binding.fromJson(value)).t
oList(); | 1338 bindings = _json["bindings"].map((value) => new Binding.fromJson(value)).t
oList(); |
1340 } | 1339 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 */ | 1413 */ |
1415 class PubsubMessage { | 1414 class PubsubMessage { |
1416 /** Optional attributes for this message. */ | 1415 /** Optional attributes for this message. */ |
1417 core.Map<core.String, core.String> attributes; | 1416 core.Map<core.String, core.String> attributes; |
1418 /** | 1417 /** |
1419 * The message payload. For JSON requests, the value of this field must be | 1418 * The message payload. For JSON requests, the value of this field must be |
1420 * base64-encoded. | 1419 * base64-encoded. |
1421 */ | 1420 */ |
1422 core.String data; | 1421 core.String data; |
1423 core.List<core.int> get dataAsBytes { | 1422 core.List<core.int> get dataAsBytes { |
1424 return crypto.CryptoUtils.base64StringToBytes(data); | 1423 return convert.BASE64.decode(data); |
1425 } | 1424 } |
1426 | 1425 |
1427 void set dataAsBytes(core.List<core.int> _bytes) { | 1426 void set dataAsBytes(core.List<core.int> _bytes) { |
1428 data = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); | 1427 data = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
1429 } | 1428 } |
1430 /** | 1429 /** |
1431 * ID of this message, assigned by the server when the message is published. | 1430 * ID of this message, assigned by the server when the message is published. |
1432 * Guaranteed to be unique within the topic. This value may be read by a | 1431 * Guaranteed to be unique within the topic. This value may be read by a |
1433 * subscriber that receives a `PubsubMessage` via a `Pull` call or a push | 1432 * subscriber that receives a `PubsubMessage` via a `Pull` call or a push |
1434 * delivery. It must not be populated by the publisher in a `Publish` call. | 1433 * delivery. It must not be populated by the publisher in a `Publish` call. |
1435 */ | 1434 */ |
1436 core.String messageId; | 1435 core.String messageId; |
1437 /** | 1436 /** |
1438 * The time at which the message was published, populated by the server when | 1437 * The time at which the message was published, populated by the server when |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1791 } | 1790 } |
1792 | 1791 |
1793 core.Map toJson() { | 1792 core.Map toJson() { |
1794 var _json = new core.Map(); | 1793 var _json = new core.Map(); |
1795 if (name != null) { | 1794 if (name != null) { |
1796 _json["name"] = name; | 1795 _json["name"] = name; |
1797 } | 1796 } |
1798 return _json; | 1797 return _json; |
1799 } | 1798 } |
1800 } | 1799 } |
OLD | NEW |