| Index: mojo/dart/packages/mojo_services/lib/authentication/authentication.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/authentication/authentication.mojom.dart b/mojo/dart/packages/mojo_services/lib/authentication/authentication.mojom.dart
|
| index babd02f386d9d72c6b98890d144cbb0d7d312108..9ef8e0ec1737e2f2df0870cca33032e4029f11fd 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/authentication/authentication.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/authentication/authentication.mojom.dart
|
| @@ -3,12 +3,12 @@
|
| // found in the LICENSE file.
|
|
|
| library authentication_mojom;
|
| +
|
| import 'dart:async';
|
| import 'package:mojo/bindings.dart' as bindings;
|
| import 'package:mojo/core.dart' as core;
|
| -import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as service_describer;
|
| -
|
| -
|
| +import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart'
|
| + as service_describer;
|
|
|
| class _AuthenticationServiceSelectAccountParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| @@ -18,7 +18,8 @@ class _AuthenticationServiceSelectAccountParams extends bindings.Struct {
|
|
|
| _AuthenticationServiceSelectAccountParams() : super(kVersions.last.size);
|
|
|
| - static _AuthenticationServiceSelectAccountParams deserialize(bindings.Message message) {
|
| + static _AuthenticationServiceSelectAccountParams deserialize(
|
| + bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -27,11 +28,13 @@ class _AuthenticationServiceSelectAccountParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _AuthenticationServiceSelectAccountParams decode(bindings.Decoder decoder0) {
|
| + static _AuthenticationServiceSelectAccountParams decode(
|
| + bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _AuthenticationServiceSelectAccountParams result = new _AuthenticationServiceSelectAccountParams();
|
| + _AuthenticationServiceSelectAccountParams result =
|
| + new _AuthenticationServiceSelectAccountParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -48,11 +51,10 @@ class _AuthenticationServiceSelectAccountParams extends bindings.Struct {
|
| }
|
| } else if (mainDataHeader.size < kVersions.last.size) {
|
| throw new bindings.MojoCodecError(
|
| - 'Message newer than the last known version cannot be shorter than '
|
| - 'required by the last known version.');
|
| + 'Message newer than the last known version cannot be shorter than '
|
| + 'required by the last known version.');
|
| }
|
| if (mainDataHeader.version >= 0) {
|
| -
|
| result.returnLastSelected = decoder0.decodeBool(8, 0);
|
| }
|
| return result;
|
| @@ -62,7 +64,7 @@ class _AuthenticationServiceSelectAccountParams extends bindings.Struct {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| try {
|
| encoder0.encodeBool(returnLastSelected, 8, 0);
|
| - } on bindings.MojoCodecError catch(e) {
|
| + } on bindings.MojoCodecError catch (e) {
|
| e.message = "Error encountered while encoding field "
|
| "returnLastSelected of struct _AuthenticationServiceSelectAccountParams: $e";
|
| rethrow;
|
| @@ -71,7 +73,8 @@ class _AuthenticationServiceSelectAccountParams extends bindings.Struct {
|
|
|
| String toString() {
|
| return "_AuthenticationServiceSelectAccountParams("
|
| - "returnLastSelected: $returnLastSelected" ")";
|
| + "returnLastSelected: $returnLastSelected"
|
| + ")";
|
| }
|
|
|
| Map toJson() {
|
| @@ -81,7 +84,6 @@ class _AuthenticationServiceSelectAccountParams extends bindings.Struct {
|
| }
|
| }
|
|
|
| -
|
| class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(24, 0)
|
| @@ -89,9 +91,11 @@ class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct {
|
| String username = null;
|
| String error = null;
|
|
|
| - AuthenticationServiceSelectAccountResponseParams() : super(kVersions.last.size);
|
| + AuthenticationServiceSelectAccountResponseParams()
|
| + : super(kVersions.last.size);
|
|
|
| - static AuthenticationServiceSelectAccountResponseParams deserialize(bindings.Message message) {
|
| + static AuthenticationServiceSelectAccountResponseParams deserialize(
|
| + bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -100,11 +104,13 @@ class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static AuthenticationServiceSelectAccountResponseParams decode(bindings.Decoder decoder0) {
|
| + static AuthenticationServiceSelectAccountResponseParams decode(
|
| + bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - AuthenticationServiceSelectAccountResponseParams result = new AuthenticationServiceSelectAccountResponseParams();
|
| + AuthenticationServiceSelectAccountResponseParams result =
|
| + new AuthenticationServiceSelectAccountResponseParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -121,15 +127,13 @@ class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct {
|
| }
|
| } else if (mainDataHeader.size < kVersions.last.size) {
|
| throw new bindings.MojoCodecError(
|
| - 'Message newer than the last known version cannot be shorter than '
|
| - 'required by the last known version.');
|
| + 'Message newer than the last known version cannot be shorter than '
|
| + 'required by the last known version.');
|
| }
|
| if (mainDataHeader.version >= 0) {
|
| -
|
| result.username = decoder0.decodeString(8, true);
|
| }
|
| if (mainDataHeader.version >= 0) {
|
| -
|
| result.error = decoder0.decodeString(16, true);
|
| }
|
| return result;
|
| @@ -139,14 +143,14 @@ class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| try {
|
| encoder0.encodeString(username, 8, true);
|
| - } on bindings.MojoCodecError catch(e) {
|
| + } on bindings.MojoCodecError catch (e) {
|
| e.message = "Error encountered while encoding field "
|
| "username of struct AuthenticationServiceSelectAccountResponseParams: $e";
|
| rethrow;
|
| }
|
| try {
|
| encoder0.encodeString(error, 16, true);
|
| - } on bindings.MojoCodecError catch(e) {
|
| + } on bindings.MojoCodecError catch (e) {
|
| e.message = "Error encountered while encoding field "
|
| "error of struct AuthenticationServiceSelectAccountResponseParams: $e";
|
| rethrow;
|
| @@ -155,8 +159,10 @@ class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct {
|
|
|
| String toString() {
|
| return "AuthenticationServiceSelectAccountResponseParams("
|
| - "username: $username" ", "
|
| - "error: $error" ")";
|
| + "username: $username"
|
| + ", "
|
| + "error: $error"
|
| + ")";
|
| }
|
|
|
| Map toJson() {
|
| @@ -167,7 +173,6 @@ class AuthenticationServiceSelectAccountResponseParams extends bindings.Struct {
|
| }
|
| }
|
|
|
| -
|
| class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(24, 0)
|
| @@ -177,7 +182,8 @@ class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct {
|
|
|
| _AuthenticationServiceGetOAuth2TokenParams() : super(kVersions.last.size);
|
|
|
| - static _AuthenticationServiceGetOAuth2TokenParams deserialize(bindings.Message message) {
|
| + static _AuthenticationServiceGetOAuth2TokenParams deserialize(
|
| + bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -186,11 +192,13 @@ class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _AuthenticationServiceGetOAuth2TokenParams decode(bindings.Decoder decoder0) {
|
| + static _AuthenticationServiceGetOAuth2TokenParams decode(
|
| + bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _AuthenticationServiceGetOAuth2TokenParams result = new _AuthenticationServiceGetOAuth2TokenParams();
|
| + _AuthenticationServiceGetOAuth2TokenParams result =
|
| + new _AuthenticationServiceGetOAuth2TokenParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -207,22 +215,22 @@ class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct {
|
| }
|
| } else if (mainDataHeader.size < kVersions.last.size) {
|
| throw new bindings.MojoCodecError(
|
| - 'Message newer than the last known version cannot be shorter than '
|
| - 'required by the last known version.');
|
| + 'Message newer than the last known version cannot be shorter than '
|
| + 'required by the last known version.');
|
| }
|
| if (mainDataHeader.version >= 0) {
|
| -
|
| result.username = decoder0.decodeString(8, false);
|
| }
|
| if (mainDataHeader.version >= 0) {
|
| -
|
| var decoder1 = decoder0.decodePointer(16, false);
|
| {
|
| - var si1 = decoder1.decodeDataHeaderForPointerArray(bindings.kUnspecifiedArrayLength);
|
| + var si1 = decoder1
|
| + .decodeDataHeaderForPointerArray(bindings.kUnspecifiedArrayLength);
|
| result.scopes = new List<String>(si1.numElements);
|
| for (int i1 = 0; i1 < si1.numElements; ++i1) {
|
| -
|
| - result.scopes[i1] = decoder1.decodeString(bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i1, false);
|
| + result.scopes[i1] = decoder1.decodeString(
|
| + bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i1,
|
| + false);
|
| }
|
| }
|
| }
|
| @@ -233,7 +241,7 @@ class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| try {
|
| encoder0.encodeString(username, 8, false);
|
| - } on bindings.MojoCodecError catch(e) {
|
| + } on bindings.MojoCodecError catch (e) {
|
| e.message = "Error encountered while encoding field "
|
| "username of struct _AuthenticationServiceGetOAuth2TokenParams: $e";
|
| rethrow;
|
| @@ -242,12 +250,16 @@ class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct {
|
| if (scopes == null) {
|
| encoder0.encodeNullPointer(16, false);
|
| } else {
|
| - var encoder1 = encoder0.encodePointerArray(scopes.length, 16, bindings.kUnspecifiedArrayLength);
|
| + var encoder1 = encoder0.encodePointerArray(
|
| + scopes.length, 16, bindings.kUnspecifiedArrayLength);
|
| for (int i0 = 0; i0 < scopes.length; ++i0) {
|
| - encoder1.encodeString(scopes[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false);
|
| + encoder1.encodeString(
|
| + scopes[i0],
|
| + bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0,
|
| + false);
|
| }
|
| }
|
| - } on bindings.MojoCodecError catch(e) {
|
| + } on bindings.MojoCodecError catch (e) {
|
| e.message = "Error encountered while encoding field "
|
| "scopes of struct _AuthenticationServiceGetOAuth2TokenParams: $e";
|
| rethrow;
|
| @@ -256,8 +268,10 @@ class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct {
|
|
|
| String toString() {
|
| return "_AuthenticationServiceGetOAuth2TokenParams("
|
| - "username: $username" ", "
|
| - "scopes: $scopes" ")";
|
| + "username: $username"
|
| + ", "
|
| + "scopes: $scopes"
|
| + ")";
|
| }
|
|
|
| Map toJson() {
|
| @@ -268,17 +282,19 @@ class _AuthenticationServiceGetOAuth2TokenParams extends bindings.Struct {
|
| }
|
| }
|
|
|
| -
|
| -class AuthenticationServiceGetOAuth2TokenResponseParams extends bindings.Struct {
|
| +class AuthenticationServiceGetOAuth2TokenResponseParams
|
| + extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(24, 0)
|
| ];
|
| String token = null;
|
| String error = null;
|
|
|
| - AuthenticationServiceGetOAuth2TokenResponseParams() : super(kVersions.last.size);
|
| + AuthenticationServiceGetOAuth2TokenResponseParams()
|
| + : super(kVersions.last.size);
|
|
|
| - static AuthenticationServiceGetOAuth2TokenResponseParams deserialize(bindings.Message message) {
|
| + static AuthenticationServiceGetOAuth2TokenResponseParams deserialize(
|
| + bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -287,11 +303,13 @@ class AuthenticationServiceGetOAuth2TokenResponseParams extends bindings.Struct
|
| return result;
|
| }
|
|
|
| - static AuthenticationServiceGetOAuth2TokenResponseParams decode(bindings.Decoder decoder0) {
|
| + static AuthenticationServiceGetOAuth2TokenResponseParams decode(
|
| + bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - AuthenticationServiceGetOAuth2TokenResponseParams result = new AuthenticationServiceGetOAuth2TokenResponseParams();
|
| + AuthenticationServiceGetOAuth2TokenResponseParams result =
|
| + new AuthenticationServiceGetOAuth2TokenResponseParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -308,15 +326,13 @@ class AuthenticationServiceGetOAuth2TokenResponseParams extends bindings.Struct
|
| }
|
| } else if (mainDataHeader.size < kVersions.last.size) {
|
| throw new bindings.MojoCodecError(
|
| - 'Message newer than the last known version cannot be shorter than '
|
| - 'required by the last known version.');
|
| + 'Message newer than the last known version cannot be shorter than '
|
| + 'required by the last known version.');
|
| }
|
| if (mainDataHeader.version >= 0) {
|
| -
|
| result.token = decoder0.decodeString(8, true);
|
| }
|
| if (mainDataHeader.version >= 0) {
|
| -
|
| result.error = decoder0.decodeString(16, true);
|
| }
|
| return result;
|
| @@ -326,14 +342,14 @@ class AuthenticationServiceGetOAuth2TokenResponseParams extends bindings.Struct
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| try {
|
| encoder0.encodeString(token, 8, true);
|
| - } on bindings.MojoCodecError catch(e) {
|
| + } on bindings.MojoCodecError catch (e) {
|
| e.message = "Error encountered while encoding field "
|
| "token of struct AuthenticationServiceGetOAuth2TokenResponseParams: $e";
|
| rethrow;
|
| }
|
| try {
|
| encoder0.encodeString(error, 16, true);
|
| - } on bindings.MojoCodecError catch(e) {
|
| + } on bindings.MojoCodecError catch (e) {
|
| e.message = "Error encountered while encoding field "
|
| "error of struct AuthenticationServiceGetOAuth2TokenResponseParams: $e";
|
| rethrow;
|
| @@ -342,8 +358,10 @@ class AuthenticationServiceGetOAuth2TokenResponseParams extends bindings.Struct
|
|
|
| String toString() {
|
| return "AuthenticationServiceGetOAuth2TokenResponseParams("
|
| - "token: $token" ", "
|
| - "error: $error" ")";
|
| + "token: $token"
|
| + ", "
|
| + "error: $error"
|
| + ")";
|
| }
|
|
|
| Map toJson() {
|
| @@ -354,7 +372,6 @@ class AuthenticationServiceGetOAuth2TokenResponseParams extends bindings.Struct
|
| }
|
| }
|
|
|
| -
|
| class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(16, 0)
|
| @@ -363,7 +380,8 @@ class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct {
|
|
|
| _AuthenticationServiceClearOAuth2TokenParams() : super(kVersions.last.size);
|
|
|
| - static _AuthenticationServiceClearOAuth2TokenParams deserialize(bindings.Message message) {
|
| + static _AuthenticationServiceClearOAuth2TokenParams deserialize(
|
| + bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -372,11 +390,13 @@ class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _AuthenticationServiceClearOAuth2TokenParams decode(bindings.Decoder decoder0) {
|
| + static _AuthenticationServiceClearOAuth2TokenParams decode(
|
| + bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _AuthenticationServiceClearOAuth2TokenParams result = new _AuthenticationServiceClearOAuth2TokenParams();
|
| + _AuthenticationServiceClearOAuth2TokenParams result =
|
| + new _AuthenticationServiceClearOAuth2TokenParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -393,11 +413,10 @@ class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct {
|
| }
|
| } else if (mainDataHeader.size < kVersions.last.size) {
|
| throw new bindings.MojoCodecError(
|
| - 'Message newer than the last known version cannot be shorter than '
|
| - 'required by the last known version.');
|
| + 'Message newer than the last known version cannot be shorter than '
|
| + 'required by the last known version.');
|
| }
|
| if (mainDataHeader.version >= 0) {
|
| -
|
| result.token = decoder0.decodeString(8, false);
|
| }
|
| return result;
|
| @@ -407,7 +426,7 @@ class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| try {
|
| encoder0.encodeString(token, 8, false);
|
| - } on bindings.MojoCodecError catch(e) {
|
| + } on bindings.MojoCodecError catch (e) {
|
| e.message = "Error encountered while encoding field "
|
| "token of struct _AuthenticationServiceClearOAuth2TokenParams: $e";
|
| rethrow;
|
| @@ -416,7 +435,8 @@ class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct {
|
|
|
| String toString() {
|
| return "_AuthenticationServiceClearOAuth2TokenParams("
|
| - "token: $token" ")";
|
| + "token: $token"
|
| + ")";
|
| }
|
|
|
| Map toJson() {
|
| @@ -426,11 +446,390 @@ class _AuthenticationServiceClearOAuth2TokenParams extends bindings.Struct {
|
| }
|
| }
|
|
|
| +class _AuthenticationServiceGetOAuth2DeviceCodeParams extends bindings.Struct {
|
| + static const List<bindings.StructDataHeader> kVersions = const [
|
| + const bindings.StructDataHeader(16, 0)
|
| + ];
|
| + List<String> scopes = null;
|
| +
|
| + _AuthenticationServiceGetOAuth2DeviceCodeParams()
|
| + : super(kVersions.last.size);
|
| +
|
| + static _AuthenticationServiceGetOAuth2DeviceCodeParams deserialize(
|
| + bindings.Message message) {
|
| + var decoder = new bindings.Decoder(message);
|
| + var result = decode(decoder);
|
| + if (decoder.excessHandles != null) {
|
| + decoder.excessHandles.forEach((h) => h.close());
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + static _AuthenticationServiceGetOAuth2DeviceCodeParams decode(
|
| + bindings.Decoder decoder0) {
|
| + if (decoder0 == null) {
|
| + return null;
|
| + }
|
| + _AuthenticationServiceGetOAuth2DeviceCodeParams result =
|
| + new _AuthenticationServiceGetOAuth2DeviceCodeParams();
|
| +
|
| + var mainDataHeader = decoder0.decodeStructDataHeader();
|
| + if (mainDataHeader.version <= kVersions.last.version) {
|
| + // Scan in reverse order to optimize for more recent versions.
|
| + for (int i = kVersions.length - 1; i >= 0; --i) {
|
| + if (mainDataHeader.version >= kVersions[i].version) {
|
| + if (mainDataHeader.size == kVersions[i].size) {
|
| + // Found a match.
|
| + break;
|
| + }
|
| + throw new bindings.MojoCodecError(
|
| + 'Header size doesn\'t correspond to known version size.');
|
| + }
|
| + }
|
| + } else if (mainDataHeader.size < kVersions.last.size) {
|
| + throw new bindings.MojoCodecError(
|
| + 'Message newer than the last known version cannot be shorter than '
|
| + 'required by the last known version.');
|
| + }
|
| + if (mainDataHeader.version >= 0) {
|
| + var decoder1 = decoder0.decodePointer(8, false);
|
| + {
|
| + var si1 = decoder1
|
| + .decodeDataHeaderForPointerArray(bindings.kUnspecifiedArrayLength);
|
| + result.scopes = new List<String>(si1.numElements);
|
| + for (int i1 = 0; i1 < si1.numElements; ++i1) {
|
| + result.scopes[i1] = decoder1.decodeString(
|
| + bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i1,
|
| + false);
|
| + }
|
| + }
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + void encode(bindings.Encoder encoder) {
|
| + var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| + try {
|
| + if (scopes == null) {
|
| + encoder0.encodeNullPointer(8, false);
|
| + } else {
|
| + var encoder1 = encoder0.encodePointerArray(
|
| + scopes.length, 8, bindings.kUnspecifiedArrayLength);
|
| + for (int i0 = 0; i0 < scopes.length; ++i0) {
|
| + encoder1.encodeString(
|
| + scopes[i0],
|
| + bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0,
|
| + false);
|
| + }
|
| + }
|
| + } on bindings.MojoCodecError catch (e) {
|
| + e.message = "Error encountered while encoding field "
|
| + "scopes of struct _AuthenticationServiceGetOAuth2DeviceCodeParams: $e";
|
| + rethrow;
|
| + }
|
| + }
|
| +
|
| + String toString() {
|
| + return "_AuthenticationServiceGetOAuth2DeviceCodeParams("
|
| + "scopes: $scopes"
|
| + ")";
|
| + }
|
| +
|
| + Map toJson() {
|
| + Map map = new Map();
|
| + map["scopes"] = scopes;
|
| + return map;
|
| + }
|
| +}
|
| +
|
| +class AuthenticationServiceGetOAuth2DeviceCodeResponseParams
|
| + extends bindings.Struct {
|
| + static const List<bindings.StructDataHeader> kVersions = const [
|
| + const bindings.StructDataHeader(40, 0)
|
| + ];
|
| + String verificationUrl = null;
|
| + String deviceCode = null;
|
| + String userCode = null;
|
| + String error = null;
|
| +
|
| + AuthenticationServiceGetOAuth2DeviceCodeResponseParams()
|
| + : super(kVersions.last.size);
|
| +
|
| + static AuthenticationServiceGetOAuth2DeviceCodeResponseParams deserialize(
|
| + bindings.Message message) {
|
| + var decoder = new bindings.Decoder(message);
|
| + var result = decode(decoder);
|
| + if (decoder.excessHandles != null) {
|
| + decoder.excessHandles.forEach((h) => h.close());
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + static AuthenticationServiceGetOAuth2DeviceCodeResponseParams decode(
|
| + bindings.Decoder decoder0) {
|
| + if (decoder0 == null) {
|
| + return null;
|
| + }
|
| + AuthenticationServiceGetOAuth2DeviceCodeResponseParams result =
|
| + new AuthenticationServiceGetOAuth2DeviceCodeResponseParams();
|
| +
|
| + var mainDataHeader = decoder0.decodeStructDataHeader();
|
| + if (mainDataHeader.version <= kVersions.last.version) {
|
| + // Scan in reverse order to optimize for more recent versions.
|
| + for (int i = kVersions.length - 1; i >= 0; --i) {
|
| + if (mainDataHeader.version >= kVersions[i].version) {
|
| + if (mainDataHeader.size == kVersions[i].size) {
|
| + // Found a match.
|
| + break;
|
| + }
|
| + throw new bindings.MojoCodecError(
|
| + 'Header size doesn\'t correspond to known version size.');
|
| + }
|
| + }
|
| + } else if (mainDataHeader.size < kVersions.last.size) {
|
| + throw new bindings.MojoCodecError(
|
| + 'Message newer than the last known version cannot be shorter than '
|
| + 'required by the last known version.');
|
| + }
|
| + if (mainDataHeader.version >= 0) {
|
| + result.verificationUrl = decoder0.decodeString(8, true);
|
| + }
|
| + if (mainDataHeader.version >= 0) {
|
| + result.deviceCode = decoder0.decodeString(16, true);
|
| + }
|
| + if (mainDataHeader.version >= 0) {
|
| + result.userCode = decoder0.decodeString(24, true);
|
| + }
|
| + if (mainDataHeader.version >= 0) {
|
| + result.error = decoder0.decodeString(32, true);
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + void encode(bindings.Encoder encoder) {
|
| + var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| + try {
|
| + encoder0.encodeString(verificationUrl, 8, true);
|
| + } on bindings.MojoCodecError catch (e) {
|
| + e.message = "Error encountered while encoding field "
|
| + "verificationUrl of struct AuthenticationServiceGetOAuth2DeviceCodeResponseParams: $e";
|
| + rethrow;
|
| + }
|
| + try {
|
| + encoder0.encodeString(deviceCode, 16, true);
|
| + } on bindings.MojoCodecError catch (e) {
|
| + e.message = "Error encountered while encoding field "
|
| + "deviceCode of struct AuthenticationServiceGetOAuth2DeviceCodeResponseParams: $e";
|
| + rethrow;
|
| + }
|
| + try {
|
| + encoder0.encodeString(userCode, 24, true);
|
| + } on bindings.MojoCodecError catch (e) {
|
| + e.message = "Error encountered while encoding field "
|
| + "userCode of struct AuthenticationServiceGetOAuth2DeviceCodeResponseParams: $e";
|
| + rethrow;
|
| + }
|
| + try {
|
| + encoder0.encodeString(error, 32, true);
|
| + } on bindings.MojoCodecError catch (e) {
|
| + e.message = "Error encountered while encoding field "
|
| + "error of struct AuthenticationServiceGetOAuth2DeviceCodeResponseParams: $e";
|
| + rethrow;
|
| + }
|
| + }
|
| +
|
| + String toString() {
|
| + return "AuthenticationServiceGetOAuth2DeviceCodeResponseParams("
|
| + "verificationUrl: $verificationUrl"
|
| + ", "
|
| + "deviceCode: $deviceCode"
|
| + ", "
|
| + "userCode: $userCode"
|
| + ", "
|
| + "error: $error"
|
| + ")";
|
| + }
|
| +
|
| + Map toJson() {
|
| + Map map = new Map();
|
| + map["verificationUrl"] = verificationUrl;
|
| + map["deviceCode"] = deviceCode;
|
| + map["userCode"] = userCode;
|
| + map["error"] = error;
|
| + return map;
|
| + }
|
| +}
|
| +
|
| +class _AuthenticationServiceAddAccountParams extends bindings.Struct {
|
| + static const List<bindings.StructDataHeader> kVersions = const [
|
| + const bindings.StructDataHeader(16, 0)
|
| + ];
|
| + String deviceCode = null;
|
| +
|
| + _AuthenticationServiceAddAccountParams() : super(kVersions.last.size);
|
| +
|
| + static _AuthenticationServiceAddAccountParams deserialize(
|
| + bindings.Message message) {
|
| + var decoder = new bindings.Decoder(message);
|
| + var result = decode(decoder);
|
| + if (decoder.excessHandles != null) {
|
| + decoder.excessHandles.forEach((h) => h.close());
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + static _AuthenticationServiceAddAccountParams decode(
|
| + bindings.Decoder decoder0) {
|
| + if (decoder0 == null) {
|
| + return null;
|
| + }
|
| + _AuthenticationServiceAddAccountParams result =
|
| + new _AuthenticationServiceAddAccountParams();
|
| +
|
| + var mainDataHeader = decoder0.decodeStructDataHeader();
|
| + if (mainDataHeader.version <= kVersions.last.version) {
|
| + // Scan in reverse order to optimize for more recent versions.
|
| + for (int i = kVersions.length - 1; i >= 0; --i) {
|
| + if (mainDataHeader.version >= kVersions[i].version) {
|
| + if (mainDataHeader.size == kVersions[i].size) {
|
| + // Found a match.
|
| + break;
|
| + }
|
| + throw new bindings.MojoCodecError(
|
| + 'Header size doesn\'t correspond to known version size.');
|
| + }
|
| + }
|
| + } else if (mainDataHeader.size < kVersions.last.size) {
|
| + throw new bindings.MojoCodecError(
|
| + 'Message newer than the last known version cannot be shorter than '
|
| + 'required by the last known version.');
|
| + }
|
| + if (mainDataHeader.version >= 0) {
|
| + result.deviceCode = decoder0.decodeString(8, false);
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + void encode(bindings.Encoder encoder) {
|
| + var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| + try {
|
| + encoder0.encodeString(deviceCode, 8, false);
|
| + } on bindings.MojoCodecError catch (e) {
|
| + e.message = "Error encountered while encoding field "
|
| + "deviceCode of struct _AuthenticationServiceAddAccountParams: $e";
|
| + rethrow;
|
| + }
|
| + }
|
| +
|
| + String toString() {
|
| + return "_AuthenticationServiceAddAccountParams("
|
| + "deviceCode: $deviceCode"
|
| + ")";
|
| + }
|
| +
|
| + Map toJson() {
|
| + Map map = new Map();
|
| + map["deviceCode"] = deviceCode;
|
| + return map;
|
| + }
|
| +}
|
| +
|
| +class AuthenticationServiceAddAccountResponseParams extends bindings.Struct {
|
| + static const List<bindings.StructDataHeader> kVersions = const [
|
| + const bindings.StructDataHeader(24, 0)
|
| + ];
|
| + String username = null;
|
| + String error = null;
|
| +
|
| + AuthenticationServiceAddAccountResponseParams() : super(kVersions.last.size);
|
| +
|
| + static AuthenticationServiceAddAccountResponseParams deserialize(
|
| + bindings.Message message) {
|
| + var decoder = new bindings.Decoder(message);
|
| + var result = decode(decoder);
|
| + if (decoder.excessHandles != null) {
|
| + decoder.excessHandles.forEach((h) => h.close());
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + static AuthenticationServiceAddAccountResponseParams decode(
|
| + bindings.Decoder decoder0) {
|
| + if (decoder0 == null) {
|
| + return null;
|
| + }
|
| + AuthenticationServiceAddAccountResponseParams result =
|
| + new AuthenticationServiceAddAccountResponseParams();
|
| +
|
| + var mainDataHeader = decoder0.decodeStructDataHeader();
|
| + if (mainDataHeader.version <= kVersions.last.version) {
|
| + // Scan in reverse order to optimize for more recent versions.
|
| + for (int i = kVersions.length - 1; i >= 0; --i) {
|
| + if (mainDataHeader.version >= kVersions[i].version) {
|
| + if (mainDataHeader.size == kVersions[i].size) {
|
| + // Found a match.
|
| + break;
|
| + }
|
| + throw new bindings.MojoCodecError(
|
| + 'Header size doesn\'t correspond to known version size.');
|
| + }
|
| + }
|
| + } else if (mainDataHeader.size < kVersions.last.size) {
|
| + throw new bindings.MojoCodecError(
|
| + 'Message newer than the last known version cannot be shorter than '
|
| + 'required by the last known version.');
|
| + }
|
| + if (mainDataHeader.version >= 0) {
|
| + result.username = decoder0.decodeString(8, true);
|
| + }
|
| + if (mainDataHeader.version >= 0) {
|
| + result.error = decoder0.decodeString(16, true);
|
| + }
|
| + return result;
|
| + }
|
| +
|
| + void encode(bindings.Encoder encoder) {
|
| + var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| + try {
|
| + encoder0.encodeString(username, 8, true);
|
| + } on bindings.MojoCodecError catch (e) {
|
| + e.message = "Error encountered while encoding field "
|
| + "username of struct AuthenticationServiceAddAccountResponseParams: $e";
|
| + rethrow;
|
| + }
|
| + try {
|
| + encoder0.encodeString(error, 16, true);
|
| + } on bindings.MojoCodecError catch (e) {
|
| + e.message = "Error encountered while encoding field "
|
| + "error of struct AuthenticationServiceAddAccountResponseParams: $e";
|
| + rethrow;
|
| + }
|
| + }
|
| +
|
| + String toString() {
|
| + return "AuthenticationServiceAddAccountResponseParams("
|
| + "username: $username"
|
| + ", "
|
| + "error: $error"
|
| + ")";
|
| + }
|
| +
|
| + Map toJson() {
|
| + Map map = new Map();
|
| + map["username"] = username;
|
| + map["error"] = error;
|
| + return map;
|
| + }
|
| +}
|
| +
|
| const int _AuthenticationService_selectAccountName = 0;
|
| const int _AuthenticationService_getOAuth2TokenName = 1;
|
| const int _AuthenticationService_clearOAuth2TokenName = 2;
|
| +const int _AuthenticationService_getOAuth2DeviceCodeName = 3;
|
| +const int _AuthenticationService_addAccountName = 4;
|
|
|
| -class _AuthenticationServiceServiceDescription implements service_describer.ServiceDescription {
|
| +class _AuthenticationServiceServiceDescription
|
| + implements service_describer.ServiceDescription {
|
| dynamic getTopLevelInterface([Function responseFactory]) =>
|
| responseFactory(null);
|
|
|
| @@ -443,18 +842,23 @@ class _AuthenticationServiceServiceDescription implements service_describer.Serv
|
|
|
| abstract class AuthenticationService {
|
| static const String serviceName = "authentication::AuthenticationService";
|
| - dynamic selectAccount(bool returnLastSelected,[Function responseFactory = null]);
|
| - dynamic getOAuth2Token(String username,List<String> scopes,[Function responseFactory = null]);
|
| + dynamic selectAccount(bool returnLastSelected,
|
| + [Function responseFactory = null]);
|
| + dynamic getOAuth2Token(String username, List<String> scopes,
|
| + [Function responseFactory = null]);
|
| void clearOAuth2Token(String token);
|
| + dynamic getOAuth2DeviceCode(List<String> scopes,
|
| + [Function responseFactory = null]);
|
| + dynamic addAccount(String deviceCode, [Function responseFactory = null]);
|
| }
|
|
|
| -
|
| class _AuthenticationServiceProxyImpl extends bindings.Proxy {
|
| _AuthenticationServiceProxyImpl.fromEndpoint(
|
| - core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
|
| + core.MojoMessagePipeEndpoint endpoint)
|
| + : super.fromEndpoint(endpoint);
|
|
|
| - _AuthenticationServiceProxyImpl.fromHandle(core.MojoHandle handle) :
|
| - super.fromHandle(handle);
|
| + _AuthenticationServiceProxyImpl.fromHandle(core.MojoHandle handle)
|
| + : super.fromHandle(handle);
|
|
|
| _AuthenticationServiceProxyImpl.unbound() : super.unbound();
|
|
|
| @@ -465,13 +869,13 @@ class _AuthenticationServiceProxyImpl extends bindings.Proxy {
|
| }
|
|
|
| service_describer.ServiceDescription get serviceDescription =>
|
| - new _AuthenticationServiceServiceDescription();
|
| + new _AuthenticationServiceServiceDescription();
|
|
|
| void handleResponse(bindings.ServiceMessage message) {
|
| switch (message.header.type) {
|
| case _AuthenticationService_selectAccountName:
|
| - var r = AuthenticationServiceSelectAccountResponseParams.deserialize(
|
| - message.payload);
|
| + var r = AuthenticationServiceSelectAccountResponseParams
|
| + .deserialize(message.payload);
|
| if (!message.header.hasRequestId) {
|
| proxyError("Expected a message with a valid request Id.");
|
| return;
|
| @@ -490,8 +894,48 @@ class _AuthenticationServiceProxyImpl extends bindings.Proxy {
|
| c.complete(r);
|
| break;
|
| case _AuthenticationService_getOAuth2TokenName:
|
| - var r = AuthenticationServiceGetOAuth2TokenResponseParams.deserialize(
|
| - message.payload);
|
| + var r = AuthenticationServiceGetOAuth2TokenResponseParams
|
| + .deserialize(message.payload);
|
| + if (!message.header.hasRequestId) {
|
| + proxyError("Expected a message with a valid request Id.");
|
| + return;
|
| + }
|
| + Completer c = completerMap[message.header.requestId];
|
| + if (c == null) {
|
| + proxyError(
|
| + "Message had unknown request Id: ${message.header.requestId}");
|
| + return;
|
| + }
|
| + completerMap.remove(message.header.requestId);
|
| + if (c.isCompleted) {
|
| + proxyError("Response completer already completed");
|
| + return;
|
| + }
|
| + c.complete(r);
|
| + break;
|
| + case _AuthenticationService_getOAuth2DeviceCodeName:
|
| + var r = AuthenticationServiceGetOAuth2DeviceCodeResponseParams
|
| + .deserialize(message.payload);
|
| + if (!message.header.hasRequestId) {
|
| + proxyError("Expected a message with a valid request Id.");
|
| + return;
|
| + }
|
| + Completer c = completerMap[message.header.requestId];
|
| + if (c == null) {
|
| + proxyError(
|
| + "Message had unknown request Id: ${message.header.requestId}");
|
| + return;
|
| + }
|
| + completerMap.remove(message.header.requestId);
|
| + if (c.isCompleted) {
|
| + proxyError("Response completer already completed");
|
| + return;
|
| + }
|
| + c.complete(r);
|
| + break;
|
| + case _AuthenticationService_addAccountName:
|
| + var r = AuthenticationServiceAddAccountResponseParams
|
| + .deserialize(message.payload);
|
| if (!message.header.hasRequestId) {
|
| proxyError("Expected a message with a valid request Id.");
|
| return;
|
| @@ -522,68 +966,91 @@ class _AuthenticationServiceProxyImpl extends bindings.Proxy {
|
| }
|
| }
|
|
|
| -
|
| class _AuthenticationServiceProxyCalls implements AuthenticationService {
|
| _AuthenticationServiceProxyImpl _proxyImpl;
|
|
|
| _AuthenticationServiceProxyCalls(this._proxyImpl);
|
| - dynamic selectAccount(bool returnLastSelected,[Function responseFactory = null]) {
|
| - var params = new _AuthenticationServiceSelectAccountParams();
|
| - params.returnLastSelected = returnLastSelected;
|
| - return _proxyImpl.sendMessageWithRequestId(
|
| - params,
|
| - _AuthenticationService_selectAccountName,
|
| - -1,
|
| - bindings.MessageHeader.kMessageExpectsResponse);
|
| - }
|
| - dynamic getOAuth2Token(String username,List<String> scopes,[Function responseFactory = null]) {
|
| - var params = new _AuthenticationServiceGetOAuth2TokenParams();
|
| - params.username = username;
|
| - params.scopes = scopes;
|
| - return _proxyImpl.sendMessageWithRequestId(
|
| - params,
|
| - _AuthenticationService_getOAuth2TokenName,
|
| - -1,
|
| - bindings.MessageHeader.kMessageExpectsResponse);
|
| - }
|
| - void clearOAuth2Token(String token) {
|
| - if (!_proxyImpl.isBound) {
|
| - _proxyImpl.proxyError("The Proxy is closed.");
|
| - return;
|
| - }
|
| - var params = new _AuthenticationServiceClearOAuth2TokenParams();
|
| - params.token = token;
|
| - _proxyImpl.sendMessage(params, _AuthenticationService_clearOAuth2TokenName);
|
| + dynamic selectAccount(bool returnLastSelected,
|
| + [Function responseFactory = null]) {
|
| + var params = new _AuthenticationServiceSelectAccountParams();
|
| + params.returnLastSelected = returnLastSelected;
|
| + return _proxyImpl.sendMessageWithRequestId(
|
| + params,
|
| + _AuthenticationService_selectAccountName,
|
| + -1,
|
| + bindings.MessageHeader.kMessageExpectsResponse);
|
| + }
|
| +
|
| + dynamic getOAuth2Token(String username, List<String> scopes,
|
| + [Function responseFactory = null]) {
|
| + var params = new _AuthenticationServiceGetOAuth2TokenParams();
|
| + params.username = username;
|
| + params.scopes = scopes;
|
| + return _proxyImpl.sendMessageWithRequestId(
|
| + params,
|
| + _AuthenticationService_getOAuth2TokenName,
|
| + -1,
|
| + bindings.MessageHeader.kMessageExpectsResponse);
|
| + }
|
| +
|
| + void clearOAuth2Token(String token) {
|
| + if (!_proxyImpl.isBound) {
|
| + _proxyImpl.proxyError("The Proxy is closed.");
|
| + return;
|
| }
|
| -}
|
| + var params = new _AuthenticationServiceClearOAuth2TokenParams();
|
| + params.token = token;
|
| + _proxyImpl.sendMessage(params, _AuthenticationService_clearOAuth2TokenName);
|
| + }
|
|
|
| + dynamic getOAuth2DeviceCode(List<String> scopes,
|
| + [Function responseFactory = null]) {
|
| + var params = new _AuthenticationServiceGetOAuth2DeviceCodeParams();
|
| + params.scopes = scopes;
|
| + return _proxyImpl.sendMessageWithRequestId(
|
| + params,
|
| + _AuthenticationService_getOAuth2DeviceCodeName,
|
| + -1,
|
| + bindings.MessageHeader.kMessageExpectsResponse);
|
| + }
|
| +
|
| + dynamic addAccount(String deviceCode, [Function responseFactory = null]) {
|
| + var params = new _AuthenticationServiceAddAccountParams();
|
| + params.deviceCode = deviceCode;
|
| + return _proxyImpl.sendMessageWithRequestId(
|
| + params,
|
| + _AuthenticationService_addAccountName,
|
| + -1,
|
| + bindings.MessageHeader.kMessageExpectsResponse);
|
| + }
|
| +}
|
|
|
| class AuthenticationServiceProxy implements bindings.ProxyBase {
|
| final bindings.Proxy impl;
|
| AuthenticationService ptr;
|
|
|
| - AuthenticationServiceProxy(_AuthenticationServiceProxyImpl proxyImpl) :
|
| - impl = proxyImpl,
|
| - ptr = new _AuthenticationServiceProxyCalls(proxyImpl);
|
| + AuthenticationServiceProxy(_AuthenticationServiceProxyImpl proxyImpl)
|
| + : impl = proxyImpl,
|
| + ptr = new _AuthenticationServiceProxyCalls(proxyImpl);
|
|
|
| - AuthenticationServiceProxy.fromEndpoint(
|
| - core.MojoMessagePipeEndpoint endpoint) :
|
| - impl = new _AuthenticationServiceProxyImpl.fromEndpoint(endpoint) {
|
| + AuthenticationServiceProxy.fromEndpoint(core.MojoMessagePipeEndpoint endpoint)
|
| + : impl = new _AuthenticationServiceProxyImpl.fromEndpoint(endpoint) {
|
| ptr = new _AuthenticationServiceProxyCalls(impl);
|
| }
|
|
|
| - AuthenticationServiceProxy.fromHandle(core.MojoHandle handle) :
|
| - impl = new _AuthenticationServiceProxyImpl.fromHandle(handle) {
|
| + AuthenticationServiceProxy.fromHandle(core.MojoHandle handle)
|
| + : impl = new _AuthenticationServiceProxyImpl.fromHandle(handle) {
|
| ptr = new _AuthenticationServiceProxyCalls(impl);
|
| }
|
|
|
| - AuthenticationServiceProxy.unbound() :
|
| - impl = new _AuthenticationServiceProxyImpl.unbound() {
|
| + AuthenticationServiceProxy.unbound()
|
| + : impl = new _AuthenticationServiceProxyImpl.unbound() {
|
| ptr = new _AuthenticationServiceProxyCalls(impl);
|
| }
|
|
|
| factory AuthenticationServiceProxy.connectToService(
|
| - bindings.ServiceConnector s, String url, [String serviceName]) {
|
| + bindings.ServiceConnector s, String url,
|
| + [String serviceName]) {
|
| AuthenticationServiceProxy p = new AuthenticationServiceProxy.unbound();
|
| s.connectToService(url, p, serviceName);
|
| return p;
|
| @@ -616,12 +1083,11 @@ class AuthenticationServiceProxy implements bindings.ProxyBase {
|
| }
|
| }
|
|
|
| -
|
| class AuthenticationServiceStub extends bindings.Stub {
|
| AuthenticationService _impl = null;
|
|
|
| - AuthenticationServiceStub.fromEndpoint(
|
| - core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| + AuthenticationServiceStub.fromEndpoint(core.MojoMessagePipeEndpoint endpoint,
|
| + [this._impl])
|
| : super.fromEndpoint(endpoint);
|
|
|
| AuthenticationServiceStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| @@ -635,32 +1101,58 @@ class AuthenticationServiceStub extends bindings.Stub {
|
| return new AuthenticationServiceStub.fromEndpoint(endpoint);
|
| }
|
|
|
| -
|
| - AuthenticationServiceSelectAccountResponseParams _AuthenticationServiceSelectAccountResponseParamsFactory(String username, String error) {
|
| - var mojo_factory_result = new AuthenticationServiceSelectAccountResponseParams();
|
| + AuthenticationServiceSelectAccountResponseParams
|
| + _AuthenticationServiceSelectAccountResponseParamsFactory(String username, String error) {
|
| + var mojo_factory_result =
|
| + new AuthenticationServiceSelectAccountResponseParams();
|
| mojo_factory_result.username = username;
|
| mojo_factory_result.error = error;
|
| return mojo_factory_result;
|
| }
|
| - AuthenticationServiceGetOAuth2TokenResponseParams _AuthenticationServiceGetOAuth2TokenResponseParamsFactory(String token, String error) {
|
| - var mojo_factory_result = new AuthenticationServiceGetOAuth2TokenResponseParams();
|
| +
|
| + AuthenticationServiceGetOAuth2TokenResponseParams
|
| + _AuthenticationServiceGetOAuth2TokenResponseParamsFactory(String token, String error) {
|
| + var mojo_factory_result =
|
| + new AuthenticationServiceGetOAuth2TokenResponseParams();
|
| mojo_factory_result.token = token;
|
| mojo_factory_result.error = error;
|
| return mojo_factory_result;
|
| }
|
|
|
| + AuthenticationServiceGetOAuth2DeviceCodeResponseParams _AuthenticationServiceGetOAuth2DeviceCodeResponseParamsFactory(
|
| + String verificationUrl,
|
| + String deviceCode,
|
| + String userCode,
|
| + String error) {
|
| + var mojo_factory_result =
|
| + new AuthenticationServiceGetOAuth2DeviceCodeResponseParams();
|
| + mojo_factory_result.verificationUrl = verificationUrl;
|
| + mojo_factory_result.deviceCode = deviceCode;
|
| + mojo_factory_result.userCode = userCode;
|
| + mojo_factory_result.error = error;
|
| + return mojo_factory_result;
|
| + }
|
| +
|
| + AuthenticationServiceAddAccountResponseParams
|
| + _AuthenticationServiceAddAccountResponseParamsFactory(String username, String error) {
|
| + var mojo_factory_result =
|
| + new AuthenticationServiceAddAccountResponseParams();
|
| + mojo_factory_result.username = username;
|
| + mojo_factory_result.error = error;
|
| + return mojo_factory_result;
|
| + }
|
| +
|
| dynamic handleMessage(bindings.ServiceMessage message) {
|
| if (bindings.ControlMessageHandler.isControlMessage(message)) {
|
| - return bindings.ControlMessageHandler.handleMessage(this,
|
| - 0,
|
| - message);
|
| + return bindings.ControlMessageHandler.handleMessage(this, 0, message);
|
| }
|
| assert(_impl != null);
|
| switch (message.header.type) {
|
| case _AuthenticationService_selectAccountName:
|
| - var params = _AuthenticationServiceSelectAccountParams.deserialize(
|
| - message.payload);
|
| - var response = _impl.selectAccount(params.returnLastSelected,_AuthenticationServiceSelectAccountResponseParamsFactory);
|
| + var params = _AuthenticationServiceSelectAccountParams
|
| + .deserialize(message.payload);
|
| + var response = _impl.selectAccount(params.returnLastSelected,
|
| + _AuthenticationServiceSelectAccountResponseParamsFactory);
|
| if (response is Future) {
|
| return response.then((response) {
|
| if (response != null) {
|
| @@ -680,9 +1172,10 @@ class AuthenticationServiceStub extends bindings.Stub {
|
| }
|
| break;
|
| case _AuthenticationService_getOAuth2TokenName:
|
| - var params = _AuthenticationServiceGetOAuth2TokenParams.deserialize(
|
| - message.payload);
|
| - var response = _impl.getOAuth2Token(params.username,params.scopes,_AuthenticationServiceGetOAuth2TokenResponseParamsFactory);
|
| + var params = _AuthenticationServiceGetOAuth2TokenParams
|
| + .deserialize(message.payload);
|
| + var response = _impl.getOAuth2Token(params.username, params.scopes,
|
| + _AuthenticationServiceGetOAuth2TokenResponseParamsFactory);
|
| if (response is Future) {
|
| return response.then((response) {
|
| if (response != null) {
|
| @@ -702,10 +1195,56 @@ class AuthenticationServiceStub extends bindings.Stub {
|
| }
|
| break;
|
| case _AuthenticationService_clearOAuth2TokenName:
|
| - var params = _AuthenticationServiceClearOAuth2TokenParams.deserialize(
|
| - message.payload);
|
| + var params = _AuthenticationServiceClearOAuth2TokenParams
|
| + .deserialize(message.payload);
|
| _impl.clearOAuth2Token(params.token);
|
| break;
|
| + case _AuthenticationService_getOAuth2DeviceCodeName:
|
| + var params = _AuthenticationServiceGetOAuth2DeviceCodeParams
|
| + .deserialize(message.payload);
|
| + var response = _impl.getOAuth2DeviceCode(params.scopes,
|
| + _AuthenticationServiceGetOAuth2DeviceCodeResponseParamsFactory);
|
| + if (response is Future) {
|
| + return response.then((response) {
|
| + if (response != null) {
|
| + return buildResponseWithId(
|
| + response,
|
| + _AuthenticationService_getOAuth2DeviceCodeName,
|
| + message.header.requestId,
|
| + bindings.MessageHeader.kMessageIsResponse);
|
| + }
|
| + });
|
| + } else if (response != null) {
|
| + return buildResponseWithId(
|
| + response,
|
| + _AuthenticationService_getOAuth2DeviceCodeName,
|
| + message.header.requestId,
|
| + bindings.MessageHeader.kMessageIsResponse);
|
| + }
|
| + break;
|
| + case _AuthenticationService_addAccountName:
|
| + var params =
|
| + _AuthenticationServiceAddAccountParams.deserialize(message.payload);
|
| + var response = _impl.addAccount(params.deviceCode,
|
| + _AuthenticationServiceAddAccountResponseParamsFactory);
|
| + if (response is Future) {
|
| + return response.then((response) {
|
| + if (response != null) {
|
| + return buildResponseWithId(
|
| + response,
|
| + _AuthenticationService_addAccountName,
|
| + message.header.requestId,
|
| + bindings.MessageHeader.kMessageIsResponse);
|
| + }
|
| + });
|
| + } else if (response != null) {
|
| + return buildResponseWithId(
|
| + response,
|
| + _AuthenticationService_addAccountName,
|
| + message.header.requestId,
|
| + bindings.MessageHeader.kMessageIsResponse);
|
| + }
|
| + break;
|
| default:
|
| throw new bindings.MojoCodecError("Unexpected message name");
|
| break;
|
| @@ -729,11 +1268,9 @@ class AuthenticationServiceStub extends bindings.Stub {
|
| static service_describer.ServiceDescription _cachedServiceDescription;
|
| static service_describer.ServiceDescription get serviceDescription {
|
| if (_cachedServiceDescription == null) {
|
| - _cachedServiceDescription = new _AuthenticationServiceServiceDescription();
|
| + _cachedServiceDescription =
|
| + new _AuthenticationServiceServiceDescription();
|
| }
|
| return _cachedServiceDescription;
|
| }
|
| }
|
| -
|
| -
|
| -
|
|
|