OLD | NEW |
1 // WARNING: DO NOT EDIT. This file was generated by a program. | 1 // WARNING: DO NOT EDIT. This file was generated by a program. |
2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. | 2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. |
3 | 3 |
4 library authentication_admin_mojom; | 4 library authentication_admin_mojom; |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'package:mojo/bindings.dart' as bindings; | 6 import 'package:mojo/bindings.dart' as bindings; |
7 import 'package:mojo/core.dart' as core; | 7 import 'package:mojo/core.dart' as core; |
8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; | 8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
9 | 9 |
10 | 10 |
11 | 11 |
12 class _AuthenticationAdminServiceGetOAuth2DeviceCodeParams extends bindings.Stru
ct { | 12 class _AuthenticationAdminServiceGetOAuth2DeviceCodeParams extends bindings.Stru
ct { |
13 static const List<bindings.StructDataHeader> kVersions = const [ | 13 static const List<bindings.StructDataHeader> kVersions = const [ |
14 const bindings.StructDataHeader(16, 0) | 14 const bindings.StructDataHeader(16, 0) |
15 ]; | 15 ]; |
16 List<String> scopes = null; | 16 List<String> scopes = null; |
17 | 17 |
18 _AuthenticationAdminServiceGetOAuth2DeviceCodeParams() : super(kVersions.last.
size); | 18 _AuthenticationAdminServiceGetOAuth2DeviceCodeParams() : super(kVersions.last.
size); |
19 | 19 |
| 20 _AuthenticationAdminServiceGetOAuth2DeviceCodeParams.init( |
| 21 List<String> this.scopes |
| 22 ) : super(kVersions.last.size); |
| 23 |
20 static _AuthenticationAdminServiceGetOAuth2DeviceCodeParams deserialize(bindin
gs.Message message) { | 24 static _AuthenticationAdminServiceGetOAuth2DeviceCodeParams deserialize(bindin
gs.Message message) { |
21 var decoder = new bindings.Decoder(message); | 25 var decoder = new bindings.Decoder(message); |
22 var result = decode(decoder); | 26 var result = decode(decoder); |
23 if (decoder.excessHandles != null) { | 27 if (decoder.excessHandles != null) { |
24 decoder.excessHandles.forEach((h) => h.close()); | 28 decoder.excessHandles.forEach((h) => h.close()); |
25 } | 29 } |
26 return result; | 30 return result; |
27 } | 31 } |
28 | 32 |
29 static _AuthenticationAdminServiceGetOAuth2DeviceCodeParams decode(bindings.De
coder decoder0) { | 33 static _AuthenticationAdminServiceGetOAuth2DeviceCodeParams decode(bindings.De
coder decoder0) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 static const List<bindings.StructDataHeader> kVersions = const [ | 104 static const List<bindings.StructDataHeader> kVersions = const [ |
101 const bindings.StructDataHeader(40, 0) | 105 const bindings.StructDataHeader(40, 0) |
102 ]; | 106 ]; |
103 String verificationUrl = null; | 107 String verificationUrl = null; |
104 String deviceCode = null; | 108 String deviceCode = null; |
105 String userCode = null; | 109 String userCode = null; |
106 String error = null; | 110 String error = null; |
107 | 111 |
108 AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams() : super(kVersion
s.last.size); | 112 AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams() : super(kVersion
s.last.size); |
109 | 113 |
| 114 AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams.init( |
| 115 String this.verificationUrl, |
| 116 String this.deviceCode, |
| 117 String this.userCode, |
| 118 String this.error |
| 119 ) : super(kVersions.last.size); |
| 120 |
110 static AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams deserialize
(bindings.Message message) { | 121 static AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams deserialize
(bindings.Message message) { |
111 var decoder = new bindings.Decoder(message); | 122 var decoder = new bindings.Decoder(message); |
112 var result = decode(decoder); | 123 var result = decode(decoder); |
113 if (decoder.excessHandles != null) { | 124 if (decoder.excessHandles != null) { |
114 decoder.excessHandles.forEach((h) => h.close()); | 125 decoder.excessHandles.forEach((h) => h.close()); |
115 } | 126 } |
116 return result; | 127 return result; |
117 } | 128 } |
118 | 129 |
119 static AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams decode(bind
ings.Decoder decoder0) { | 130 static AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams decode(bind
ings.Decoder decoder0) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 222 |
212 | 223 |
213 class _AuthenticationAdminServiceAddAccountParams extends bindings.Struct { | 224 class _AuthenticationAdminServiceAddAccountParams extends bindings.Struct { |
214 static const List<bindings.StructDataHeader> kVersions = const [ | 225 static const List<bindings.StructDataHeader> kVersions = const [ |
215 const bindings.StructDataHeader(16, 0) | 226 const bindings.StructDataHeader(16, 0) |
216 ]; | 227 ]; |
217 String deviceCode = null; | 228 String deviceCode = null; |
218 | 229 |
219 _AuthenticationAdminServiceAddAccountParams() : super(kVersions.last.size); | 230 _AuthenticationAdminServiceAddAccountParams() : super(kVersions.last.size); |
220 | 231 |
| 232 _AuthenticationAdminServiceAddAccountParams.init( |
| 233 String this.deviceCode |
| 234 ) : super(kVersions.last.size); |
| 235 |
221 static _AuthenticationAdminServiceAddAccountParams deserialize(bindings.Messag
e message) { | 236 static _AuthenticationAdminServiceAddAccountParams deserialize(bindings.Messag
e message) { |
222 var decoder = new bindings.Decoder(message); | 237 var decoder = new bindings.Decoder(message); |
223 var result = decode(decoder); | 238 var result = decode(decoder); |
224 if (decoder.excessHandles != null) { | 239 if (decoder.excessHandles != null) { |
225 decoder.excessHandles.forEach((h) => h.close()); | 240 decoder.excessHandles.forEach((h) => h.close()); |
226 } | 241 } |
227 return result; | 242 return result; |
228 } | 243 } |
229 | 244 |
230 static _AuthenticationAdminServiceAddAccountParams decode(bindings.Decoder dec
oder0) { | 245 static _AuthenticationAdminServiceAddAccountParams decode(bindings.Decoder dec
oder0) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 299 |
285 class AuthenticationAdminServiceAddAccountResponseParams extends bindings.Struct
{ | 300 class AuthenticationAdminServiceAddAccountResponseParams extends bindings.Struct
{ |
286 static const List<bindings.StructDataHeader> kVersions = const [ | 301 static const List<bindings.StructDataHeader> kVersions = const [ |
287 const bindings.StructDataHeader(24, 0) | 302 const bindings.StructDataHeader(24, 0) |
288 ]; | 303 ]; |
289 String username = null; | 304 String username = null; |
290 String error = null; | 305 String error = null; |
291 | 306 |
292 AuthenticationAdminServiceAddAccountResponseParams() : super(kVersions.last.si
ze); | 307 AuthenticationAdminServiceAddAccountResponseParams() : super(kVersions.last.si
ze); |
293 | 308 |
| 309 AuthenticationAdminServiceAddAccountResponseParams.init( |
| 310 String this.username, |
| 311 String this.error |
| 312 ) : super(kVersions.last.size); |
| 313 |
294 static AuthenticationAdminServiceAddAccountResponseParams deserialize(bindings
.Message message) { | 314 static AuthenticationAdminServiceAddAccountResponseParams deserialize(bindings
.Message message) { |
295 var decoder = new bindings.Decoder(message); | 315 var decoder = new bindings.Decoder(message); |
296 var result = decode(decoder); | 316 var result = decode(decoder); |
297 if (decoder.excessHandles != null) { | 317 if (decoder.excessHandles != null) { |
298 decoder.excessHandles.forEach((h) => h.close()); | 318 decoder.excessHandles.forEach((h) => h.close()); |
299 } | 319 } |
300 return result; | 320 return result; |
301 } | 321 } |
302 | 322 |
303 static AuthenticationAdminServiceAddAccountResponseParams decode(bindings.Deco
der decoder0) { | 323 static AuthenticationAdminServiceAddAccountResponseParams decode(bindings.Deco
der decoder0) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 } | 388 } |
369 | 389 |
370 | 390 |
371 class _AuthenticationAdminServiceGetAllUsersParams extends bindings.Struct { | 391 class _AuthenticationAdminServiceGetAllUsersParams extends bindings.Struct { |
372 static const List<bindings.StructDataHeader> kVersions = const [ | 392 static const List<bindings.StructDataHeader> kVersions = const [ |
373 const bindings.StructDataHeader(8, 0) | 393 const bindings.StructDataHeader(8, 0) |
374 ]; | 394 ]; |
375 | 395 |
376 _AuthenticationAdminServiceGetAllUsersParams() : super(kVersions.last.size); | 396 _AuthenticationAdminServiceGetAllUsersParams() : super(kVersions.last.size); |
377 | 397 |
| 398 _AuthenticationAdminServiceGetAllUsersParams.init( |
| 399 ) : super(kVersions.last.size); |
| 400 |
378 static _AuthenticationAdminServiceGetAllUsersParams deserialize(bindings.Messa
ge message) { | 401 static _AuthenticationAdminServiceGetAllUsersParams deserialize(bindings.Messa
ge message) { |
379 var decoder = new bindings.Decoder(message); | 402 var decoder = new bindings.Decoder(message); |
380 var result = decode(decoder); | 403 var result = decode(decoder); |
381 if (decoder.excessHandles != null) { | 404 if (decoder.excessHandles != null) { |
382 decoder.excessHandles.forEach((h) => h.close()); | 405 decoder.excessHandles.forEach((h) => h.close()); |
383 } | 406 } |
384 return result; | 407 return result; |
385 } | 408 } |
386 | 409 |
387 static _AuthenticationAdminServiceGetAllUsersParams decode(bindings.Decoder de
coder0) { | 410 static _AuthenticationAdminServiceGetAllUsersParams decode(bindings.Decoder de
coder0) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 451 |
429 class AuthenticationAdminServiceGetAllUsersResponseParams extends bindings.Struc
t { | 452 class AuthenticationAdminServiceGetAllUsersResponseParams extends bindings.Struc
t { |
430 static const List<bindings.StructDataHeader> kVersions = const [ | 453 static const List<bindings.StructDataHeader> kVersions = const [ |
431 const bindings.StructDataHeader(24, 0) | 454 const bindings.StructDataHeader(24, 0) |
432 ]; | 455 ]; |
433 List<String> usernames = null; | 456 List<String> usernames = null; |
434 String error = null; | 457 String error = null; |
435 | 458 |
436 AuthenticationAdminServiceGetAllUsersResponseParams() : super(kVersions.last.s
ize); | 459 AuthenticationAdminServiceGetAllUsersResponseParams() : super(kVersions.last.s
ize); |
437 | 460 |
| 461 AuthenticationAdminServiceGetAllUsersResponseParams.init( |
| 462 List<String> this.usernames, |
| 463 String this.error |
| 464 ) : super(kVersions.last.size); |
| 465 |
438 static AuthenticationAdminServiceGetAllUsersResponseParams deserialize(binding
s.Message message) { | 466 static AuthenticationAdminServiceGetAllUsersResponseParams deserialize(binding
s.Message message) { |
439 var decoder = new bindings.Decoder(message); | 467 var decoder = new bindings.Decoder(message); |
440 var result = decode(decoder); | 468 var result = decode(decoder); |
441 if (decoder.excessHandles != null) { | 469 if (decoder.excessHandles != null) { |
442 decoder.excessHandles.forEach((h) => h.close()); | 470 decoder.excessHandles.forEach((h) => h.close()); |
443 } | 471 } |
444 return result; | 472 return result; |
445 } | 473 } |
446 | 474 |
447 static AuthenticationAdminServiceGetAllUsersResponseParams decode(bindings.Dec
oder decoder0) { | 475 static AuthenticationAdminServiceGetAllUsersResponseParams decode(bindings.Dec
oder decoder0) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 map["error"] = error; | 552 map["error"] = error; |
525 return map; | 553 return map; |
526 } | 554 } |
527 } | 555 } |
528 | 556 |
529 const int _authenticationAdminServiceMethodGetOAuth2DeviceCodeName = 0; | 557 const int _authenticationAdminServiceMethodGetOAuth2DeviceCodeName = 0; |
530 const int _authenticationAdminServiceMethodAddAccountName = 1; | 558 const int _authenticationAdminServiceMethodAddAccountName = 1; |
531 const int _authenticationAdminServiceMethodGetAllUsersName = 2; | 559 const int _authenticationAdminServiceMethodGetAllUsersName = 2; |
532 | 560 |
533 class _AuthenticationAdminServiceServiceDescription implements service_describer
.ServiceDescription { | 561 class _AuthenticationAdminServiceServiceDescription implements service_describer
.ServiceDescription { |
534 dynamic getTopLevelInterface([Function responseFactory]) => | 562 void getTopLevelInterface(Function responder) { |
535 responseFactory(null); | 563 responder(null); |
| 564 } |
536 | 565 |
537 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 566 void getTypeDefinition(String typeKey, Function responder) { |
538 responseFactory(null); | 567 responder(null); |
| 568 } |
539 | 569 |
540 dynamic getAllTypeDefinitions([Function responseFactory]) => | 570 void getAllTypeDefinitions(Function responder) { |
541 responseFactory(null); | 571 responder(null); |
| 572 } |
542 } | 573 } |
543 | 574 |
544 abstract class AuthenticationAdminService { | 575 abstract class AuthenticationAdminService { |
545 static const String serviceName = "authentication::AuthenticationAdminService"
; | 576 static const String serviceName = "authentication::AuthenticationAdminService"
; |
546 | 577 |
547 static service_describer.ServiceDescription _cachedServiceDescription; | 578 static service_describer.ServiceDescription _cachedServiceDescription; |
548 static service_describer.ServiceDescription get serviceDescription { | 579 static service_describer.ServiceDescription get serviceDescription { |
549 if (_cachedServiceDescription == null) { | 580 if (_cachedServiceDescription == null) { |
550 _cachedServiceDescription = new _AuthenticationAdminServiceServiceDescript
ion(); | 581 _cachedServiceDescription = new _AuthenticationAdminServiceServiceDescript
ion(); |
551 } | 582 } |
552 return _cachedServiceDescription; | 583 return _cachedServiceDescription; |
553 } | 584 } |
554 | 585 |
555 static AuthenticationAdminServiceProxy connectToService( | 586 static AuthenticationAdminServiceProxy connectToService( |
556 bindings.ServiceConnector s, String url, [String serviceName]) { | 587 bindings.ServiceConnector s, String url, [String serviceName]) { |
557 AuthenticationAdminServiceProxy p = new AuthenticationAdminServiceProxy.unbo
und(); | 588 AuthenticationAdminServiceProxy p = new AuthenticationAdminServiceProxy.unbo
und(); |
558 String name = serviceName ?? AuthenticationAdminService.serviceName; | 589 String name = serviceName ?? AuthenticationAdminService.serviceName; |
559 if ((name == null) || name.isEmpty) { | 590 if ((name == null) || name.isEmpty) { |
560 throw new core.MojoApiError( | 591 throw new core.MojoApiError( |
561 "If an interface has no ServiceName, then one must be provided."); | 592 "If an interface has no ServiceName, then one must be provided."); |
562 } | 593 } |
563 s.connectToService(url, p, name); | 594 s.connectToService(url, p, name); |
564 return p; | 595 return p; |
565 } | 596 } |
566 dynamic getOAuth2DeviceCode(List<String> scopes,[Function responseFactory = nu
ll]); | 597 void getOAuth2DeviceCode(List<String> scopes,void callback(String verification
Url, String deviceCode, String userCode, String error)); |
567 dynamic addAccount(String deviceCode,[Function responseFactory = null]); | 598 void addAccount(String deviceCode,void callback(String username, String error)
); |
568 dynamic getAllUsers([Function responseFactory = null]); | 599 void getAllUsers(void callback(List<String> usernames, String error)); |
569 } | 600 } |
570 | 601 |
571 abstract class AuthenticationAdminServiceInterface | 602 abstract class AuthenticationAdminServiceInterface |
572 implements bindings.MojoInterface<AuthenticationAdminService>, | 603 implements bindings.MojoInterface<AuthenticationAdminService>, |
573 AuthenticationAdminService { | 604 AuthenticationAdminService { |
574 factory AuthenticationAdminServiceInterface([AuthenticationAdminService impl])
=> | 605 factory AuthenticationAdminServiceInterface([AuthenticationAdminService impl])
=> |
575 new AuthenticationAdminServiceStub.unbound(impl); | 606 new AuthenticationAdminServiceStub.unbound(impl); |
576 | 607 |
577 factory AuthenticationAdminServiceInterface.fromEndpoint( | 608 factory AuthenticationAdminServiceInterface.fromEndpoint( |
578 core.MojoMessagePipeEndpoint endpoint, | 609 core.MojoMessagePipeEndpoint endpoint, |
(...skipping 29 matching lines...) Expand all Loading... |
608 | 639 |
609 void handleResponse(bindings.ServiceMessage message) { | 640 void handleResponse(bindings.ServiceMessage message) { |
610 switch (message.header.type) { | 641 switch (message.header.type) { |
611 case _authenticationAdminServiceMethodGetOAuth2DeviceCodeName: | 642 case _authenticationAdminServiceMethodGetOAuth2DeviceCodeName: |
612 var r = AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams.dese
rialize( | 643 var r = AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams.dese
rialize( |
613 message.payload); | 644 message.payload); |
614 if (!message.header.hasRequestId) { | 645 if (!message.header.hasRequestId) { |
615 proxyError("Expected a message with a valid request Id."); | 646 proxyError("Expected a message with a valid request Id."); |
616 return; | 647 return; |
617 } | 648 } |
618 Completer c = completerMap[message.header.requestId]; | 649 Function callback = callbackMap[message.header.requestId]; |
619 if (c == null) { | 650 if (callback == null) { |
620 proxyError( | 651 proxyError( |
621 "Message had unknown request Id: ${message.header.requestId}"); | 652 "Message had unknown request Id: ${message.header.requestId}"); |
622 return; | 653 return; |
623 } | 654 } |
624 completerMap.remove(message.header.requestId); | 655 callbackMap.remove(message.header.requestId); |
625 if (c.isCompleted) { | 656 callback(r.verificationUrl , r.deviceCode , r.userCode , r.error ); |
626 proxyError("Response completer already completed"); | |
627 return; | |
628 } | |
629 c.complete(r); | |
630 break; | 657 break; |
631 case _authenticationAdminServiceMethodAddAccountName: | 658 case _authenticationAdminServiceMethodAddAccountName: |
632 var r = AuthenticationAdminServiceAddAccountResponseParams.deserialize( | 659 var r = AuthenticationAdminServiceAddAccountResponseParams.deserialize( |
633 message.payload); | 660 message.payload); |
634 if (!message.header.hasRequestId) { | 661 if (!message.header.hasRequestId) { |
635 proxyError("Expected a message with a valid request Id."); | 662 proxyError("Expected a message with a valid request Id."); |
636 return; | 663 return; |
637 } | 664 } |
638 Completer c = completerMap[message.header.requestId]; | 665 Function callback = callbackMap[message.header.requestId]; |
639 if (c == null) { | 666 if (callback == null) { |
640 proxyError( | 667 proxyError( |
641 "Message had unknown request Id: ${message.header.requestId}"); | 668 "Message had unknown request Id: ${message.header.requestId}"); |
642 return; | 669 return; |
643 } | 670 } |
644 completerMap.remove(message.header.requestId); | 671 callbackMap.remove(message.header.requestId); |
645 if (c.isCompleted) { | 672 callback(r.username , r.error ); |
646 proxyError("Response completer already completed"); | |
647 return; | |
648 } | |
649 c.complete(r); | |
650 break; | 673 break; |
651 case _authenticationAdminServiceMethodGetAllUsersName: | 674 case _authenticationAdminServiceMethodGetAllUsersName: |
652 var r = AuthenticationAdminServiceGetAllUsersResponseParams.deserialize( | 675 var r = AuthenticationAdminServiceGetAllUsersResponseParams.deserialize( |
653 message.payload); | 676 message.payload); |
654 if (!message.header.hasRequestId) { | 677 if (!message.header.hasRequestId) { |
655 proxyError("Expected a message with a valid request Id."); | 678 proxyError("Expected a message with a valid request Id."); |
656 return; | 679 return; |
657 } | 680 } |
658 Completer c = completerMap[message.header.requestId]; | 681 Function callback = callbackMap[message.header.requestId]; |
659 if (c == null) { | 682 if (callback == null) { |
660 proxyError( | 683 proxyError( |
661 "Message had unknown request Id: ${message.header.requestId}"); | 684 "Message had unknown request Id: ${message.header.requestId}"); |
662 return; | 685 return; |
663 } | 686 } |
664 completerMap.remove(message.header.requestId); | 687 callbackMap.remove(message.header.requestId); |
665 if (c.isCompleted) { | 688 callback(r.usernames , r.error ); |
666 proxyError("Response completer already completed"); | |
667 return; | |
668 } | |
669 c.complete(r); | |
670 break; | 689 break; |
671 default: | 690 default: |
672 proxyError("Unexpected message type: ${message.header.type}"); | 691 proxyError("Unexpected message type: ${message.header.type}"); |
673 close(immediate: true); | 692 close(immediate: true); |
674 break; | 693 break; |
675 } | 694 } |
676 } | 695 } |
677 | 696 |
678 @override | 697 @override |
679 String toString() { | 698 String toString() { |
(...skipping 24 matching lines...) Expand all Loading... |
704 return newMockedProxy; | 723 return newMockedProxy; |
705 } | 724 } |
706 | 725 |
707 static AuthenticationAdminServiceProxy newFromEndpoint( | 726 static AuthenticationAdminServiceProxy newFromEndpoint( |
708 core.MojoMessagePipeEndpoint endpoint) { | 727 core.MojoMessagePipeEndpoint endpoint) { |
709 assert(endpoint.setDescription("For AuthenticationAdminServiceProxy")); | 728 assert(endpoint.setDescription("For AuthenticationAdminServiceProxy")); |
710 return new AuthenticationAdminServiceProxy.fromEndpoint(endpoint); | 729 return new AuthenticationAdminServiceProxy.fromEndpoint(endpoint); |
711 } | 730 } |
712 | 731 |
713 | 732 |
714 dynamic getOAuth2DeviceCode(List<String> scopes,[Function responseFactory = nu
ll]) { | 733 void getOAuth2DeviceCode(List<String> scopes,void callback(String verification
Url, String deviceCode, String userCode, String error)) { |
715 if (impl != null) { | 734 if (impl != null) { |
716 return new Future(() => impl.getOAuth2DeviceCode(scopes,_AuthenticationAdm
inServiceStubControl._authenticationAdminServiceGetOAuth2DeviceCodeResponseParam
sFactory)); | 735 impl.getOAuth2DeviceCode(scopes,callback); |
| 736 return; |
717 } | 737 } |
718 var params = new _AuthenticationAdminServiceGetOAuth2DeviceCodeParams(); | 738 var params = new _AuthenticationAdminServiceGetOAuth2DeviceCodeParams(); |
719 params.scopes = scopes; | 739 params.scopes = scopes; |
720 return ctrl.sendMessageWithRequestId( | 740 ctrl.sendMessageWithRequestId( |
721 params, | 741 params, |
722 _authenticationAdminServiceMethodGetOAuth2DeviceCodeName, | 742 _authenticationAdminServiceMethodGetOAuth2DeviceCodeName, |
723 -1, | 743 -1, |
724 bindings.MessageHeader.kMessageExpectsResponse); | 744 bindings.MessageHeader.kMessageExpectsResponse, |
| 745 callback); |
725 } | 746 } |
726 dynamic addAccount(String deviceCode,[Function responseFactory = null]) { | 747 void addAccount(String deviceCode,void callback(String username, String error)
) { |
727 if (impl != null) { | 748 if (impl != null) { |
728 return new Future(() => impl.addAccount(deviceCode,_AuthenticationAdminSer
viceStubControl._authenticationAdminServiceAddAccountResponseParamsFactory)); | 749 impl.addAccount(deviceCode,callback); |
| 750 return; |
729 } | 751 } |
730 var params = new _AuthenticationAdminServiceAddAccountParams(); | 752 var params = new _AuthenticationAdminServiceAddAccountParams(); |
731 params.deviceCode = deviceCode; | 753 params.deviceCode = deviceCode; |
732 return ctrl.sendMessageWithRequestId( | 754 ctrl.sendMessageWithRequestId( |
733 params, | 755 params, |
734 _authenticationAdminServiceMethodAddAccountName, | 756 _authenticationAdminServiceMethodAddAccountName, |
735 -1, | 757 -1, |
736 bindings.MessageHeader.kMessageExpectsResponse); | 758 bindings.MessageHeader.kMessageExpectsResponse, |
| 759 callback); |
737 } | 760 } |
738 dynamic getAllUsers([Function responseFactory = null]) { | 761 void getAllUsers(void callback(List<String> usernames, String error)) { |
739 if (impl != null) { | 762 if (impl != null) { |
740 return new Future(() => impl.getAllUsers(_AuthenticationAdminServiceStubCo
ntrol._authenticationAdminServiceGetAllUsersResponseParamsFactory)); | 763 impl.getAllUsers(callback); |
| 764 return; |
741 } | 765 } |
742 var params = new _AuthenticationAdminServiceGetAllUsersParams(); | 766 var params = new _AuthenticationAdminServiceGetAllUsersParams(); |
743 return ctrl.sendMessageWithRequestId( | 767 ctrl.sendMessageWithRequestId( |
744 params, | 768 params, |
745 _authenticationAdminServiceMethodGetAllUsersName, | 769 _authenticationAdminServiceMethodGetAllUsersName, |
746 -1, | 770 -1, |
747 bindings.MessageHeader.kMessageExpectsResponse); | 771 bindings.MessageHeader.kMessageExpectsResponse, |
| 772 callback); |
748 } | 773 } |
749 } | 774 } |
750 | 775 |
751 class _AuthenticationAdminServiceStubControl | 776 class _AuthenticationAdminServiceStubControl |
752 extends bindings.StubMessageHandler | 777 extends bindings.StubMessageHandler |
753 implements bindings.StubControl<AuthenticationAdminService> { | 778 implements bindings.StubControl<AuthenticationAdminService> { |
754 AuthenticationAdminService _impl; | 779 AuthenticationAdminService _impl; |
755 | 780 |
756 _AuthenticationAdminServiceStubControl.fromEndpoint( | 781 _AuthenticationAdminServiceStubControl.fromEndpoint( |
757 core.MojoMessagePipeEndpoint endpoint, [AuthenticationAdminService impl]) | 782 core.MojoMessagePipeEndpoint endpoint, [AuthenticationAdminService impl]) |
758 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 783 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
759 _impl = impl; | 784 _impl = impl; |
760 } | 785 } |
761 | 786 |
762 _AuthenticationAdminServiceStubControl.fromHandle( | 787 _AuthenticationAdminServiceStubControl.fromHandle( |
763 core.MojoHandle handle, [AuthenticationAdminService impl]) | 788 core.MojoHandle handle, [AuthenticationAdminService impl]) |
764 : super.fromHandle(handle, autoBegin: impl != null) { | 789 : super.fromHandle(handle, autoBegin: impl != null) { |
765 _impl = impl; | 790 _impl = impl; |
766 } | 791 } |
767 | 792 |
768 _AuthenticationAdminServiceStubControl.unbound([this._impl]) : super.unbound()
; | 793 _AuthenticationAdminServiceStubControl.unbound([this._impl]) : super.unbound()
; |
769 | 794 |
770 String get serviceName => AuthenticationAdminService.serviceName; | 795 String get serviceName => AuthenticationAdminService.serviceName; |
771 | 796 |
772 | 797 |
773 static AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams _authentica
tionAdminServiceGetOAuth2DeviceCodeResponseParamsFactory(String verificationUrl,
String deviceCode, String userCode, String error) { | 798 Function _authenticationAdminServiceGetOAuth2DeviceCodeResponseParamsResponder
( |
774 var result = new AuthenticationAdminServiceGetOAuth2DeviceCodeResponseParams
(); | 799 int requestId) { |
775 result.verificationUrl = verificationUrl; | 800 return (String verificationUrl, String deviceCode, String userCode, String err
or) { |
776 result.deviceCode = deviceCode; | 801 var result = new AuthenticationAdminServiceGetOAuth2DeviceCodeResponsePara
ms(); |
777 result.userCode = userCode; | 802 result.verificationUrl = verificationUrl; |
778 result.error = error; | 803 result.deviceCode = deviceCode; |
779 return result; | 804 result.userCode = userCode; |
| 805 result.error = error; |
| 806 sendResponse(buildResponseWithId( |
| 807 result, |
| 808 _authenticationAdminServiceMethodGetOAuth2DeviceCodeName, |
| 809 requestId, |
| 810 bindings.MessageHeader.kMessageIsResponse)); |
| 811 }; |
780 } | 812 } |
781 static AuthenticationAdminServiceAddAccountResponseParams _authenticationAdmin
ServiceAddAccountResponseParamsFactory(String username, String error) { | 813 Function _authenticationAdminServiceAddAccountResponseParamsResponder( |
782 var result = new AuthenticationAdminServiceAddAccountResponseParams(); | 814 int requestId) { |
783 result.username = username; | 815 return (String username, String error) { |
784 result.error = error; | 816 var result = new AuthenticationAdminServiceAddAccountResponseParams(); |
785 return result; | 817 result.username = username; |
| 818 result.error = error; |
| 819 sendResponse(buildResponseWithId( |
| 820 result, |
| 821 _authenticationAdminServiceMethodAddAccountName, |
| 822 requestId, |
| 823 bindings.MessageHeader.kMessageIsResponse)); |
| 824 }; |
786 } | 825 } |
787 static AuthenticationAdminServiceGetAllUsersResponseParams _authenticationAdmi
nServiceGetAllUsersResponseParamsFactory(List<String> usernames, String error) { | 826 Function _authenticationAdminServiceGetAllUsersResponseParamsResponder( |
788 var result = new AuthenticationAdminServiceGetAllUsersResponseParams(); | 827 int requestId) { |
789 result.usernames = usernames; | 828 return (List<String> usernames, String error) { |
790 result.error = error; | 829 var result = new AuthenticationAdminServiceGetAllUsersResponseParams(); |
791 return result; | 830 result.usernames = usernames; |
| 831 result.error = error; |
| 832 sendResponse(buildResponseWithId( |
| 833 result, |
| 834 _authenticationAdminServiceMethodGetAllUsersName, |
| 835 requestId, |
| 836 bindings.MessageHeader.kMessageIsResponse)); |
| 837 }; |
792 } | 838 } |
793 | 839 |
794 dynamic handleMessage(bindings.ServiceMessage message) { | 840 void handleMessage(bindings.ServiceMessage message) { |
795 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 841 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
796 return bindings.ControlMessageHandler.handleMessage(this, | 842 bindings.ControlMessageHandler.handleMessage( |
797 0, | 843 this, 0, message); |
798 message); | 844 return; |
799 } | 845 } |
800 if (_impl == null) { | 846 if (_impl == null) { |
801 throw new core.MojoApiError("$this has no implementation set"); | 847 throw new core.MojoApiError("$this has no implementation set"); |
802 } | 848 } |
803 switch (message.header.type) { | 849 switch (message.header.type) { |
804 case _authenticationAdminServiceMethodGetOAuth2DeviceCodeName: | 850 case _authenticationAdminServiceMethodGetOAuth2DeviceCodeName: |
805 var params = _AuthenticationAdminServiceGetOAuth2DeviceCodeParams.deseri
alize( | 851 var params = _AuthenticationAdminServiceGetOAuth2DeviceCodeParams.deseri
alize( |
806 message.payload); | 852 message.payload); |
807 var response = _impl.getOAuth2DeviceCode(params.scopes,_authenticationAd
minServiceGetOAuth2DeviceCodeResponseParamsFactory); | 853 _impl.getOAuth2DeviceCode(params.scopes, _authenticationAdminServiceGetO
Auth2DeviceCodeResponseParamsResponder(message.header.requestId)); |
808 if (response is Future) { | |
809 return response.then((response) { | |
810 if (response != null) { | |
811 return buildResponseWithId( | |
812 response, | |
813 _authenticationAdminServiceMethodGetOAuth2DeviceCodeName, | |
814 message.header.requestId, | |
815 bindings.MessageHeader.kMessageIsResponse); | |
816 } | |
817 }); | |
818 } else if (response != null) { | |
819 return buildResponseWithId( | |
820 response, | |
821 _authenticationAdminServiceMethodGetOAuth2DeviceCodeName, | |
822 message.header.requestId, | |
823 bindings.MessageHeader.kMessageIsResponse); | |
824 } | |
825 break; | 854 break; |
826 case _authenticationAdminServiceMethodAddAccountName: | 855 case _authenticationAdminServiceMethodAddAccountName: |
827 var params = _AuthenticationAdminServiceAddAccountParams.deserialize( | 856 var params = _AuthenticationAdminServiceAddAccountParams.deserialize( |
828 message.payload); | 857 message.payload); |
829 var response = _impl.addAccount(params.deviceCode,_authenticationAdminSe
rviceAddAccountResponseParamsFactory); | 858 _impl.addAccount(params.deviceCode, _authenticationAdminServiceAddAccoun
tResponseParamsResponder(message.header.requestId)); |
830 if (response is Future) { | |
831 return response.then((response) { | |
832 if (response != null) { | |
833 return buildResponseWithId( | |
834 response, | |
835 _authenticationAdminServiceMethodAddAccountName, | |
836 message.header.requestId, | |
837 bindings.MessageHeader.kMessageIsResponse); | |
838 } | |
839 }); | |
840 } else if (response != null) { | |
841 return buildResponseWithId( | |
842 response, | |
843 _authenticationAdminServiceMethodAddAccountName, | |
844 message.header.requestId, | |
845 bindings.MessageHeader.kMessageIsResponse); | |
846 } | |
847 break; | 859 break; |
848 case _authenticationAdminServiceMethodGetAllUsersName: | 860 case _authenticationAdminServiceMethodGetAllUsersName: |
849 var response = _impl.getAllUsers(_authenticationAdminServiceGetAllUsersR
esponseParamsFactory); | 861 _impl.getAllUsers(_authenticationAdminServiceGetAllUsersResponseParamsRe
sponder(message.header.requestId)); |
850 if (response is Future) { | |
851 return response.then((response) { | |
852 if (response != null) { | |
853 return buildResponseWithId( | |
854 response, | |
855 _authenticationAdminServiceMethodGetAllUsersName, | |
856 message.header.requestId, | |
857 bindings.MessageHeader.kMessageIsResponse); | |
858 } | |
859 }); | |
860 } else if (response != null) { | |
861 return buildResponseWithId( | |
862 response, | |
863 _authenticationAdminServiceMethodGetAllUsersName, | |
864 message.header.requestId, | |
865 bindings.MessageHeader.kMessageIsResponse); | |
866 } | |
867 break; | 862 break; |
868 default: | 863 default: |
869 throw new bindings.MojoCodecError("Unexpected message name"); | 864 throw new bindings.MojoCodecError("Unexpected message name"); |
870 break; | 865 break; |
871 } | 866 } |
872 return null; | |
873 } | 867 } |
874 | 868 |
875 AuthenticationAdminService get impl => _impl; | 869 AuthenticationAdminService get impl => _impl; |
876 set impl(AuthenticationAdminService d) { | 870 set impl(AuthenticationAdminService d) { |
877 if (d == null) { | 871 if (d == null) { |
878 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 872 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
879 } | 873 } |
880 if (isBound && (_impl == null)) { | 874 if (isBound && (_impl == null)) { |
881 beginHandlingEvents(); | 875 beginHandlingEvents(); |
882 } | 876 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 core.MojoHandle handle, [AuthenticationAdminService impl]) | 910 core.MojoHandle handle, [AuthenticationAdminService impl]) |
917 : super(new _AuthenticationAdminServiceStubControl.fromHandle(handle, impl
)); | 911 : super(new _AuthenticationAdminServiceStubControl.fromHandle(handle, impl
)); |
918 | 912 |
919 static AuthenticationAdminServiceStub newFromEndpoint( | 913 static AuthenticationAdminServiceStub newFromEndpoint( |
920 core.MojoMessagePipeEndpoint endpoint) { | 914 core.MojoMessagePipeEndpoint endpoint) { |
921 assert(endpoint.setDescription("For AuthenticationAdminServiceStub")); | 915 assert(endpoint.setDescription("For AuthenticationAdminServiceStub")); |
922 return new AuthenticationAdminServiceStub.fromEndpoint(endpoint); | 916 return new AuthenticationAdminServiceStub.fromEndpoint(endpoint); |
923 } | 917 } |
924 | 918 |
925 | 919 |
926 dynamic getOAuth2DeviceCode(List<String> scopes,[Function responseFactory = nu
ll]) { | 920 void getOAuth2DeviceCode(List<String> scopes,void callback(String verification
Url, String deviceCode, String userCode, String error)) { |
927 return impl.getOAuth2DeviceCode(scopes,responseFactory); | 921 return impl.getOAuth2DeviceCode(scopes,callback); |
928 } | 922 } |
929 dynamic addAccount(String deviceCode,[Function responseFactory = null]) { | 923 void addAccount(String deviceCode,void callback(String username, String error)
) { |
930 return impl.addAccount(deviceCode,responseFactory); | 924 return impl.addAccount(deviceCode,callback); |
931 } | 925 } |
932 dynamic getAllUsers([Function responseFactory = null]) { | 926 void getAllUsers(void callback(List<String> usernames, String error)) { |
933 return impl.getAllUsers(responseFactory); | 927 return impl.getAllUsers(callback); |
934 } | 928 } |
935 } | 929 } |
936 | 930 |
937 | 931 |
938 | 932 |
OLD | NEW |