| // ignore_for_file: camel_case_types |
| // ignore_for_file: comment_references |
| // ignore_for_file: constant_identifier_names |
| // ignore_for_file: directives_ordering |
| // ignore_for_file: file_names |
| // ignore_for_file: library_names |
| // ignore_for_file: lines_longer_than_80_chars |
| // ignore_for_file: non_constant_identifier_names |
| // ignore_for_file: omit_local_variable_types |
| // ignore_for_file: prefer_expression_function_bodies |
| // ignore_for_file: prefer_final_locals |
| // ignore_for_file: prefer_interpolation_to_compose_strings |
| // ignore_for_file: unnecessary_brace_in_string_interps |
| // ignore_for_file: unnecessary_cast |
| // ignore_for_file: unnecessary_lambdas |
| // ignore_for_file: unnecessary_parenthesis |
| // ignore_for_file: unnecessary_string_interpolations |
| // ignore_for_file: avoid_returning_null |
| // ignore_for_file: cascade_invocations |
| // ignore_for_file: prefer_single_quotes |
| // ignore_for_file: unused_local_variable |
| |
| library googleapis.spanner.v1.test; |
| |
| import "dart:core" as core; |
| import "dart:async" as async; |
| import "dart:convert" as convert; |
| |
| import 'package:http/http.dart' as http; |
| import 'package:test/test.dart' as unittest; |
| |
| import 'package:googleapis/spanner/v1.dart' as api; |
| |
| class HttpServerMock extends http.BaseClient { |
| core.Function _callback; |
| core.bool _expectJson; |
| |
| void register(core.Function callback, core.bool expectJson) { |
| _callback = callback; |
| _expectJson = expectJson; |
| } |
| |
| @core.override |
| async.Future<http.StreamedResponse> send(http.BaseRequest request) async { |
| if (_expectJson) { |
| final jsonString = |
| await request.finalize().transform(convert.utf8.decoder).join(''); |
| if (jsonString.isEmpty) { |
| return _callback(request, null); |
| } else { |
| return _callback(request, convert.json.decode(jsonString)); |
| } |
| } else { |
| var stream = request.finalize(); |
| if (stream == null) { |
| return _callback(request, []); |
| } else { |
| final data = await stream.toBytes(); |
| return _callback(request, data); |
| } |
| } |
| } |
| } |
| |
| http.StreamedResponse stringResponse(core.int status, |
| core.Map<core.String, core.String> headers, core.String body) { |
| var stream = async.Stream.fromIterable([convert.utf8.encode(body)]); |
| return http.StreamedResponse(stream, status, headers: headers); |
| } |
| |
| core.List<core.String> buildUnnamed1534() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1534(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterBackup = 0; |
| api.Backup buildBackup() { |
| var o = api.Backup(); |
| buildCounterBackup++; |
| if (buildCounterBackup < 3) { |
| o.createTime = 'foo'; |
| o.database = 'foo'; |
| o.expireTime = 'foo'; |
| o.name = 'foo'; |
| o.referencingDatabases = buildUnnamed1534(); |
| o.sizeBytes = 'foo'; |
| o.state = 'foo'; |
| } |
| buildCounterBackup--; |
| return o; |
| } |
| |
| void checkBackup(api.Backup o) { |
| buildCounterBackup++; |
| if (buildCounterBackup < 3) { |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.database, unittest.equals('foo')); |
| unittest.expect(o.expireTime, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed1534(o.referencingDatabases); |
| unittest.expect(o.sizeBytes, unittest.equals('foo')); |
| unittest.expect(o.state, unittest.equals('foo')); |
| } |
| buildCounterBackup--; |
| } |
| |
| core.int buildCounterBackupInfo = 0; |
| api.BackupInfo buildBackupInfo() { |
| var o = api.BackupInfo(); |
| buildCounterBackupInfo++; |
| if (buildCounterBackupInfo < 3) { |
| o.backup = 'foo'; |
| o.createTime = 'foo'; |
| o.sourceDatabase = 'foo'; |
| } |
| buildCounterBackupInfo--; |
| return o; |
| } |
| |
| void checkBackupInfo(api.BackupInfo o) { |
| buildCounterBackupInfo++; |
| if (buildCounterBackupInfo < 3) { |
| unittest.expect(o.backup, unittest.equals('foo')); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.sourceDatabase, unittest.equals('foo')); |
| } |
| buildCounterBackupInfo--; |
| } |
| |
| core.int buildCounterBatchCreateSessionsRequest = 0; |
| api.BatchCreateSessionsRequest buildBatchCreateSessionsRequest() { |
| var o = api.BatchCreateSessionsRequest(); |
| buildCounterBatchCreateSessionsRequest++; |
| if (buildCounterBatchCreateSessionsRequest < 3) { |
| o.sessionCount = 42; |
| o.sessionTemplate = buildSession(); |
| } |
| buildCounterBatchCreateSessionsRequest--; |
| return o; |
| } |
| |
| void checkBatchCreateSessionsRequest(api.BatchCreateSessionsRequest o) { |
| buildCounterBatchCreateSessionsRequest++; |
| if (buildCounterBatchCreateSessionsRequest < 3) { |
| unittest.expect(o.sessionCount, unittest.equals(42)); |
| checkSession(o.sessionTemplate); |
| } |
| buildCounterBatchCreateSessionsRequest--; |
| } |
| |
| core.List<api.Session> buildUnnamed1535() { |
| var o = <api.Session>[]; |
| o.add(buildSession()); |
| o.add(buildSession()); |
| return o; |
| } |
| |
| void checkUnnamed1535(core.List<api.Session> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSession(o[0]); |
| checkSession(o[1]); |
| } |
| |
| core.int buildCounterBatchCreateSessionsResponse = 0; |
| api.BatchCreateSessionsResponse buildBatchCreateSessionsResponse() { |
| var o = api.BatchCreateSessionsResponse(); |
| buildCounterBatchCreateSessionsResponse++; |
| if (buildCounterBatchCreateSessionsResponse < 3) { |
| o.session = buildUnnamed1535(); |
| } |
| buildCounterBatchCreateSessionsResponse--; |
| return o; |
| } |
| |
| void checkBatchCreateSessionsResponse(api.BatchCreateSessionsResponse o) { |
| buildCounterBatchCreateSessionsResponse++; |
| if (buildCounterBatchCreateSessionsResponse < 3) { |
| checkUnnamed1535(o.session); |
| } |
| buildCounterBatchCreateSessionsResponse--; |
| } |
| |
| core.int buildCounterBeginTransactionRequest = 0; |
| api.BeginTransactionRequest buildBeginTransactionRequest() { |
| var o = api.BeginTransactionRequest(); |
| buildCounterBeginTransactionRequest++; |
| if (buildCounterBeginTransactionRequest < 3) { |
| o.options = buildTransactionOptions(); |
| } |
| buildCounterBeginTransactionRequest--; |
| return o; |
| } |
| |
| void checkBeginTransactionRequest(api.BeginTransactionRequest o) { |
| buildCounterBeginTransactionRequest++; |
| if (buildCounterBeginTransactionRequest < 3) { |
| checkTransactionOptions(o.options); |
| } |
| buildCounterBeginTransactionRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed1536() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1536(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterBinding = 0; |
| api.Binding buildBinding() { |
| var o = api.Binding(); |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| o.bindingId = 'foo'; |
| o.condition = buildExpr(); |
| o.members = buildUnnamed1536(); |
| o.role = 'foo'; |
| } |
| buildCounterBinding--; |
| return o; |
| } |
| |
| void checkBinding(api.Binding o) { |
| buildCounterBinding++; |
| if (buildCounterBinding < 3) { |
| unittest.expect(o.bindingId, unittest.equals('foo')); |
| checkExpr(o.condition); |
| checkUnnamed1536(o.members); |
| unittest.expect(o.role, unittest.equals('foo')); |
| } |
| buildCounterBinding--; |
| } |
| |
| core.int buildCounterChildLink = 0; |
| api.ChildLink buildChildLink() { |
| var o = api.ChildLink(); |
| buildCounterChildLink++; |
| if (buildCounterChildLink < 3) { |
| o.childIndex = 42; |
| o.type = 'foo'; |
| o.variable = 'foo'; |
| } |
| buildCounterChildLink--; |
| return o; |
| } |
| |
| void checkChildLink(api.ChildLink o) { |
| buildCounterChildLink++; |
| if (buildCounterChildLink < 3) { |
| unittest.expect(o.childIndex, unittest.equals(42)); |
| unittest.expect(o.type, unittest.equals('foo')); |
| unittest.expect(o.variable, unittest.equals('foo')); |
| } |
| buildCounterChildLink--; |
| } |
| |
| core.List<api.Mutation> buildUnnamed1537() { |
| var o = <api.Mutation>[]; |
| o.add(buildMutation()); |
| o.add(buildMutation()); |
| return o; |
| } |
| |
| void checkUnnamed1537(core.List<api.Mutation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkMutation(o[0]); |
| checkMutation(o[1]); |
| } |
| |
| core.int buildCounterCommitRequest = 0; |
| api.CommitRequest buildCommitRequest() { |
| var o = api.CommitRequest(); |
| buildCounterCommitRequest++; |
| if (buildCounterCommitRequest < 3) { |
| o.mutations = buildUnnamed1537(); |
| o.singleUseTransaction = buildTransactionOptions(); |
| o.transactionId = 'foo'; |
| } |
| buildCounterCommitRequest--; |
| return o; |
| } |
| |
| void checkCommitRequest(api.CommitRequest o) { |
| buildCounterCommitRequest++; |
| if (buildCounterCommitRequest < 3) { |
| checkUnnamed1537(o.mutations); |
| checkTransactionOptions(o.singleUseTransaction); |
| unittest.expect(o.transactionId, unittest.equals('foo')); |
| } |
| buildCounterCommitRequest--; |
| } |
| |
| core.int buildCounterCommitResponse = 0; |
| api.CommitResponse buildCommitResponse() { |
| var o = api.CommitResponse(); |
| buildCounterCommitResponse++; |
| if (buildCounterCommitResponse < 3) { |
| o.commitTimestamp = 'foo'; |
| } |
| buildCounterCommitResponse--; |
| return o; |
| } |
| |
| void checkCommitResponse(api.CommitResponse o) { |
| buildCounterCommitResponse++; |
| if (buildCounterCommitResponse < 3) { |
| unittest.expect(o.commitTimestamp, unittest.equals('foo')); |
| } |
| buildCounterCommitResponse--; |
| } |
| |
| core.int buildCounterCreateBackupMetadata = 0; |
| api.CreateBackupMetadata buildCreateBackupMetadata() { |
| var o = api.CreateBackupMetadata(); |
| buildCounterCreateBackupMetadata++; |
| if (buildCounterCreateBackupMetadata < 3) { |
| o.cancelTime = 'foo'; |
| o.database = 'foo'; |
| o.name = 'foo'; |
| o.progress = buildOperationProgress(); |
| } |
| buildCounterCreateBackupMetadata--; |
| return o; |
| } |
| |
| void checkCreateBackupMetadata(api.CreateBackupMetadata o) { |
| buildCounterCreateBackupMetadata++; |
| if (buildCounterCreateBackupMetadata < 3) { |
| unittest.expect(o.cancelTime, unittest.equals('foo')); |
| unittest.expect(o.database, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkOperationProgress(o.progress); |
| } |
| buildCounterCreateBackupMetadata--; |
| } |
| |
| core.int buildCounterCreateDatabaseMetadata = 0; |
| api.CreateDatabaseMetadata buildCreateDatabaseMetadata() { |
| var o = api.CreateDatabaseMetadata(); |
| buildCounterCreateDatabaseMetadata++; |
| if (buildCounterCreateDatabaseMetadata < 3) { |
| o.database = 'foo'; |
| } |
| buildCounterCreateDatabaseMetadata--; |
| return o; |
| } |
| |
| void checkCreateDatabaseMetadata(api.CreateDatabaseMetadata o) { |
| buildCounterCreateDatabaseMetadata++; |
| if (buildCounterCreateDatabaseMetadata < 3) { |
| unittest.expect(o.database, unittest.equals('foo')); |
| } |
| buildCounterCreateDatabaseMetadata--; |
| } |
| |
| core.List<core.String> buildUnnamed1538() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1538(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterCreateDatabaseRequest = 0; |
| api.CreateDatabaseRequest buildCreateDatabaseRequest() { |
| var o = api.CreateDatabaseRequest(); |
| buildCounterCreateDatabaseRequest++; |
| if (buildCounterCreateDatabaseRequest < 3) { |
| o.createStatement = 'foo'; |
| o.extraStatements = buildUnnamed1538(); |
| } |
| buildCounterCreateDatabaseRequest--; |
| return o; |
| } |
| |
| void checkCreateDatabaseRequest(api.CreateDatabaseRequest o) { |
| buildCounterCreateDatabaseRequest++; |
| if (buildCounterCreateDatabaseRequest < 3) { |
| unittest.expect(o.createStatement, unittest.equals('foo')); |
| checkUnnamed1538(o.extraStatements); |
| } |
| buildCounterCreateDatabaseRequest--; |
| } |
| |
| core.int buildCounterCreateInstanceMetadata = 0; |
| api.CreateInstanceMetadata buildCreateInstanceMetadata() { |
| var o = api.CreateInstanceMetadata(); |
| buildCounterCreateInstanceMetadata++; |
| if (buildCounterCreateInstanceMetadata < 3) { |
| o.cancelTime = 'foo'; |
| o.endTime = 'foo'; |
| o.instance = buildInstance(); |
| o.startTime = 'foo'; |
| } |
| buildCounterCreateInstanceMetadata--; |
| return o; |
| } |
| |
| void checkCreateInstanceMetadata(api.CreateInstanceMetadata o) { |
| buildCounterCreateInstanceMetadata++; |
| if (buildCounterCreateInstanceMetadata < 3) { |
| unittest.expect(o.cancelTime, unittest.equals('foo')); |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| checkInstance(o.instance); |
| unittest.expect(o.startTime, unittest.equals('foo')); |
| } |
| buildCounterCreateInstanceMetadata--; |
| } |
| |
| core.int buildCounterCreateInstanceRequest = 0; |
| api.CreateInstanceRequest buildCreateInstanceRequest() { |
| var o = api.CreateInstanceRequest(); |
| buildCounterCreateInstanceRequest++; |
| if (buildCounterCreateInstanceRequest < 3) { |
| o.instance = buildInstance(); |
| o.instanceId = 'foo'; |
| } |
| buildCounterCreateInstanceRequest--; |
| return o; |
| } |
| |
| void checkCreateInstanceRequest(api.CreateInstanceRequest o) { |
| buildCounterCreateInstanceRequest++; |
| if (buildCounterCreateInstanceRequest < 3) { |
| checkInstance(o.instance); |
| unittest.expect(o.instanceId, unittest.equals('foo')); |
| } |
| buildCounterCreateInstanceRequest--; |
| } |
| |
| core.int buildCounterCreateSessionRequest = 0; |
| api.CreateSessionRequest buildCreateSessionRequest() { |
| var o = api.CreateSessionRequest(); |
| buildCounterCreateSessionRequest++; |
| if (buildCounterCreateSessionRequest < 3) { |
| o.session = buildSession(); |
| } |
| buildCounterCreateSessionRequest--; |
| return o; |
| } |
| |
| void checkCreateSessionRequest(api.CreateSessionRequest o) { |
| buildCounterCreateSessionRequest++; |
| if (buildCounterCreateSessionRequest < 3) { |
| checkSession(o.session); |
| } |
| buildCounterCreateSessionRequest--; |
| } |
| |
| core.int buildCounterDatabase = 0; |
| api.Database buildDatabase() { |
| var o = api.Database(); |
| buildCounterDatabase++; |
| if (buildCounterDatabase < 3) { |
| o.createTime = 'foo'; |
| o.name = 'foo'; |
| o.restoreInfo = buildRestoreInfo(); |
| o.state = 'foo'; |
| } |
| buildCounterDatabase--; |
| return o; |
| } |
| |
| void checkDatabase(api.Database o) { |
| buildCounterDatabase++; |
| if (buildCounterDatabase < 3) { |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkRestoreInfo(o.restoreInfo); |
| unittest.expect(o.state, unittest.equals('foo')); |
| } |
| buildCounterDatabase--; |
| } |
| |
| core.int buildCounterDelete = 0; |
| api.Delete buildDelete() { |
| var o = api.Delete(); |
| buildCounterDelete++; |
| if (buildCounterDelete < 3) { |
| o.keySet = buildKeySet(); |
| o.table = 'foo'; |
| } |
| buildCounterDelete--; |
| return o; |
| } |
| |
| void checkDelete(api.Delete o) { |
| buildCounterDelete++; |
| if (buildCounterDelete < 3) { |
| checkKeySet(o.keySet); |
| unittest.expect(o.table, unittest.equals('foo')); |
| } |
| buildCounterDelete--; |
| } |
| |
| core.int buildCounterEmpty = 0; |
| api.Empty buildEmpty() { |
| var o = api.Empty(); |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| return o; |
| } |
| |
| void checkEmpty(api.Empty o) { |
| buildCounterEmpty++; |
| if (buildCounterEmpty < 3) {} |
| buildCounterEmpty--; |
| } |
| |
| core.List<api.Statement> buildUnnamed1539() { |
| var o = <api.Statement>[]; |
| o.add(buildStatement()); |
| o.add(buildStatement()); |
| return o; |
| } |
| |
| void checkUnnamed1539(core.List<api.Statement> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkStatement(o[0]); |
| checkStatement(o[1]); |
| } |
| |
| core.int buildCounterExecuteBatchDmlRequest = 0; |
| api.ExecuteBatchDmlRequest buildExecuteBatchDmlRequest() { |
| var o = api.ExecuteBatchDmlRequest(); |
| buildCounterExecuteBatchDmlRequest++; |
| if (buildCounterExecuteBatchDmlRequest < 3) { |
| o.seqno = 'foo'; |
| o.statements = buildUnnamed1539(); |
| o.transaction = buildTransactionSelector(); |
| } |
| buildCounterExecuteBatchDmlRequest--; |
| return o; |
| } |
| |
| void checkExecuteBatchDmlRequest(api.ExecuteBatchDmlRequest o) { |
| buildCounterExecuteBatchDmlRequest++; |
| if (buildCounterExecuteBatchDmlRequest < 3) { |
| unittest.expect(o.seqno, unittest.equals('foo')); |
| checkUnnamed1539(o.statements); |
| checkTransactionSelector(o.transaction); |
| } |
| buildCounterExecuteBatchDmlRequest--; |
| } |
| |
| core.List<api.ResultSet> buildUnnamed1540() { |
| var o = <api.ResultSet>[]; |
| o.add(buildResultSet()); |
| o.add(buildResultSet()); |
| return o; |
| } |
| |
| void checkUnnamed1540(core.List<api.ResultSet> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkResultSet(o[0]); |
| checkResultSet(o[1]); |
| } |
| |
| core.int buildCounterExecuteBatchDmlResponse = 0; |
| api.ExecuteBatchDmlResponse buildExecuteBatchDmlResponse() { |
| var o = api.ExecuteBatchDmlResponse(); |
| buildCounterExecuteBatchDmlResponse++; |
| if (buildCounterExecuteBatchDmlResponse < 3) { |
| o.resultSets = buildUnnamed1540(); |
| o.status = buildStatus(); |
| } |
| buildCounterExecuteBatchDmlResponse--; |
| return o; |
| } |
| |
| void checkExecuteBatchDmlResponse(api.ExecuteBatchDmlResponse o) { |
| buildCounterExecuteBatchDmlResponse++; |
| if (buildCounterExecuteBatchDmlResponse < 3) { |
| checkUnnamed1540(o.resultSets); |
| checkStatus(o.status); |
| } |
| buildCounterExecuteBatchDmlResponse--; |
| } |
| |
| core.Map<core.String, api.Type> buildUnnamed1541() { |
| var o = <core.String, api.Type>{}; |
| o['x'] = buildType(); |
| o['y'] = buildType(); |
| return o; |
| } |
| |
| void checkUnnamed1541(core.Map<core.String, api.Type> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkType(o['x']); |
| checkType(o['y']); |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1542() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1542(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted1 = (o['x']) as core.Map; |
| unittest.expect(casted1, unittest.hasLength(3)); |
| unittest.expect(casted1['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted1['bool'], unittest.equals(true)); |
| unittest.expect(casted1['string'], unittest.equals('foo')); |
| var casted2 = (o['y']) as core.Map; |
| unittest.expect(casted2, unittest.hasLength(3)); |
| unittest.expect(casted2['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted2['bool'], unittest.equals(true)); |
| unittest.expect(casted2['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterExecuteSqlRequest = 0; |
| api.ExecuteSqlRequest buildExecuteSqlRequest() { |
| var o = api.ExecuteSqlRequest(); |
| buildCounterExecuteSqlRequest++; |
| if (buildCounterExecuteSqlRequest < 3) { |
| o.paramTypes = buildUnnamed1541(); |
| o.params = buildUnnamed1542(); |
| o.partitionToken = 'foo'; |
| o.queryMode = 'foo'; |
| o.queryOptions = buildQueryOptions(); |
| o.resumeToken = 'foo'; |
| o.seqno = 'foo'; |
| o.sql = 'foo'; |
| o.transaction = buildTransactionSelector(); |
| } |
| buildCounterExecuteSqlRequest--; |
| return o; |
| } |
| |
| void checkExecuteSqlRequest(api.ExecuteSqlRequest o) { |
| buildCounterExecuteSqlRequest++; |
| if (buildCounterExecuteSqlRequest < 3) { |
| checkUnnamed1541(o.paramTypes); |
| checkUnnamed1542(o.params); |
| unittest.expect(o.partitionToken, unittest.equals('foo')); |
| unittest.expect(o.queryMode, unittest.equals('foo')); |
| checkQueryOptions(o.queryOptions); |
| unittest.expect(o.resumeToken, unittest.equals('foo')); |
| unittest.expect(o.seqno, unittest.equals('foo')); |
| unittest.expect(o.sql, unittest.equals('foo')); |
| checkTransactionSelector(o.transaction); |
| } |
| buildCounterExecuteSqlRequest--; |
| } |
| |
| core.int buildCounterExpr = 0; |
| api.Expr buildExpr() { |
| var o = api.Expr(); |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| o.description = 'foo'; |
| o.expression = 'foo'; |
| o.location = 'foo'; |
| o.title = 'foo'; |
| } |
| buildCounterExpr--; |
| return o; |
| } |
| |
| void checkExpr(api.Expr o) { |
| buildCounterExpr++; |
| if (buildCounterExpr < 3) { |
| unittest.expect(o.description, unittest.equals('foo')); |
| unittest.expect(o.expression, unittest.equals('foo')); |
| unittest.expect(o.location, unittest.equals('foo')); |
| unittest.expect(o.title, unittest.equals('foo')); |
| } |
| buildCounterExpr--; |
| } |
| |
| core.int buildCounterField = 0; |
| api.Field buildField() { |
| var o = api.Field(); |
| buildCounterField++; |
| if (buildCounterField < 3) { |
| o.name = 'foo'; |
| o.type = buildType(); |
| } |
| buildCounterField--; |
| return o; |
| } |
| |
| void checkField(api.Field o) { |
| buildCounterField++; |
| if (buildCounterField < 3) { |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkType(o.type); |
| } |
| buildCounterField--; |
| } |
| |
| core.List<core.String> buildUnnamed1543() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1543(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterGetDatabaseDdlResponse = 0; |
| api.GetDatabaseDdlResponse buildGetDatabaseDdlResponse() { |
| var o = api.GetDatabaseDdlResponse(); |
| buildCounterGetDatabaseDdlResponse++; |
| if (buildCounterGetDatabaseDdlResponse < 3) { |
| o.statements = buildUnnamed1543(); |
| } |
| buildCounterGetDatabaseDdlResponse--; |
| return o; |
| } |
| |
| void checkGetDatabaseDdlResponse(api.GetDatabaseDdlResponse o) { |
| buildCounterGetDatabaseDdlResponse++; |
| if (buildCounterGetDatabaseDdlResponse < 3) { |
| checkUnnamed1543(o.statements); |
| } |
| buildCounterGetDatabaseDdlResponse--; |
| } |
| |
| core.int buildCounterGetIamPolicyRequest = 0; |
| api.GetIamPolicyRequest buildGetIamPolicyRequest() { |
| var o = api.GetIamPolicyRequest(); |
| buildCounterGetIamPolicyRequest++; |
| if (buildCounterGetIamPolicyRequest < 3) { |
| o.options = buildGetPolicyOptions(); |
| } |
| buildCounterGetIamPolicyRequest--; |
| return o; |
| } |
| |
| void checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { |
| buildCounterGetIamPolicyRequest++; |
| if (buildCounterGetIamPolicyRequest < 3) { |
| checkGetPolicyOptions(o.options); |
| } |
| buildCounterGetIamPolicyRequest--; |
| } |
| |
| core.int buildCounterGetPolicyOptions = 0; |
| api.GetPolicyOptions buildGetPolicyOptions() { |
| var o = api.GetPolicyOptions(); |
| buildCounterGetPolicyOptions++; |
| if (buildCounterGetPolicyOptions < 3) { |
| o.requestedPolicyVersion = 42; |
| } |
| buildCounterGetPolicyOptions--; |
| return o; |
| } |
| |
| void checkGetPolicyOptions(api.GetPolicyOptions o) { |
| buildCounterGetPolicyOptions++; |
| if (buildCounterGetPolicyOptions < 3) { |
| unittest.expect(o.requestedPolicyVersion, unittest.equals(42)); |
| } |
| buildCounterGetPolicyOptions--; |
| } |
| |
| core.List<core.String> buildUnnamed1544() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1544(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed1545() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed1545(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o['x'], unittest.equals('foo')); |
| unittest.expect(o['y'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterInstance = 0; |
| api.Instance buildInstance() { |
| var o = api.Instance(); |
| buildCounterInstance++; |
| if (buildCounterInstance < 3) { |
| o.config = 'foo'; |
| o.displayName = 'foo'; |
| o.endpointUris = buildUnnamed1544(); |
| o.labels = buildUnnamed1545(); |
| o.name = 'foo'; |
| o.nodeCount = 42; |
| o.state = 'foo'; |
| } |
| buildCounterInstance--; |
| return o; |
| } |
| |
| void checkInstance(api.Instance o) { |
| buildCounterInstance++; |
| if (buildCounterInstance < 3) { |
| unittest.expect(o.config, unittest.equals('foo')); |
| unittest.expect(o.displayName, unittest.equals('foo')); |
| checkUnnamed1544(o.endpointUris); |
| checkUnnamed1545(o.labels); |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.nodeCount, unittest.equals(42)); |
| unittest.expect(o.state, unittest.equals('foo')); |
| } |
| buildCounterInstance--; |
| } |
| |
| core.List<api.ReplicaInfo> buildUnnamed1546() { |
| var o = <api.ReplicaInfo>[]; |
| o.add(buildReplicaInfo()); |
| o.add(buildReplicaInfo()); |
| return o; |
| } |
| |
| void checkUnnamed1546(core.List<api.ReplicaInfo> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkReplicaInfo(o[0]); |
| checkReplicaInfo(o[1]); |
| } |
| |
| core.int buildCounterInstanceConfig = 0; |
| api.InstanceConfig buildInstanceConfig() { |
| var o = api.InstanceConfig(); |
| buildCounterInstanceConfig++; |
| if (buildCounterInstanceConfig < 3) { |
| o.displayName = 'foo'; |
| o.name = 'foo'; |
| o.replicas = buildUnnamed1546(); |
| } |
| buildCounterInstanceConfig--; |
| return o; |
| } |
| |
| void checkInstanceConfig(api.InstanceConfig o) { |
| buildCounterInstanceConfig++; |
| if (buildCounterInstanceConfig < 3) { |
| unittest.expect(o.displayName, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed1546(o.replicas); |
| } |
| buildCounterInstanceConfig--; |
| } |
| |
| core.List<core.Object> buildUnnamed1547() { |
| var o = <core.Object>[]; |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| return o; |
| } |
| |
| void checkUnnamed1547(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted3 = (o[0]) as core.Map; |
| unittest.expect(casted3, unittest.hasLength(3)); |
| unittest.expect(casted3['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted3['bool'], unittest.equals(true)); |
| unittest.expect(casted3['string'], unittest.equals('foo')); |
| var casted4 = (o[1]) as core.Map; |
| unittest.expect(casted4, unittest.hasLength(3)); |
| unittest.expect(casted4['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted4['bool'], unittest.equals(true)); |
| unittest.expect(casted4['string'], unittest.equals('foo')); |
| } |
| |
| core.List<core.Object> buildUnnamed1548() { |
| var o = <core.Object>[]; |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| return o; |
| } |
| |
| void checkUnnamed1548(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted5 = (o[0]) as core.Map; |
| unittest.expect(casted5, unittest.hasLength(3)); |
| unittest.expect(casted5['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted5['bool'], unittest.equals(true)); |
| unittest.expect(casted5['string'], unittest.equals('foo')); |
| var casted6 = (o[1]) as core.Map; |
| unittest.expect(casted6, unittest.hasLength(3)); |
| unittest.expect(casted6['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted6['bool'], unittest.equals(true)); |
| unittest.expect(casted6['string'], unittest.equals('foo')); |
| } |
| |
| core.List<core.Object> buildUnnamed1549() { |
| var o = <core.Object>[]; |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| return o; |
| } |
| |
| void checkUnnamed1549(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted7 = (o[0]) as core.Map; |
| unittest.expect(casted7, unittest.hasLength(3)); |
| unittest.expect(casted7['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted7['bool'], unittest.equals(true)); |
| unittest.expect(casted7['string'], unittest.equals('foo')); |
| var casted8 = (o[1]) as core.Map; |
| unittest.expect(casted8, unittest.hasLength(3)); |
| unittest.expect(casted8['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted8['bool'], unittest.equals(true)); |
| unittest.expect(casted8['string'], unittest.equals('foo')); |
| } |
| |
| core.List<core.Object> buildUnnamed1550() { |
| var o = <core.Object>[]; |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| return o; |
| } |
| |
| void checkUnnamed1550(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted9 = (o[0]) as core.Map; |
| unittest.expect(casted9, unittest.hasLength(3)); |
| unittest.expect(casted9['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted9['bool'], unittest.equals(true)); |
| unittest.expect(casted9['string'], unittest.equals('foo')); |
| var casted10 = (o[1]) as core.Map; |
| unittest.expect(casted10, unittest.hasLength(3)); |
| unittest.expect(casted10['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted10['bool'], unittest.equals(true)); |
| unittest.expect(casted10['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterKeyRange = 0; |
| api.KeyRange buildKeyRange() { |
| var o = api.KeyRange(); |
| buildCounterKeyRange++; |
| if (buildCounterKeyRange < 3) { |
| o.endClosed = buildUnnamed1547(); |
| o.endOpen = buildUnnamed1548(); |
| o.startClosed = buildUnnamed1549(); |
| o.startOpen = buildUnnamed1550(); |
| } |
| buildCounterKeyRange--; |
| return o; |
| } |
| |
| void checkKeyRange(api.KeyRange o) { |
| buildCounterKeyRange++; |
| if (buildCounterKeyRange < 3) { |
| checkUnnamed1547(o.endClosed); |
| checkUnnamed1548(o.endOpen); |
| checkUnnamed1549(o.startClosed); |
| checkUnnamed1550(o.startOpen); |
| } |
| buildCounterKeyRange--; |
| } |
| |
| core.List<core.Object> buildUnnamed1551() { |
| var o = <core.Object>[]; |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| return o; |
| } |
| |
| void checkUnnamed1551(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted11 = (o[0]) as core.Map; |
| unittest.expect(casted11, unittest.hasLength(3)); |
| unittest.expect(casted11['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted11['bool'], unittest.equals(true)); |
| unittest.expect(casted11['string'], unittest.equals('foo')); |
| var casted12 = (o[1]) as core.Map; |
| unittest.expect(casted12, unittest.hasLength(3)); |
| unittest.expect(casted12['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted12['bool'], unittest.equals(true)); |
| unittest.expect(casted12['string'], unittest.equals('foo')); |
| } |
| |
| core.List<core.List<core.Object>> buildUnnamed1552() { |
| var o = <core.List<core.Object>>[]; |
| o.add(buildUnnamed1551()); |
| o.add(buildUnnamed1551()); |
| return o; |
| } |
| |
| void checkUnnamed1552(core.List<core.List<core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed1551(o[0]); |
| checkUnnamed1551(o[1]); |
| } |
| |
| core.List<api.KeyRange> buildUnnamed1553() { |
| var o = <api.KeyRange>[]; |
| o.add(buildKeyRange()); |
| o.add(buildKeyRange()); |
| return o; |
| } |
| |
| void checkUnnamed1553(core.List<api.KeyRange> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkKeyRange(o[0]); |
| checkKeyRange(o[1]); |
| } |
| |
| core.int buildCounterKeySet = 0; |
| api.KeySet buildKeySet() { |
| var o = api.KeySet(); |
| buildCounterKeySet++; |
| if (buildCounterKeySet < 3) { |
| o.all = true; |
| o.keys = buildUnnamed1552(); |
| o.ranges = buildUnnamed1553(); |
| } |
| buildCounterKeySet--; |
| return o; |
| } |
| |
| void checkKeySet(api.KeySet o) { |
| buildCounterKeySet++; |
| if (buildCounterKeySet < 3) { |
| unittest.expect(o.all, unittest.isTrue); |
| checkUnnamed1552(o.keys); |
| checkUnnamed1553(o.ranges); |
| } |
| buildCounterKeySet--; |
| } |
| |
| core.List<api.Operation> buildUnnamed1554() { |
| var o = <api.Operation>[]; |
| o.add(buildOperation()); |
| o.add(buildOperation()); |
| return o; |
| } |
| |
| void checkUnnamed1554(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.int buildCounterListBackupOperationsResponse = 0; |
| api.ListBackupOperationsResponse buildListBackupOperationsResponse() { |
| var o = api.ListBackupOperationsResponse(); |
| buildCounterListBackupOperationsResponse++; |
| if (buildCounterListBackupOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed1554(); |
| } |
| buildCounterListBackupOperationsResponse--; |
| return o; |
| } |
| |
| void checkListBackupOperationsResponse(api.ListBackupOperationsResponse o) { |
| buildCounterListBackupOperationsResponse++; |
| if (buildCounterListBackupOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed1554(o.operations); |
| } |
| buildCounterListBackupOperationsResponse--; |
| } |
| |
| core.List<api.Backup> buildUnnamed1555() { |
| var o = <api.Backup>[]; |
| o.add(buildBackup()); |
| o.add(buildBackup()); |
| return o; |
| } |
| |
| void checkUnnamed1555(core.List<api.Backup> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBackup(o[0]); |
| checkBackup(o[1]); |
| } |
| |
| core.int buildCounterListBackupsResponse = 0; |
| api.ListBackupsResponse buildListBackupsResponse() { |
| var o = api.ListBackupsResponse(); |
| buildCounterListBackupsResponse++; |
| if (buildCounterListBackupsResponse < 3) { |
| o.backups = buildUnnamed1555(); |
| o.nextPageToken = 'foo'; |
| } |
| buildCounterListBackupsResponse--; |
| return o; |
| } |
| |
| void checkListBackupsResponse(api.ListBackupsResponse o) { |
| buildCounterListBackupsResponse++; |
| if (buildCounterListBackupsResponse < 3) { |
| checkUnnamed1555(o.backups); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| } |
| buildCounterListBackupsResponse--; |
| } |
| |
| core.List<api.Operation> buildUnnamed1556() { |
| var o = <api.Operation>[]; |
| o.add(buildOperation()); |
| o.add(buildOperation()); |
| return o; |
| } |
| |
| void checkUnnamed1556(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.int buildCounterListDatabaseOperationsResponse = 0; |
| api.ListDatabaseOperationsResponse buildListDatabaseOperationsResponse() { |
| var o = api.ListDatabaseOperationsResponse(); |
| buildCounterListDatabaseOperationsResponse++; |
| if (buildCounterListDatabaseOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed1556(); |
| } |
| buildCounterListDatabaseOperationsResponse--; |
| return o; |
| } |
| |
| void checkListDatabaseOperationsResponse(api.ListDatabaseOperationsResponse o) { |
| buildCounterListDatabaseOperationsResponse++; |
| if (buildCounterListDatabaseOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed1556(o.operations); |
| } |
| buildCounterListDatabaseOperationsResponse--; |
| } |
| |
| core.List<api.Database> buildUnnamed1557() { |
| var o = <api.Database>[]; |
| o.add(buildDatabase()); |
| o.add(buildDatabase()); |
| return o; |
| } |
| |
| void checkUnnamed1557(core.List<api.Database> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkDatabase(o[0]); |
| checkDatabase(o[1]); |
| } |
| |
| core.int buildCounterListDatabasesResponse = 0; |
| api.ListDatabasesResponse buildListDatabasesResponse() { |
| var o = api.ListDatabasesResponse(); |
| buildCounterListDatabasesResponse++; |
| if (buildCounterListDatabasesResponse < 3) { |
| o.databases = buildUnnamed1557(); |
| o.nextPageToken = 'foo'; |
| } |
| buildCounterListDatabasesResponse--; |
| return o; |
| } |
| |
| void checkListDatabasesResponse(api.ListDatabasesResponse o) { |
| buildCounterListDatabasesResponse++; |
| if (buildCounterListDatabasesResponse < 3) { |
| checkUnnamed1557(o.databases); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| } |
| buildCounterListDatabasesResponse--; |
| } |
| |
| core.List<api.InstanceConfig> buildUnnamed1558() { |
| var o = <api.InstanceConfig>[]; |
| o.add(buildInstanceConfig()); |
| o.add(buildInstanceConfig()); |
| return o; |
| } |
| |
| void checkUnnamed1558(core.List<api.InstanceConfig> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkInstanceConfig(o[0]); |
| checkInstanceConfig(o[1]); |
| } |
| |
| core.int buildCounterListInstanceConfigsResponse = 0; |
| api.ListInstanceConfigsResponse buildListInstanceConfigsResponse() { |
| var o = api.ListInstanceConfigsResponse(); |
| buildCounterListInstanceConfigsResponse++; |
| if (buildCounterListInstanceConfigsResponse < 3) { |
| o.instanceConfigs = buildUnnamed1558(); |
| o.nextPageToken = 'foo'; |
| } |
| buildCounterListInstanceConfigsResponse--; |
| return o; |
| } |
| |
| void checkListInstanceConfigsResponse(api.ListInstanceConfigsResponse o) { |
| buildCounterListInstanceConfigsResponse++; |
| if (buildCounterListInstanceConfigsResponse < 3) { |
| checkUnnamed1558(o.instanceConfigs); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| } |
| buildCounterListInstanceConfigsResponse--; |
| } |
| |
| core.List<api.Instance> buildUnnamed1559() { |
| var o = <api.Instance>[]; |
| o.add(buildInstance()); |
| o.add(buildInstance()); |
| return o; |
| } |
| |
| void checkUnnamed1559(core.List<api.Instance> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkInstance(o[0]); |
| checkInstance(o[1]); |
| } |
| |
| core.int buildCounterListInstancesResponse = 0; |
| api.ListInstancesResponse buildListInstancesResponse() { |
| var o = api.ListInstancesResponse(); |
| buildCounterListInstancesResponse++; |
| if (buildCounterListInstancesResponse < 3) { |
| o.instances = buildUnnamed1559(); |
| o.nextPageToken = 'foo'; |
| } |
| buildCounterListInstancesResponse--; |
| return o; |
| } |
| |
| void checkListInstancesResponse(api.ListInstancesResponse o) { |
| buildCounterListInstancesResponse++; |
| if (buildCounterListInstancesResponse < 3) { |
| checkUnnamed1559(o.instances); |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| } |
| buildCounterListInstancesResponse--; |
| } |
| |
| core.List<api.Operation> buildUnnamed1560() { |
| var o = <api.Operation>[]; |
| o.add(buildOperation()); |
| o.add(buildOperation()); |
| return o; |
| } |
| |
| void checkUnnamed1560(core.List<api.Operation> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkOperation(o[0]); |
| checkOperation(o[1]); |
| } |
| |
| core.int buildCounterListOperationsResponse = 0; |
| api.ListOperationsResponse buildListOperationsResponse() { |
| var o = api.ListOperationsResponse(); |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.operations = buildUnnamed1560(); |
| } |
| buildCounterListOperationsResponse--; |
| return o; |
| } |
| |
| void checkListOperationsResponse(api.ListOperationsResponse o) { |
| buildCounterListOperationsResponse++; |
| if (buildCounterListOperationsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed1560(o.operations); |
| } |
| buildCounterListOperationsResponse--; |
| } |
| |
| core.List<api.Session> buildUnnamed1561() { |
| var o = <api.Session>[]; |
| o.add(buildSession()); |
| o.add(buildSession()); |
| return o; |
| } |
| |
| void checkUnnamed1561(core.List<api.Session> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkSession(o[0]); |
| checkSession(o[1]); |
| } |
| |
| core.int buildCounterListSessionsResponse = 0; |
| api.ListSessionsResponse buildListSessionsResponse() { |
| var o = api.ListSessionsResponse(); |
| buildCounterListSessionsResponse++; |
| if (buildCounterListSessionsResponse < 3) { |
| o.nextPageToken = 'foo'; |
| o.sessions = buildUnnamed1561(); |
| } |
| buildCounterListSessionsResponse--; |
| return o; |
| } |
| |
| void checkListSessionsResponse(api.ListSessionsResponse o) { |
| buildCounterListSessionsResponse++; |
| if (buildCounterListSessionsResponse < 3) { |
| unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| checkUnnamed1561(o.sessions); |
| } |
| buildCounterListSessionsResponse--; |
| } |
| |
| core.int buildCounterMutation = 0; |
| api.Mutation buildMutation() { |
| var o = api.Mutation(); |
| buildCounterMutation++; |
| if (buildCounterMutation < 3) { |
| o.delete = buildDelete(); |
| o.insert = buildWrite(); |
| o.insertOrUpdate = buildWrite(); |
| o.replace = buildWrite(); |
| o.update = buildWrite(); |
| } |
| buildCounterMutation--; |
| return o; |
| } |
| |
| void checkMutation(api.Mutation o) { |
| buildCounterMutation++; |
| if (buildCounterMutation < 3) { |
| checkDelete(o.delete); |
| checkWrite(o.insert); |
| checkWrite(o.insertOrUpdate); |
| checkWrite(o.replace); |
| checkWrite(o.update); |
| } |
| buildCounterMutation--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1562() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1562(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted13 = (o['x']) as core.Map; |
| unittest.expect(casted13, unittest.hasLength(3)); |
| unittest.expect(casted13['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted13['bool'], unittest.equals(true)); |
| unittest.expect(casted13['string'], unittest.equals('foo')); |
| var casted14 = (o['y']) as core.Map; |
| unittest.expect(casted14, unittest.hasLength(3)); |
| unittest.expect(casted14['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted14['bool'], unittest.equals(true)); |
| unittest.expect(casted14['string'], unittest.equals('foo')); |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1563() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1563(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted15 = (o['x']) as core.Map; |
| unittest.expect(casted15, unittest.hasLength(3)); |
| unittest.expect(casted15['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted15['bool'], unittest.equals(true)); |
| unittest.expect(casted15['string'], unittest.equals('foo')); |
| var casted16 = (o['y']) as core.Map; |
| unittest.expect(casted16, unittest.hasLength(3)); |
| unittest.expect(casted16['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted16['bool'], unittest.equals(true)); |
| unittest.expect(casted16['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterOperation = 0; |
| api.Operation buildOperation() { |
| var o = api.Operation(); |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| o.done = true; |
| o.error = buildStatus(); |
| o.metadata = buildUnnamed1562(); |
| o.name = 'foo'; |
| o.response = buildUnnamed1563(); |
| } |
| buildCounterOperation--; |
| return o; |
| } |
| |
| void checkOperation(api.Operation o) { |
| buildCounterOperation++; |
| if (buildCounterOperation < 3) { |
| unittest.expect(o.done, unittest.isTrue); |
| checkStatus(o.error); |
| checkUnnamed1562(o.metadata); |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkUnnamed1563(o.response); |
| } |
| buildCounterOperation--; |
| } |
| |
| core.int buildCounterOperationProgress = 0; |
| api.OperationProgress buildOperationProgress() { |
| var o = api.OperationProgress(); |
| buildCounterOperationProgress++; |
| if (buildCounterOperationProgress < 3) { |
| o.endTime = 'foo'; |
| o.progressPercent = 42; |
| o.startTime = 'foo'; |
| } |
| buildCounterOperationProgress--; |
| return o; |
| } |
| |
| void checkOperationProgress(api.OperationProgress o) { |
| buildCounterOperationProgress++; |
| if (buildCounterOperationProgress < 3) { |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| unittest.expect(o.progressPercent, unittest.equals(42)); |
| unittest.expect(o.startTime, unittest.equals('foo')); |
| } |
| buildCounterOperationProgress--; |
| } |
| |
| core.int buildCounterOptimizeRestoredDatabaseMetadata = 0; |
| api.OptimizeRestoredDatabaseMetadata buildOptimizeRestoredDatabaseMetadata() { |
| var o = api.OptimizeRestoredDatabaseMetadata(); |
| buildCounterOptimizeRestoredDatabaseMetadata++; |
| if (buildCounterOptimizeRestoredDatabaseMetadata < 3) { |
| o.name = 'foo'; |
| o.progress = buildOperationProgress(); |
| } |
| buildCounterOptimizeRestoredDatabaseMetadata--; |
| return o; |
| } |
| |
| void checkOptimizeRestoredDatabaseMetadata( |
| api.OptimizeRestoredDatabaseMetadata o) { |
| buildCounterOptimizeRestoredDatabaseMetadata++; |
| if (buildCounterOptimizeRestoredDatabaseMetadata < 3) { |
| unittest.expect(o.name, unittest.equals('foo')); |
| checkOperationProgress(o.progress); |
| } |
| buildCounterOptimizeRestoredDatabaseMetadata--; |
| } |
| |
| core.List<core.Object> buildUnnamed1564() { |
| var o = <core.Object>[]; |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| return o; |
| } |
| |
| void checkUnnamed1564(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted17 = (o[0]) as core.Map; |
| unittest.expect(casted17, unittest.hasLength(3)); |
| unittest.expect(casted17['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted17['bool'], unittest.equals(true)); |
| unittest.expect(casted17['string'], unittest.equals('foo')); |
| var casted18 = (o[1]) as core.Map; |
| unittest.expect(casted18, unittest.hasLength(3)); |
| unittest.expect(casted18['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted18['bool'], unittest.equals(true)); |
| unittest.expect(casted18['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterPartialResultSet = 0; |
| api.PartialResultSet buildPartialResultSet() { |
| var o = api.PartialResultSet(); |
| buildCounterPartialResultSet++; |
| if (buildCounterPartialResultSet < 3) { |
| o.chunkedValue = true; |
| o.metadata = buildResultSetMetadata(); |
| o.resumeToken = 'foo'; |
| o.stats = buildResultSetStats(); |
| o.values = buildUnnamed1564(); |
| } |
| buildCounterPartialResultSet--; |
| return o; |
| } |
| |
| void checkPartialResultSet(api.PartialResultSet o) { |
| buildCounterPartialResultSet++; |
| if (buildCounterPartialResultSet < 3) { |
| unittest.expect(o.chunkedValue, unittest.isTrue); |
| checkResultSetMetadata(o.metadata); |
| unittest.expect(o.resumeToken, unittest.equals('foo')); |
| checkResultSetStats(o.stats); |
| checkUnnamed1564(o.values); |
| } |
| buildCounterPartialResultSet--; |
| } |
| |
| core.int buildCounterPartition = 0; |
| api.Partition buildPartition() { |
| var o = api.Partition(); |
| buildCounterPartition++; |
| if (buildCounterPartition < 3) { |
| o.partitionToken = 'foo'; |
| } |
| buildCounterPartition--; |
| return o; |
| } |
| |
| void checkPartition(api.Partition o) { |
| buildCounterPartition++; |
| if (buildCounterPartition < 3) { |
| unittest.expect(o.partitionToken, unittest.equals('foo')); |
| } |
| buildCounterPartition--; |
| } |
| |
| core.int buildCounterPartitionOptions = 0; |
| api.PartitionOptions buildPartitionOptions() { |
| var o = api.PartitionOptions(); |
| buildCounterPartitionOptions++; |
| if (buildCounterPartitionOptions < 3) { |
| o.maxPartitions = 'foo'; |
| o.partitionSizeBytes = 'foo'; |
| } |
| buildCounterPartitionOptions--; |
| return o; |
| } |
| |
| void checkPartitionOptions(api.PartitionOptions o) { |
| buildCounterPartitionOptions++; |
| if (buildCounterPartitionOptions < 3) { |
| unittest.expect(o.maxPartitions, unittest.equals('foo')); |
| unittest.expect(o.partitionSizeBytes, unittest.equals('foo')); |
| } |
| buildCounterPartitionOptions--; |
| } |
| |
| core.Map<core.String, api.Type> buildUnnamed1565() { |
| var o = <core.String, api.Type>{}; |
| o['x'] = buildType(); |
| o['y'] = buildType(); |
| return o; |
| } |
| |
| void checkUnnamed1565(core.Map<core.String, api.Type> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkType(o['x']); |
| checkType(o['y']); |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1566() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1566(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted19 = (o['x']) as core.Map; |
| unittest.expect(casted19, unittest.hasLength(3)); |
| unittest.expect(casted19['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted19['bool'], unittest.equals(true)); |
| unittest.expect(casted19['string'], unittest.equals('foo')); |
| var casted20 = (o['y']) as core.Map; |
| unittest.expect(casted20, unittest.hasLength(3)); |
| unittest.expect(casted20['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted20['bool'], unittest.equals(true)); |
| unittest.expect(casted20['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterPartitionQueryRequest = 0; |
| api.PartitionQueryRequest buildPartitionQueryRequest() { |
| var o = api.PartitionQueryRequest(); |
| buildCounterPartitionQueryRequest++; |
| if (buildCounterPartitionQueryRequest < 3) { |
| o.paramTypes = buildUnnamed1565(); |
| o.params = buildUnnamed1566(); |
| o.partitionOptions = buildPartitionOptions(); |
| o.sql = 'foo'; |
| o.transaction = buildTransactionSelector(); |
| } |
| buildCounterPartitionQueryRequest--; |
| return o; |
| } |
| |
| void checkPartitionQueryRequest(api.PartitionQueryRequest o) { |
| buildCounterPartitionQueryRequest++; |
| if (buildCounterPartitionQueryRequest < 3) { |
| checkUnnamed1565(o.paramTypes); |
| checkUnnamed1566(o.params); |
| checkPartitionOptions(o.partitionOptions); |
| unittest.expect(o.sql, unittest.equals('foo')); |
| checkTransactionSelector(o.transaction); |
| } |
| buildCounterPartitionQueryRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed1567() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1567(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterPartitionReadRequest = 0; |
| api.PartitionReadRequest buildPartitionReadRequest() { |
| var o = api.PartitionReadRequest(); |
| buildCounterPartitionReadRequest++; |
| if (buildCounterPartitionReadRequest < 3) { |
| o.columns = buildUnnamed1567(); |
| o.index = 'foo'; |
| o.keySet = buildKeySet(); |
| o.partitionOptions = buildPartitionOptions(); |
| o.table = 'foo'; |
| o.transaction = buildTransactionSelector(); |
| } |
| buildCounterPartitionReadRequest--; |
| return o; |
| } |
| |
| void checkPartitionReadRequest(api.PartitionReadRequest o) { |
| buildCounterPartitionReadRequest++; |
| if (buildCounterPartitionReadRequest < 3) { |
| checkUnnamed1567(o.columns); |
| unittest.expect(o.index, unittest.equals('foo')); |
| checkKeySet(o.keySet); |
| checkPartitionOptions(o.partitionOptions); |
| unittest.expect(o.table, unittest.equals('foo')); |
| checkTransactionSelector(o.transaction); |
| } |
| buildCounterPartitionReadRequest--; |
| } |
| |
| core.List<api.Partition> buildUnnamed1568() { |
| var o = <api.Partition>[]; |
| o.add(buildPartition()); |
| o.add(buildPartition()); |
| return o; |
| } |
| |
| void checkUnnamed1568(core.List<api.Partition> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPartition(o[0]); |
| checkPartition(o[1]); |
| } |
| |
| core.int buildCounterPartitionResponse = 0; |
| api.PartitionResponse buildPartitionResponse() { |
| var o = api.PartitionResponse(); |
| buildCounterPartitionResponse++; |
| if (buildCounterPartitionResponse < 3) { |
| o.partitions = buildUnnamed1568(); |
| o.transaction = buildTransaction(); |
| } |
| buildCounterPartitionResponse--; |
| return o; |
| } |
| |
| void checkPartitionResponse(api.PartitionResponse o) { |
| buildCounterPartitionResponse++; |
| if (buildCounterPartitionResponse < 3) { |
| checkUnnamed1568(o.partitions); |
| checkTransaction(o.transaction); |
| } |
| buildCounterPartitionResponse--; |
| } |
| |
| core.int buildCounterPartitionedDml = 0; |
| api.PartitionedDml buildPartitionedDml() { |
| var o = api.PartitionedDml(); |
| buildCounterPartitionedDml++; |
| if (buildCounterPartitionedDml < 3) {} |
| buildCounterPartitionedDml--; |
| return o; |
| } |
| |
| void checkPartitionedDml(api.PartitionedDml o) { |
| buildCounterPartitionedDml++; |
| if (buildCounterPartitionedDml < 3) {} |
| buildCounterPartitionedDml--; |
| } |
| |
| core.List<api.ChildLink> buildUnnamed1569() { |
| var o = <api.ChildLink>[]; |
| o.add(buildChildLink()); |
| o.add(buildChildLink()); |
| return o; |
| } |
| |
| void checkUnnamed1569(core.List<api.ChildLink> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkChildLink(o[0]); |
| checkChildLink(o[1]); |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1570() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1570(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted21 = (o['x']) as core.Map; |
| unittest.expect(casted21, unittest.hasLength(3)); |
| unittest.expect(casted21['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted21['bool'], unittest.equals(true)); |
| unittest.expect(casted21['string'], unittest.equals('foo')); |
| var casted22 = (o['y']) as core.Map; |
| unittest.expect(casted22, unittest.hasLength(3)); |
| unittest.expect(casted22['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted22['bool'], unittest.equals(true)); |
| unittest.expect(casted22['string'], unittest.equals('foo')); |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1571() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1571(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted23 = (o['x']) as core.Map; |
| unittest.expect(casted23, unittest.hasLength(3)); |
| unittest.expect(casted23['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted23['bool'], unittest.equals(true)); |
| unittest.expect(casted23['string'], unittest.equals('foo')); |
| var casted24 = (o['y']) as core.Map; |
| unittest.expect(casted24, unittest.hasLength(3)); |
| unittest.expect(casted24['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted24['bool'], unittest.equals(true)); |
| unittest.expect(casted24['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterPlanNode = 0; |
| api.PlanNode buildPlanNode() { |
| var o = api.PlanNode(); |
| buildCounterPlanNode++; |
| if (buildCounterPlanNode < 3) { |
| o.childLinks = buildUnnamed1569(); |
| o.displayName = 'foo'; |
| o.executionStats = buildUnnamed1570(); |
| o.index = 42; |
| o.kind = 'foo'; |
| o.metadata = buildUnnamed1571(); |
| o.shortRepresentation = buildShortRepresentation(); |
| } |
| buildCounterPlanNode--; |
| return o; |
| } |
| |
| void checkPlanNode(api.PlanNode o) { |
| buildCounterPlanNode++; |
| if (buildCounterPlanNode < 3) { |
| checkUnnamed1569(o.childLinks); |
| unittest.expect(o.displayName, unittest.equals('foo')); |
| checkUnnamed1570(o.executionStats); |
| unittest.expect(o.index, unittest.equals(42)); |
| unittest.expect(o.kind, unittest.equals('foo')); |
| checkUnnamed1571(o.metadata); |
| checkShortRepresentation(o.shortRepresentation); |
| } |
| buildCounterPlanNode--; |
| } |
| |
| core.List<api.Binding> buildUnnamed1572() { |
| var o = <api.Binding>[]; |
| o.add(buildBinding()); |
| o.add(buildBinding()); |
| return o; |
| } |
| |
| void checkUnnamed1572(core.List<api.Binding> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkBinding(o[0]); |
| checkBinding(o[1]); |
| } |
| |
| core.int buildCounterPolicy = 0; |
| api.Policy buildPolicy() { |
| var o = api.Policy(); |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| o.bindings = buildUnnamed1572(); |
| o.etag = 'foo'; |
| o.version = 42; |
| } |
| buildCounterPolicy--; |
| return o; |
| } |
| |
| void checkPolicy(api.Policy o) { |
| buildCounterPolicy++; |
| if (buildCounterPolicy < 3) { |
| checkUnnamed1572(o.bindings); |
| unittest.expect(o.etag, unittest.equals('foo')); |
| unittest.expect(o.version, unittest.equals(42)); |
| } |
| buildCounterPolicy--; |
| } |
| |
| core.int buildCounterQueryOptions = 0; |
| api.QueryOptions buildQueryOptions() { |
| var o = api.QueryOptions(); |
| buildCounterQueryOptions++; |
| if (buildCounterQueryOptions < 3) { |
| o.optimizerVersion = 'foo'; |
| } |
| buildCounterQueryOptions--; |
| return o; |
| } |
| |
| void checkQueryOptions(api.QueryOptions o) { |
| buildCounterQueryOptions++; |
| if (buildCounterQueryOptions < 3) { |
| unittest.expect(o.optimizerVersion, unittest.equals('foo')); |
| } |
| buildCounterQueryOptions--; |
| } |
| |
| core.List<api.PlanNode> buildUnnamed1573() { |
| var o = <api.PlanNode>[]; |
| o.add(buildPlanNode()); |
| o.add(buildPlanNode()); |
| return o; |
| } |
| |
| void checkUnnamed1573(core.List<api.PlanNode> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkPlanNode(o[0]); |
| checkPlanNode(o[1]); |
| } |
| |
| core.int buildCounterQueryPlan = 0; |
| api.QueryPlan buildQueryPlan() { |
| var o = api.QueryPlan(); |
| buildCounterQueryPlan++; |
| if (buildCounterQueryPlan < 3) { |
| o.planNodes = buildUnnamed1573(); |
| } |
| buildCounterQueryPlan--; |
| return o; |
| } |
| |
| void checkQueryPlan(api.QueryPlan o) { |
| buildCounterQueryPlan++; |
| if (buildCounterQueryPlan < 3) { |
| checkUnnamed1573(o.planNodes); |
| } |
| buildCounterQueryPlan--; |
| } |
| |
| core.int buildCounterReadOnly = 0; |
| api.ReadOnly buildReadOnly() { |
| var o = api.ReadOnly(); |
| buildCounterReadOnly++; |
| if (buildCounterReadOnly < 3) { |
| o.exactStaleness = 'foo'; |
| o.maxStaleness = 'foo'; |
| o.minReadTimestamp = 'foo'; |
| o.readTimestamp = 'foo'; |
| o.returnReadTimestamp = true; |
| o.strong = true; |
| } |
| buildCounterReadOnly--; |
| return o; |
| } |
| |
| void checkReadOnly(api.ReadOnly o) { |
| buildCounterReadOnly++; |
| if (buildCounterReadOnly < 3) { |
| unittest.expect(o.exactStaleness, unittest.equals('foo')); |
| unittest.expect(o.maxStaleness, unittest.equals('foo')); |
| unittest.expect(o.minReadTimestamp, unittest.equals('foo')); |
| unittest.expect(o.readTimestamp, unittest.equals('foo')); |
| unittest.expect(o.returnReadTimestamp, unittest.isTrue); |
| unittest.expect(o.strong, unittest.isTrue); |
| } |
| buildCounterReadOnly--; |
| } |
| |
| core.List<core.String> buildUnnamed1574() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1574(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterReadRequest = 0; |
| api.ReadRequest buildReadRequest() { |
| var o = api.ReadRequest(); |
| buildCounterReadRequest++; |
| if (buildCounterReadRequest < 3) { |
| o.columns = buildUnnamed1574(); |
| o.index = 'foo'; |
| o.keySet = buildKeySet(); |
| o.limit = 'foo'; |
| o.partitionToken = 'foo'; |
| o.resumeToken = 'foo'; |
| o.table = 'foo'; |
| o.transaction = buildTransactionSelector(); |
| } |
| buildCounterReadRequest--; |
| return o; |
| } |
| |
| void checkReadRequest(api.ReadRequest o) { |
| buildCounterReadRequest++; |
| if (buildCounterReadRequest < 3) { |
| checkUnnamed1574(o.columns); |
| unittest.expect(o.index, unittest.equals('foo')); |
| checkKeySet(o.keySet); |
| unittest.expect(o.limit, unittest.equals('foo')); |
| unittest.expect(o.partitionToken, unittest.equals('foo')); |
| unittest.expect(o.resumeToken, unittest.equals('foo')); |
| unittest.expect(o.table, unittest.equals('foo')); |
| checkTransactionSelector(o.transaction); |
| } |
| buildCounterReadRequest--; |
| } |
| |
| core.int buildCounterReadWrite = 0; |
| api.ReadWrite buildReadWrite() { |
| var o = api.ReadWrite(); |
| buildCounterReadWrite++; |
| if (buildCounterReadWrite < 3) {} |
| buildCounterReadWrite--; |
| return o; |
| } |
| |
| void checkReadWrite(api.ReadWrite o) { |
| buildCounterReadWrite++; |
| if (buildCounterReadWrite < 3) {} |
| buildCounterReadWrite--; |
| } |
| |
| core.int buildCounterReplicaInfo = 0; |
| api.ReplicaInfo buildReplicaInfo() { |
| var o = api.ReplicaInfo(); |
| buildCounterReplicaInfo++; |
| if (buildCounterReplicaInfo < 3) { |
| o.defaultLeaderLocation = true; |
| o.location = 'foo'; |
| o.type = 'foo'; |
| } |
| buildCounterReplicaInfo--; |
| return o; |
| } |
| |
| void checkReplicaInfo(api.ReplicaInfo o) { |
| buildCounterReplicaInfo++; |
| if (buildCounterReplicaInfo < 3) { |
| unittest.expect(o.defaultLeaderLocation, unittest.isTrue); |
| unittest.expect(o.location, unittest.equals('foo')); |
| unittest.expect(o.type, unittest.equals('foo')); |
| } |
| buildCounterReplicaInfo--; |
| } |
| |
| core.int buildCounterRestoreDatabaseMetadata = 0; |
| api.RestoreDatabaseMetadata buildRestoreDatabaseMetadata() { |
| var o = api.RestoreDatabaseMetadata(); |
| buildCounterRestoreDatabaseMetadata++; |
| if (buildCounterRestoreDatabaseMetadata < 3) { |
| o.backupInfo = buildBackupInfo(); |
| o.cancelTime = 'foo'; |
| o.name = 'foo'; |
| o.optimizeDatabaseOperationName = 'foo'; |
| o.progress = buildOperationProgress(); |
| o.sourceType = 'foo'; |
| } |
| buildCounterRestoreDatabaseMetadata--; |
| return o; |
| } |
| |
| void checkRestoreDatabaseMetadata(api.RestoreDatabaseMetadata o) { |
| buildCounterRestoreDatabaseMetadata++; |
| if (buildCounterRestoreDatabaseMetadata < 3) { |
| checkBackupInfo(o.backupInfo); |
| unittest.expect(o.cancelTime, unittest.equals('foo')); |
| unittest.expect(o.name, unittest.equals('foo')); |
| unittest.expect(o.optimizeDatabaseOperationName, unittest.equals('foo')); |
| checkOperationProgress(o.progress); |
| unittest.expect(o.sourceType, unittest.equals('foo')); |
| } |
| buildCounterRestoreDatabaseMetadata--; |
| } |
| |
| core.int buildCounterRestoreDatabaseRequest = 0; |
| api.RestoreDatabaseRequest buildRestoreDatabaseRequest() { |
| var o = api.RestoreDatabaseRequest(); |
| buildCounterRestoreDatabaseRequest++; |
| if (buildCounterRestoreDatabaseRequest < 3) { |
| o.backup = 'foo'; |
| o.databaseId = 'foo'; |
| } |
| buildCounterRestoreDatabaseRequest--; |
| return o; |
| } |
| |
| void checkRestoreDatabaseRequest(api.RestoreDatabaseRequest o) { |
| buildCounterRestoreDatabaseRequest++; |
| if (buildCounterRestoreDatabaseRequest < 3) { |
| unittest.expect(o.backup, unittest.equals('foo')); |
| unittest.expect(o.databaseId, unittest.equals('foo')); |
| } |
| buildCounterRestoreDatabaseRequest--; |
| } |
| |
| core.int buildCounterRestoreInfo = 0; |
| api.RestoreInfo buildRestoreInfo() { |
| var o = api.RestoreInfo(); |
| buildCounterRestoreInfo++; |
| if (buildCounterRestoreInfo < 3) { |
| o.backupInfo = buildBackupInfo(); |
| o.sourceType = 'foo'; |
| } |
| buildCounterRestoreInfo--; |
| return o; |
| } |
| |
| void checkRestoreInfo(api.RestoreInfo o) { |
| buildCounterRestoreInfo++; |
| if (buildCounterRestoreInfo < 3) { |
| checkBackupInfo(o.backupInfo); |
| unittest.expect(o.sourceType, unittest.equals('foo')); |
| } |
| buildCounterRestoreInfo--; |
| } |
| |
| core.List<core.Object> buildUnnamed1575() { |
| var o = <core.Object>[]; |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| return o; |
| } |
| |
| void checkUnnamed1575(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted25 = (o[0]) as core.Map; |
| unittest.expect(casted25, unittest.hasLength(3)); |
| unittest.expect(casted25['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted25['bool'], unittest.equals(true)); |
| unittest.expect(casted25['string'], unittest.equals('foo')); |
| var casted26 = (o[1]) as core.Map; |
| unittest.expect(casted26, unittest.hasLength(3)); |
| unittest.expect(casted26['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted26['bool'], unittest.equals(true)); |
| unittest.expect(casted26['string'], unittest.equals('foo')); |
| } |
| |
| core.List<core.List<core.Object>> buildUnnamed1576() { |
| var o = <core.List<core.Object>>[]; |
| o.add(buildUnnamed1575()); |
| o.add(buildUnnamed1575()); |
| return o; |
| } |
| |
| void checkUnnamed1576(core.List<core.List<core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed1575(o[0]); |
| checkUnnamed1575(o[1]); |
| } |
| |
| core.int buildCounterResultSet = 0; |
| api.ResultSet buildResultSet() { |
| var o = api.ResultSet(); |
| buildCounterResultSet++; |
| if (buildCounterResultSet < 3) { |
| o.metadata = buildResultSetMetadata(); |
| o.rows = buildUnnamed1576(); |
| o.stats = buildResultSetStats(); |
| } |
| buildCounterResultSet--; |
| return o; |
| } |
| |
| void checkResultSet(api.ResultSet o) { |
| buildCounterResultSet++; |
| if (buildCounterResultSet < 3) { |
| checkResultSetMetadata(o.metadata); |
| checkUnnamed1576(o.rows); |
| checkResultSetStats(o.stats); |
| } |
| buildCounterResultSet--; |
| } |
| |
| core.int buildCounterResultSetMetadata = 0; |
| api.ResultSetMetadata buildResultSetMetadata() { |
| var o = api.ResultSetMetadata(); |
| buildCounterResultSetMetadata++; |
| if (buildCounterResultSetMetadata < 3) { |
| o.rowType = buildStructType(); |
| o.transaction = buildTransaction(); |
| } |
| buildCounterResultSetMetadata--; |
| return o; |
| } |
| |
| void checkResultSetMetadata(api.ResultSetMetadata o) { |
| buildCounterResultSetMetadata++; |
| if (buildCounterResultSetMetadata < 3) { |
| checkStructType(o.rowType); |
| checkTransaction(o.transaction); |
| } |
| buildCounterResultSetMetadata--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1577() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1577(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted27 = (o['x']) as core.Map; |
| unittest.expect(casted27, unittest.hasLength(3)); |
| unittest.expect(casted27['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted27['bool'], unittest.equals(true)); |
| unittest.expect(casted27['string'], unittest.equals('foo')); |
| var casted28 = (o['y']) as core.Map; |
| unittest.expect(casted28, unittest.hasLength(3)); |
| unittest.expect(casted28['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted28['bool'], unittest.equals(true)); |
| unittest.expect(casted28['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterResultSetStats = 0; |
| api.ResultSetStats buildResultSetStats() { |
| var o = api.ResultSetStats(); |
| buildCounterResultSetStats++; |
| if (buildCounterResultSetStats < 3) { |
| o.queryPlan = buildQueryPlan(); |
| o.queryStats = buildUnnamed1577(); |
| o.rowCountExact = 'foo'; |
| o.rowCountLowerBound = 'foo'; |
| } |
| buildCounterResultSetStats--; |
| return o; |
| } |
| |
| void checkResultSetStats(api.ResultSetStats o) { |
| buildCounterResultSetStats++; |
| if (buildCounterResultSetStats < 3) { |
| checkQueryPlan(o.queryPlan); |
| checkUnnamed1577(o.queryStats); |
| unittest.expect(o.rowCountExact, unittest.equals('foo')); |
| unittest.expect(o.rowCountLowerBound, unittest.equals('foo')); |
| } |
| buildCounterResultSetStats--; |
| } |
| |
| core.int buildCounterRollbackRequest = 0; |
| api.RollbackRequest buildRollbackRequest() { |
| var o = api.RollbackRequest(); |
| buildCounterRollbackRequest++; |
| if (buildCounterRollbackRequest < 3) { |
| o.transactionId = 'foo'; |
| } |
| buildCounterRollbackRequest--; |
| return o; |
| } |
| |
| void checkRollbackRequest(api.RollbackRequest o) { |
| buildCounterRollbackRequest++; |
| if (buildCounterRollbackRequest < 3) { |
| unittest.expect(o.transactionId, unittest.equals('foo')); |
| } |
| buildCounterRollbackRequest--; |
| } |
| |
| core.Map<core.String, core.String> buildUnnamed1578() { |
| var o = <core.String, core.String>{}; |
| o['x'] = 'foo'; |
| o['y'] = 'foo'; |
| return o; |
| } |
| |
| void checkUnnamed1578(core.Map<core.String, core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o['x'], unittest.equals('foo')); |
| unittest.expect(o['y'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterSession = 0; |
| api.Session buildSession() { |
| var o = api.Session(); |
| buildCounterSession++; |
| if (buildCounterSession < 3) { |
| o.approximateLastUseTime = 'foo'; |
| o.createTime = 'foo'; |
| o.labels = buildUnnamed1578(); |
| o.name = 'foo'; |
| } |
| buildCounterSession--; |
| return o; |
| } |
| |
| void checkSession(api.Session o) { |
| buildCounterSession++; |
| if (buildCounterSession < 3) { |
| unittest.expect(o.approximateLastUseTime, unittest.equals('foo')); |
| unittest.expect(o.createTime, unittest.equals('foo')); |
| checkUnnamed1578(o.labels); |
| unittest.expect(o.name, unittest.equals('foo')); |
| } |
| buildCounterSession--; |
| } |
| |
| core.int buildCounterSetIamPolicyRequest = 0; |
| api.SetIamPolicyRequest buildSetIamPolicyRequest() { |
| var o = api.SetIamPolicyRequest(); |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| o.policy = buildPolicy(); |
| } |
| buildCounterSetIamPolicyRequest--; |
| return o; |
| } |
| |
| void checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| buildCounterSetIamPolicyRequest++; |
| if (buildCounterSetIamPolicyRequest < 3) { |
| checkPolicy(o.policy); |
| } |
| buildCounterSetIamPolicyRequest--; |
| } |
| |
| core.Map<core.String, core.int> buildUnnamed1579() { |
| var o = <core.String, core.int>{}; |
| o['x'] = 42; |
| o['y'] = 42; |
| return o; |
| } |
| |
| void checkUnnamed1579(core.Map<core.String, core.int> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o['x'], unittest.equals(42)); |
| unittest.expect(o['y'], unittest.equals(42)); |
| } |
| |
| core.int buildCounterShortRepresentation = 0; |
| api.ShortRepresentation buildShortRepresentation() { |
| var o = api.ShortRepresentation(); |
| buildCounterShortRepresentation++; |
| if (buildCounterShortRepresentation < 3) { |
| o.description = 'foo'; |
| o.subqueries = buildUnnamed1579(); |
| } |
| buildCounterShortRepresentation--; |
| return o; |
| } |
| |
| void checkShortRepresentation(api.ShortRepresentation o) { |
| buildCounterShortRepresentation++; |
| if (buildCounterShortRepresentation < 3) { |
| unittest.expect(o.description, unittest.equals('foo')); |
| checkUnnamed1579(o.subqueries); |
| } |
| buildCounterShortRepresentation--; |
| } |
| |
| core.Map<core.String, api.Type> buildUnnamed1580() { |
| var o = <core.String, api.Type>{}; |
| o['x'] = buildType(); |
| o['y'] = buildType(); |
| return o; |
| } |
| |
| void checkUnnamed1580(core.Map<core.String, api.Type> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkType(o['x']); |
| checkType(o['y']); |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1581() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1581(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted29 = (o['x']) as core.Map; |
| unittest.expect(casted29, unittest.hasLength(3)); |
| unittest.expect(casted29['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted29['bool'], unittest.equals(true)); |
| unittest.expect(casted29['string'], unittest.equals('foo')); |
| var casted30 = (o['y']) as core.Map; |
| unittest.expect(casted30, unittest.hasLength(3)); |
| unittest.expect(casted30['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted30['bool'], unittest.equals(true)); |
| unittest.expect(casted30['string'], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterStatement = 0; |
| api.Statement buildStatement() { |
| var o = api.Statement(); |
| buildCounterStatement++; |
| if (buildCounterStatement < 3) { |
| o.paramTypes = buildUnnamed1580(); |
| o.params = buildUnnamed1581(); |
| o.sql = 'foo'; |
| } |
| buildCounterStatement--; |
| return o; |
| } |
| |
| void checkStatement(api.Statement o) { |
| buildCounterStatement++; |
| if (buildCounterStatement < 3) { |
| checkUnnamed1580(o.paramTypes); |
| checkUnnamed1581(o.params); |
| unittest.expect(o.sql, unittest.equals('foo')); |
| } |
| buildCounterStatement--; |
| } |
| |
| core.Map<core.String, core.Object> buildUnnamed1582() { |
| var o = <core.String, core.Object>{}; |
| o['x'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| o['y'] = { |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }; |
| return o; |
| } |
| |
| void checkUnnamed1582(core.Map<core.String, core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted31 = (o['x']) as core.Map; |
| unittest.expect(casted31, unittest.hasLength(3)); |
| unittest.expect(casted31['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted31['bool'], unittest.equals(true)); |
| unittest.expect(casted31['string'], unittest.equals('foo')); |
| var casted32 = (o['y']) as core.Map; |
| unittest.expect(casted32, unittest.hasLength(3)); |
| unittest.expect(casted32['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted32['bool'], unittest.equals(true)); |
| unittest.expect(casted32['string'], unittest.equals('foo')); |
| } |
| |
| core.List<core.Map<core.String, core.Object>> buildUnnamed1583() { |
| var o = <core.Map<core.String, core.Object>>[]; |
| o.add(buildUnnamed1582()); |
| o.add(buildUnnamed1582()); |
| return o; |
| } |
| |
| void checkUnnamed1583(core.List<core.Map<core.String, core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed1582(o[0]); |
| checkUnnamed1582(o[1]); |
| } |
| |
| core.int buildCounterStatus = 0; |
| api.Status buildStatus() { |
| var o = api.Status(); |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| o.code = 42; |
| o.details = buildUnnamed1583(); |
| o.message = 'foo'; |
| } |
| buildCounterStatus--; |
| return o; |
| } |
| |
| void checkStatus(api.Status o) { |
| buildCounterStatus++; |
| if (buildCounterStatus < 3) { |
| unittest.expect(o.code, unittest.equals(42)); |
| checkUnnamed1583(o.details); |
| unittest.expect(o.message, unittest.equals('foo')); |
| } |
| buildCounterStatus--; |
| } |
| |
| core.List<api.Field> buildUnnamed1584() { |
| var o = <api.Field>[]; |
| o.add(buildField()); |
| o.add(buildField()); |
| return o; |
| } |
| |
| void checkUnnamed1584(core.List<api.Field> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkField(o[0]); |
| checkField(o[1]); |
| } |
| |
| core.int buildCounterStructType = 0; |
| api.StructType buildStructType() { |
| var o = api.StructType(); |
| buildCounterStructType++; |
| if (buildCounterStructType < 3) { |
| o.fields = buildUnnamed1584(); |
| } |
| buildCounterStructType--; |
| return o; |
| } |
| |
| void checkStructType(api.StructType o) { |
| buildCounterStructType++; |
| if (buildCounterStructType < 3) { |
| checkUnnamed1584(o.fields); |
| } |
| buildCounterStructType--; |
| } |
| |
| core.List<core.String> buildUnnamed1585() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1585(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterTestIamPermissionsRequest = 0; |
| api.TestIamPermissionsRequest buildTestIamPermissionsRequest() { |
| var o = api.TestIamPermissionsRequest(); |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| o.permissions = buildUnnamed1585(); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| buildCounterTestIamPermissionsRequest++; |
| if (buildCounterTestIamPermissionsRequest < 3) { |
| checkUnnamed1585(o.permissions); |
| } |
| buildCounterTestIamPermissionsRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed1586() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1586(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterTestIamPermissionsResponse = 0; |
| api.TestIamPermissionsResponse buildTestIamPermissionsResponse() { |
| var o = api.TestIamPermissionsResponse(); |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| o.permissions = buildUnnamed1586(); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| return o; |
| } |
| |
| void checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| buildCounterTestIamPermissionsResponse++; |
| if (buildCounterTestIamPermissionsResponse < 3) { |
| checkUnnamed1586(o.permissions); |
| } |
| buildCounterTestIamPermissionsResponse--; |
| } |
| |
| core.int buildCounterTransaction = 0; |
| api.Transaction buildTransaction() { |
| var o = api.Transaction(); |
| buildCounterTransaction++; |
| if (buildCounterTransaction < 3) { |
| o.id = 'foo'; |
| o.readTimestamp = 'foo'; |
| } |
| buildCounterTransaction--; |
| return o; |
| } |
| |
| void checkTransaction(api.Transaction o) { |
| buildCounterTransaction++; |
| if (buildCounterTransaction < 3) { |
| unittest.expect(o.id, unittest.equals('foo')); |
| unittest.expect(o.readTimestamp, unittest.equals('foo')); |
| } |
| buildCounterTransaction--; |
| } |
| |
| core.int buildCounterTransactionOptions = 0; |
| api.TransactionOptions buildTransactionOptions() { |
| var o = api.TransactionOptions(); |
| buildCounterTransactionOptions++; |
| if (buildCounterTransactionOptions < 3) { |
| o.partitionedDml = buildPartitionedDml(); |
| o.readOnly = buildReadOnly(); |
| o.readWrite = buildReadWrite(); |
| } |
| buildCounterTransactionOptions--; |
| return o; |
| } |
| |
| void checkTransactionOptions(api.TransactionOptions o) { |
| buildCounterTransactionOptions++; |
| if (buildCounterTransactionOptions < 3) { |
| checkPartitionedDml(o.partitionedDml); |
| checkReadOnly(o.readOnly); |
| checkReadWrite(o.readWrite); |
| } |
| buildCounterTransactionOptions--; |
| } |
| |
| core.int buildCounterTransactionSelector = 0; |
| api.TransactionSelector buildTransactionSelector() { |
| var o = api.TransactionSelector(); |
| buildCounterTransactionSelector++; |
| if (buildCounterTransactionSelector < 3) { |
| o.begin = buildTransactionOptions(); |
| o.id = 'foo'; |
| o.singleUse = buildTransactionOptions(); |
| } |
| buildCounterTransactionSelector--; |
| return o; |
| } |
| |
| void checkTransactionSelector(api.TransactionSelector o) { |
| buildCounterTransactionSelector++; |
| if (buildCounterTransactionSelector < 3) { |
| checkTransactionOptions(o.begin); |
| unittest.expect(o.id, unittest.equals('foo')); |
| checkTransactionOptions(o.singleUse); |
| } |
| buildCounterTransactionSelector--; |
| } |
| |
| core.int buildCounterType = 0; |
| api.Type buildType() { |
| var o = api.Type(); |
| buildCounterType++; |
| if (buildCounterType < 3) { |
| o.arrayElementType = buildType(); |
| o.code = 'foo'; |
| o.structType = buildStructType(); |
| } |
| buildCounterType--; |
| return o; |
| } |
| |
| void checkType(api.Type o) { |
| buildCounterType++; |
| if (buildCounterType < 3) { |
| checkType(o.arrayElementType); |
| unittest.expect(o.code, unittest.equals('foo')); |
| checkStructType(o.structType); |
| } |
| buildCounterType--; |
| } |
| |
| core.List<core.String> buildUnnamed1587() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1587(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.List<core.String> buildUnnamed1588() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1588(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterUpdateDatabaseDdlMetadata = 0; |
| api.UpdateDatabaseDdlMetadata buildUpdateDatabaseDdlMetadata() { |
| var o = api.UpdateDatabaseDdlMetadata(); |
| buildCounterUpdateDatabaseDdlMetadata++; |
| if (buildCounterUpdateDatabaseDdlMetadata < 3) { |
| o.commitTimestamps = buildUnnamed1587(); |
| o.database = 'foo'; |
| o.statements = buildUnnamed1588(); |
| } |
| buildCounterUpdateDatabaseDdlMetadata--; |
| return o; |
| } |
| |
| void checkUpdateDatabaseDdlMetadata(api.UpdateDatabaseDdlMetadata o) { |
| buildCounterUpdateDatabaseDdlMetadata++; |
| if (buildCounterUpdateDatabaseDdlMetadata < 3) { |
| checkUnnamed1587(o.commitTimestamps); |
| unittest.expect(o.database, unittest.equals('foo')); |
| checkUnnamed1588(o.statements); |
| } |
| buildCounterUpdateDatabaseDdlMetadata--; |
| } |
| |
| core.List<core.String> buildUnnamed1589() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1589(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.int buildCounterUpdateDatabaseDdlRequest = 0; |
| api.UpdateDatabaseDdlRequest buildUpdateDatabaseDdlRequest() { |
| var o = api.UpdateDatabaseDdlRequest(); |
| buildCounterUpdateDatabaseDdlRequest++; |
| if (buildCounterUpdateDatabaseDdlRequest < 3) { |
| o.operationId = 'foo'; |
| o.statements = buildUnnamed1589(); |
| } |
| buildCounterUpdateDatabaseDdlRequest--; |
| return o; |
| } |
| |
| void checkUpdateDatabaseDdlRequest(api.UpdateDatabaseDdlRequest o) { |
| buildCounterUpdateDatabaseDdlRequest++; |
| if (buildCounterUpdateDatabaseDdlRequest < 3) { |
| unittest.expect(o.operationId, unittest.equals('foo')); |
| checkUnnamed1589(o.statements); |
| } |
| buildCounterUpdateDatabaseDdlRequest--; |
| } |
| |
| core.int buildCounterUpdateInstanceMetadata = 0; |
| api.UpdateInstanceMetadata buildUpdateInstanceMetadata() { |
| var o = api.UpdateInstanceMetadata(); |
| buildCounterUpdateInstanceMetadata++; |
| if (buildCounterUpdateInstanceMetadata < 3) { |
| o.cancelTime = 'foo'; |
| o.endTime = 'foo'; |
| o.instance = buildInstance(); |
| o.startTime = 'foo'; |
| } |
| buildCounterUpdateInstanceMetadata--; |
| return o; |
| } |
| |
| void checkUpdateInstanceMetadata(api.UpdateInstanceMetadata o) { |
| buildCounterUpdateInstanceMetadata++; |
| if (buildCounterUpdateInstanceMetadata < 3) { |
| unittest.expect(o.cancelTime, unittest.equals('foo')); |
| unittest.expect(o.endTime, unittest.equals('foo')); |
| checkInstance(o.instance); |
| unittest.expect(o.startTime, unittest.equals('foo')); |
| } |
| buildCounterUpdateInstanceMetadata--; |
| } |
| |
| core.int buildCounterUpdateInstanceRequest = 0; |
| api.UpdateInstanceRequest buildUpdateInstanceRequest() { |
| var o = api.UpdateInstanceRequest(); |
| buildCounterUpdateInstanceRequest++; |
| if (buildCounterUpdateInstanceRequest < 3) { |
| o.fieldMask = 'foo'; |
| o.instance = buildInstance(); |
| } |
| buildCounterUpdateInstanceRequest--; |
| return o; |
| } |
| |
| void checkUpdateInstanceRequest(api.UpdateInstanceRequest o) { |
| buildCounterUpdateInstanceRequest++; |
| if (buildCounterUpdateInstanceRequest < 3) { |
| unittest.expect(o.fieldMask, unittest.equals('foo')); |
| checkInstance(o.instance); |
| } |
| buildCounterUpdateInstanceRequest--; |
| } |
| |
| core.List<core.String> buildUnnamed1590() { |
| var o = <core.String>[]; |
| o.add('foo'); |
| o.add('foo'); |
| return o; |
| } |
| |
| void checkUnnamed1590(core.List<core.String> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| unittest.expect(o[0], unittest.equals('foo')); |
| unittest.expect(o[1], unittest.equals('foo')); |
| } |
| |
| core.List<core.Object> buildUnnamed1591() { |
| var o = <core.Object>[]; |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| o.add({ |
| 'list': [1, 2, 3], |
| 'bool': true, |
| 'string': 'foo' |
| }); |
| return o; |
| } |
| |
| void checkUnnamed1591(core.List<core.Object> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| var casted33 = (o[0]) as core.Map; |
| unittest.expect(casted33, unittest.hasLength(3)); |
| unittest.expect(casted33['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted33['bool'], unittest.equals(true)); |
| unittest.expect(casted33['string'], unittest.equals('foo')); |
| var casted34 = (o[1]) as core.Map; |
| unittest.expect(casted34, unittest.hasLength(3)); |
| unittest.expect(casted34['list'], unittest.equals([1, 2, 3])); |
| unittest.expect(casted34['bool'], unittest.equals(true)); |
| unittest.expect(casted34['string'], unittest.equals('foo')); |
| } |
| |
| core.List<core.List<core.Object>> buildUnnamed1592() { |
| var o = <core.List<core.Object>>[]; |
| o.add(buildUnnamed1591()); |
| o.add(buildUnnamed1591()); |
| return o; |
| } |
| |
| void checkUnnamed1592(core.List<core.List<core.Object>> o) { |
| unittest.expect(o, unittest.hasLength(2)); |
| checkUnnamed1591(o[0]); |
| checkUnnamed1591(o[1]); |
| } |
| |
| core.int buildCounterWrite = 0; |
| api.Write buildWrite() { |
| var o = api.Write(); |
| buildCounterWrite++; |
| if (buildCounterWrite < 3) { |
| o.columns = buildUnnamed1590(); |
| o.table = 'foo'; |
| o.values = buildUnnamed1592(); |
| } |
| buildCounterWrite--; |
| return o; |
| } |
| |
| void checkWrite(api.Write o) { |
| buildCounterWrite++; |
| if (buildCounterWrite < 3) { |
| checkUnnamed1590(o.columns); |
| unittest.expect(o.table, unittest.equals('foo')); |
| checkUnnamed1592(o.values); |
| } |
| buildCounterWrite--; |
| } |
| |
| void main() { |
| unittest.group('obj-schema-Backup', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildBackup(); |
| var od = api.Backup.fromJson(o.toJson()); |
| checkBackup(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BackupInfo', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildBackupInfo(); |
| var od = api.BackupInfo.fromJson(o.toJson()); |
| checkBackupInfo(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BatchCreateSessionsRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildBatchCreateSessionsRequest(); |
| var od = api.BatchCreateSessionsRequest.fromJson(o.toJson()); |
| checkBatchCreateSessionsRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BatchCreateSessionsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildBatchCreateSessionsResponse(); |
| var od = api.BatchCreateSessionsResponse.fromJson(o.toJson()); |
| checkBatchCreateSessionsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-BeginTransactionRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildBeginTransactionRequest(); |
| var od = api.BeginTransactionRequest.fromJson(o.toJson()); |
| checkBeginTransactionRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Binding', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildBinding(); |
| var od = api.Binding.fromJson(o.toJson()); |
| checkBinding(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ChildLink', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildChildLink(); |
| var od = api.ChildLink.fromJson(o.toJson()); |
| checkChildLink(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CommitRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildCommitRequest(); |
| var od = api.CommitRequest.fromJson(o.toJson()); |
| checkCommitRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CommitResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildCommitResponse(); |
| var od = api.CommitResponse.fromJson(o.toJson()); |
| checkCommitResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CreateBackupMetadata', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildCreateBackupMetadata(); |
| var od = api.CreateBackupMetadata.fromJson(o.toJson()); |
| checkCreateBackupMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CreateDatabaseMetadata', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildCreateDatabaseMetadata(); |
| var od = api.CreateDatabaseMetadata.fromJson(o.toJson()); |
| checkCreateDatabaseMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CreateDatabaseRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildCreateDatabaseRequest(); |
| var od = api.CreateDatabaseRequest.fromJson(o.toJson()); |
| checkCreateDatabaseRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CreateInstanceMetadata', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildCreateInstanceMetadata(); |
| var od = api.CreateInstanceMetadata.fromJson(o.toJson()); |
| checkCreateInstanceMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CreateInstanceRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildCreateInstanceRequest(); |
| var od = api.CreateInstanceRequest.fromJson(o.toJson()); |
| checkCreateInstanceRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-CreateSessionRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildCreateSessionRequest(); |
| var od = api.CreateSessionRequest.fromJson(o.toJson()); |
| checkCreateSessionRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Database', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildDatabase(); |
| var od = api.Database.fromJson(o.toJson()); |
| checkDatabase(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Delete', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildDelete(); |
| var od = api.Delete.fromJson(o.toJson()); |
| checkDelete(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Empty', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildEmpty(); |
| var od = api.Empty.fromJson(o.toJson()); |
| checkEmpty(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ExecuteBatchDmlRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildExecuteBatchDmlRequest(); |
| var od = api.ExecuteBatchDmlRequest.fromJson(o.toJson()); |
| checkExecuteBatchDmlRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ExecuteBatchDmlResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildExecuteBatchDmlResponse(); |
| var od = api.ExecuteBatchDmlResponse.fromJson(o.toJson()); |
| checkExecuteBatchDmlResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ExecuteSqlRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildExecuteSqlRequest(); |
| var od = api.ExecuteSqlRequest.fromJson(o.toJson()); |
| checkExecuteSqlRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Expr', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildExpr(); |
| var od = api.Expr.fromJson(o.toJson()); |
| checkExpr(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Field', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildField(); |
| var od = api.Field.fromJson(o.toJson()); |
| checkField(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GetDatabaseDdlResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGetDatabaseDdlResponse(); |
| var od = api.GetDatabaseDdlResponse.fromJson(o.toJson()); |
| checkGetDatabaseDdlResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GetIamPolicyRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGetIamPolicyRequest(); |
| var od = api.GetIamPolicyRequest.fromJson(o.toJson()); |
| checkGetIamPolicyRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-GetPolicyOptions', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildGetPolicyOptions(); |
| var od = api.GetPolicyOptions.fromJson(o.toJson()); |
| checkGetPolicyOptions(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Instance', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildInstance(); |
| var od = api.Instance.fromJson(o.toJson()); |
| checkInstance(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-InstanceConfig', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildInstanceConfig(); |
| var od = api.InstanceConfig.fromJson(o.toJson()); |
| checkInstanceConfig(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-KeyRange', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildKeyRange(); |
| var od = api.KeyRange.fromJson(o.toJson()); |
| checkKeyRange(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-KeySet', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildKeySet(); |
| var od = api.KeySet.fromJson(o.toJson()); |
| checkKeySet(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListBackupOperationsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListBackupOperationsResponse(); |
| var od = api.ListBackupOperationsResponse.fromJson(o.toJson()); |
| checkListBackupOperationsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListBackupsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListBackupsResponse(); |
| var od = api.ListBackupsResponse.fromJson(o.toJson()); |
| checkListBackupsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListDatabaseOperationsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListDatabaseOperationsResponse(); |
| var od = api.ListDatabaseOperationsResponse.fromJson(o.toJson()); |
| checkListDatabaseOperationsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListDatabasesResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListDatabasesResponse(); |
| var od = api.ListDatabasesResponse.fromJson(o.toJson()); |
| checkListDatabasesResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListInstanceConfigsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListInstanceConfigsResponse(); |
| var od = api.ListInstanceConfigsResponse.fromJson(o.toJson()); |
| checkListInstanceConfigsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListInstancesResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListInstancesResponse(); |
| var od = api.ListInstancesResponse.fromJson(o.toJson()); |
| checkListInstancesResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListOperationsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListOperationsResponse(); |
| var od = api.ListOperationsResponse.fromJson(o.toJson()); |
| checkListOperationsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ListSessionsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildListSessionsResponse(); |
| var od = api.ListSessionsResponse.fromJson(o.toJson()); |
| checkListSessionsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Mutation', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildMutation(); |
| var od = api.Mutation.fromJson(o.toJson()); |
| checkMutation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Operation', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildOperation(); |
| var od = api.Operation.fromJson(o.toJson()); |
| checkOperation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OperationProgress', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildOperationProgress(); |
| var od = api.OperationProgress.fromJson(o.toJson()); |
| checkOperationProgress(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-OptimizeRestoredDatabaseMetadata', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildOptimizeRestoredDatabaseMetadata(); |
| var od = api.OptimizeRestoredDatabaseMetadata.fromJson(o.toJson()); |
| checkOptimizeRestoredDatabaseMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PartialResultSet', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPartialResultSet(); |
| var od = api.PartialResultSet.fromJson(o.toJson()); |
| checkPartialResultSet(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Partition', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPartition(); |
| var od = api.Partition.fromJson(o.toJson()); |
| checkPartition(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PartitionOptions', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPartitionOptions(); |
| var od = api.PartitionOptions.fromJson(o.toJson()); |
| checkPartitionOptions(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PartitionQueryRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPartitionQueryRequest(); |
| var od = api.PartitionQueryRequest.fromJson(o.toJson()); |
| checkPartitionQueryRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PartitionReadRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPartitionReadRequest(); |
| var od = api.PartitionReadRequest.fromJson(o.toJson()); |
| checkPartitionReadRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PartitionResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPartitionResponse(); |
| var od = api.PartitionResponse.fromJson(o.toJson()); |
| checkPartitionResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PartitionedDml', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPartitionedDml(); |
| var od = api.PartitionedDml.fromJson(o.toJson()); |
| checkPartitionedDml(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-PlanNode', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPlanNode(); |
| var od = api.PlanNode.fromJson(o.toJson()); |
| checkPlanNode(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Policy', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildPolicy(); |
| var od = api.Policy.fromJson(o.toJson()); |
| checkPolicy(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-QueryOptions', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildQueryOptions(); |
| var od = api.QueryOptions.fromJson(o.toJson()); |
| checkQueryOptions(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-QueryPlan', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildQueryPlan(); |
| var od = api.QueryPlan.fromJson(o.toJson()); |
| checkQueryPlan(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ReadOnly', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildReadOnly(); |
| var od = api.ReadOnly.fromJson(o.toJson()); |
| checkReadOnly(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ReadRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildReadRequest(); |
| var od = api.ReadRequest.fromJson(o.toJson()); |
| checkReadRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ReadWrite', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildReadWrite(); |
| var od = api.ReadWrite.fromJson(o.toJson()); |
| checkReadWrite(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ReplicaInfo', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildReplicaInfo(); |
| var od = api.ReplicaInfo.fromJson(o.toJson()); |
| checkReplicaInfo(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RestoreDatabaseMetadata', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildRestoreDatabaseMetadata(); |
| var od = api.RestoreDatabaseMetadata.fromJson(o.toJson()); |
| checkRestoreDatabaseMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RestoreDatabaseRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildRestoreDatabaseRequest(); |
| var od = api.RestoreDatabaseRequest.fromJson(o.toJson()); |
| checkRestoreDatabaseRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RestoreInfo', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildRestoreInfo(); |
| var od = api.RestoreInfo.fromJson(o.toJson()); |
| checkRestoreInfo(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ResultSet', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildResultSet(); |
| var od = api.ResultSet.fromJson(o.toJson()); |
| checkResultSet(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ResultSetMetadata', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildResultSetMetadata(); |
| var od = api.ResultSetMetadata.fromJson(o.toJson()); |
| checkResultSetMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ResultSetStats', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildResultSetStats(); |
| var od = api.ResultSetStats.fromJson(o.toJson()); |
| checkResultSetStats(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-RollbackRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildRollbackRequest(); |
| var od = api.RollbackRequest.fromJson(o.toJson()); |
| checkRollbackRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Session', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSession(); |
| var od = api.Session.fromJson(o.toJson()); |
| checkSession(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-SetIamPolicyRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildSetIamPolicyRequest(); |
| var od = api.SetIamPolicyRequest.fromJson(o.toJson()); |
| checkSetIamPolicyRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-ShortRepresentation', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildShortRepresentation(); |
| var od = api.ShortRepresentation.fromJson(o.toJson()); |
| checkShortRepresentation(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Statement', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildStatement(); |
| var od = api.Statement.fromJson(o.toJson()); |
| checkStatement(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Status', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildStatus(); |
| var od = api.Status.fromJson(o.toJson()); |
| checkStatus(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-StructType', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildStructType(); |
| var od = api.StructType.fromJson(o.toJson()); |
| checkStructType(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTestIamPermissionsRequest(); |
| var od = api.TestIamPermissionsRequest.fromJson(o.toJson()); |
| checkTestIamPermissionsRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TestIamPermissionsResponse', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTestIamPermissionsResponse(); |
| var od = api.TestIamPermissionsResponse.fromJson(o.toJson()); |
| checkTestIamPermissionsResponse(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Transaction', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTransaction(); |
| var od = api.Transaction.fromJson(o.toJson()); |
| checkTransaction(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TransactionOptions', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTransactionOptions(); |
| var od = api.TransactionOptions.fromJson(o.toJson()); |
| checkTransactionOptions(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-TransactionSelector', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildTransactionSelector(); |
| var od = api.TransactionSelector.fromJson(o.toJson()); |
| checkTransactionSelector(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Type', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildType(); |
| var od = api.Type.fromJson(o.toJson()); |
| checkType(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-UpdateDatabaseDdlMetadata', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildUpdateDatabaseDdlMetadata(); |
| var od = api.UpdateDatabaseDdlMetadata.fromJson(o.toJson()); |
| checkUpdateDatabaseDdlMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-UpdateDatabaseDdlRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildUpdateDatabaseDdlRequest(); |
| var od = api.UpdateDatabaseDdlRequest.fromJson(o.toJson()); |
| checkUpdateDatabaseDdlRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-UpdateInstanceMetadata', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildUpdateInstanceMetadata(); |
| var od = api.UpdateInstanceMetadata.fromJson(o.toJson()); |
| checkUpdateInstanceMetadata(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-UpdateInstanceRequest', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildUpdateInstanceRequest(); |
| var od = api.UpdateInstanceRequest.fromJson(o.toJson()); |
| checkUpdateInstanceRequest(od); |
| }); |
| }); |
| |
| unittest.group('obj-schema-Write', () { |
| unittest.test('to-json--from-json', () { |
| var o = buildWrite(); |
| var od = api.Write.fromJson(o.toJson()); |
| checkWrite(od); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsInstanceConfigsResourceApi', () { |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstanceConfigsResourceApi res = |
| api.SpannerApi(mock).projects.instanceConfigs; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildInstanceConfig()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkInstanceConfig(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstanceConfigsResourceApi res = |
| api.SpannerApi(mock).projects.instanceConfigs; |
| var arg_parent = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListInstanceConfigsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListInstanceConfigsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsInstancesResourceApi', () { |
| unittest.test('method--create', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesResourceApi res = |
| api.SpannerApi(mock).projects.instances; |
| var arg_request = buildCreateInstanceRequest(); |
| var arg_parent = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.CreateInstanceRequest.fromJson(json); |
| checkCreateInstanceRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesResourceApi res = |
| api.SpannerApi(mock).projects.instances; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesResourceApi res = |
| api.SpannerApi(mock).projects.instances; |
| var arg_name = 'foo'; |
| var arg_fieldMask = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["fieldMask"].first, unittest.equals(arg_fieldMask)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildInstance()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, fieldMask: arg_fieldMask, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkInstance(response); |
| }))); |
| }); |
| |
| unittest.test('method--getIamPolicy', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesResourceApi res = |
| api.SpannerApi(mock).projects.instances; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesResourceApi res = |
| api.SpannerApi(mock).projects.instances; |
| var arg_parent = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListInstancesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListInstancesResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--patch', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesResourceApi res = |
| api.SpannerApi(mock).projects.instances; |
| var arg_request = buildUpdateInstanceRequest(); |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.UpdateInstanceRequest.fromJson(json); |
| checkUpdateInstanceRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .patch(arg_request, arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test('method--setIamPolicy', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesResourceApi res = |
| api.SpannerApi(mock).projects.instances; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test('method--testIamPermissions', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesResourceApi res = |
| api.SpannerApi(mock).projects.instances; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsInstancesBackupOperationsResourceApi', () { |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backupOperations; |
| var arg_parent = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListBackupOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListBackupOperationsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsInstancesBackupsResourceApi', () { |
| unittest.test('method--create', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups; |
| var arg_request = buildBackup(); |
| var arg_parent = 'foo'; |
| var arg_backupId = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.Backup.fromJson(json); |
| checkBackup(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["backupId"].first, unittest.equals(arg_backupId)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, |
| backupId: arg_backupId, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildBackup()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkBackup(response); |
| }))); |
| }); |
| |
| unittest.test('method--getIamPolicy', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups; |
| var arg_parent = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListBackupsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListBackupsResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--patch', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups; |
| var arg_request = buildBackup(); |
| var arg_name = 'foo'; |
| var arg_updateMask = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.Backup.fromJson(json); |
| checkBackup(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect( |
| queryMap["updateMask"].first, unittest.equals(arg_updateMask)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildBackup()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .patch(arg_request, arg_name, |
| updateMask: arg_updateMask, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkBackup(response); |
| }))); |
| }); |
| |
| unittest.test('method--setIamPolicy', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test('method--testIamPermissions', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsInstancesBackupsOperationsResourceApi', () { |
| unittest.test('method--cancel', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .cancel(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesBackupsOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.backups.operations; |
| var arg_name = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListOperationsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsInstancesDatabaseOperationsResourceApi', () { |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabaseOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databaseOperations; |
| var arg_parent = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListDatabaseOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListDatabaseOperationsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsInstancesDatabasesResourceApi', () { |
| unittest.test('method--create', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases; |
| var arg_request = buildCreateDatabaseRequest(); |
| var arg_parent = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.CreateDatabaseRequest.fromJson(json); |
| checkCreateDatabaseRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test('method--dropDatabase', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases; |
| var arg_database = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .dropDatabase(arg_database, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildDatabase()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkDatabase(response); |
| }))); |
| }); |
| |
| unittest.test('method--getDdl', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases; |
| var arg_database = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildGetDatabaseDdlResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getDdl(arg_database, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkGetDatabaseDdlResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--getIamPolicy', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases; |
| var arg_request = buildGetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.GetIamPolicyRequest.fromJson(json); |
| checkGetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .getIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases; |
| var arg_parent = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListDatabasesResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_parent, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListDatabasesResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--restore', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases; |
| var arg_request = buildRestoreDatabaseRequest(); |
| var arg_parent = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.RestoreDatabaseRequest.fromJson(json); |
| checkRestoreDatabaseRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .restore(arg_request, arg_parent, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test('method--setIamPolicy', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases; |
| var arg_request = buildSetIamPolicyRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.SetIamPolicyRequest.fromJson(json); |
| checkSetIamPolicyRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPolicy()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .setIamPolicy(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPolicy(response); |
| }))); |
| }); |
| |
| unittest.test('method--testIamPermissions', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases; |
| var arg_request = buildTestIamPermissionsRequest(); |
| var arg_resource = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.TestIamPermissionsRequest.fromJson(json); |
| checkTestIamPermissionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildTestIamPermissionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .testIamPermissions(arg_request, arg_resource, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTestIamPermissionsResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--updateDdl', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases; |
| var arg_request = buildUpdateDatabaseDdlRequest(); |
| var arg_database = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.UpdateDatabaseDdlRequest.fromJson(json); |
| checkUpdateDatabaseDdlRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .updateDdl(arg_request, arg_database, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsInstancesDatabasesOperationsResourceApi', |
| () { |
| unittest.test('method--cancel', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .cancel(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.operations; |
| var arg_name = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListOperationsResponse(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsInstancesDatabasesSessionsResourceApi', () { |
| unittest.test('method--batchCreate', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildBatchCreateSessionsRequest(); |
| var arg_database = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.BatchCreateSessionsRequest.fromJson(json); |
| checkBatchCreateSessionsRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildBatchCreateSessionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .batchCreate(arg_request, arg_database, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkBatchCreateSessionsResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--beginTransaction', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildBeginTransactionRequest(); |
| var arg_session = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.BeginTransactionRequest.fromJson(json); |
| checkBeginTransactionRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildTransaction()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .beginTransaction(arg_request, arg_session, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkTransaction(response); |
| }))); |
| }); |
| |
| unittest.test('method--commit', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildCommitRequest(); |
| var arg_session = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.CommitRequest.fromJson(json); |
| checkCommitRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildCommitResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .commit(arg_request, arg_session, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkCommitResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--create', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildCreateSessionRequest(); |
| var arg_database = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.CreateSessionRequest.fromJson(json); |
| checkCreateSessionRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildSession()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .create(arg_request, arg_database, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkSession(response); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--executeBatchDml', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildExecuteBatchDmlRequest(); |
| var arg_session = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ExecuteBatchDmlRequest.fromJson(json); |
| checkExecuteBatchDmlRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildExecuteBatchDmlResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .executeBatchDml(arg_request, arg_session, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkExecuteBatchDmlResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--executeSql', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildExecuteSqlRequest(); |
| var arg_session = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ExecuteSqlRequest.fromJson(json); |
| checkExecuteSqlRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildResultSet()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .executeSql(arg_request, arg_session, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkResultSet(response); |
| }))); |
| }); |
| |
| unittest.test('method--executeStreamingSql', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildExecuteSqlRequest(); |
| var arg_session = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ExecuteSqlRequest.fromJson(json); |
| checkExecuteSqlRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPartialResultSet()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .executeStreamingSql(arg_request, arg_session, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPartialResultSet(response); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildSession()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkSession(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_database = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListSessionsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_database, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListSessionsResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--partitionQuery', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildPartitionQueryRequest(); |
| var arg_session = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.PartitionQueryRequest.fromJson(json); |
| checkPartitionQueryRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPartitionResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .partitionQuery(arg_request, arg_session, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPartitionResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--partitionRead', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildPartitionReadRequest(); |
| var arg_session = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.PartitionReadRequest.fromJson(json); |
| checkPartitionReadRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPartitionResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .partitionRead(arg_request, arg_session, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPartitionResponse(response); |
| }))); |
| }); |
| |
| unittest.test('method--read', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildReadRequest(); |
| var arg_session = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ReadRequest.fromJson(json); |
| checkReadRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildResultSet()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .read(arg_request, arg_session, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkResultSet(response); |
| }))); |
| }); |
| |
| unittest.test('method--rollback', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildRollbackRequest(); |
| var arg_session = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.RollbackRequest.fromJson(json); |
| checkRollbackRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .rollback(arg_request, arg_session, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--streamingRead', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesDatabasesSessionsResourceApi res = |
| api.SpannerApi(mock).projects.instances.databases.sessions; |
| var arg_request = buildReadRequest(); |
| var arg_session = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var obj = api.ReadRequest.fromJson(json); |
| checkReadRequest(obj); |
| |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildPartialResultSet()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .streamingRead(arg_request, arg_session, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkPartialResultSet(response); |
| }))); |
| }); |
| }); |
| |
| unittest.group('resource-ProjectsInstancesOperationsResourceApi', () { |
| unittest.test('method--cancel', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .cancel(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--delete', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildEmpty()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .delete(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkEmpty(response); |
| }))); |
| }); |
| |
| unittest.test('method--get', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.operations; |
| var arg_name = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildOperation()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .get(arg_name, $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkOperation(response); |
| }))); |
| }); |
| |
| unittest.test('method--list', () { |
| var mock = HttpServerMock(); |
| api.ProjectsInstancesOperationsResourceApi res = |
| api.SpannerApi(mock).projects.instances.operations; |
| var arg_name = 'foo'; |
| var arg_filter = 'foo'; |
| var arg_pageSize = 42; |
| var arg_pageToken = 'foo'; |
| var arg_$fields = 'foo'; |
| mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| var path = (req.url).path; |
| var pathOffset = 0; |
| core.int index; |
| core.String subPart; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| pathOffset += 1; |
| unittest.expect( |
| path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| pathOffset += 3; |
| // NOTE: We cannot test reserved expansions due to the inability to reverse the operation; |
| |
| var query = (req.url).query; |
| var queryOffset = 0; |
| var queryMap = <core.String, core.List<core.String>>{}; |
| void addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| |
| if (query.isNotEmpty) { |
| for (var part in query.split('&')) { |
| var keyValue = part.split('='); |
| addQueryParam( |
| core.Uri.decodeQueryComponent(keyValue[0]), |
| core.Uri.decodeQueryComponent(keyValue[1]), |
| ); |
| } |
| } |
| unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| unittest.equals(arg_pageSize)); |
| unittest.expect( |
| queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields)); |
| |
| var h = { |
| 'content-type': 'application/json; charset=utf-8', |
| }; |
| var resp = convert.json.encode(buildListOperationsResponse()); |
| return async.Future.value(stringResponse(200, h, resp)); |
| }), true); |
| res |
| .list(arg_name, |
| filter: arg_filter, |
| pageSize: arg_pageSize, |
| pageToken: arg_pageToken, |
| $fields: arg_$fields) |
| .then(unittest.expectAsync1(((response) { |
| checkListOperationsResponse(response); |
| }))); |
| }); |
| }); |
| } |