| OLD | NEW |
| 1 library googleapis_beta.clouduseraccounts.beta.test; | 1 library googleapis_beta.clouduseraccounts.beta.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | |
| 5 import "dart:async" as async; | 4 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 5 import "dart:convert" as convert; |
| 7 | 6 |
| 8 import 'package:http/http.dart' as http; | 7 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | |
| 10 import 'package:test/test.dart' as unittest; | 8 import 'package:test/test.dart' as unittest; |
| 11 | 9 |
| 12 import 'package:googleapis_beta/clouduseraccounts/beta.dart' as api; | 10 import 'package:googleapis_beta/clouduseraccounts/beta.dart' as api; |
| 13 | 11 |
| 14 class HttpServerMock extends http.BaseClient { | 12 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; | 13 core.Function _callback; |
| 16 core.bool _expectJson; | 14 core.bool _expectJson; |
| 17 | 15 |
| 18 void register(core.Function callback, core.bool expectJson) { | 16 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; | 17 _callback = callback; |
| 20 _expectJson = expectJson; | 18 _expectJson = expectJson; |
| 21 } | 19 } |
| 22 | 20 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { | 21 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { | 22 if (_expectJson) { |
| 25 return request.finalize() | 23 return request |
| 24 .finalize() |
| 26 .transform(convert.UTF8.decoder) | 25 .transform(convert.UTF8.decoder) |
| 27 .join('') | 26 .join('') |
| 28 .then((core.String jsonString) { | 27 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { | 28 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); | 29 return _callback(request, null); |
| 31 } else { | 30 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); | 31 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } | 32 } |
| 34 }); | 33 }); |
| 35 } else { | 34 } else { |
| 36 var stream = request.finalize(); | 35 var stream = request.finalize(); |
| 37 if (stream == null) { | 36 if (stream == null) { |
| 38 return _callback(request, []); | 37 return _callback(request, []); |
| 39 } else { | 38 } else { |
| 40 return stream.toBytes().then((data) { | 39 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); | 40 return _callback(request, data); |
| 42 }); | 41 }); |
| 43 } | 42 } |
| 44 } | 43 } |
| 45 } | 44 } |
| 46 } | 45 } |
| 47 | 46 |
| 48 http.StreamedResponse stringResponse( | 47 http.StreamedResponse stringResponse(core.int status, |
| 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { | 48 core.Map<core.String, core.String> headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 50 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 51 } |
| 53 | 52 |
| 54 buildUnnamed3258() { | 53 buildUnnamed3251() { |
| 55 var o = new core.List<core.String>(); | 54 var o = new core.List<core.String>(); |
| 56 o.add("foo"); | 55 o.add("foo"); |
| 57 o.add("foo"); | 56 o.add("foo"); |
| 58 return o; | 57 return o; |
| 59 } | 58 } |
| 60 | 59 |
| 61 checkUnnamed3258(core.List<core.String> o) { | 60 checkUnnamed3251(core.List<core.String> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); | 61 unittest.expect(o, unittest.hasLength(2)); |
| 63 unittest.expect(o[0], unittest.equals('foo')); | 62 unittest.expect(o[0], unittest.equals('foo')); |
| 64 unittest.expect(o[1], unittest.equals('foo')); | 63 unittest.expect(o[1], unittest.equals('foo')); |
| 65 } | 64 } |
| 66 | 65 |
| 67 core.int buildCounterAuthorizedKeysView = 0; | 66 core.int buildCounterAuthorizedKeysView = 0; |
| 68 buildAuthorizedKeysView() { | 67 buildAuthorizedKeysView() { |
| 69 var o = new api.AuthorizedKeysView(); | 68 var o = new api.AuthorizedKeysView(); |
| 70 buildCounterAuthorizedKeysView++; | 69 buildCounterAuthorizedKeysView++; |
| 71 if (buildCounterAuthorizedKeysView < 3) { | 70 if (buildCounterAuthorizedKeysView < 3) { |
| 72 o.keys = buildUnnamed3258(); | 71 o.keys = buildUnnamed3251(); |
| 73 o.sudoer = true; | 72 o.sudoer = true; |
| 74 } | 73 } |
| 75 buildCounterAuthorizedKeysView--; | 74 buildCounterAuthorizedKeysView--; |
| 76 return o; | 75 return o; |
| 77 } | 76 } |
| 78 | 77 |
| 79 checkAuthorizedKeysView(api.AuthorizedKeysView o) { | 78 checkAuthorizedKeysView(api.AuthorizedKeysView o) { |
| 80 buildCounterAuthorizedKeysView++; | 79 buildCounterAuthorizedKeysView++; |
| 81 if (buildCounterAuthorizedKeysView < 3) { | 80 if (buildCounterAuthorizedKeysView < 3) { |
| 82 checkUnnamed3258(o.keys); | 81 checkUnnamed3251(o.keys); |
| 83 unittest.expect(o.sudoer, unittest.isTrue); | 82 unittest.expect(o.sudoer, unittest.isTrue); |
| 84 } | 83 } |
| 85 buildCounterAuthorizedKeysView--; | 84 buildCounterAuthorizedKeysView--; |
| 86 } | 85 } |
| 87 | 86 |
| 88 buildUnnamed3259() { | 87 buildUnnamed3252() { |
| 89 var o = new core.List<core.String>(); | 88 var o = new core.List<core.String>(); |
| 90 o.add("foo"); | 89 o.add("foo"); |
| 91 o.add("foo"); | 90 o.add("foo"); |
| 92 return o; | 91 return o; |
| 93 } | 92 } |
| 94 | 93 |
| 95 checkUnnamed3259(core.List<core.String> o) { | 94 checkUnnamed3252(core.List<core.String> o) { |
| 96 unittest.expect(o, unittest.hasLength(2)); | 95 unittest.expect(o, unittest.hasLength(2)); |
| 97 unittest.expect(o[0], unittest.equals('foo')); | 96 unittest.expect(o[0], unittest.equals('foo')); |
| 98 unittest.expect(o[1], unittest.equals('foo')); | 97 unittest.expect(o[1], unittest.equals('foo')); |
| 99 } | 98 } |
| 100 | 99 |
| 101 core.int buildCounterGroup = 0; | 100 core.int buildCounterGroup = 0; |
| 102 buildGroup() { | 101 buildGroup() { |
| 103 var o = new api.Group(); | 102 var o = new api.Group(); |
| 104 buildCounterGroup++; | 103 buildCounterGroup++; |
| 105 if (buildCounterGroup < 3) { | 104 if (buildCounterGroup < 3) { |
| 106 o.creationTimestamp = "foo"; | 105 o.creationTimestamp = "foo"; |
| 107 o.description = "foo"; | 106 o.description = "foo"; |
| 108 o.id = "foo"; | 107 o.id = "foo"; |
| 109 o.kind = "foo"; | 108 o.kind = "foo"; |
| 110 o.members = buildUnnamed3259(); | 109 o.members = buildUnnamed3252(); |
| 111 o.name = "foo"; | 110 o.name = "foo"; |
| 112 o.selfLink = "foo"; | 111 o.selfLink = "foo"; |
| 113 } | 112 } |
| 114 buildCounterGroup--; | 113 buildCounterGroup--; |
| 115 return o; | 114 return o; |
| 116 } | 115 } |
| 117 | 116 |
| 118 checkGroup(api.Group o) { | 117 checkGroup(api.Group o) { |
| 119 buildCounterGroup++; | 118 buildCounterGroup++; |
| 120 if (buildCounterGroup < 3) { | 119 if (buildCounterGroup < 3) { |
| 121 unittest.expect(o.creationTimestamp, unittest.equals('foo')); | 120 unittest.expect(o.creationTimestamp, unittest.equals('foo')); |
| 122 unittest.expect(o.description, unittest.equals('foo')); | 121 unittest.expect(o.description, unittest.equals('foo')); |
| 123 unittest.expect(o.id, unittest.equals('foo')); | 122 unittest.expect(o.id, unittest.equals('foo')); |
| 124 unittest.expect(o.kind, unittest.equals('foo')); | 123 unittest.expect(o.kind, unittest.equals('foo')); |
| 125 checkUnnamed3259(o.members); | 124 checkUnnamed3252(o.members); |
| 126 unittest.expect(o.name, unittest.equals('foo')); | 125 unittest.expect(o.name, unittest.equals('foo')); |
| 127 unittest.expect(o.selfLink, unittest.equals('foo')); | 126 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 128 } | 127 } |
| 129 buildCounterGroup--; | 128 buildCounterGroup--; |
| 130 } | 129 } |
| 131 | 130 |
| 132 buildUnnamed3260() { | 131 buildUnnamed3253() { |
| 133 var o = new core.List<api.Group>(); | 132 var o = new core.List<api.Group>(); |
| 134 o.add(buildGroup()); | 133 o.add(buildGroup()); |
| 135 o.add(buildGroup()); | 134 o.add(buildGroup()); |
| 136 return o; | 135 return o; |
| 137 } | 136 } |
| 138 | 137 |
| 139 checkUnnamed3260(core.List<api.Group> o) { | 138 checkUnnamed3253(core.List<api.Group> o) { |
| 140 unittest.expect(o, unittest.hasLength(2)); | 139 unittest.expect(o, unittest.hasLength(2)); |
| 141 checkGroup(o[0]); | 140 checkGroup(o[0]); |
| 142 checkGroup(o[1]); | 141 checkGroup(o[1]); |
| 143 } | 142 } |
| 144 | 143 |
| 145 core.int buildCounterGroupList = 0; | 144 core.int buildCounterGroupList = 0; |
| 146 buildGroupList() { | 145 buildGroupList() { |
| 147 var o = new api.GroupList(); | 146 var o = new api.GroupList(); |
| 148 buildCounterGroupList++; | 147 buildCounterGroupList++; |
| 149 if (buildCounterGroupList < 3) { | 148 if (buildCounterGroupList < 3) { |
| 150 o.id = "foo"; | 149 o.id = "foo"; |
| 151 o.items = buildUnnamed3260(); | 150 o.items = buildUnnamed3253(); |
| 152 o.kind = "foo"; | 151 o.kind = "foo"; |
| 153 o.nextPageToken = "foo"; | 152 o.nextPageToken = "foo"; |
| 154 o.selfLink = "foo"; | 153 o.selfLink = "foo"; |
| 155 } | 154 } |
| 156 buildCounterGroupList--; | 155 buildCounterGroupList--; |
| 157 return o; | 156 return o; |
| 158 } | 157 } |
| 159 | 158 |
| 160 checkGroupList(api.GroupList o) { | 159 checkGroupList(api.GroupList o) { |
| 161 buildCounterGroupList++; | 160 buildCounterGroupList++; |
| 162 if (buildCounterGroupList < 3) { | 161 if (buildCounterGroupList < 3) { |
| 163 unittest.expect(o.id, unittest.equals('foo')); | 162 unittest.expect(o.id, unittest.equals('foo')); |
| 164 checkUnnamed3260(o.items); | 163 checkUnnamed3253(o.items); |
| 165 unittest.expect(o.kind, unittest.equals('foo')); | 164 unittest.expect(o.kind, unittest.equals('foo')); |
| 166 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 165 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 167 unittest.expect(o.selfLink, unittest.equals('foo')); | 166 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 168 } | 167 } |
| 169 buildCounterGroupList--; | 168 buildCounterGroupList--; |
| 170 } | 169 } |
| 171 | 170 |
| 172 buildUnnamed3261() { | 171 buildUnnamed3254() { |
| 173 var o = new core.List<core.String>(); | 172 var o = new core.List<core.String>(); |
| 174 o.add("foo"); | 173 o.add("foo"); |
| 175 o.add("foo"); | 174 o.add("foo"); |
| 176 return o; | 175 return o; |
| 177 } | 176 } |
| 178 | 177 |
| 179 checkUnnamed3261(core.List<core.String> o) { | 178 checkUnnamed3254(core.List<core.String> o) { |
| 180 unittest.expect(o, unittest.hasLength(2)); | 179 unittest.expect(o, unittest.hasLength(2)); |
| 181 unittest.expect(o[0], unittest.equals('foo')); | 180 unittest.expect(o[0], unittest.equals('foo')); |
| 182 unittest.expect(o[1], unittest.equals('foo')); | 181 unittest.expect(o[1], unittest.equals('foo')); |
| 183 } | 182 } |
| 184 | 183 |
| 185 core.int buildCounterGroupsAddMemberRequest = 0; | 184 core.int buildCounterGroupsAddMemberRequest = 0; |
| 186 buildGroupsAddMemberRequest() { | 185 buildGroupsAddMemberRequest() { |
| 187 var o = new api.GroupsAddMemberRequest(); | 186 var o = new api.GroupsAddMemberRequest(); |
| 188 buildCounterGroupsAddMemberRequest++; | 187 buildCounterGroupsAddMemberRequest++; |
| 189 if (buildCounterGroupsAddMemberRequest < 3) { | 188 if (buildCounterGroupsAddMemberRequest < 3) { |
| 190 o.users = buildUnnamed3261(); | 189 o.users = buildUnnamed3254(); |
| 191 } | 190 } |
| 192 buildCounterGroupsAddMemberRequest--; | 191 buildCounterGroupsAddMemberRequest--; |
| 193 return o; | 192 return o; |
| 194 } | 193 } |
| 195 | 194 |
| 196 checkGroupsAddMemberRequest(api.GroupsAddMemberRequest o) { | 195 checkGroupsAddMemberRequest(api.GroupsAddMemberRequest o) { |
| 197 buildCounterGroupsAddMemberRequest++; | 196 buildCounterGroupsAddMemberRequest++; |
| 198 if (buildCounterGroupsAddMemberRequest < 3) { | 197 if (buildCounterGroupsAddMemberRequest < 3) { |
| 199 checkUnnamed3261(o.users); | 198 checkUnnamed3254(o.users); |
| 200 } | 199 } |
| 201 buildCounterGroupsAddMemberRequest--; | 200 buildCounterGroupsAddMemberRequest--; |
| 202 } | 201 } |
| 203 | 202 |
| 204 buildUnnamed3262() { | 203 buildUnnamed3255() { |
| 205 var o = new core.List<core.String>(); | 204 var o = new core.List<core.String>(); |
| 206 o.add("foo"); | 205 o.add("foo"); |
| 207 o.add("foo"); | 206 o.add("foo"); |
| 208 return o; | 207 return o; |
| 209 } | 208 } |
| 210 | 209 |
| 211 checkUnnamed3262(core.List<core.String> o) { | 210 checkUnnamed3255(core.List<core.String> o) { |
| 212 unittest.expect(o, unittest.hasLength(2)); | 211 unittest.expect(o, unittest.hasLength(2)); |
| 213 unittest.expect(o[0], unittest.equals('foo')); | 212 unittest.expect(o[0], unittest.equals('foo')); |
| 214 unittest.expect(o[1], unittest.equals('foo')); | 213 unittest.expect(o[1], unittest.equals('foo')); |
| 215 } | 214 } |
| 216 | 215 |
| 217 core.int buildCounterGroupsRemoveMemberRequest = 0; | 216 core.int buildCounterGroupsRemoveMemberRequest = 0; |
| 218 buildGroupsRemoveMemberRequest() { | 217 buildGroupsRemoveMemberRequest() { |
| 219 var o = new api.GroupsRemoveMemberRequest(); | 218 var o = new api.GroupsRemoveMemberRequest(); |
| 220 buildCounterGroupsRemoveMemberRequest++; | 219 buildCounterGroupsRemoveMemberRequest++; |
| 221 if (buildCounterGroupsRemoveMemberRequest < 3) { | 220 if (buildCounterGroupsRemoveMemberRequest < 3) { |
| 222 o.users = buildUnnamed3262(); | 221 o.users = buildUnnamed3255(); |
| 223 } | 222 } |
| 224 buildCounterGroupsRemoveMemberRequest--; | 223 buildCounterGroupsRemoveMemberRequest--; |
| 225 return o; | 224 return o; |
| 226 } | 225 } |
| 227 | 226 |
| 228 checkGroupsRemoveMemberRequest(api.GroupsRemoveMemberRequest o) { | 227 checkGroupsRemoveMemberRequest(api.GroupsRemoveMemberRequest o) { |
| 229 buildCounterGroupsRemoveMemberRequest++; | 228 buildCounterGroupsRemoveMemberRequest++; |
| 230 if (buildCounterGroupsRemoveMemberRequest < 3) { | 229 if (buildCounterGroupsRemoveMemberRequest < 3) { |
| 231 checkUnnamed3262(o.users); | 230 checkUnnamed3255(o.users); |
| 232 } | 231 } |
| 233 buildCounterGroupsRemoveMemberRequest--; | 232 buildCounterGroupsRemoveMemberRequest--; |
| 234 } | 233 } |
| 235 | 234 |
| 236 buildUnnamed3263() { | 235 buildUnnamed3256() { |
| 237 var o = new core.List<api.LinuxGroupView>(); | 236 var o = new core.List<api.LinuxGroupView>(); |
| 238 o.add(buildLinuxGroupView()); | 237 o.add(buildLinuxGroupView()); |
| 239 o.add(buildLinuxGroupView()); | 238 o.add(buildLinuxGroupView()); |
| 240 return o; | 239 return o; |
| 241 } | 240 } |
| 242 | 241 |
| 243 checkUnnamed3263(core.List<api.LinuxGroupView> o) { | 242 checkUnnamed3256(core.List<api.LinuxGroupView> o) { |
| 244 unittest.expect(o, unittest.hasLength(2)); | 243 unittest.expect(o, unittest.hasLength(2)); |
| 245 checkLinuxGroupView(o[0]); | 244 checkLinuxGroupView(o[0]); |
| 246 checkLinuxGroupView(o[1]); | 245 checkLinuxGroupView(o[1]); |
| 247 } | 246 } |
| 248 | 247 |
| 249 buildUnnamed3264() { | 248 buildUnnamed3257() { |
| 250 var o = new core.List<api.LinuxUserView>(); | 249 var o = new core.List<api.LinuxUserView>(); |
| 251 o.add(buildLinuxUserView()); | 250 o.add(buildLinuxUserView()); |
| 252 o.add(buildLinuxUserView()); | 251 o.add(buildLinuxUserView()); |
| 253 return o; | 252 return o; |
| 254 } | 253 } |
| 255 | 254 |
| 256 checkUnnamed3264(core.List<api.LinuxUserView> o) { | 255 checkUnnamed3257(core.List<api.LinuxUserView> o) { |
| 257 unittest.expect(o, unittest.hasLength(2)); | 256 unittest.expect(o, unittest.hasLength(2)); |
| 258 checkLinuxUserView(o[0]); | 257 checkLinuxUserView(o[0]); |
| 259 checkLinuxUserView(o[1]); | 258 checkLinuxUserView(o[1]); |
| 260 } | 259 } |
| 261 | 260 |
| 262 core.int buildCounterLinuxAccountViews = 0; | 261 core.int buildCounterLinuxAccountViews = 0; |
| 263 buildLinuxAccountViews() { | 262 buildLinuxAccountViews() { |
| 264 var o = new api.LinuxAccountViews(); | 263 var o = new api.LinuxAccountViews(); |
| 265 buildCounterLinuxAccountViews++; | 264 buildCounterLinuxAccountViews++; |
| 266 if (buildCounterLinuxAccountViews < 3) { | 265 if (buildCounterLinuxAccountViews < 3) { |
| 267 o.groupViews = buildUnnamed3263(); | 266 o.groupViews = buildUnnamed3256(); |
| 268 o.kind = "foo"; | 267 o.kind = "foo"; |
| 269 o.userViews = buildUnnamed3264(); | 268 o.userViews = buildUnnamed3257(); |
| 270 } | 269 } |
| 271 buildCounterLinuxAccountViews--; | 270 buildCounterLinuxAccountViews--; |
| 272 return o; | 271 return o; |
| 273 } | 272 } |
| 274 | 273 |
| 275 checkLinuxAccountViews(api.LinuxAccountViews o) { | 274 checkLinuxAccountViews(api.LinuxAccountViews o) { |
| 276 buildCounterLinuxAccountViews++; | 275 buildCounterLinuxAccountViews++; |
| 277 if (buildCounterLinuxAccountViews < 3) { | 276 if (buildCounterLinuxAccountViews < 3) { |
| 278 checkUnnamed3263(o.groupViews); | 277 checkUnnamed3256(o.groupViews); |
| 279 unittest.expect(o.kind, unittest.equals('foo')); | 278 unittest.expect(o.kind, unittest.equals('foo')); |
| 280 checkUnnamed3264(o.userViews); | 279 checkUnnamed3257(o.userViews); |
| 281 } | 280 } |
| 282 buildCounterLinuxAccountViews--; | 281 buildCounterLinuxAccountViews--; |
| 283 } | 282 } |
| 284 | 283 |
| 285 core.int buildCounterLinuxGetAuthorizedKeysViewResponse = 0; | 284 core.int buildCounterLinuxGetAuthorizedKeysViewResponse = 0; |
| 286 buildLinuxGetAuthorizedKeysViewResponse() { | 285 buildLinuxGetAuthorizedKeysViewResponse() { |
| 287 var o = new api.LinuxGetAuthorizedKeysViewResponse(); | 286 var o = new api.LinuxGetAuthorizedKeysViewResponse(); |
| 288 buildCounterLinuxGetAuthorizedKeysViewResponse++; | 287 buildCounterLinuxGetAuthorizedKeysViewResponse++; |
| 289 if (buildCounterLinuxGetAuthorizedKeysViewResponse < 3) { | 288 if (buildCounterLinuxGetAuthorizedKeysViewResponse < 3) { |
| 290 o.resource = buildAuthorizedKeysView(); | 289 o.resource = buildAuthorizedKeysView(); |
| 291 } | 290 } |
| 292 buildCounterLinuxGetAuthorizedKeysViewResponse--; | 291 buildCounterLinuxGetAuthorizedKeysViewResponse--; |
| 293 return o; | 292 return o; |
| 294 } | 293 } |
| 295 | 294 |
| 296 checkLinuxGetAuthorizedKeysViewResponse(api.LinuxGetAuthorizedKeysViewResponse o
) { | 295 checkLinuxGetAuthorizedKeysViewResponse( |
| 296 api.LinuxGetAuthorizedKeysViewResponse o) { |
| 297 buildCounterLinuxGetAuthorizedKeysViewResponse++; | 297 buildCounterLinuxGetAuthorizedKeysViewResponse++; |
| 298 if (buildCounterLinuxGetAuthorizedKeysViewResponse < 3) { | 298 if (buildCounterLinuxGetAuthorizedKeysViewResponse < 3) { |
| 299 checkAuthorizedKeysView(o.resource); | 299 checkAuthorizedKeysView(o.resource); |
| 300 } | 300 } |
| 301 buildCounterLinuxGetAuthorizedKeysViewResponse--; | 301 buildCounterLinuxGetAuthorizedKeysViewResponse--; |
| 302 } | 302 } |
| 303 | 303 |
| 304 core.int buildCounterLinuxGetLinuxAccountViewsResponse = 0; | 304 core.int buildCounterLinuxGetLinuxAccountViewsResponse = 0; |
| 305 buildLinuxGetLinuxAccountViewsResponse() { | 305 buildLinuxGetLinuxAccountViewsResponse() { |
| 306 var o = new api.LinuxGetLinuxAccountViewsResponse(); | 306 var o = new api.LinuxGetLinuxAccountViewsResponse(); |
| 307 buildCounterLinuxGetLinuxAccountViewsResponse++; | 307 buildCounterLinuxGetLinuxAccountViewsResponse++; |
| 308 if (buildCounterLinuxGetLinuxAccountViewsResponse < 3) { | 308 if (buildCounterLinuxGetLinuxAccountViewsResponse < 3) { |
| 309 o.resource = buildLinuxAccountViews(); | 309 o.resource = buildLinuxAccountViews(); |
| 310 } | 310 } |
| 311 buildCounterLinuxGetLinuxAccountViewsResponse--; | 311 buildCounterLinuxGetLinuxAccountViewsResponse--; |
| 312 return o; | 312 return o; |
| 313 } | 313 } |
| 314 | 314 |
| 315 checkLinuxGetLinuxAccountViewsResponse(api.LinuxGetLinuxAccountViewsResponse o)
{ | 315 checkLinuxGetLinuxAccountViewsResponse( |
| 316 api.LinuxGetLinuxAccountViewsResponse o) { |
| 316 buildCounterLinuxGetLinuxAccountViewsResponse++; | 317 buildCounterLinuxGetLinuxAccountViewsResponse++; |
| 317 if (buildCounterLinuxGetLinuxAccountViewsResponse < 3) { | 318 if (buildCounterLinuxGetLinuxAccountViewsResponse < 3) { |
| 318 checkLinuxAccountViews(o.resource); | 319 checkLinuxAccountViews(o.resource); |
| 319 } | 320 } |
| 320 buildCounterLinuxGetLinuxAccountViewsResponse--; | 321 buildCounterLinuxGetLinuxAccountViewsResponse--; |
| 321 } | 322 } |
| 322 | 323 |
| 323 buildUnnamed3265() { | 324 buildUnnamed3258() { |
| 324 var o = new core.List<core.String>(); | 325 var o = new core.List<core.String>(); |
| 325 o.add("foo"); | 326 o.add("foo"); |
| 326 o.add("foo"); | 327 o.add("foo"); |
| 327 return o; | 328 return o; |
| 328 } | 329 } |
| 329 | 330 |
| 330 checkUnnamed3265(core.List<core.String> o) { | 331 checkUnnamed3258(core.List<core.String> o) { |
| 331 unittest.expect(o, unittest.hasLength(2)); | 332 unittest.expect(o, unittest.hasLength(2)); |
| 332 unittest.expect(o[0], unittest.equals('foo')); | 333 unittest.expect(o[0], unittest.equals('foo')); |
| 333 unittest.expect(o[1], unittest.equals('foo')); | 334 unittest.expect(o[1], unittest.equals('foo')); |
| 334 } | 335 } |
| 335 | 336 |
| 336 core.int buildCounterLinuxGroupView = 0; | 337 core.int buildCounterLinuxGroupView = 0; |
| 337 buildLinuxGroupView() { | 338 buildLinuxGroupView() { |
| 338 var o = new api.LinuxGroupView(); | 339 var o = new api.LinuxGroupView(); |
| 339 buildCounterLinuxGroupView++; | 340 buildCounterLinuxGroupView++; |
| 340 if (buildCounterLinuxGroupView < 3) { | 341 if (buildCounterLinuxGroupView < 3) { |
| 341 o.gid = 42; | 342 o.gid = 42; |
| 342 o.groupName = "foo"; | 343 o.groupName = "foo"; |
| 343 o.members = buildUnnamed3265(); | 344 o.members = buildUnnamed3258(); |
| 344 } | 345 } |
| 345 buildCounterLinuxGroupView--; | 346 buildCounterLinuxGroupView--; |
| 346 return o; | 347 return o; |
| 347 } | 348 } |
| 348 | 349 |
| 349 checkLinuxGroupView(api.LinuxGroupView o) { | 350 checkLinuxGroupView(api.LinuxGroupView o) { |
| 350 buildCounterLinuxGroupView++; | 351 buildCounterLinuxGroupView++; |
| 351 if (buildCounterLinuxGroupView < 3) { | 352 if (buildCounterLinuxGroupView < 3) { |
| 352 unittest.expect(o.gid, unittest.equals(42)); | 353 unittest.expect(o.gid, unittest.equals(42)); |
| 353 unittest.expect(o.groupName, unittest.equals('foo')); | 354 unittest.expect(o.groupName, unittest.equals('foo')); |
| 354 checkUnnamed3265(o.members); | 355 checkUnnamed3258(o.members); |
| 355 } | 356 } |
| 356 buildCounterLinuxGroupView--; | 357 buildCounterLinuxGroupView--; |
| 357 } | 358 } |
| 358 | 359 |
| 359 core.int buildCounterLinuxUserView = 0; | 360 core.int buildCounterLinuxUserView = 0; |
| 360 buildLinuxUserView() { | 361 buildLinuxUserView() { |
| 361 var o = new api.LinuxUserView(); | 362 var o = new api.LinuxUserView(); |
| 362 buildCounterLinuxUserView++; | 363 buildCounterLinuxUserView++; |
| 363 if (buildCounterLinuxUserView < 3) { | 364 if (buildCounterLinuxUserView < 3) { |
| 364 o.gecos = "foo"; | 365 o.gecos = "foo"; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 checkOperationErrorErrors(api.OperationErrorErrors o) { | 402 checkOperationErrorErrors(api.OperationErrorErrors o) { |
| 402 buildCounterOperationErrorErrors++; | 403 buildCounterOperationErrorErrors++; |
| 403 if (buildCounterOperationErrorErrors < 3) { | 404 if (buildCounterOperationErrorErrors < 3) { |
| 404 unittest.expect(o.code, unittest.equals('foo')); | 405 unittest.expect(o.code, unittest.equals('foo')); |
| 405 unittest.expect(o.location, unittest.equals('foo')); | 406 unittest.expect(o.location, unittest.equals('foo')); |
| 406 unittest.expect(o.message, unittest.equals('foo')); | 407 unittest.expect(o.message, unittest.equals('foo')); |
| 407 } | 408 } |
| 408 buildCounterOperationErrorErrors--; | 409 buildCounterOperationErrorErrors--; |
| 409 } | 410 } |
| 410 | 411 |
| 411 buildUnnamed3266() { | 412 buildUnnamed3259() { |
| 412 var o = new core.List<api.OperationErrorErrors>(); | 413 var o = new core.List<api.OperationErrorErrors>(); |
| 413 o.add(buildOperationErrorErrors()); | 414 o.add(buildOperationErrorErrors()); |
| 414 o.add(buildOperationErrorErrors()); | 415 o.add(buildOperationErrorErrors()); |
| 415 return o; | 416 return o; |
| 416 } | 417 } |
| 417 | 418 |
| 418 checkUnnamed3266(core.List<api.OperationErrorErrors> o) { | 419 checkUnnamed3259(core.List<api.OperationErrorErrors> o) { |
| 419 unittest.expect(o, unittest.hasLength(2)); | 420 unittest.expect(o, unittest.hasLength(2)); |
| 420 checkOperationErrorErrors(o[0]); | 421 checkOperationErrorErrors(o[0]); |
| 421 checkOperationErrorErrors(o[1]); | 422 checkOperationErrorErrors(o[1]); |
| 422 } | 423 } |
| 423 | 424 |
| 424 core.int buildCounterOperationError = 0; | 425 core.int buildCounterOperationError = 0; |
| 425 buildOperationError() { | 426 buildOperationError() { |
| 426 var o = new api.OperationError(); | 427 var o = new api.OperationError(); |
| 427 buildCounterOperationError++; | 428 buildCounterOperationError++; |
| 428 if (buildCounterOperationError < 3) { | 429 if (buildCounterOperationError < 3) { |
| 429 o.errors = buildUnnamed3266(); | 430 o.errors = buildUnnamed3259(); |
| 430 } | 431 } |
| 431 buildCounterOperationError--; | 432 buildCounterOperationError--; |
| 432 return o; | 433 return o; |
| 433 } | 434 } |
| 434 | 435 |
| 435 checkOperationError(api.OperationError o) { | 436 checkOperationError(api.OperationError o) { |
| 436 buildCounterOperationError++; | 437 buildCounterOperationError++; |
| 437 if (buildCounterOperationError < 3) { | 438 if (buildCounterOperationError < 3) { |
| 438 checkUnnamed3266(o.errors); | 439 checkUnnamed3259(o.errors); |
| 439 } | 440 } |
| 440 buildCounterOperationError--; | 441 buildCounterOperationError--; |
| 441 } | 442 } |
| 442 | 443 |
| 443 core.int buildCounterOperationWarningsData = 0; | 444 core.int buildCounterOperationWarningsData = 0; |
| 444 buildOperationWarningsData() { | 445 buildOperationWarningsData() { |
| 445 var o = new api.OperationWarningsData(); | 446 var o = new api.OperationWarningsData(); |
| 446 buildCounterOperationWarningsData++; | 447 buildCounterOperationWarningsData++; |
| 447 if (buildCounterOperationWarningsData < 3) { | 448 if (buildCounterOperationWarningsData < 3) { |
| 448 o.key = "foo"; | 449 o.key = "foo"; |
| 449 o.value = "foo"; | 450 o.value = "foo"; |
| 450 } | 451 } |
| 451 buildCounterOperationWarningsData--; | 452 buildCounterOperationWarningsData--; |
| 452 return o; | 453 return o; |
| 453 } | 454 } |
| 454 | 455 |
| 455 checkOperationWarningsData(api.OperationWarningsData o) { | 456 checkOperationWarningsData(api.OperationWarningsData o) { |
| 456 buildCounterOperationWarningsData++; | 457 buildCounterOperationWarningsData++; |
| 457 if (buildCounterOperationWarningsData < 3) { | 458 if (buildCounterOperationWarningsData < 3) { |
| 458 unittest.expect(o.key, unittest.equals('foo')); | 459 unittest.expect(o.key, unittest.equals('foo')); |
| 459 unittest.expect(o.value, unittest.equals('foo')); | 460 unittest.expect(o.value, unittest.equals('foo')); |
| 460 } | 461 } |
| 461 buildCounterOperationWarningsData--; | 462 buildCounterOperationWarningsData--; |
| 462 } | 463 } |
| 463 | 464 |
| 464 buildUnnamed3267() { | 465 buildUnnamed3260() { |
| 465 var o = new core.List<api.OperationWarningsData>(); | 466 var o = new core.List<api.OperationWarningsData>(); |
| 466 o.add(buildOperationWarningsData()); | 467 o.add(buildOperationWarningsData()); |
| 467 o.add(buildOperationWarningsData()); | 468 o.add(buildOperationWarningsData()); |
| 468 return o; | 469 return o; |
| 469 } | 470 } |
| 470 | 471 |
| 471 checkUnnamed3267(core.List<api.OperationWarningsData> o) { | 472 checkUnnamed3260(core.List<api.OperationWarningsData> o) { |
| 472 unittest.expect(o, unittest.hasLength(2)); | 473 unittest.expect(o, unittest.hasLength(2)); |
| 473 checkOperationWarningsData(o[0]); | 474 checkOperationWarningsData(o[0]); |
| 474 checkOperationWarningsData(o[1]); | 475 checkOperationWarningsData(o[1]); |
| 475 } | 476 } |
| 476 | 477 |
| 477 core.int buildCounterOperationWarnings = 0; | 478 core.int buildCounterOperationWarnings = 0; |
| 478 buildOperationWarnings() { | 479 buildOperationWarnings() { |
| 479 var o = new api.OperationWarnings(); | 480 var o = new api.OperationWarnings(); |
| 480 buildCounterOperationWarnings++; | 481 buildCounterOperationWarnings++; |
| 481 if (buildCounterOperationWarnings < 3) { | 482 if (buildCounterOperationWarnings < 3) { |
| 482 o.code = "foo"; | 483 o.code = "foo"; |
| 483 o.data = buildUnnamed3267(); | 484 o.data = buildUnnamed3260(); |
| 484 o.message = "foo"; | 485 o.message = "foo"; |
| 485 } | 486 } |
| 486 buildCounterOperationWarnings--; | 487 buildCounterOperationWarnings--; |
| 487 return o; | 488 return o; |
| 488 } | 489 } |
| 489 | 490 |
| 490 checkOperationWarnings(api.OperationWarnings o) { | 491 checkOperationWarnings(api.OperationWarnings o) { |
| 491 buildCounterOperationWarnings++; | 492 buildCounterOperationWarnings++; |
| 492 if (buildCounterOperationWarnings < 3) { | 493 if (buildCounterOperationWarnings < 3) { |
| 493 unittest.expect(o.code, unittest.equals('foo')); | 494 unittest.expect(o.code, unittest.equals('foo')); |
| 494 checkUnnamed3267(o.data); | 495 checkUnnamed3260(o.data); |
| 495 unittest.expect(o.message, unittest.equals('foo')); | 496 unittest.expect(o.message, unittest.equals('foo')); |
| 496 } | 497 } |
| 497 buildCounterOperationWarnings--; | 498 buildCounterOperationWarnings--; |
| 498 } | 499 } |
| 499 | 500 |
| 500 buildUnnamed3268() { | 501 buildUnnamed3261() { |
| 501 var o = new core.List<api.OperationWarnings>(); | 502 var o = new core.List<api.OperationWarnings>(); |
| 502 o.add(buildOperationWarnings()); | 503 o.add(buildOperationWarnings()); |
| 503 o.add(buildOperationWarnings()); | 504 o.add(buildOperationWarnings()); |
| 504 return o; | 505 return o; |
| 505 } | 506 } |
| 506 | 507 |
| 507 checkUnnamed3268(core.List<api.OperationWarnings> o) { | 508 checkUnnamed3261(core.List<api.OperationWarnings> o) { |
| 508 unittest.expect(o, unittest.hasLength(2)); | 509 unittest.expect(o, unittest.hasLength(2)); |
| 509 checkOperationWarnings(o[0]); | 510 checkOperationWarnings(o[0]); |
| 510 checkOperationWarnings(o[1]); | 511 checkOperationWarnings(o[1]); |
| 511 } | 512 } |
| 512 | 513 |
| 513 core.int buildCounterOperation = 0; | 514 core.int buildCounterOperation = 0; |
| 514 buildOperation() { | 515 buildOperation() { |
| 515 var o = new api.Operation(); | 516 var o = new api.Operation(); |
| 516 buildCounterOperation++; | 517 buildCounterOperation++; |
| 517 if (buildCounterOperation < 3) { | 518 if (buildCounterOperation < 3) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 529 o.operationType = "foo"; | 530 o.operationType = "foo"; |
| 530 o.progress = 42; | 531 o.progress = 42; |
| 531 o.region = "foo"; | 532 o.region = "foo"; |
| 532 o.selfLink = "foo"; | 533 o.selfLink = "foo"; |
| 533 o.startTime = "foo"; | 534 o.startTime = "foo"; |
| 534 o.status = "foo"; | 535 o.status = "foo"; |
| 535 o.statusMessage = "foo"; | 536 o.statusMessage = "foo"; |
| 536 o.targetId = "foo"; | 537 o.targetId = "foo"; |
| 537 o.targetLink = "foo"; | 538 o.targetLink = "foo"; |
| 538 o.user = "foo"; | 539 o.user = "foo"; |
| 539 o.warnings = buildUnnamed3268(); | 540 o.warnings = buildUnnamed3261(); |
| 540 o.zone = "foo"; | 541 o.zone = "foo"; |
| 541 } | 542 } |
| 542 buildCounterOperation--; | 543 buildCounterOperation--; |
| 543 return o; | 544 return o; |
| 544 } | 545 } |
| 545 | 546 |
| 546 checkOperation(api.Operation o) { | 547 checkOperation(api.Operation o) { |
| 547 buildCounterOperation++; | 548 buildCounterOperation++; |
| 548 if (buildCounterOperation < 3) { | 549 if (buildCounterOperation < 3) { |
| 549 unittest.expect(o.clientOperationId, unittest.equals('foo')); | 550 unittest.expect(o.clientOperationId, unittest.equals('foo')); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 560 unittest.expect(o.operationType, unittest.equals('foo')); | 561 unittest.expect(o.operationType, unittest.equals('foo')); |
| 561 unittest.expect(o.progress, unittest.equals(42)); | 562 unittest.expect(o.progress, unittest.equals(42)); |
| 562 unittest.expect(o.region, unittest.equals('foo')); | 563 unittest.expect(o.region, unittest.equals('foo')); |
| 563 unittest.expect(o.selfLink, unittest.equals('foo')); | 564 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 564 unittest.expect(o.startTime, unittest.equals('foo')); | 565 unittest.expect(o.startTime, unittest.equals('foo')); |
| 565 unittest.expect(o.status, unittest.equals('foo')); | 566 unittest.expect(o.status, unittest.equals('foo')); |
| 566 unittest.expect(o.statusMessage, unittest.equals('foo')); | 567 unittest.expect(o.statusMessage, unittest.equals('foo')); |
| 567 unittest.expect(o.targetId, unittest.equals('foo')); | 568 unittest.expect(o.targetId, unittest.equals('foo')); |
| 568 unittest.expect(o.targetLink, unittest.equals('foo')); | 569 unittest.expect(o.targetLink, unittest.equals('foo')); |
| 569 unittest.expect(o.user, unittest.equals('foo')); | 570 unittest.expect(o.user, unittest.equals('foo')); |
| 570 checkUnnamed3268(o.warnings); | 571 checkUnnamed3261(o.warnings); |
| 571 unittest.expect(o.zone, unittest.equals('foo')); | 572 unittest.expect(o.zone, unittest.equals('foo')); |
| 572 } | 573 } |
| 573 buildCounterOperation--; | 574 buildCounterOperation--; |
| 574 } | 575 } |
| 575 | 576 |
| 576 buildUnnamed3269() { | 577 buildUnnamed3262() { |
| 577 var o = new core.List<api.Operation>(); | 578 var o = new core.List<api.Operation>(); |
| 578 o.add(buildOperation()); | 579 o.add(buildOperation()); |
| 579 o.add(buildOperation()); | 580 o.add(buildOperation()); |
| 580 return o; | 581 return o; |
| 581 } | 582 } |
| 582 | 583 |
| 583 checkUnnamed3269(core.List<api.Operation> o) { | 584 checkUnnamed3262(core.List<api.Operation> o) { |
| 584 unittest.expect(o, unittest.hasLength(2)); | 585 unittest.expect(o, unittest.hasLength(2)); |
| 585 checkOperation(o[0]); | 586 checkOperation(o[0]); |
| 586 checkOperation(o[1]); | 587 checkOperation(o[1]); |
| 587 } | 588 } |
| 588 | 589 |
| 589 core.int buildCounterOperationList = 0; | 590 core.int buildCounterOperationList = 0; |
| 590 buildOperationList() { | 591 buildOperationList() { |
| 591 var o = new api.OperationList(); | 592 var o = new api.OperationList(); |
| 592 buildCounterOperationList++; | 593 buildCounterOperationList++; |
| 593 if (buildCounterOperationList < 3) { | 594 if (buildCounterOperationList < 3) { |
| 594 o.id = "foo"; | 595 o.id = "foo"; |
| 595 o.items = buildUnnamed3269(); | 596 o.items = buildUnnamed3262(); |
| 596 o.kind = "foo"; | 597 o.kind = "foo"; |
| 597 o.nextPageToken = "foo"; | 598 o.nextPageToken = "foo"; |
| 598 o.selfLink = "foo"; | 599 o.selfLink = "foo"; |
| 599 } | 600 } |
| 600 buildCounterOperationList--; | 601 buildCounterOperationList--; |
| 601 return o; | 602 return o; |
| 602 } | 603 } |
| 603 | 604 |
| 604 checkOperationList(api.OperationList o) { | 605 checkOperationList(api.OperationList o) { |
| 605 buildCounterOperationList++; | 606 buildCounterOperationList++; |
| 606 if (buildCounterOperationList < 3) { | 607 if (buildCounterOperationList < 3) { |
| 607 unittest.expect(o.id, unittest.equals('foo')); | 608 unittest.expect(o.id, unittest.equals('foo')); |
| 608 checkUnnamed3269(o.items); | 609 checkUnnamed3262(o.items); |
| 609 unittest.expect(o.kind, unittest.equals('foo')); | 610 unittest.expect(o.kind, unittest.equals('foo')); |
| 610 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 611 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 611 unittest.expect(o.selfLink, unittest.equals('foo')); | 612 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 612 } | 613 } |
| 613 buildCounterOperationList--; | 614 buildCounterOperationList--; |
| 614 } | 615 } |
| 615 | 616 |
| 616 core.int buildCounterPublicKey = 0; | 617 core.int buildCounterPublicKey = 0; |
| 617 buildPublicKey() { | 618 buildPublicKey() { |
| 618 var o = new api.PublicKey(); | 619 var o = new api.PublicKey(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 633 if (buildCounterPublicKey < 3) { | 634 if (buildCounterPublicKey < 3) { |
| 634 unittest.expect(o.creationTimestamp, unittest.equals('foo')); | 635 unittest.expect(o.creationTimestamp, unittest.equals('foo')); |
| 635 unittest.expect(o.description, unittest.equals('foo')); | 636 unittest.expect(o.description, unittest.equals('foo')); |
| 636 unittest.expect(o.expirationTimestamp, unittest.equals('foo')); | 637 unittest.expect(o.expirationTimestamp, unittest.equals('foo')); |
| 637 unittest.expect(o.fingerprint, unittest.equals('foo')); | 638 unittest.expect(o.fingerprint, unittest.equals('foo')); |
| 638 unittest.expect(o.key, unittest.equals('foo')); | 639 unittest.expect(o.key, unittest.equals('foo')); |
| 639 } | 640 } |
| 640 buildCounterPublicKey--; | 641 buildCounterPublicKey--; |
| 641 } | 642 } |
| 642 | 643 |
| 643 buildUnnamed3270() { | 644 buildUnnamed3263() { |
| 644 var o = new core.List<core.String>(); | 645 var o = new core.List<core.String>(); |
| 645 o.add("foo"); | 646 o.add("foo"); |
| 646 o.add("foo"); | 647 o.add("foo"); |
| 647 return o; | 648 return o; |
| 648 } | 649 } |
| 649 | 650 |
| 650 checkUnnamed3270(core.List<core.String> o) { | 651 checkUnnamed3263(core.List<core.String> o) { |
| 651 unittest.expect(o, unittest.hasLength(2)); | 652 unittest.expect(o, unittest.hasLength(2)); |
| 652 unittest.expect(o[0], unittest.equals('foo')); | 653 unittest.expect(o[0], unittest.equals('foo')); |
| 653 unittest.expect(o[1], unittest.equals('foo')); | 654 unittest.expect(o[1], unittest.equals('foo')); |
| 654 } | 655 } |
| 655 | 656 |
| 656 buildUnnamed3271() { | 657 buildUnnamed3264() { |
| 657 var o = new core.List<api.PublicKey>(); | 658 var o = new core.List<api.PublicKey>(); |
| 658 o.add(buildPublicKey()); | 659 o.add(buildPublicKey()); |
| 659 o.add(buildPublicKey()); | 660 o.add(buildPublicKey()); |
| 660 return o; | 661 return o; |
| 661 } | 662 } |
| 662 | 663 |
| 663 checkUnnamed3271(core.List<api.PublicKey> o) { | 664 checkUnnamed3264(core.List<api.PublicKey> o) { |
| 664 unittest.expect(o, unittest.hasLength(2)); | 665 unittest.expect(o, unittest.hasLength(2)); |
| 665 checkPublicKey(o[0]); | 666 checkPublicKey(o[0]); |
| 666 checkPublicKey(o[1]); | 667 checkPublicKey(o[1]); |
| 667 } | 668 } |
| 668 | 669 |
| 669 core.int buildCounterUser = 0; | 670 core.int buildCounterUser = 0; |
| 670 buildUser() { | 671 buildUser() { |
| 671 var o = new api.User(); | 672 var o = new api.User(); |
| 672 buildCounterUser++; | 673 buildCounterUser++; |
| 673 if (buildCounterUser < 3) { | 674 if (buildCounterUser < 3) { |
| 674 o.creationTimestamp = "foo"; | 675 o.creationTimestamp = "foo"; |
| 675 o.description = "foo"; | 676 o.description = "foo"; |
| 676 o.groups = buildUnnamed3270(); | 677 o.groups = buildUnnamed3263(); |
| 677 o.id = "foo"; | 678 o.id = "foo"; |
| 678 o.kind = "foo"; | 679 o.kind = "foo"; |
| 679 o.name = "foo"; | 680 o.name = "foo"; |
| 680 o.owner = "foo"; | 681 o.owner = "foo"; |
| 681 o.publicKeys = buildUnnamed3271(); | 682 o.publicKeys = buildUnnamed3264(); |
| 682 o.selfLink = "foo"; | 683 o.selfLink = "foo"; |
| 683 } | 684 } |
| 684 buildCounterUser--; | 685 buildCounterUser--; |
| 685 return o; | 686 return o; |
| 686 } | 687 } |
| 687 | 688 |
| 688 checkUser(api.User o) { | 689 checkUser(api.User o) { |
| 689 buildCounterUser++; | 690 buildCounterUser++; |
| 690 if (buildCounterUser < 3) { | 691 if (buildCounterUser < 3) { |
| 691 unittest.expect(o.creationTimestamp, unittest.equals('foo')); | 692 unittest.expect(o.creationTimestamp, unittest.equals('foo')); |
| 692 unittest.expect(o.description, unittest.equals('foo')); | 693 unittest.expect(o.description, unittest.equals('foo')); |
| 693 checkUnnamed3270(o.groups); | 694 checkUnnamed3263(o.groups); |
| 694 unittest.expect(o.id, unittest.equals('foo')); | 695 unittest.expect(o.id, unittest.equals('foo')); |
| 695 unittest.expect(o.kind, unittest.equals('foo')); | 696 unittest.expect(o.kind, unittest.equals('foo')); |
| 696 unittest.expect(o.name, unittest.equals('foo')); | 697 unittest.expect(o.name, unittest.equals('foo')); |
| 697 unittest.expect(o.owner, unittest.equals('foo')); | 698 unittest.expect(o.owner, unittest.equals('foo')); |
| 698 checkUnnamed3271(o.publicKeys); | 699 checkUnnamed3264(o.publicKeys); |
| 699 unittest.expect(o.selfLink, unittest.equals('foo')); | 700 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 700 } | 701 } |
| 701 buildCounterUser--; | 702 buildCounterUser--; |
| 702 } | 703 } |
| 703 | 704 |
| 704 buildUnnamed3272() { | 705 buildUnnamed3265() { |
| 705 var o = new core.List<api.User>(); | 706 var o = new core.List<api.User>(); |
| 706 o.add(buildUser()); | 707 o.add(buildUser()); |
| 707 o.add(buildUser()); | 708 o.add(buildUser()); |
| 708 return o; | 709 return o; |
| 709 } | 710 } |
| 710 | 711 |
| 711 checkUnnamed3272(core.List<api.User> o) { | 712 checkUnnamed3265(core.List<api.User> o) { |
| 712 unittest.expect(o, unittest.hasLength(2)); | 713 unittest.expect(o, unittest.hasLength(2)); |
| 713 checkUser(o[0]); | 714 checkUser(o[0]); |
| 714 checkUser(o[1]); | 715 checkUser(o[1]); |
| 715 } | 716 } |
| 716 | 717 |
| 717 core.int buildCounterUserList = 0; | 718 core.int buildCounterUserList = 0; |
| 718 buildUserList() { | 719 buildUserList() { |
| 719 var o = new api.UserList(); | 720 var o = new api.UserList(); |
| 720 buildCounterUserList++; | 721 buildCounterUserList++; |
| 721 if (buildCounterUserList < 3) { | 722 if (buildCounterUserList < 3) { |
| 722 o.id = "foo"; | 723 o.id = "foo"; |
| 723 o.items = buildUnnamed3272(); | 724 o.items = buildUnnamed3265(); |
| 724 o.kind = "foo"; | 725 o.kind = "foo"; |
| 725 o.nextPageToken = "foo"; | 726 o.nextPageToken = "foo"; |
| 726 o.selfLink = "foo"; | 727 o.selfLink = "foo"; |
| 727 } | 728 } |
| 728 buildCounterUserList--; | 729 buildCounterUserList--; |
| 729 return o; | 730 return o; |
| 730 } | 731 } |
| 731 | 732 |
| 732 checkUserList(api.UserList o) { | 733 checkUserList(api.UserList o) { |
| 733 buildCounterUserList++; | 734 buildCounterUserList++; |
| 734 if (buildCounterUserList < 3) { | 735 if (buildCounterUserList < 3) { |
| 735 unittest.expect(o.id, unittest.equals('foo')); | 736 unittest.expect(o.id, unittest.equals('foo')); |
| 736 checkUnnamed3272(o.items); | 737 checkUnnamed3265(o.items); |
| 737 unittest.expect(o.kind, unittest.equals('foo')); | 738 unittest.expect(o.kind, unittest.equals('foo')); |
| 738 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 739 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 739 unittest.expect(o.selfLink, unittest.equals('foo')); | 740 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 740 } | 741 } |
| 741 buildCounterUserList--; | 742 buildCounterUserList--; |
| 742 } | 743 } |
| 743 | 744 |
| 744 | |
| 745 main() { | 745 main() { |
| 746 unittest.group("obj-schema-AuthorizedKeysView", () { | 746 unittest.group("obj-schema-AuthorizedKeysView", () { |
| 747 unittest.test("to-json--from-json", () { | 747 unittest.test("to-json--from-json", () { |
| 748 var o = buildAuthorizedKeysView(); | 748 var o = buildAuthorizedKeysView(); |
| 749 var od = new api.AuthorizedKeysView.fromJson(o.toJson()); | 749 var od = new api.AuthorizedKeysView.fromJson(o.toJson()); |
| 750 checkAuthorizedKeysView(od); | 750 checkAuthorizedKeysView(od); |
| 751 }); | 751 }); |
| 752 }); | 752 }); |
| 753 | 753 |
| 754 | |
| 755 unittest.group("obj-schema-Group", () { | 754 unittest.group("obj-schema-Group", () { |
| 756 unittest.test("to-json--from-json", () { | 755 unittest.test("to-json--from-json", () { |
| 757 var o = buildGroup(); | 756 var o = buildGroup(); |
| 758 var od = new api.Group.fromJson(o.toJson()); | 757 var od = new api.Group.fromJson(o.toJson()); |
| 759 checkGroup(od); | 758 checkGroup(od); |
| 760 }); | 759 }); |
| 761 }); | 760 }); |
| 762 | 761 |
| 763 | |
| 764 unittest.group("obj-schema-GroupList", () { | 762 unittest.group("obj-schema-GroupList", () { |
| 765 unittest.test("to-json--from-json", () { | 763 unittest.test("to-json--from-json", () { |
| 766 var o = buildGroupList(); | 764 var o = buildGroupList(); |
| 767 var od = new api.GroupList.fromJson(o.toJson()); | 765 var od = new api.GroupList.fromJson(o.toJson()); |
| 768 checkGroupList(od); | 766 checkGroupList(od); |
| 769 }); | 767 }); |
| 770 }); | 768 }); |
| 771 | 769 |
| 772 | |
| 773 unittest.group("obj-schema-GroupsAddMemberRequest", () { | 770 unittest.group("obj-schema-GroupsAddMemberRequest", () { |
| 774 unittest.test("to-json--from-json", () { | 771 unittest.test("to-json--from-json", () { |
| 775 var o = buildGroupsAddMemberRequest(); | 772 var o = buildGroupsAddMemberRequest(); |
| 776 var od = new api.GroupsAddMemberRequest.fromJson(o.toJson()); | 773 var od = new api.GroupsAddMemberRequest.fromJson(o.toJson()); |
| 777 checkGroupsAddMemberRequest(od); | 774 checkGroupsAddMemberRequest(od); |
| 778 }); | 775 }); |
| 779 }); | 776 }); |
| 780 | 777 |
| 781 | |
| 782 unittest.group("obj-schema-GroupsRemoveMemberRequest", () { | 778 unittest.group("obj-schema-GroupsRemoveMemberRequest", () { |
| 783 unittest.test("to-json--from-json", () { | 779 unittest.test("to-json--from-json", () { |
| 784 var o = buildGroupsRemoveMemberRequest(); | 780 var o = buildGroupsRemoveMemberRequest(); |
| 785 var od = new api.GroupsRemoveMemberRequest.fromJson(o.toJson()); | 781 var od = new api.GroupsRemoveMemberRequest.fromJson(o.toJson()); |
| 786 checkGroupsRemoveMemberRequest(od); | 782 checkGroupsRemoveMemberRequest(od); |
| 787 }); | 783 }); |
| 788 }); | 784 }); |
| 789 | 785 |
| 790 | |
| 791 unittest.group("obj-schema-LinuxAccountViews", () { | 786 unittest.group("obj-schema-LinuxAccountViews", () { |
| 792 unittest.test("to-json--from-json", () { | 787 unittest.test("to-json--from-json", () { |
| 793 var o = buildLinuxAccountViews(); | 788 var o = buildLinuxAccountViews(); |
| 794 var od = new api.LinuxAccountViews.fromJson(o.toJson()); | 789 var od = new api.LinuxAccountViews.fromJson(o.toJson()); |
| 795 checkLinuxAccountViews(od); | 790 checkLinuxAccountViews(od); |
| 796 }); | 791 }); |
| 797 }); | 792 }); |
| 798 | 793 |
| 799 | |
| 800 unittest.group("obj-schema-LinuxGetAuthorizedKeysViewResponse", () { | 794 unittest.group("obj-schema-LinuxGetAuthorizedKeysViewResponse", () { |
| 801 unittest.test("to-json--from-json", () { | 795 unittest.test("to-json--from-json", () { |
| 802 var o = buildLinuxGetAuthorizedKeysViewResponse(); | 796 var o = buildLinuxGetAuthorizedKeysViewResponse(); |
| 803 var od = new api.LinuxGetAuthorizedKeysViewResponse.fromJson(o.toJson()); | 797 var od = new api.LinuxGetAuthorizedKeysViewResponse.fromJson(o.toJson()); |
| 804 checkLinuxGetAuthorizedKeysViewResponse(od); | 798 checkLinuxGetAuthorizedKeysViewResponse(od); |
| 805 }); | 799 }); |
| 806 }); | 800 }); |
| 807 | 801 |
| 808 | |
| 809 unittest.group("obj-schema-LinuxGetLinuxAccountViewsResponse", () { | 802 unittest.group("obj-schema-LinuxGetLinuxAccountViewsResponse", () { |
| 810 unittest.test("to-json--from-json", () { | 803 unittest.test("to-json--from-json", () { |
| 811 var o = buildLinuxGetLinuxAccountViewsResponse(); | 804 var o = buildLinuxGetLinuxAccountViewsResponse(); |
| 812 var od = new api.LinuxGetLinuxAccountViewsResponse.fromJson(o.toJson()); | 805 var od = new api.LinuxGetLinuxAccountViewsResponse.fromJson(o.toJson()); |
| 813 checkLinuxGetLinuxAccountViewsResponse(od); | 806 checkLinuxGetLinuxAccountViewsResponse(od); |
| 814 }); | 807 }); |
| 815 }); | 808 }); |
| 816 | 809 |
| 817 | |
| 818 unittest.group("obj-schema-LinuxGroupView", () { | 810 unittest.group("obj-schema-LinuxGroupView", () { |
| 819 unittest.test("to-json--from-json", () { | 811 unittest.test("to-json--from-json", () { |
| 820 var o = buildLinuxGroupView(); | 812 var o = buildLinuxGroupView(); |
| 821 var od = new api.LinuxGroupView.fromJson(o.toJson()); | 813 var od = new api.LinuxGroupView.fromJson(o.toJson()); |
| 822 checkLinuxGroupView(od); | 814 checkLinuxGroupView(od); |
| 823 }); | 815 }); |
| 824 }); | 816 }); |
| 825 | 817 |
| 826 | |
| 827 unittest.group("obj-schema-LinuxUserView", () { | 818 unittest.group("obj-schema-LinuxUserView", () { |
| 828 unittest.test("to-json--from-json", () { | 819 unittest.test("to-json--from-json", () { |
| 829 var o = buildLinuxUserView(); | 820 var o = buildLinuxUserView(); |
| 830 var od = new api.LinuxUserView.fromJson(o.toJson()); | 821 var od = new api.LinuxUserView.fromJson(o.toJson()); |
| 831 checkLinuxUserView(od); | 822 checkLinuxUserView(od); |
| 832 }); | 823 }); |
| 833 }); | 824 }); |
| 834 | 825 |
| 835 | |
| 836 unittest.group("obj-schema-OperationErrorErrors", () { | 826 unittest.group("obj-schema-OperationErrorErrors", () { |
| 837 unittest.test("to-json--from-json", () { | 827 unittest.test("to-json--from-json", () { |
| 838 var o = buildOperationErrorErrors(); | 828 var o = buildOperationErrorErrors(); |
| 839 var od = new api.OperationErrorErrors.fromJson(o.toJson()); | 829 var od = new api.OperationErrorErrors.fromJson(o.toJson()); |
| 840 checkOperationErrorErrors(od); | 830 checkOperationErrorErrors(od); |
| 841 }); | 831 }); |
| 842 }); | 832 }); |
| 843 | 833 |
| 844 | |
| 845 unittest.group("obj-schema-OperationError", () { | 834 unittest.group("obj-schema-OperationError", () { |
| 846 unittest.test("to-json--from-json", () { | 835 unittest.test("to-json--from-json", () { |
| 847 var o = buildOperationError(); | 836 var o = buildOperationError(); |
| 848 var od = new api.OperationError.fromJson(o.toJson()); | 837 var od = new api.OperationError.fromJson(o.toJson()); |
| 849 checkOperationError(od); | 838 checkOperationError(od); |
| 850 }); | 839 }); |
| 851 }); | 840 }); |
| 852 | 841 |
| 853 | |
| 854 unittest.group("obj-schema-OperationWarningsData", () { | 842 unittest.group("obj-schema-OperationWarningsData", () { |
| 855 unittest.test("to-json--from-json", () { | 843 unittest.test("to-json--from-json", () { |
| 856 var o = buildOperationWarningsData(); | 844 var o = buildOperationWarningsData(); |
| 857 var od = new api.OperationWarningsData.fromJson(o.toJson()); | 845 var od = new api.OperationWarningsData.fromJson(o.toJson()); |
| 858 checkOperationWarningsData(od); | 846 checkOperationWarningsData(od); |
| 859 }); | 847 }); |
| 860 }); | 848 }); |
| 861 | 849 |
| 862 | |
| 863 unittest.group("obj-schema-OperationWarnings", () { | 850 unittest.group("obj-schema-OperationWarnings", () { |
| 864 unittest.test("to-json--from-json", () { | 851 unittest.test("to-json--from-json", () { |
| 865 var o = buildOperationWarnings(); | 852 var o = buildOperationWarnings(); |
| 866 var od = new api.OperationWarnings.fromJson(o.toJson()); | 853 var od = new api.OperationWarnings.fromJson(o.toJson()); |
| 867 checkOperationWarnings(od); | 854 checkOperationWarnings(od); |
| 868 }); | 855 }); |
| 869 }); | 856 }); |
| 870 | 857 |
| 871 | |
| 872 unittest.group("obj-schema-Operation", () { | 858 unittest.group("obj-schema-Operation", () { |
| 873 unittest.test("to-json--from-json", () { | 859 unittest.test("to-json--from-json", () { |
| 874 var o = buildOperation(); | 860 var o = buildOperation(); |
| 875 var od = new api.Operation.fromJson(o.toJson()); | 861 var od = new api.Operation.fromJson(o.toJson()); |
| 876 checkOperation(od); | 862 checkOperation(od); |
| 877 }); | 863 }); |
| 878 }); | 864 }); |
| 879 | 865 |
| 880 | |
| 881 unittest.group("obj-schema-OperationList", () { | 866 unittest.group("obj-schema-OperationList", () { |
| 882 unittest.test("to-json--from-json", () { | 867 unittest.test("to-json--from-json", () { |
| 883 var o = buildOperationList(); | 868 var o = buildOperationList(); |
| 884 var od = new api.OperationList.fromJson(o.toJson()); | 869 var od = new api.OperationList.fromJson(o.toJson()); |
| 885 checkOperationList(od); | 870 checkOperationList(od); |
| 886 }); | 871 }); |
| 887 }); | 872 }); |
| 888 | 873 |
| 889 | |
| 890 unittest.group("obj-schema-PublicKey", () { | 874 unittest.group("obj-schema-PublicKey", () { |
| 891 unittest.test("to-json--from-json", () { | 875 unittest.test("to-json--from-json", () { |
| 892 var o = buildPublicKey(); | 876 var o = buildPublicKey(); |
| 893 var od = new api.PublicKey.fromJson(o.toJson()); | 877 var od = new api.PublicKey.fromJson(o.toJson()); |
| 894 checkPublicKey(od); | 878 checkPublicKey(od); |
| 895 }); | 879 }); |
| 896 }); | 880 }); |
| 897 | 881 |
| 898 | |
| 899 unittest.group("obj-schema-User", () { | 882 unittest.group("obj-schema-User", () { |
| 900 unittest.test("to-json--from-json", () { | 883 unittest.test("to-json--from-json", () { |
| 901 var o = buildUser(); | 884 var o = buildUser(); |
| 902 var od = new api.User.fromJson(o.toJson()); | 885 var od = new api.User.fromJson(o.toJson()); |
| 903 checkUser(od); | 886 checkUser(od); |
| 904 }); | 887 }); |
| 905 }); | 888 }); |
| 906 | 889 |
| 907 | |
| 908 unittest.group("obj-schema-UserList", () { | 890 unittest.group("obj-schema-UserList", () { |
| 909 unittest.test("to-json--from-json", () { | 891 unittest.test("to-json--from-json", () { |
| 910 var o = buildUserList(); | 892 var o = buildUserList(); |
| 911 var od = new api.UserList.fromJson(o.toJson()); | 893 var od = new api.UserList.fromJson(o.toJson()); |
| 912 checkUserList(od); | 894 checkUserList(od); |
| 913 }); | 895 }); |
| 914 }); | 896 }); |
| 915 | 897 |
| 916 | |
| 917 unittest.group("resource-GlobalAccountsOperationsResourceApi", () { | 898 unittest.group("resource-GlobalAccountsOperationsResourceApi", () { |
| 918 unittest.test("method--delete", () { | 899 unittest.test("method--delete", () { |
| 919 | |
| 920 var mock = new HttpServerMock(); | 900 var mock = new HttpServerMock(); |
| 921 api.GlobalAccountsOperationsResourceApi res = new api.ClouduseraccountsApi
(mock).globalAccountsOperations; | 901 api.GlobalAccountsOperationsResourceApi res = |
| 902 new api.ClouduseraccountsApi(mock).globalAccountsOperations; |
| 922 var arg_project = "foo"; | 903 var arg_project = "foo"; |
| 923 var arg_operation = "foo"; | 904 var arg_operation = "foo"; |
| 924 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 905 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 925 var path = (req.url).path; | 906 var path = (req.url).path; |
| 926 var pathOffset = 0; | 907 var pathOffset = 0; |
| 927 var index; | 908 var index; |
| 928 var subPart; | 909 var subPart; |
| 929 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 910 unittest.expect( |
| 911 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 930 pathOffset += 1; | 912 pathOffset += 1; |
| 931 | 913 |
| 932 var query = (req.url).query; | 914 var query = (req.url).query; |
| 933 var queryOffset = 0; | 915 var queryOffset = 0; |
| 934 var queryMap = {}; | 916 var queryMap = {}; |
| 935 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 917 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 936 parseBool(n) { | 918 parseBool(n) { |
| 937 if (n == "true") return true; | 919 if (n == "true") return true; |
| 938 if (n == "false") return false; | 920 if (n == "false") return false; |
| 939 if (n == null) return null; | 921 if (n == null) return null; |
| 940 throw new core.ArgumentError("Invalid boolean: $n"); | 922 throw new core.ArgumentError("Invalid boolean: $n"); |
| 941 } | 923 } |
| 924 |
| 942 if (query.length > 0) { | 925 if (query.length > 0) { |
| 943 for (var part in query.split("&")) { | 926 for (var part in query.split("&")) { |
| 944 var keyvalue = part.split("="); | 927 var keyvalue = part.split("="); |
| 945 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 928 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 929 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 946 } | 930 } |
| 947 } | 931 } |
| 948 | 932 |
| 949 | |
| 950 var h = { | 933 var h = { |
| 951 "content-type" : "application/json; charset=utf-8", | 934 "content-type": "application/json; charset=utf-8", |
| 952 }; | 935 }; |
| 953 var resp = ""; | 936 var resp = ""; |
| 954 return new async.Future.value(stringResponse(200, h, resp)); | 937 return new async.Future.value(stringResponse(200, h, resp)); |
| 955 }), true); | 938 }), true); |
| 956 res.delete(arg_project, arg_operation).then(unittest.expectAsync1((_) {}))
; | 939 res |
| 940 .delete(arg_project, arg_operation) |
| 941 .then(unittest.expectAsync1((_) {})); |
| 957 }); | 942 }); |
| 958 | 943 |
| 959 unittest.test("method--get", () { | 944 unittest.test("method--get", () { |
| 960 | |
| 961 var mock = new HttpServerMock(); | 945 var mock = new HttpServerMock(); |
| 962 api.GlobalAccountsOperationsResourceApi res = new api.ClouduseraccountsApi
(mock).globalAccountsOperations; | 946 api.GlobalAccountsOperationsResourceApi res = |
| 947 new api.ClouduseraccountsApi(mock).globalAccountsOperations; |
| 963 var arg_project = "foo"; | 948 var arg_project = "foo"; |
| 964 var arg_operation = "foo"; | 949 var arg_operation = "foo"; |
| 965 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 950 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 966 var path = (req.url).path; | 951 var path = (req.url).path; |
| 967 var pathOffset = 0; | 952 var pathOffset = 0; |
| 968 var index; | 953 var index; |
| 969 var subPart; | 954 var subPart; |
| 970 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 955 unittest.expect( |
| 956 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 971 pathOffset += 1; | 957 pathOffset += 1; |
| 972 | 958 |
| 973 var query = (req.url).query; | 959 var query = (req.url).query; |
| 974 var queryOffset = 0; | 960 var queryOffset = 0; |
| 975 var queryMap = {}; | 961 var queryMap = {}; |
| 976 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 962 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 977 parseBool(n) { | 963 parseBool(n) { |
| 978 if (n == "true") return true; | 964 if (n == "true") return true; |
| 979 if (n == "false") return false; | 965 if (n == "false") return false; |
| 980 if (n == null) return null; | 966 if (n == null) return null; |
| 981 throw new core.ArgumentError("Invalid boolean: $n"); | 967 throw new core.ArgumentError("Invalid boolean: $n"); |
| 982 } | 968 } |
| 969 |
| 983 if (query.length > 0) { | 970 if (query.length > 0) { |
| 984 for (var part in query.split("&")) { | 971 for (var part in query.split("&")) { |
| 985 var keyvalue = part.split("="); | 972 var keyvalue = part.split("="); |
| 986 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 973 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 974 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 987 } | 975 } |
| 988 } | 976 } |
| 989 | 977 |
| 990 | |
| 991 var h = { | 978 var h = { |
| 992 "content-type" : "application/json; charset=utf-8", | 979 "content-type": "application/json; charset=utf-8", |
| 993 }; | 980 }; |
| 994 var resp = convert.JSON.encode(buildOperation()); | 981 var resp = convert.JSON.encode(buildOperation()); |
| 995 return new async.Future.value(stringResponse(200, h, resp)); | 982 return new async.Future.value(stringResponse(200, h, resp)); |
| 996 }), true); | 983 }), true); |
| 997 res.get(arg_project, arg_operation).then(unittest.expectAsync1(((api.Opera
tion response) { | 984 res |
| 985 .get(arg_project, arg_operation) |
| 986 .then(unittest.expectAsync1(((api.Operation response) { |
| 998 checkOperation(response); | 987 checkOperation(response); |
| 999 }))); | 988 }))); |
| 1000 }); | 989 }); |
| 1001 | 990 |
| 1002 unittest.test("method--list", () { | 991 unittest.test("method--list", () { |
| 1003 | |
| 1004 var mock = new HttpServerMock(); | 992 var mock = new HttpServerMock(); |
| 1005 api.GlobalAccountsOperationsResourceApi res = new api.ClouduseraccountsApi
(mock).globalAccountsOperations; | 993 api.GlobalAccountsOperationsResourceApi res = |
| 994 new api.ClouduseraccountsApi(mock).globalAccountsOperations; |
| 1006 var arg_project = "foo"; | 995 var arg_project = "foo"; |
| 1007 var arg_filter = "foo"; | 996 var arg_filter = "foo"; |
| 1008 var arg_maxResults = 42; | 997 var arg_maxResults = 42; |
| 1009 var arg_orderBy = "foo"; | 998 var arg_orderBy = "foo"; |
| 1010 var arg_pageToken = "foo"; | 999 var arg_pageToken = "foo"; |
| 1011 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1000 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1012 var path = (req.url).path; | 1001 var path = (req.url).path; |
| 1013 var pathOffset = 0; | 1002 var pathOffset = 0; |
| 1014 var index; | 1003 var index; |
| 1015 var subPart; | 1004 var subPart; |
| 1016 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1005 unittest.expect( |
| 1006 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1017 pathOffset += 1; | 1007 pathOffset += 1; |
| 1018 | 1008 |
| 1019 var query = (req.url).query; | 1009 var query = (req.url).query; |
| 1020 var queryOffset = 0; | 1010 var queryOffset = 0; |
| 1021 var queryMap = {}; | 1011 var queryMap = {}; |
| 1022 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1012 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1023 parseBool(n) { | 1013 parseBool(n) { |
| 1024 if (n == "true") return true; | 1014 if (n == "true") return true; |
| 1025 if (n == "false") return false; | 1015 if (n == "false") return false; |
| 1026 if (n == null) return null; | 1016 if (n == null) return null; |
| 1027 throw new core.ArgumentError("Invalid boolean: $n"); | 1017 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1028 } | 1018 } |
| 1019 |
| 1029 if (query.length > 0) { | 1020 if (query.length > 0) { |
| 1030 for (var part in query.split("&")) { | 1021 for (var part in query.split("&")) { |
| 1031 var keyvalue = part.split("="); | 1022 var keyvalue = part.split("="); |
| 1032 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1023 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1024 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1033 } | 1025 } |
| 1034 } | 1026 } |
| 1035 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1027 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 1036 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1028 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
| 1037 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; | 1029 unittest.equals(arg_maxResults)); |
| 1038 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1030 unittest.expect( |
| 1039 | 1031 queryMap["orderBy"].first, unittest.equals(arg_orderBy)); |
| 1032 unittest.expect( |
| 1033 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 1040 | 1034 |
| 1041 var h = { | 1035 var h = { |
| 1042 "content-type" : "application/json; charset=utf-8", | 1036 "content-type": "application/json; charset=utf-8", |
| 1043 }; | 1037 }; |
| 1044 var resp = convert.JSON.encode(buildOperationList()); | 1038 var resp = convert.JSON.encode(buildOperationList()); |
| 1045 return new async.Future.value(stringResponse(200, h, resp)); | 1039 return new async.Future.value(stringResponse(200, h, resp)); |
| 1046 }), true); | 1040 }), true); |
| 1047 res.list(arg_project, filter: arg_filter, maxResults: arg_maxResults, orde
rBy: arg_orderBy, pageToken: arg_pageToken).then(unittest.expectAsync1(((api.Ope
rationList response) { | 1041 res |
| 1042 .list(arg_project, |
| 1043 filter: arg_filter, |
| 1044 maxResults: arg_maxResults, |
| 1045 orderBy: arg_orderBy, |
| 1046 pageToken: arg_pageToken) |
| 1047 .then(unittest.expectAsync1(((api.OperationList response) { |
| 1048 checkOperationList(response); | 1048 checkOperationList(response); |
| 1049 }))); | 1049 }))); |
| 1050 }); | 1050 }); |
| 1051 | |
| 1052 }); | 1051 }); |
| 1053 | 1052 |
| 1054 | |
| 1055 unittest.group("resource-GroupsResourceApi", () { | 1053 unittest.group("resource-GroupsResourceApi", () { |
| 1056 unittest.test("method--addMember", () { | 1054 unittest.test("method--addMember", () { |
| 1057 | |
| 1058 var mock = new HttpServerMock(); | 1055 var mock = new HttpServerMock(); |
| 1059 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; | 1056 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; |
| 1060 var arg_request = buildGroupsAddMemberRequest(); | 1057 var arg_request = buildGroupsAddMemberRequest(); |
| 1061 var arg_project = "foo"; | 1058 var arg_project = "foo"; |
| 1062 var arg_groupName = "foo"; | 1059 var arg_groupName = "foo"; |
| 1063 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1060 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1064 var obj = new api.GroupsAddMemberRequest.fromJson(json); | 1061 var obj = new api.GroupsAddMemberRequest.fromJson(json); |
| 1065 checkGroupsAddMemberRequest(obj); | 1062 checkGroupsAddMemberRequest(obj); |
| 1066 | 1063 |
| 1067 var path = (req.url).path; | 1064 var path = (req.url).path; |
| 1068 var pathOffset = 0; | 1065 var pathOffset = 0; |
| 1069 var index; | 1066 var index; |
| 1070 var subPart; | 1067 var subPart; |
| 1071 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1068 unittest.expect( |
| 1069 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1072 pathOffset += 1; | 1070 pathOffset += 1; |
| 1073 | 1071 |
| 1074 var query = (req.url).query; | 1072 var query = (req.url).query; |
| 1075 var queryOffset = 0; | 1073 var queryOffset = 0; |
| 1076 var queryMap = {}; | 1074 var queryMap = {}; |
| 1077 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1075 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1078 parseBool(n) { | 1076 parseBool(n) { |
| 1079 if (n == "true") return true; | 1077 if (n == "true") return true; |
| 1080 if (n == "false") return false; | 1078 if (n == "false") return false; |
| 1081 if (n == null) return null; | 1079 if (n == null) return null; |
| 1082 throw new core.ArgumentError("Invalid boolean: $n"); | 1080 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1083 } | 1081 } |
| 1082 |
| 1084 if (query.length > 0) { | 1083 if (query.length > 0) { |
| 1085 for (var part in query.split("&")) { | 1084 for (var part in query.split("&")) { |
| 1086 var keyvalue = part.split("="); | 1085 var keyvalue = part.split("="); |
| 1087 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1086 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1087 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1088 } | 1088 } |
| 1089 } | 1089 } |
| 1090 | 1090 |
| 1091 | |
| 1092 var h = { | 1091 var h = { |
| 1093 "content-type" : "application/json; charset=utf-8", | 1092 "content-type": "application/json; charset=utf-8", |
| 1094 }; | 1093 }; |
| 1095 var resp = convert.JSON.encode(buildOperation()); | 1094 var resp = convert.JSON.encode(buildOperation()); |
| 1096 return new async.Future.value(stringResponse(200, h, resp)); | 1095 return new async.Future.value(stringResponse(200, h, resp)); |
| 1097 }), true); | 1096 }), true); |
| 1098 res.addMember(arg_request, arg_project, arg_groupName).then(unittest.expec
tAsync1(((api.Operation response) { | 1097 res |
| 1098 .addMember(arg_request, arg_project, arg_groupName) |
| 1099 .then(unittest.expectAsync1(((api.Operation response) { |
| 1099 checkOperation(response); | 1100 checkOperation(response); |
| 1100 }))); | 1101 }))); |
| 1101 }); | 1102 }); |
| 1102 | 1103 |
| 1103 unittest.test("method--delete", () { | 1104 unittest.test("method--delete", () { |
| 1104 | |
| 1105 var mock = new HttpServerMock(); | 1105 var mock = new HttpServerMock(); |
| 1106 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; | 1106 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; |
| 1107 var arg_project = "foo"; | 1107 var arg_project = "foo"; |
| 1108 var arg_groupName = "foo"; | 1108 var arg_groupName = "foo"; |
| 1109 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1109 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1110 var path = (req.url).path; | 1110 var path = (req.url).path; |
| 1111 var pathOffset = 0; | 1111 var pathOffset = 0; |
| 1112 var index; | 1112 var index; |
| 1113 var subPart; | 1113 var subPart; |
| 1114 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1114 unittest.expect( |
| 1115 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1115 pathOffset += 1; | 1116 pathOffset += 1; |
| 1116 | 1117 |
| 1117 var query = (req.url).query; | 1118 var query = (req.url).query; |
| 1118 var queryOffset = 0; | 1119 var queryOffset = 0; |
| 1119 var queryMap = {}; | 1120 var queryMap = {}; |
| 1120 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1121 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1121 parseBool(n) { | 1122 parseBool(n) { |
| 1122 if (n == "true") return true; | 1123 if (n == "true") return true; |
| 1123 if (n == "false") return false; | 1124 if (n == "false") return false; |
| 1124 if (n == null) return null; | 1125 if (n == null) return null; |
| 1125 throw new core.ArgumentError("Invalid boolean: $n"); | 1126 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1126 } | 1127 } |
| 1128 |
| 1127 if (query.length > 0) { | 1129 if (query.length > 0) { |
| 1128 for (var part in query.split("&")) { | 1130 for (var part in query.split("&")) { |
| 1129 var keyvalue = part.split("="); | 1131 var keyvalue = part.split("="); |
| 1130 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1132 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1133 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1131 } | 1134 } |
| 1132 } | 1135 } |
| 1133 | 1136 |
| 1134 | |
| 1135 var h = { | 1137 var h = { |
| 1136 "content-type" : "application/json; charset=utf-8", | 1138 "content-type": "application/json; charset=utf-8", |
| 1137 }; | 1139 }; |
| 1138 var resp = convert.JSON.encode(buildOperation()); | 1140 var resp = convert.JSON.encode(buildOperation()); |
| 1139 return new async.Future.value(stringResponse(200, h, resp)); | 1141 return new async.Future.value(stringResponse(200, h, resp)); |
| 1140 }), true); | 1142 }), true); |
| 1141 res.delete(arg_project, arg_groupName).then(unittest.expectAsync1(((api.Op
eration response) { | 1143 res |
| 1144 .delete(arg_project, arg_groupName) |
| 1145 .then(unittest.expectAsync1(((api.Operation response) { |
| 1142 checkOperation(response); | 1146 checkOperation(response); |
| 1143 }))); | 1147 }))); |
| 1144 }); | 1148 }); |
| 1145 | 1149 |
| 1146 unittest.test("method--get", () { | 1150 unittest.test("method--get", () { |
| 1147 | |
| 1148 var mock = new HttpServerMock(); | 1151 var mock = new HttpServerMock(); |
| 1149 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; | 1152 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; |
| 1150 var arg_project = "foo"; | 1153 var arg_project = "foo"; |
| 1151 var arg_groupName = "foo"; | 1154 var arg_groupName = "foo"; |
| 1152 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1155 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1153 var path = (req.url).path; | 1156 var path = (req.url).path; |
| 1154 var pathOffset = 0; | 1157 var pathOffset = 0; |
| 1155 var index; | 1158 var index; |
| 1156 var subPart; | 1159 var subPart; |
| 1157 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1160 unittest.expect( |
| 1161 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1158 pathOffset += 1; | 1162 pathOffset += 1; |
| 1159 | 1163 |
| 1160 var query = (req.url).query; | 1164 var query = (req.url).query; |
| 1161 var queryOffset = 0; | 1165 var queryOffset = 0; |
| 1162 var queryMap = {}; | 1166 var queryMap = {}; |
| 1163 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1167 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1164 parseBool(n) { | 1168 parseBool(n) { |
| 1165 if (n == "true") return true; | 1169 if (n == "true") return true; |
| 1166 if (n == "false") return false; | 1170 if (n == "false") return false; |
| 1167 if (n == null) return null; | 1171 if (n == null) return null; |
| 1168 throw new core.ArgumentError("Invalid boolean: $n"); | 1172 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1169 } | 1173 } |
| 1174 |
| 1170 if (query.length > 0) { | 1175 if (query.length > 0) { |
| 1171 for (var part in query.split("&")) { | 1176 for (var part in query.split("&")) { |
| 1172 var keyvalue = part.split("="); | 1177 var keyvalue = part.split("="); |
| 1173 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1178 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1179 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1174 } | 1180 } |
| 1175 } | 1181 } |
| 1176 | 1182 |
| 1177 | |
| 1178 var h = { | 1183 var h = { |
| 1179 "content-type" : "application/json; charset=utf-8", | 1184 "content-type": "application/json; charset=utf-8", |
| 1180 }; | 1185 }; |
| 1181 var resp = convert.JSON.encode(buildGroup()); | 1186 var resp = convert.JSON.encode(buildGroup()); |
| 1182 return new async.Future.value(stringResponse(200, h, resp)); | 1187 return new async.Future.value(stringResponse(200, h, resp)); |
| 1183 }), true); | 1188 }), true); |
| 1184 res.get(arg_project, arg_groupName).then(unittest.expectAsync1(((api.Group
response) { | 1189 res |
| 1190 .get(arg_project, arg_groupName) |
| 1191 .then(unittest.expectAsync1(((api.Group response) { |
| 1185 checkGroup(response); | 1192 checkGroup(response); |
| 1186 }))); | 1193 }))); |
| 1187 }); | 1194 }); |
| 1188 | 1195 |
| 1189 unittest.test("method--insert", () { | 1196 unittest.test("method--insert", () { |
| 1190 | |
| 1191 var mock = new HttpServerMock(); | 1197 var mock = new HttpServerMock(); |
| 1192 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; | 1198 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; |
| 1193 var arg_request = buildGroup(); | 1199 var arg_request = buildGroup(); |
| 1194 var arg_project = "foo"; | 1200 var arg_project = "foo"; |
| 1195 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1201 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1196 var obj = new api.Group.fromJson(json); | 1202 var obj = new api.Group.fromJson(json); |
| 1197 checkGroup(obj); | 1203 checkGroup(obj); |
| 1198 | 1204 |
| 1199 var path = (req.url).path; | 1205 var path = (req.url).path; |
| 1200 var pathOffset = 0; | 1206 var pathOffset = 0; |
| 1201 var index; | 1207 var index; |
| 1202 var subPart; | 1208 var subPart; |
| 1203 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1209 unittest.expect( |
| 1210 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1204 pathOffset += 1; | 1211 pathOffset += 1; |
| 1205 | 1212 |
| 1206 var query = (req.url).query; | 1213 var query = (req.url).query; |
| 1207 var queryOffset = 0; | 1214 var queryOffset = 0; |
| 1208 var queryMap = {}; | 1215 var queryMap = {}; |
| 1209 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1216 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1210 parseBool(n) { | 1217 parseBool(n) { |
| 1211 if (n == "true") return true; | 1218 if (n == "true") return true; |
| 1212 if (n == "false") return false; | 1219 if (n == "false") return false; |
| 1213 if (n == null) return null; | 1220 if (n == null) return null; |
| 1214 throw new core.ArgumentError("Invalid boolean: $n"); | 1221 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1215 } | 1222 } |
| 1223 |
| 1216 if (query.length > 0) { | 1224 if (query.length > 0) { |
| 1217 for (var part in query.split("&")) { | 1225 for (var part in query.split("&")) { |
| 1218 var keyvalue = part.split("="); | 1226 var keyvalue = part.split("="); |
| 1219 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1227 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1228 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1220 } | 1229 } |
| 1221 } | 1230 } |
| 1222 | 1231 |
| 1223 | |
| 1224 var h = { | 1232 var h = { |
| 1225 "content-type" : "application/json; charset=utf-8", | 1233 "content-type": "application/json; charset=utf-8", |
| 1226 }; | 1234 }; |
| 1227 var resp = convert.JSON.encode(buildOperation()); | 1235 var resp = convert.JSON.encode(buildOperation()); |
| 1228 return new async.Future.value(stringResponse(200, h, resp)); | 1236 return new async.Future.value(stringResponse(200, h, resp)); |
| 1229 }), true); | 1237 }), true); |
| 1230 res.insert(arg_request, arg_project).then(unittest.expectAsync1(((api.Oper
ation response) { | 1238 res |
| 1239 .insert(arg_request, arg_project) |
| 1240 .then(unittest.expectAsync1(((api.Operation response) { |
| 1231 checkOperation(response); | 1241 checkOperation(response); |
| 1232 }))); | 1242 }))); |
| 1233 }); | 1243 }); |
| 1234 | 1244 |
| 1235 unittest.test("method--list", () { | 1245 unittest.test("method--list", () { |
| 1236 | |
| 1237 var mock = new HttpServerMock(); | 1246 var mock = new HttpServerMock(); |
| 1238 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; | 1247 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; |
| 1239 var arg_project = "foo"; | 1248 var arg_project = "foo"; |
| 1240 var arg_filter = "foo"; | 1249 var arg_filter = "foo"; |
| 1241 var arg_maxResults = 42; | 1250 var arg_maxResults = 42; |
| 1242 var arg_orderBy = "foo"; | 1251 var arg_orderBy = "foo"; |
| 1243 var arg_pageToken = "foo"; | 1252 var arg_pageToken = "foo"; |
| 1244 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1253 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1245 var path = (req.url).path; | 1254 var path = (req.url).path; |
| 1246 var pathOffset = 0; | 1255 var pathOffset = 0; |
| 1247 var index; | 1256 var index; |
| 1248 var subPart; | 1257 var subPart; |
| 1249 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1258 unittest.expect( |
| 1259 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1250 pathOffset += 1; | 1260 pathOffset += 1; |
| 1251 | 1261 |
| 1252 var query = (req.url).query; | 1262 var query = (req.url).query; |
| 1253 var queryOffset = 0; | 1263 var queryOffset = 0; |
| 1254 var queryMap = {}; | 1264 var queryMap = {}; |
| 1255 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1265 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1256 parseBool(n) { | 1266 parseBool(n) { |
| 1257 if (n == "true") return true; | 1267 if (n == "true") return true; |
| 1258 if (n == "false") return false; | 1268 if (n == "false") return false; |
| 1259 if (n == null) return null; | 1269 if (n == null) return null; |
| 1260 throw new core.ArgumentError("Invalid boolean: $n"); | 1270 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1261 } | 1271 } |
| 1272 |
| 1262 if (query.length > 0) { | 1273 if (query.length > 0) { |
| 1263 for (var part in query.split("&")) { | 1274 for (var part in query.split("&")) { |
| 1264 var keyvalue = part.split("="); | 1275 var keyvalue = part.split("="); |
| 1265 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1276 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1277 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1266 } | 1278 } |
| 1267 } | 1279 } |
| 1268 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1280 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 1269 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1281 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
| 1270 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; | 1282 unittest.equals(arg_maxResults)); |
| 1271 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1283 unittest.expect( |
| 1272 | 1284 queryMap["orderBy"].first, unittest.equals(arg_orderBy)); |
| 1285 unittest.expect( |
| 1286 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 1273 | 1287 |
| 1274 var h = { | 1288 var h = { |
| 1275 "content-type" : "application/json; charset=utf-8", | 1289 "content-type": "application/json; charset=utf-8", |
| 1276 }; | 1290 }; |
| 1277 var resp = convert.JSON.encode(buildGroupList()); | 1291 var resp = convert.JSON.encode(buildGroupList()); |
| 1278 return new async.Future.value(stringResponse(200, h, resp)); | 1292 return new async.Future.value(stringResponse(200, h, resp)); |
| 1279 }), true); | 1293 }), true); |
| 1280 res.list(arg_project, filter: arg_filter, maxResults: arg_maxResults, orde
rBy: arg_orderBy, pageToken: arg_pageToken).then(unittest.expectAsync1(((api.Gro
upList response) { | 1294 res |
| 1295 .list(arg_project, |
| 1296 filter: arg_filter, |
| 1297 maxResults: arg_maxResults, |
| 1298 orderBy: arg_orderBy, |
| 1299 pageToken: arg_pageToken) |
| 1300 .then(unittest.expectAsync1(((api.GroupList response) { |
| 1281 checkGroupList(response); | 1301 checkGroupList(response); |
| 1282 }))); | 1302 }))); |
| 1283 }); | 1303 }); |
| 1284 | 1304 |
| 1285 unittest.test("method--removeMember", () { | 1305 unittest.test("method--removeMember", () { |
| 1286 | |
| 1287 var mock = new HttpServerMock(); | 1306 var mock = new HttpServerMock(); |
| 1288 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; | 1307 api.GroupsResourceApi res = new api.ClouduseraccountsApi(mock).groups; |
| 1289 var arg_request = buildGroupsRemoveMemberRequest(); | 1308 var arg_request = buildGroupsRemoveMemberRequest(); |
| 1290 var arg_project = "foo"; | 1309 var arg_project = "foo"; |
| 1291 var arg_groupName = "foo"; | 1310 var arg_groupName = "foo"; |
| 1292 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1311 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1293 var obj = new api.GroupsRemoveMemberRequest.fromJson(json); | 1312 var obj = new api.GroupsRemoveMemberRequest.fromJson(json); |
| 1294 checkGroupsRemoveMemberRequest(obj); | 1313 checkGroupsRemoveMemberRequest(obj); |
| 1295 | 1314 |
| 1296 var path = (req.url).path; | 1315 var path = (req.url).path; |
| 1297 var pathOffset = 0; | 1316 var pathOffset = 0; |
| 1298 var index; | 1317 var index; |
| 1299 var subPart; | 1318 var subPart; |
| 1300 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1319 unittest.expect( |
| 1320 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1301 pathOffset += 1; | 1321 pathOffset += 1; |
| 1302 | 1322 |
| 1303 var query = (req.url).query; | 1323 var query = (req.url).query; |
| 1304 var queryOffset = 0; | 1324 var queryOffset = 0; |
| 1305 var queryMap = {}; | 1325 var queryMap = {}; |
| 1306 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1326 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1307 parseBool(n) { | 1327 parseBool(n) { |
| 1308 if (n == "true") return true; | 1328 if (n == "true") return true; |
| 1309 if (n == "false") return false; | 1329 if (n == "false") return false; |
| 1310 if (n == null) return null; | 1330 if (n == null) return null; |
| 1311 throw new core.ArgumentError("Invalid boolean: $n"); | 1331 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1312 } | 1332 } |
| 1333 |
| 1313 if (query.length > 0) { | 1334 if (query.length > 0) { |
| 1314 for (var part in query.split("&")) { | 1335 for (var part in query.split("&")) { |
| 1315 var keyvalue = part.split("="); | 1336 var keyvalue = part.split("="); |
| 1316 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1337 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1338 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1317 } | 1339 } |
| 1318 } | 1340 } |
| 1319 | 1341 |
| 1320 | |
| 1321 var h = { | 1342 var h = { |
| 1322 "content-type" : "application/json; charset=utf-8", | 1343 "content-type": "application/json; charset=utf-8", |
| 1323 }; | 1344 }; |
| 1324 var resp = convert.JSON.encode(buildOperation()); | 1345 var resp = convert.JSON.encode(buildOperation()); |
| 1325 return new async.Future.value(stringResponse(200, h, resp)); | 1346 return new async.Future.value(stringResponse(200, h, resp)); |
| 1326 }), true); | 1347 }), true); |
| 1327 res.removeMember(arg_request, arg_project, arg_groupName).then(unittest.ex
pectAsync1(((api.Operation response) { | 1348 res |
| 1349 .removeMember(arg_request, arg_project, arg_groupName) |
| 1350 .then(unittest.expectAsync1(((api.Operation response) { |
| 1328 checkOperation(response); | 1351 checkOperation(response); |
| 1329 }))); | 1352 }))); |
| 1330 }); | 1353 }); |
| 1331 | |
| 1332 }); | 1354 }); |
| 1333 | 1355 |
| 1334 | |
| 1335 unittest.group("resource-LinuxResourceApi", () { | 1356 unittest.group("resource-LinuxResourceApi", () { |
| 1336 unittest.test("method--getAuthorizedKeysView", () { | 1357 unittest.test("method--getAuthorizedKeysView", () { |
| 1337 | |
| 1338 var mock = new HttpServerMock(); | 1358 var mock = new HttpServerMock(); |
| 1339 api.LinuxResourceApi res = new api.ClouduseraccountsApi(mock).linux; | 1359 api.LinuxResourceApi res = new api.ClouduseraccountsApi(mock).linux; |
| 1340 var arg_project = "foo"; | 1360 var arg_project = "foo"; |
| 1341 var arg_zone = "foo"; | 1361 var arg_zone = "foo"; |
| 1342 var arg_user = "foo"; | 1362 var arg_user = "foo"; |
| 1343 var arg_instance = "foo"; | 1363 var arg_instance = "foo"; |
| 1344 var arg_login = true; | 1364 var arg_login = true; |
| 1345 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1365 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1346 var path = (req.url).path; | 1366 var path = (req.url).path; |
| 1347 var pathOffset = 0; | 1367 var pathOffset = 0; |
| 1348 var index; | 1368 var index; |
| 1349 var subPart; | 1369 var subPart; |
| 1350 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1370 unittest.expect( |
| 1371 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1351 pathOffset += 1; | 1372 pathOffset += 1; |
| 1352 | 1373 |
| 1353 var query = (req.url).query; | 1374 var query = (req.url).query; |
| 1354 var queryOffset = 0; | 1375 var queryOffset = 0; |
| 1355 var queryMap = {}; | 1376 var queryMap = {}; |
| 1356 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1377 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1357 parseBool(n) { | 1378 parseBool(n) { |
| 1358 if (n == "true") return true; | 1379 if (n == "true") return true; |
| 1359 if (n == "false") return false; | 1380 if (n == "false") return false; |
| 1360 if (n == null) return null; | 1381 if (n == null) return null; |
| 1361 throw new core.ArgumentError("Invalid boolean: $n"); | 1382 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1362 } | 1383 } |
| 1384 |
| 1363 if (query.length > 0) { | 1385 if (query.length > 0) { |
| 1364 for (var part in query.split("&")) { | 1386 for (var part in query.split("&")) { |
| 1365 var keyvalue = part.split("="); | 1387 var keyvalue = part.split("="); |
| 1366 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1388 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1389 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1367 } | 1390 } |
| 1368 } | 1391 } |
| 1369 unittest.expect(queryMap["instance"].first, unittest.equals(arg_instance
)); | 1392 unittest.expect( |
| 1393 queryMap["instance"].first, unittest.equals(arg_instance)); |
| 1370 unittest.expect(queryMap["login"].first, unittest.equals("$arg_login")); | 1394 unittest.expect(queryMap["login"].first, unittest.equals("$arg_login")); |
| 1371 | 1395 |
| 1372 | |
| 1373 var h = { | 1396 var h = { |
| 1374 "content-type" : "application/json; charset=utf-8", | 1397 "content-type": "application/json; charset=utf-8", |
| 1375 }; | 1398 }; |
| 1376 var resp = convert.JSON.encode(buildLinuxGetAuthorizedKeysViewResponse()
); | 1399 var resp = |
| 1400 convert.JSON.encode(buildLinuxGetAuthorizedKeysViewResponse()); |
| 1377 return new async.Future.value(stringResponse(200, h, resp)); | 1401 return new async.Future.value(stringResponse(200, h, resp)); |
| 1378 }), true); | 1402 }), true); |
| 1379 res.getAuthorizedKeysView(arg_project, arg_zone, arg_user, arg_instance, l
ogin: arg_login).then(unittest.expectAsync1(((api.LinuxGetAuthorizedKeysViewResp
onse response) { | 1403 res |
| 1404 .getAuthorizedKeysView(arg_project, arg_zone, arg_user, arg_instance, |
| 1405 login: arg_login) |
| 1406 .then(unittest |
| 1407 .expectAsync1(((api.LinuxGetAuthorizedKeysViewResponse response) { |
| 1380 checkLinuxGetAuthorizedKeysViewResponse(response); | 1408 checkLinuxGetAuthorizedKeysViewResponse(response); |
| 1381 }))); | 1409 }))); |
| 1382 }); | 1410 }); |
| 1383 | 1411 |
| 1384 unittest.test("method--getLinuxAccountViews", () { | 1412 unittest.test("method--getLinuxAccountViews", () { |
| 1385 | |
| 1386 var mock = new HttpServerMock(); | 1413 var mock = new HttpServerMock(); |
| 1387 api.LinuxResourceApi res = new api.ClouduseraccountsApi(mock).linux; | 1414 api.LinuxResourceApi res = new api.ClouduseraccountsApi(mock).linux; |
| 1388 var arg_project = "foo"; | 1415 var arg_project = "foo"; |
| 1389 var arg_zone = "foo"; | 1416 var arg_zone = "foo"; |
| 1390 var arg_instance = "foo"; | 1417 var arg_instance = "foo"; |
| 1391 var arg_filter = "foo"; | 1418 var arg_filter = "foo"; |
| 1392 var arg_maxResults = 42; | 1419 var arg_maxResults = 42; |
| 1393 var arg_orderBy = "foo"; | 1420 var arg_orderBy = "foo"; |
| 1394 var arg_pageToken = "foo"; | 1421 var arg_pageToken = "foo"; |
| 1395 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1422 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1396 var path = (req.url).path; | 1423 var path = (req.url).path; |
| 1397 var pathOffset = 0; | 1424 var pathOffset = 0; |
| 1398 var index; | 1425 var index; |
| 1399 var subPart; | 1426 var subPart; |
| 1400 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1427 unittest.expect( |
| 1428 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1401 pathOffset += 1; | 1429 pathOffset += 1; |
| 1402 | 1430 |
| 1403 var query = (req.url).query; | 1431 var query = (req.url).query; |
| 1404 var queryOffset = 0; | 1432 var queryOffset = 0; |
| 1405 var queryMap = {}; | 1433 var queryMap = {}; |
| 1406 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1434 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1407 parseBool(n) { | 1435 parseBool(n) { |
| 1408 if (n == "true") return true; | 1436 if (n == "true") return true; |
| 1409 if (n == "false") return false; | 1437 if (n == "false") return false; |
| 1410 if (n == null) return null; | 1438 if (n == null) return null; |
| 1411 throw new core.ArgumentError("Invalid boolean: $n"); | 1439 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1412 } | 1440 } |
| 1441 |
| 1413 if (query.length > 0) { | 1442 if (query.length > 0) { |
| 1414 for (var part in query.split("&")) { | 1443 for (var part in query.split("&")) { |
| 1415 var keyvalue = part.split("="); | 1444 var keyvalue = part.split("="); |
| 1416 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1445 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1446 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1417 } | 1447 } |
| 1418 } | 1448 } |
| 1419 unittest.expect(queryMap["instance"].first, unittest.equals(arg_instance
)); | 1449 unittest.expect( |
| 1450 queryMap["instance"].first, unittest.equals(arg_instance)); |
| 1420 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1451 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 1421 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1452 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
| 1422 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; | 1453 unittest.equals(arg_maxResults)); |
| 1423 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1454 unittest.expect( |
| 1424 | 1455 queryMap["orderBy"].first, unittest.equals(arg_orderBy)); |
| 1456 unittest.expect( |
| 1457 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 1425 | 1458 |
| 1426 var h = { | 1459 var h = { |
| 1427 "content-type" : "application/json; charset=utf-8", | 1460 "content-type": "application/json; charset=utf-8", |
| 1428 }; | 1461 }; |
| 1429 var resp = convert.JSON.encode(buildLinuxGetLinuxAccountViewsResponse())
; | 1462 var resp = |
| 1463 convert.JSON.encode(buildLinuxGetLinuxAccountViewsResponse()); |
| 1430 return new async.Future.value(stringResponse(200, h, resp)); | 1464 return new async.Future.value(stringResponse(200, h, resp)); |
| 1431 }), true); | 1465 }), true); |
| 1432 res.getLinuxAccountViews(arg_project, arg_zone, arg_instance, filter: arg_
filter, maxResults: arg_maxResults, orderBy: arg_orderBy, pageToken: arg_pageTok
en).then(unittest.expectAsync1(((api.LinuxGetLinuxAccountViewsResponse response)
{ | 1466 res |
| 1467 .getLinuxAccountViews(arg_project, arg_zone, arg_instance, |
| 1468 filter: arg_filter, |
| 1469 maxResults: arg_maxResults, |
| 1470 orderBy: arg_orderBy, |
| 1471 pageToken: arg_pageToken) |
| 1472 .then(unittest |
| 1473 .expectAsync1(((api.LinuxGetLinuxAccountViewsResponse response) { |
| 1433 checkLinuxGetLinuxAccountViewsResponse(response); | 1474 checkLinuxGetLinuxAccountViewsResponse(response); |
| 1434 }))); | 1475 }))); |
| 1435 }); | 1476 }); |
| 1436 | |
| 1437 }); | 1477 }); |
| 1438 | 1478 |
| 1439 | |
| 1440 unittest.group("resource-UsersResourceApi", () { | 1479 unittest.group("resource-UsersResourceApi", () { |
| 1441 unittest.test("method--addPublicKey", () { | 1480 unittest.test("method--addPublicKey", () { |
| 1442 | |
| 1443 var mock = new HttpServerMock(); | 1481 var mock = new HttpServerMock(); |
| 1444 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; | 1482 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; |
| 1445 var arg_request = buildPublicKey(); | 1483 var arg_request = buildPublicKey(); |
| 1446 var arg_project = "foo"; | 1484 var arg_project = "foo"; |
| 1447 var arg_user = "foo"; | 1485 var arg_user = "foo"; |
| 1448 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1486 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1449 var obj = new api.PublicKey.fromJson(json); | 1487 var obj = new api.PublicKey.fromJson(json); |
| 1450 checkPublicKey(obj); | 1488 checkPublicKey(obj); |
| 1451 | 1489 |
| 1452 var path = (req.url).path; | 1490 var path = (req.url).path; |
| 1453 var pathOffset = 0; | 1491 var pathOffset = 0; |
| 1454 var index; | 1492 var index; |
| 1455 var subPart; | 1493 var subPart; |
| 1456 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1494 unittest.expect( |
| 1495 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1457 pathOffset += 1; | 1496 pathOffset += 1; |
| 1458 | 1497 |
| 1459 var query = (req.url).query; | 1498 var query = (req.url).query; |
| 1460 var queryOffset = 0; | 1499 var queryOffset = 0; |
| 1461 var queryMap = {}; | 1500 var queryMap = {}; |
| 1462 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1501 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1463 parseBool(n) { | 1502 parseBool(n) { |
| 1464 if (n == "true") return true; | 1503 if (n == "true") return true; |
| 1465 if (n == "false") return false; | 1504 if (n == "false") return false; |
| 1466 if (n == null) return null; | 1505 if (n == null) return null; |
| 1467 throw new core.ArgumentError("Invalid boolean: $n"); | 1506 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1468 } | 1507 } |
| 1508 |
| 1469 if (query.length > 0) { | 1509 if (query.length > 0) { |
| 1470 for (var part in query.split("&")) { | 1510 for (var part in query.split("&")) { |
| 1471 var keyvalue = part.split("="); | 1511 var keyvalue = part.split("="); |
| 1472 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1512 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1513 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1473 } | 1514 } |
| 1474 } | 1515 } |
| 1475 | 1516 |
| 1476 | |
| 1477 var h = { | 1517 var h = { |
| 1478 "content-type" : "application/json; charset=utf-8", | 1518 "content-type": "application/json; charset=utf-8", |
| 1479 }; | 1519 }; |
| 1480 var resp = convert.JSON.encode(buildOperation()); | 1520 var resp = convert.JSON.encode(buildOperation()); |
| 1481 return new async.Future.value(stringResponse(200, h, resp)); | 1521 return new async.Future.value(stringResponse(200, h, resp)); |
| 1482 }), true); | 1522 }), true); |
| 1483 res.addPublicKey(arg_request, arg_project, arg_user).then(unittest.expectA
sync1(((api.Operation response) { | 1523 res |
| 1524 .addPublicKey(arg_request, arg_project, arg_user) |
| 1525 .then(unittest.expectAsync1(((api.Operation response) { |
| 1484 checkOperation(response); | 1526 checkOperation(response); |
| 1485 }))); | 1527 }))); |
| 1486 }); | 1528 }); |
| 1487 | 1529 |
| 1488 unittest.test("method--delete", () { | 1530 unittest.test("method--delete", () { |
| 1489 | |
| 1490 var mock = new HttpServerMock(); | 1531 var mock = new HttpServerMock(); |
| 1491 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; | 1532 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; |
| 1492 var arg_project = "foo"; | 1533 var arg_project = "foo"; |
| 1493 var arg_user = "foo"; | 1534 var arg_user = "foo"; |
| 1494 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1535 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1495 var path = (req.url).path; | 1536 var path = (req.url).path; |
| 1496 var pathOffset = 0; | 1537 var pathOffset = 0; |
| 1497 var index; | 1538 var index; |
| 1498 var subPart; | 1539 var subPart; |
| 1499 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1540 unittest.expect( |
| 1541 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1500 pathOffset += 1; | 1542 pathOffset += 1; |
| 1501 | 1543 |
| 1502 var query = (req.url).query; | 1544 var query = (req.url).query; |
| 1503 var queryOffset = 0; | 1545 var queryOffset = 0; |
| 1504 var queryMap = {}; | 1546 var queryMap = {}; |
| 1505 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1547 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1506 parseBool(n) { | 1548 parseBool(n) { |
| 1507 if (n == "true") return true; | 1549 if (n == "true") return true; |
| 1508 if (n == "false") return false; | 1550 if (n == "false") return false; |
| 1509 if (n == null) return null; | 1551 if (n == null) return null; |
| 1510 throw new core.ArgumentError("Invalid boolean: $n"); | 1552 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1511 } | 1553 } |
| 1554 |
| 1512 if (query.length > 0) { | 1555 if (query.length > 0) { |
| 1513 for (var part in query.split("&")) { | 1556 for (var part in query.split("&")) { |
| 1514 var keyvalue = part.split("="); | 1557 var keyvalue = part.split("="); |
| 1515 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1558 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1559 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1516 } | 1560 } |
| 1517 } | 1561 } |
| 1518 | 1562 |
| 1519 | |
| 1520 var h = { | 1563 var h = { |
| 1521 "content-type" : "application/json; charset=utf-8", | 1564 "content-type": "application/json; charset=utf-8", |
| 1522 }; | 1565 }; |
| 1523 var resp = convert.JSON.encode(buildOperation()); | 1566 var resp = convert.JSON.encode(buildOperation()); |
| 1524 return new async.Future.value(stringResponse(200, h, resp)); | 1567 return new async.Future.value(stringResponse(200, h, resp)); |
| 1525 }), true); | 1568 }), true); |
| 1526 res.delete(arg_project, arg_user).then(unittest.expectAsync1(((api.Operati
on response) { | 1569 res |
| 1570 .delete(arg_project, arg_user) |
| 1571 .then(unittest.expectAsync1(((api.Operation response) { |
| 1527 checkOperation(response); | 1572 checkOperation(response); |
| 1528 }))); | 1573 }))); |
| 1529 }); | 1574 }); |
| 1530 | 1575 |
| 1531 unittest.test("method--get", () { | 1576 unittest.test("method--get", () { |
| 1532 | |
| 1533 var mock = new HttpServerMock(); | 1577 var mock = new HttpServerMock(); |
| 1534 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; | 1578 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; |
| 1535 var arg_project = "foo"; | 1579 var arg_project = "foo"; |
| 1536 var arg_user = "foo"; | 1580 var arg_user = "foo"; |
| 1537 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1581 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1538 var path = (req.url).path; | 1582 var path = (req.url).path; |
| 1539 var pathOffset = 0; | 1583 var pathOffset = 0; |
| 1540 var index; | 1584 var index; |
| 1541 var subPart; | 1585 var subPart; |
| 1542 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1586 unittest.expect( |
| 1587 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1543 pathOffset += 1; | 1588 pathOffset += 1; |
| 1544 | 1589 |
| 1545 var query = (req.url).query; | 1590 var query = (req.url).query; |
| 1546 var queryOffset = 0; | 1591 var queryOffset = 0; |
| 1547 var queryMap = {}; | 1592 var queryMap = {}; |
| 1548 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1593 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1549 parseBool(n) { | 1594 parseBool(n) { |
| 1550 if (n == "true") return true; | 1595 if (n == "true") return true; |
| 1551 if (n == "false") return false; | 1596 if (n == "false") return false; |
| 1552 if (n == null) return null; | 1597 if (n == null) return null; |
| 1553 throw new core.ArgumentError("Invalid boolean: $n"); | 1598 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1554 } | 1599 } |
| 1600 |
| 1555 if (query.length > 0) { | 1601 if (query.length > 0) { |
| 1556 for (var part in query.split("&")) { | 1602 for (var part in query.split("&")) { |
| 1557 var keyvalue = part.split("="); | 1603 var keyvalue = part.split("="); |
| 1558 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1604 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1605 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1559 } | 1606 } |
| 1560 } | 1607 } |
| 1561 | 1608 |
| 1562 | |
| 1563 var h = { | 1609 var h = { |
| 1564 "content-type" : "application/json; charset=utf-8", | 1610 "content-type": "application/json; charset=utf-8", |
| 1565 }; | 1611 }; |
| 1566 var resp = convert.JSON.encode(buildUser()); | 1612 var resp = convert.JSON.encode(buildUser()); |
| 1567 return new async.Future.value(stringResponse(200, h, resp)); | 1613 return new async.Future.value(stringResponse(200, h, resp)); |
| 1568 }), true); | 1614 }), true); |
| 1569 res.get(arg_project, arg_user).then(unittest.expectAsync1(((api.User respo
nse) { | 1615 res |
| 1616 .get(arg_project, arg_user) |
| 1617 .then(unittest.expectAsync1(((api.User response) { |
| 1570 checkUser(response); | 1618 checkUser(response); |
| 1571 }))); | 1619 }))); |
| 1572 }); | 1620 }); |
| 1573 | 1621 |
| 1574 unittest.test("method--insert", () { | 1622 unittest.test("method--insert", () { |
| 1575 | |
| 1576 var mock = new HttpServerMock(); | 1623 var mock = new HttpServerMock(); |
| 1577 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; | 1624 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; |
| 1578 var arg_request = buildUser(); | 1625 var arg_request = buildUser(); |
| 1579 var arg_project = "foo"; | 1626 var arg_project = "foo"; |
| 1580 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1627 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1581 var obj = new api.User.fromJson(json); | 1628 var obj = new api.User.fromJson(json); |
| 1582 checkUser(obj); | 1629 checkUser(obj); |
| 1583 | 1630 |
| 1584 var path = (req.url).path; | 1631 var path = (req.url).path; |
| 1585 var pathOffset = 0; | 1632 var pathOffset = 0; |
| 1586 var index; | 1633 var index; |
| 1587 var subPart; | 1634 var subPart; |
| 1588 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1635 unittest.expect( |
| 1636 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1589 pathOffset += 1; | 1637 pathOffset += 1; |
| 1590 | 1638 |
| 1591 var query = (req.url).query; | 1639 var query = (req.url).query; |
| 1592 var queryOffset = 0; | 1640 var queryOffset = 0; |
| 1593 var queryMap = {}; | 1641 var queryMap = {}; |
| 1594 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1642 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1595 parseBool(n) { | 1643 parseBool(n) { |
| 1596 if (n == "true") return true; | 1644 if (n == "true") return true; |
| 1597 if (n == "false") return false; | 1645 if (n == "false") return false; |
| 1598 if (n == null) return null; | 1646 if (n == null) return null; |
| 1599 throw new core.ArgumentError("Invalid boolean: $n"); | 1647 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1600 } | 1648 } |
| 1649 |
| 1601 if (query.length > 0) { | 1650 if (query.length > 0) { |
| 1602 for (var part in query.split("&")) { | 1651 for (var part in query.split("&")) { |
| 1603 var keyvalue = part.split("="); | 1652 var keyvalue = part.split("="); |
| 1604 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1653 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1654 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1605 } | 1655 } |
| 1606 } | 1656 } |
| 1607 | 1657 |
| 1608 | |
| 1609 var h = { | 1658 var h = { |
| 1610 "content-type" : "application/json; charset=utf-8", | 1659 "content-type": "application/json; charset=utf-8", |
| 1611 }; | 1660 }; |
| 1612 var resp = convert.JSON.encode(buildOperation()); | 1661 var resp = convert.JSON.encode(buildOperation()); |
| 1613 return new async.Future.value(stringResponse(200, h, resp)); | 1662 return new async.Future.value(stringResponse(200, h, resp)); |
| 1614 }), true); | 1663 }), true); |
| 1615 res.insert(arg_request, arg_project).then(unittest.expectAsync1(((api.Oper
ation response) { | 1664 res |
| 1665 .insert(arg_request, arg_project) |
| 1666 .then(unittest.expectAsync1(((api.Operation response) { |
| 1616 checkOperation(response); | 1667 checkOperation(response); |
| 1617 }))); | 1668 }))); |
| 1618 }); | 1669 }); |
| 1619 | 1670 |
| 1620 unittest.test("method--list", () { | 1671 unittest.test("method--list", () { |
| 1621 | |
| 1622 var mock = new HttpServerMock(); | 1672 var mock = new HttpServerMock(); |
| 1623 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; | 1673 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; |
| 1624 var arg_project = "foo"; | 1674 var arg_project = "foo"; |
| 1625 var arg_filter = "foo"; | 1675 var arg_filter = "foo"; |
| 1626 var arg_maxResults = 42; | 1676 var arg_maxResults = 42; |
| 1627 var arg_orderBy = "foo"; | 1677 var arg_orderBy = "foo"; |
| 1628 var arg_pageToken = "foo"; | 1678 var arg_pageToken = "foo"; |
| 1629 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1679 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1630 var path = (req.url).path; | 1680 var path = (req.url).path; |
| 1631 var pathOffset = 0; | 1681 var pathOffset = 0; |
| 1632 var index; | 1682 var index; |
| 1633 var subPart; | 1683 var subPart; |
| 1634 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1684 unittest.expect( |
| 1685 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1635 pathOffset += 1; | 1686 pathOffset += 1; |
| 1636 | 1687 |
| 1637 var query = (req.url).query; | 1688 var query = (req.url).query; |
| 1638 var queryOffset = 0; | 1689 var queryOffset = 0; |
| 1639 var queryMap = {}; | 1690 var queryMap = {}; |
| 1640 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1691 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1641 parseBool(n) { | 1692 parseBool(n) { |
| 1642 if (n == "true") return true; | 1693 if (n == "true") return true; |
| 1643 if (n == "false") return false; | 1694 if (n == "false") return false; |
| 1644 if (n == null) return null; | 1695 if (n == null) return null; |
| 1645 throw new core.ArgumentError("Invalid boolean: $n"); | 1696 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1646 } | 1697 } |
| 1698 |
| 1647 if (query.length > 0) { | 1699 if (query.length > 0) { |
| 1648 for (var part in query.split("&")) { | 1700 for (var part in query.split("&")) { |
| 1649 var keyvalue = part.split("="); | 1701 var keyvalue = part.split("="); |
| 1650 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1702 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1703 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1651 } | 1704 } |
| 1652 } | 1705 } |
| 1653 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1706 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 1654 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1707 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
| 1655 unittest.expect(queryMap["orderBy"].first, unittest.equals(arg_orderBy))
; | 1708 unittest.equals(arg_maxResults)); |
| 1656 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1709 unittest.expect( |
| 1657 | 1710 queryMap["orderBy"].first, unittest.equals(arg_orderBy)); |
| 1711 unittest.expect( |
| 1712 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 1658 | 1713 |
| 1659 var h = { | 1714 var h = { |
| 1660 "content-type" : "application/json; charset=utf-8", | 1715 "content-type": "application/json; charset=utf-8", |
| 1661 }; | 1716 }; |
| 1662 var resp = convert.JSON.encode(buildUserList()); | 1717 var resp = convert.JSON.encode(buildUserList()); |
| 1663 return new async.Future.value(stringResponse(200, h, resp)); | 1718 return new async.Future.value(stringResponse(200, h, resp)); |
| 1664 }), true); | 1719 }), true); |
| 1665 res.list(arg_project, filter: arg_filter, maxResults: arg_maxResults, orde
rBy: arg_orderBy, pageToken: arg_pageToken).then(unittest.expectAsync1(((api.Use
rList response) { | 1720 res |
| 1721 .list(arg_project, |
| 1722 filter: arg_filter, |
| 1723 maxResults: arg_maxResults, |
| 1724 orderBy: arg_orderBy, |
| 1725 pageToken: arg_pageToken) |
| 1726 .then(unittest.expectAsync1(((api.UserList response) { |
| 1666 checkUserList(response); | 1727 checkUserList(response); |
| 1667 }))); | 1728 }))); |
| 1668 }); | 1729 }); |
| 1669 | 1730 |
| 1670 unittest.test("method--removePublicKey", () { | 1731 unittest.test("method--removePublicKey", () { |
| 1671 | |
| 1672 var mock = new HttpServerMock(); | 1732 var mock = new HttpServerMock(); |
| 1673 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; | 1733 api.UsersResourceApi res = new api.ClouduseraccountsApi(mock).users; |
| 1674 var arg_project = "foo"; | 1734 var arg_project = "foo"; |
| 1675 var arg_user = "foo"; | 1735 var arg_user = "foo"; |
| 1676 var arg_fingerprint = "foo"; | 1736 var arg_fingerprint = "foo"; |
| 1677 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1737 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1678 var path = (req.url).path; | 1738 var path = (req.url).path; |
| 1679 var pathOffset = 0; | 1739 var pathOffset = 0; |
| 1680 var index; | 1740 var index; |
| 1681 var subPart; | 1741 var subPart; |
| 1682 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1742 unittest.expect( |
| 1743 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1683 pathOffset += 1; | 1744 pathOffset += 1; |
| 1684 | 1745 |
| 1685 var query = (req.url).query; | 1746 var query = (req.url).query; |
| 1686 var queryOffset = 0; | 1747 var queryOffset = 0; |
| 1687 var queryMap = {}; | 1748 var queryMap = {}; |
| 1688 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1749 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1689 parseBool(n) { | 1750 parseBool(n) { |
| 1690 if (n == "true") return true; | 1751 if (n == "true") return true; |
| 1691 if (n == "false") return false; | 1752 if (n == "false") return false; |
| 1692 if (n == null) return null; | 1753 if (n == null) return null; |
| 1693 throw new core.ArgumentError("Invalid boolean: $n"); | 1754 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1694 } | 1755 } |
| 1756 |
| 1695 if (query.length > 0) { | 1757 if (query.length > 0) { |
| 1696 for (var part in query.split("&")) { | 1758 for (var part in query.split("&")) { |
| 1697 var keyvalue = part.split("="); | 1759 var keyvalue = part.split("="); |
| 1698 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1760 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1761 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1699 } | 1762 } |
| 1700 } | 1763 } |
| 1701 unittest.expect(queryMap["fingerprint"].first, unittest.equals(arg_finge
rprint)); | 1764 unittest.expect( |
| 1702 | 1765 queryMap["fingerprint"].first, unittest.equals(arg_fingerprint)); |
| 1703 | 1766 |
| 1704 var h = { | 1767 var h = { |
| 1705 "content-type" : "application/json; charset=utf-8", | 1768 "content-type": "application/json; charset=utf-8", |
| 1706 }; | 1769 }; |
| 1707 var resp = convert.JSON.encode(buildOperation()); | 1770 var resp = convert.JSON.encode(buildOperation()); |
| 1708 return new async.Future.value(stringResponse(200, h, resp)); | 1771 return new async.Future.value(stringResponse(200, h, resp)); |
| 1709 }), true); | 1772 }), true); |
| 1710 res.removePublicKey(arg_project, arg_user, arg_fingerprint).then(unittest.
expectAsync1(((api.Operation response) { | 1773 res |
| 1774 .removePublicKey(arg_project, arg_user, arg_fingerprint) |
| 1775 .then(unittest.expectAsync1(((api.Operation response) { |
| 1711 checkOperation(response); | 1776 checkOperation(response); |
| 1712 }))); | 1777 }))); |
| 1713 }); | 1778 }); |
| 1714 | |
| 1715 }); | 1779 }); |
| 1716 | |
| 1717 | |
| 1718 } | 1780 } |
| 1719 | |
| OLD | NEW |