diff --git a/flutter_reach_five/example/ios/Runner.xcodeproj/project.pbxproj b/flutter_reach_five/example/ios/Runner.xcodeproj/project.pbxproj index 5bad757..2146e45 100644 --- a/flutter_reach_five/example/ios/Runner.xcodeproj/project.pbxproj +++ b/flutter_reach_five/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -222,6 +222,7 @@ }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -253,6 +254,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/flutter_reach_five/example/lib/const.dart b/flutter_reach_five/example/lib/const.dart index a87be00..c250822 100644 --- a/flutter_reach_five/example/lib/const.dart +++ b/flutter_reach_five/example/lib/const.dart @@ -118,7 +118,7 @@ class _SecondDataSet extends DataSet { /// Your reach five ios scheme @override - String get initialIosScheme => ''; + String get initialIosScheme => 'reachfive-$initialClientId://callback'; /// Your reach five origin @override diff --git a/flutter_reach_five_android/android/src/main/java/tech/bam/flutter_reach_five/android/ReachFiveApi.java b/flutter_reach_five_android/android/src/main/java/tech/bam/flutter_reach_five/android/ReachFiveApi.java deleted file mode 100644 index f9e8627..0000000 --- a/flutter_reach_five_android/android/src/main/java/tech/bam/flutter_reach_five/android/ReachFiveApi.java +++ /dev/null @@ -1,4868 +0,0 @@ -// Autogenerated from Pigeon (v9.1.0), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -package tech.bam.flutter_reach_five.android; - -import android.util.Log; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import io.flutter.plugin.common.BasicMessageChannel; -import io.flutter.plugin.common.BinaryMessenger; -import io.flutter.plugin.common.MessageCodec; -import io.flutter.plugin.common.StandardMessageCodec; -import java.io.ByteArrayOutputStream; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** Generated class from Pigeon. */ -@SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) -public class ReachFiveApi { - - /** Error class for passing custom error details to Flutter via a thrown PlatformException. */ - public static class FlutterError extends RuntimeException { - - /** The error code. */ - public final String code; - - /** The error details. Must be a datatype supported by the api codec. */ - public final Object details; - - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) - { - super(message); - this.code = code; - this.details = details; - } - } - - @NonNull - private static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); - if (exception instanceof FlutterError) { - FlutterError error = (FlutterError) exception; - errorList.add(error.code); - errorList.add(error.getMessage()); - errorList.add(error.details); - } else { - errorList.add(exception.toString()); - errorList.add(exception.getClass().getSimpleName()); - errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); - } - return errorList; - } - - public enum ProviderCreatorTypeInterface { - GOOGLE(0), - FACEBOOK(1), - WEBVIEW(2); - - private final int index; - - private ProviderCreatorTypeInterface(final int index) { - this.index = index; - } - } - - public enum ProfileAddressTypeInterface { - BILLING(0), - DELIVERY(1); - - private final int index; - - private ProfileAddressTypeInterface(final int index) { - this.index = index; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class ErrorCodesInterface { - private @NonNull String emailAlreadyInUseCode; - - public @NonNull String getEmailAlreadyInUseCode() { - return emailAlreadyInUseCode; - } - - public void setEmailAlreadyInUseCode(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"emailAlreadyInUseCode\" is null."); - } - this.emailAlreadyInUseCode = setterArg; - } - - private @NonNull String invalidEmailOrPasswordCode; - - public @NonNull String getInvalidEmailOrPasswordCode() { - return invalidEmailOrPasswordCode; - } - - public void setInvalidEmailOrPasswordCode(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"invalidEmailOrPasswordCode\" is null."); - } - this.invalidEmailOrPasswordCode = setterArg; - } - - private @NonNull String invalidVerificationCode; - - public @NonNull String getInvalidVerificationCode() { - return invalidVerificationCode; - } - - public void setInvalidVerificationCode(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"invalidVerificationCode\" is null."); - } - this.invalidVerificationCode = setterArg; - } - - private @NonNull String invalidGrant; - - public @NonNull String getInvalidGrant() { - return invalidGrant; - } - - public void setInvalidGrant(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"invalidGrant\" is null."); - } - this.invalidGrant = setterArg; - } - - private @NonNull String userCancelledOrClosedTheWebFlow; - - public @NonNull String getUserCancelledOrClosedTheWebFlow() { - return userCancelledOrClosedTheWebFlow; - } - - public void setUserCancelledOrClosedTheWebFlow(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"userCancelledOrClosedTheWebFlow\" is null."); - } - this.userCancelledOrClosedTheWebFlow = setterArg; - } - - private @NonNull String socialAccountEmailAlreadyInUse; - - public @NonNull String getSocialAccountEmailAlreadyInUse() { - return socialAccountEmailAlreadyInUse; - } - - public void setSocialAccountEmailAlreadyInUse(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"socialAccountEmailAlreadyInUse\" is null."); - } - this.socialAccountEmailAlreadyInUse = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private ErrorCodesInterface() {} - - public static final class Builder { - - private @Nullable String emailAlreadyInUseCode; - - public @NonNull Builder setEmailAlreadyInUseCode(@NonNull String setterArg) { - this.emailAlreadyInUseCode = setterArg; - return this; - } - - private @Nullable String invalidEmailOrPasswordCode; - - public @NonNull Builder setInvalidEmailOrPasswordCode(@NonNull String setterArg) { - this.invalidEmailOrPasswordCode = setterArg; - return this; - } - - private @Nullable String invalidVerificationCode; - - public @NonNull Builder setInvalidVerificationCode(@NonNull String setterArg) { - this.invalidVerificationCode = setterArg; - return this; - } - - private @Nullable String invalidGrant; - - public @NonNull Builder setInvalidGrant(@NonNull String setterArg) { - this.invalidGrant = setterArg; - return this; - } - - private @Nullable String userCancelledOrClosedTheWebFlow; - - public @NonNull Builder setUserCancelledOrClosedTheWebFlow(@NonNull String setterArg) { - this.userCancelledOrClosedTheWebFlow = setterArg; - return this; - } - - private @Nullable String socialAccountEmailAlreadyInUse; - - public @NonNull Builder setSocialAccountEmailAlreadyInUse(@NonNull String setterArg) { - this.socialAccountEmailAlreadyInUse = setterArg; - return this; - } - - public @NonNull ErrorCodesInterface build() { - ErrorCodesInterface pigeonReturn = new ErrorCodesInterface(); - pigeonReturn.setEmailAlreadyInUseCode(emailAlreadyInUseCode); - pigeonReturn.setInvalidEmailOrPasswordCode(invalidEmailOrPasswordCode); - pigeonReturn.setInvalidVerificationCode(invalidVerificationCode); - pigeonReturn.setInvalidGrant(invalidGrant); - pigeonReturn.setUserCancelledOrClosedTheWebFlow(userCancelledOrClosedTheWebFlow); - pigeonReturn.setSocialAccountEmailAlreadyInUse(socialAccountEmailAlreadyInUse); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(6); - toListResult.add(emailAlreadyInUseCode); - toListResult.add(invalidEmailOrPasswordCode); - toListResult.add(invalidVerificationCode); - toListResult.add(invalidGrant); - toListResult.add(userCancelledOrClosedTheWebFlow); - toListResult.add(socialAccountEmailAlreadyInUse); - return toListResult; - } - - static @NonNull ErrorCodesInterface fromList(@NonNull ArrayList list) { - ErrorCodesInterface pigeonResult = new ErrorCodesInterface(); - Object emailAlreadyInUseCode = list.get(0); - pigeonResult.setEmailAlreadyInUseCode((String) emailAlreadyInUseCode); - Object invalidEmailOrPasswordCode = list.get(1); - pigeonResult.setInvalidEmailOrPasswordCode((String) invalidEmailOrPasswordCode); - Object invalidVerificationCode = list.get(2); - pigeonResult.setInvalidVerificationCode((String) invalidVerificationCode); - Object invalidGrant = list.get(3); - pigeonResult.setInvalidGrant((String) invalidGrant); - Object userCancelledOrClosedTheWebFlow = list.get(4); - pigeonResult.setUserCancelledOrClosedTheWebFlow((String) userCancelledOrClosedTheWebFlow); - Object socialAccountEmailAlreadyInUse = list.get(5); - pigeonResult.setSocialAccountEmailAlreadyInUse((String) socialAccountEmailAlreadyInUse); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class SdkConfigInterface { - private @NonNull String domain; - - public @NonNull String getDomain() { - return domain; - } - - public void setDomain(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"domain\" is null."); - } - this.domain = setterArg; - } - - private @NonNull String clientId; - - public @NonNull String getClientId() { - return clientId; - } - - public void setClientId(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"clientId\" is null."); - } - this.clientId = setterArg; - } - - private @NonNull String androidScheme; - - public @NonNull String getAndroidScheme() { - return androidScheme; - } - - public void setAndroidScheme(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"androidScheme\" is null."); - } - this.androidScheme = setterArg; - } - - private @NonNull String iosScheme; - - public @NonNull String getIosScheme() { - return iosScheme; - } - - public void setIosScheme(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"iosScheme\" is null."); - } - this.iosScheme = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private SdkConfigInterface() {} - - public static final class Builder { - - private @Nullable String domain; - - public @NonNull Builder setDomain(@NonNull String setterArg) { - this.domain = setterArg; - return this; - } - - private @Nullable String clientId; - - public @NonNull Builder setClientId(@NonNull String setterArg) { - this.clientId = setterArg; - return this; - } - - private @Nullable String androidScheme; - - public @NonNull Builder setAndroidScheme(@NonNull String setterArg) { - this.androidScheme = setterArg; - return this; - } - - private @Nullable String iosScheme; - - public @NonNull Builder setIosScheme(@NonNull String setterArg) { - this.iosScheme = setterArg; - return this; - } - - public @NonNull SdkConfigInterface build() { - SdkConfigInterface pigeonReturn = new SdkConfigInterface(); - pigeonReturn.setDomain(domain); - pigeonReturn.setClientId(clientId); - pigeonReturn.setAndroidScheme(androidScheme); - pigeonReturn.setIosScheme(iosScheme); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(4); - toListResult.add(domain); - toListResult.add(clientId); - toListResult.add(androidScheme); - toListResult.add(iosScheme); - return toListResult; - } - - static @NonNull SdkConfigInterface fromList(@NonNull ArrayList list) { - SdkConfigInterface pigeonResult = new SdkConfigInterface(); - Object domain = list.get(0); - pigeonResult.setDomain((String) domain); - Object clientId = list.get(1); - pigeonResult.setClientId((String) clientId); - Object androidScheme = list.get(2); - pigeonResult.setAndroidScheme((String) androidScheme); - Object iosScheme = list.get(3); - pigeonResult.setIosScheme((String) iosScheme); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class ProviderCreatorInterface { - private @NonNull ProviderCreatorTypeInterface type; - - public @NonNull ProviderCreatorTypeInterface getType() { - return type; - } - - public void setType(@NonNull ProviderCreatorTypeInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"type\" is null."); - } - this.type = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private ProviderCreatorInterface() {} - - public static final class Builder { - - private @Nullable ProviderCreatorTypeInterface type; - - public @NonNull Builder setType(@NonNull ProviderCreatorTypeInterface setterArg) { - this.type = setterArg; - return this; - } - - public @NonNull ProviderCreatorInterface build() { - ProviderCreatorInterface pigeonReturn = new ProviderCreatorInterface(); - pigeonReturn.setType(type); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add(type == null ? null : type.index); - return toListResult; - } - - static @NonNull ProviderCreatorInterface fromList(@NonNull ArrayList list) { - ProviderCreatorInterface pigeonResult = new ProviderCreatorInterface(); - Object type = list.get(0); - pigeonResult.setType(type == null ? null : ProviderCreatorTypeInterface.values()[(int) type]); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class ReachFiveKeyInterface { - private @NonNull SdkConfigInterface sdkConfig; - - public @NonNull SdkConfigInterface getSdkConfig() { - return sdkConfig; - } - - public void setSdkConfig(@NonNull SdkConfigInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"sdkConfig\" is null."); - } - this.sdkConfig = setterArg; - } - - private @NonNull List providerCreators; - - public @NonNull List getProviderCreators() { - return providerCreators; - } - - public void setProviderCreators(@NonNull List setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"providerCreators\" is null."); - } - this.providerCreators = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private ReachFiveKeyInterface() {} - - public static final class Builder { - - private @Nullable SdkConfigInterface sdkConfig; - - public @NonNull Builder setSdkConfig(@NonNull SdkConfigInterface setterArg) { - this.sdkConfig = setterArg; - return this; - } - - private @Nullable List providerCreators; - - public @NonNull Builder setProviderCreators(@NonNull List setterArg) { - this.providerCreators = setterArg; - return this; - } - - public @NonNull ReachFiveKeyInterface build() { - ReachFiveKeyInterface pigeonReturn = new ReachFiveKeyInterface(); - pigeonReturn.setSdkConfig(sdkConfig); - pigeonReturn.setProviderCreators(providerCreators); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add((sdkConfig == null) ? null : sdkConfig.toList()); - toListResult.add(providerCreators); - return toListResult; - } - - static @NonNull ReachFiveKeyInterface fromList(@NonNull ArrayList list) { - ReachFiveKeyInterface pigeonResult = new ReachFiveKeyInterface(); - Object sdkConfig = list.get(0); - pigeonResult.setSdkConfig((sdkConfig == null) ? null : SdkConfigInterface.fromList((ArrayList) sdkConfig)); - Object providerCreators = list.get(1); - pigeonResult.setProviderCreators((List) providerCreators); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class ReachFiveConfigInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @NonNull List providers; - - public @NonNull List getProviders() { - return providers; - } - - public void setProviders(@NonNull List setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"providers\" is null."); - } - this.providers = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private ReachFiveConfigInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable List providers; - - public @NonNull Builder setProviders(@NonNull List setterArg) { - this.providers = setterArg; - return this; - } - - public @NonNull ReachFiveConfigInterface build() { - ReachFiveConfigInterface pigeonReturn = new ReachFiveConfigInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setProviders(providers); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add(providers); - return toListResult; - } - - static @NonNull ReachFiveConfigInterface fromList(@NonNull ArrayList list) { - ReachFiveConfigInterface pigeonResult = new ReachFiveConfigInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object providers = list.get(1); - pigeonResult.setProviders((List) providers); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class ProfileAddressInterface { - private @Nullable String title; - - public @Nullable String getTitle() { - return title; - } - - public void setTitle(@Nullable String setterArg) { - this.title = setterArg; - } - - private @Nullable Boolean isDefault; - - public @Nullable Boolean getIsDefault() { - return isDefault; - } - - public void setIsDefault(@Nullable Boolean setterArg) { - this.isDefault = setterArg; - } - - private @Nullable ProfileAddressTypeInterface addressType; - - public @Nullable ProfileAddressTypeInterface getAddressType() { - return addressType; - } - - public void setAddressType(@Nullable ProfileAddressTypeInterface setterArg) { - this.addressType = setterArg; - } - - private @Nullable String streetAddress; - - public @Nullable String getStreetAddress() { - return streetAddress; - } - - public void setStreetAddress(@Nullable String setterArg) { - this.streetAddress = setterArg; - } - - private @Nullable String locality; - - public @Nullable String getLocality() { - return locality; - } - - public void setLocality(@Nullable String setterArg) { - this.locality = setterArg; - } - - private @Nullable String region; - - public @Nullable String getRegion() { - return region; - } - - public void setRegion(@Nullable String setterArg) { - this.region = setterArg; - } - - private @Nullable String postalCode; - - public @Nullable String getPostalCode() { - return postalCode; - } - - public void setPostalCode(@Nullable String setterArg) { - this.postalCode = setterArg; - } - - private @Nullable String country; - - public @Nullable String getCountry() { - return country; - } - - public void setCountry(@Nullable String setterArg) { - this.country = setterArg; - } - - private @Nullable String raw; - - public @Nullable String getRaw() { - return raw; - } - - public void setRaw(@Nullable String setterArg) { - this.raw = setterArg; - } - - private @Nullable String deliveryNote; - - public @Nullable String getDeliveryNote() { - return deliveryNote; - } - - public void setDeliveryNote(@Nullable String setterArg) { - this.deliveryNote = setterArg; - } - - private @Nullable String recipient; - - public @Nullable String getRecipient() { - return recipient; - } - - public void setRecipient(@Nullable String setterArg) { - this.recipient = setterArg; - } - - private @Nullable String company; - - public @Nullable String getCompany() { - return company; - } - - public void setCompany(@Nullable String setterArg) { - this.company = setterArg; - } - - private @Nullable String phoneNumber; - - public @Nullable String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - } - - public static final class Builder { - - private @Nullable String title; - - public @NonNull Builder setTitle(@Nullable String setterArg) { - this.title = setterArg; - return this; - } - - private @Nullable Boolean isDefault; - - public @NonNull Builder setIsDefault(@Nullable Boolean setterArg) { - this.isDefault = setterArg; - return this; - } - - private @Nullable ProfileAddressTypeInterface addressType; - - public @NonNull Builder setAddressType(@Nullable ProfileAddressTypeInterface setterArg) { - this.addressType = setterArg; - return this; - } - - private @Nullable String streetAddress; - - public @NonNull Builder setStreetAddress(@Nullable String setterArg) { - this.streetAddress = setterArg; - return this; - } - - private @Nullable String locality; - - public @NonNull Builder setLocality(@Nullable String setterArg) { - this.locality = setterArg; - return this; - } - - private @Nullable String region; - - public @NonNull Builder setRegion(@Nullable String setterArg) { - this.region = setterArg; - return this; - } - - private @Nullable String postalCode; - - public @NonNull Builder setPostalCode(@Nullable String setterArg) { - this.postalCode = setterArg; - return this; - } - - private @Nullable String country; - - public @NonNull Builder setCountry(@Nullable String setterArg) { - this.country = setterArg; - return this; - } - - private @Nullable String raw; - - public @NonNull Builder setRaw(@Nullable String setterArg) { - this.raw = setterArg; - return this; - } - - private @Nullable String deliveryNote; - - public @NonNull Builder setDeliveryNote(@Nullable String setterArg) { - this.deliveryNote = setterArg; - return this; - } - - private @Nullable String recipient; - - public @NonNull Builder setRecipient(@Nullable String setterArg) { - this.recipient = setterArg; - return this; - } - - private @Nullable String company; - - public @NonNull Builder setCompany(@Nullable String setterArg) { - this.company = setterArg; - return this; - } - - private @Nullable String phoneNumber; - - public @NonNull Builder setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - return this; - } - - public @NonNull ProfileAddressInterface build() { - ProfileAddressInterface pigeonReturn = new ProfileAddressInterface(); - pigeonReturn.setTitle(title); - pigeonReturn.setIsDefault(isDefault); - pigeonReturn.setAddressType(addressType); - pigeonReturn.setStreetAddress(streetAddress); - pigeonReturn.setLocality(locality); - pigeonReturn.setRegion(region); - pigeonReturn.setPostalCode(postalCode); - pigeonReturn.setCountry(country); - pigeonReturn.setRaw(raw); - pigeonReturn.setDeliveryNote(deliveryNote); - pigeonReturn.setRecipient(recipient); - pigeonReturn.setCompany(company); - pigeonReturn.setPhoneNumber(phoneNumber); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(13); - toListResult.add(title); - toListResult.add(isDefault); - toListResult.add(addressType == null ? null : addressType.index); - toListResult.add(streetAddress); - toListResult.add(locality); - toListResult.add(region); - toListResult.add(postalCode); - toListResult.add(country); - toListResult.add(raw); - toListResult.add(deliveryNote); - toListResult.add(recipient); - toListResult.add(company); - toListResult.add(phoneNumber); - return toListResult; - } - - static @NonNull ProfileAddressInterface fromList(@NonNull ArrayList list) { - ProfileAddressInterface pigeonResult = new ProfileAddressInterface(); - Object title = list.get(0); - pigeonResult.setTitle((String) title); - Object isDefault = list.get(1); - pigeonResult.setIsDefault((Boolean) isDefault); - Object addressType = list.get(2); - pigeonResult.setAddressType(addressType == null ? null : ProfileAddressTypeInterface.values()[(int) addressType]); - Object streetAddress = list.get(3); - pigeonResult.setStreetAddress((String) streetAddress); - Object locality = list.get(4); - pigeonResult.setLocality((String) locality); - Object region = list.get(5); - pigeonResult.setRegion((String) region); - Object postalCode = list.get(6); - pigeonResult.setPostalCode((String) postalCode); - Object country = list.get(7); - pigeonResult.setCountry((String) country); - Object raw = list.get(8); - pigeonResult.setRaw((String) raw); - Object deliveryNote = list.get(9); - pigeonResult.setDeliveryNote((String) deliveryNote); - Object recipient = list.get(10); - pigeonResult.setRecipient((String) recipient); - Object company = list.get(11); - pigeonResult.setCompany((String) company); - Object phoneNumber = list.get(12); - pigeonResult.setPhoneNumber((String) phoneNumber); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class ConsentInterface { - private @NonNull Boolean granted; - - public @NonNull Boolean getGranted() { - return granted; - } - - public void setGranted(@NonNull Boolean setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"granted\" is null."); - } - this.granted = setterArg; - } - - private @Nullable String consentType; - - public @Nullable String getConsentType() { - return consentType; - } - - public void setConsentType(@Nullable String setterArg) { - this.consentType = setterArg; - } - - private @NonNull String date; - - public @NonNull String getDate() { - return date; - } - - public void setDate(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"date\" is null."); - } - this.date = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private ConsentInterface() {} - - public static final class Builder { - - private @Nullable Boolean granted; - - public @NonNull Builder setGranted(@NonNull Boolean setterArg) { - this.granted = setterArg; - return this; - } - - private @Nullable String consentType; - - public @NonNull Builder setConsentType(@Nullable String setterArg) { - this.consentType = setterArg; - return this; - } - - private @Nullable String date; - - public @NonNull Builder setDate(@NonNull String setterArg) { - this.date = setterArg; - return this; - } - - public @NonNull ConsentInterface build() { - ConsentInterface pigeonReturn = new ConsentInterface(); - pigeonReturn.setGranted(granted); - pigeonReturn.setConsentType(consentType); - pigeonReturn.setDate(date); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(3); - toListResult.add(granted); - toListResult.add(consentType); - toListResult.add(date); - return toListResult; - } - - static @NonNull ConsentInterface fromList(@NonNull ArrayList list) { - ConsentInterface pigeonResult = new ConsentInterface(); - Object granted = list.get(0); - pigeonResult.setGranted((Boolean) granted); - Object consentType = list.get(1); - pigeonResult.setConsentType((String) consentType); - Object date = list.get(2); - pigeonResult.setDate((String) date); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class ProfileSignupRequestInterface { - private @NonNull String password; - - public @NonNull String getPassword() { - return password; - } - - public void setPassword(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"password\" is null."); - } - this.password = setterArg; - } - - private @Nullable String email; - - public @Nullable String getEmail() { - return email; - } - - public void setEmail(@Nullable String setterArg) { - this.email = setterArg; - } - - private @Nullable String phoneNumber; - - public @Nullable String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - } - - private @Nullable String givenName; - - public @Nullable String getGivenName() { - return givenName; - } - - public void setGivenName(@Nullable String setterArg) { - this.givenName = setterArg; - } - - private @Nullable String middleName; - - public @Nullable String getMiddleName() { - return middleName; - } - - public void setMiddleName(@Nullable String setterArg) { - this.middleName = setterArg; - } - - private @Nullable String familyName; - - public @Nullable String getFamilyName() { - return familyName; - } - - public void setFamilyName(@Nullable String setterArg) { - this.familyName = setterArg; - } - - private @Nullable String name; - - public @Nullable String getName() { - return name; - } - - public void setName(@Nullable String setterArg) { - this.name = setterArg; - } - - private @Nullable String nickname; - - public @Nullable String getNickname() { - return nickname; - } - - public void setNickname(@Nullable String setterArg) { - this.nickname = setterArg; - } - - private @Nullable String birthdate; - - public @Nullable String getBirthdate() { - return birthdate; - } - - public void setBirthdate(@Nullable String setterArg) { - this.birthdate = setterArg; - } - - private @Nullable String profileURL; - - public @Nullable String getProfileURL() { - return profileURL; - } - - public void setProfileURL(@Nullable String setterArg) { - this.profileURL = setterArg; - } - - private @Nullable String picture; - - public @Nullable String getPicture() { - return picture; - } - - public void setPicture(@Nullable String setterArg) { - this.picture = setterArg; - } - - private @Nullable String username; - - public @Nullable String getUsername() { - return username; - } - - public void setUsername(@Nullable String setterArg) { - this.username = setterArg; - } - - private @Nullable String gender; - - public @Nullable String getGender() { - return gender; - } - - public void setGender(@Nullable String setterArg) { - this.gender = setterArg; - } - - private @Nullable String company; - - public @Nullable String getCompany() { - return company; - } - - public void setCompany(@Nullable String setterArg) { - this.company = setterArg; - } - - private @Nullable List addresses; - - public @Nullable List getAddresses() { - return addresses; - } - - public void setAddresses(@Nullable List setterArg) { - this.addresses = setterArg; - } - - private @Nullable String locale; - - public @Nullable String getLocale() { - return locale; - } - - public void setLocale(@Nullable String setterArg) { - this.locale = setterArg; - } - - private @Nullable String bio; - - public @Nullable String getBio() { - return bio; - } - - public void setBio(@Nullable String setterArg) { - this.bio = setterArg; - } - - private @Nullable Map customFields; - - public @Nullable Map getCustomFields() { - return customFields; - } - - public void setCustomFields(@Nullable Map setterArg) { - this.customFields = setterArg; - } - - private @Nullable Map consents; - - public @Nullable Map getConsents() { - return consents; - } - - public void setConsents(@Nullable Map setterArg) { - this.consents = setterArg; - } - - private @Nullable Boolean liteOnly; - - public @Nullable Boolean getLiteOnly() { - return liteOnly; - } - - public void setLiteOnly(@Nullable Boolean setterArg) { - this.liteOnly = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private ProfileSignupRequestInterface() {} - - public static final class Builder { - - private @Nullable String password; - - public @NonNull Builder setPassword(@NonNull String setterArg) { - this.password = setterArg; - return this; - } - - private @Nullable String email; - - public @NonNull Builder setEmail(@Nullable String setterArg) { - this.email = setterArg; - return this; - } - - private @Nullable String phoneNumber; - - public @NonNull Builder setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - return this; - } - - private @Nullable String givenName; - - public @NonNull Builder setGivenName(@Nullable String setterArg) { - this.givenName = setterArg; - return this; - } - - private @Nullable String middleName; - - public @NonNull Builder setMiddleName(@Nullable String setterArg) { - this.middleName = setterArg; - return this; - } - - private @Nullable String familyName; - - public @NonNull Builder setFamilyName(@Nullable String setterArg) { - this.familyName = setterArg; - return this; - } - - private @Nullable String name; - - public @NonNull Builder setName(@Nullable String setterArg) { - this.name = setterArg; - return this; - } - - private @Nullable String nickname; - - public @NonNull Builder setNickname(@Nullable String setterArg) { - this.nickname = setterArg; - return this; - } - - private @Nullable String birthdate; - - public @NonNull Builder setBirthdate(@Nullable String setterArg) { - this.birthdate = setterArg; - return this; - } - - private @Nullable String profileURL; - - public @NonNull Builder setProfileURL(@Nullable String setterArg) { - this.profileURL = setterArg; - return this; - } - - private @Nullable String picture; - - public @NonNull Builder setPicture(@Nullable String setterArg) { - this.picture = setterArg; - return this; - } - - private @Nullable String username; - - public @NonNull Builder setUsername(@Nullable String setterArg) { - this.username = setterArg; - return this; - } - - private @Nullable String gender; - - public @NonNull Builder setGender(@Nullable String setterArg) { - this.gender = setterArg; - return this; - } - - private @Nullable String company; - - public @NonNull Builder setCompany(@Nullable String setterArg) { - this.company = setterArg; - return this; - } - - private @Nullable List addresses; - - public @NonNull Builder setAddresses(@Nullable List setterArg) { - this.addresses = setterArg; - return this; - } - - private @Nullable String locale; - - public @NonNull Builder setLocale(@Nullable String setterArg) { - this.locale = setterArg; - return this; - } - - private @Nullable String bio; - - public @NonNull Builder setBio(@Nullable String setterArg) { - this.bio = setterArg; - return this; - } - - private @Nullable Map customFields; - - public @NonNull Builder setCustomFields(@Nullable Map setterArg) { - this.customFields = setterArg; - return this; - } - - private @Nullable Map consents; - - public @NonNull Builder setConsents(@Nullable Map setterArg) { - this.consents = setterArg; - return this; - } - - private @Nullable Boolean liteOnly; - - public @NonNull Builder setLiteOnly(@Nullable Boolean setterArg) { - this.liteOnly = setterArg; - return this; - } - - public @NonNull ProfileSignupRequestInterface build() { - ProfileSignupRequestInterface pigeonReturn = new ProfileSignupRequestInterface(); - pigeonReturn.setPassword(password); - pigeonReturn.setEmail(email); - pigeonReturn.setPhoneNumber(phoneNumber); - pigeonReturn.setGivenName(givenName); - pigeonReturn.setMiddleName(middleName); - pigeonReturn.setFamilyName(familyName); - pigeonReturn.setName(name); - pigeonReturn.setNickname(nickname); - pigeonReturn.setBirthdate(birthdate); - pigeonReturn.setProfileURL(profileURL); - pigeonReturn.setPicture(picture); - pigeonReturn.setUsername(username); - pigeonReturn.setGender(gender); - pigeonReturn.setCompany(company); - pigeonReturn.setAddresses(addresses); - pigeonReturn.setLocale(locale); - pigeonReturn.setBio(bio); - pigeonReturn.setCustomFields(customFields); - pigeonReturn.setConsents(consents); - pigeonReturn.setLiteOnly(liteOnly); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(20); - toListResult.add(password); - toListResult.add(email); - toListResult.add(phoneNumber); - toListResult.add(givenName); - toListResult.add(middleName); - toListResult.add(familyName); - toListResult.add(name); - toListResult.add(nickname); - toListResult.add(birthdate); - toListResult.add(profileURL); - toListResult.add(picture); - toListResult.add(username); - toListResult.add(gender); - toListResult.add(company); - toListResult.add(addresses); - toListResult.add(locale); - toListResult.add(bio); - toListResult.add(customFields); - toListResult.add(consents); - toListResult.add(liteOnly); - return toListResult; - } - - static @NonNull ProfileSignupRequestInterface fromList(@NonNull ArrayList list) { - ProfileSignupRequestInterface pigeonResult = new ProfileSignupRequestInterface(); - Object password = list.get(0); - pigeonResult.setPassword((String) password); - Object email = list.get(1); - pigeonResult.setEmail((String) email); - Object phoneNumber = list.get(2); - pigeonResult.setPhoneNumber((String) phoneNumber); - Object givenName = list.get(3); - pigeonResult.setGivenName((String) givenName); - Object middleName = list.get(4); - pigeonResult.setMiddleName((String) middleName); - Object familyName = list.get(5); - pigeonResult.setFamilyName((String) familyName); - Object name = list.get(6); - pigeonResult.setName((String) name); - Object nickname = list.get(7); - pigeonResult.setNickname((String) nickname); - Object birthdate = list.get(8); - pigeonResult.setBirthdate((String) birthdate); - Object profileURL = list.get(9); - pigeonResult.setProfileURL((String) profileURL); - Object picture = list.get(10); - pigeonResult.setPicture((String) picture); - Object username = list.get(11); - pigeonResult.setUsername((String) username); - Object gender = list.get(12); - pigeonResult.setGender((String) gender); - Object company = list.get(13); - pigeonResult.setCompany((String) company); - Object addresses = list.get(14); - pigeonResult.setAddresses((List) addresses); - Object locale = list.get(15); - pigeonResult.setLocale((String) locale); - Object bio = list.get(16); - pigeonResult.setBio((String) bio); - Object customFields = list.get(17); - pigeonResult.setCustomFields((Map) customFields); - Object consents = list.get(18); - pigeonResult.setConsents((Map) consents); - Object liteOnly = list.get(19); - pigeonResult.setLiteOnly((Boolean) liteOnly); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class SignupRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @NonNull ProfileSignupRequestInterface profile; - - public @NonNull ProfileSignupRequestInterface getProfile() { - return profile; - } - - public void setProfile(@NonNull ProfileSignupRequestInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"profile\" is null."); - } - this.profile = setterArg; - } - - private @Nullable String redirectUrl; - - public @Nullable String getRedirectUrl() { - return redirectUrl; - } - - public void setRedirectUrl(@Nullable String setterArg) { - this.redirectUrl = setterArg; - } - - private @Nullable List scope; - - public @Nullable List getScope() { - return scope; - } - - public void setScope(@Nullable List setterArg) { - this.scope = setterArg; - } - - private @NonNull ErrorCodesInterface errorCodes; - - public @NonNull ErrorCodesInterface getErrorCodes() { - return errorCodes; - } - - public void setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"errorCodes\" is null."); - } - this.errorCodes = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private SignupRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable ProfileSignupRequestInterface profile; - - public @NonNull Builder setProfile(@NonNull ProfileSignupRequestInterface setterArg) { - this.profile = setterArg; - return this; - } - - private @Nullable String redirectUrl; - - public @NonNull Builder setRedirectUrl(@Nullable String setterArg) { - this.redirectUrl = setterArg; - return this; - } - - private @Nullable List scope; - - public @NonNull Builder setScope(@Nullable List setterArg) { - this.scope = setterArg; - return this; - } - - private @Nullable ErrorCodesInterface errorCodes; - - public @NonNull Builder setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - this.errorCodes = setterArg; - return this; - } - - public @NonNull SignupRequestInterface build() { - SignupRequestInterface pigeonReturn = new SignupRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setProfile(profile); - pigeonReturn.setRedirectUrl(redirectUrl); - pigeonReturn.setScope(scope); - pigeonReturn.setErrorCodes(errorCodes); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(5); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add((profile == null) ? null : profile.toList()); - toListResult.add(redirectUrl); - toListResult.add(scope); - toListResult.add((errorCodes == null) ? null : errorCodes.toList()); - return toListResult; - } - - static @NonNull SignupRequestInterface fromList(@NonNull ArrayList list) { - SignupRequestInterface pigeonResult = new SignupRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object profile = list.get(1); - pigeonResult.setProfile((profile == null) ? null : ProfileSignupRequestInterface.fromList((ArrayList) profile)); - Object redirectUrl = list.get(2); - pigeonResult.setRedirectUrl((String) redirectUrl); - Object scope = list.get(3); - pigeonResult.setScope((List) scope); - Object errorCodes = list.get(4); - pigeonResult.setErrorCodes((errorCodes == null) ? null : ErrorCodesInterface.fromList((ArrayList) errorCodes)); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class AddressInterface { - private @Nullable String formatted; - - public @Nullable String getFormatted() { - return formatted; - } - - public void setFormatted(@Nullable String setterArg) { - this.formatted = setterArg; - } - - private @Nullable String streetAddress; - - public @Nullable String getStreetAddress() { - return streetAddress; - } - - public void setStreetAddress(@Nullable String setterArg) { - this.streetAddress = setterArg; - } - - private @Nullable String locality; - - public @Nullable String getLocality() { - return locality; - } - - public void setLocality(@Nullable String setterArg) { - this.locality = setterArg; - } - - private @Nullable String region; - - public @Nullable String getRegion() { - return region; - } - - public void setRegion(@Nullable String setterArg) { - this.region = setterArg; - } - - private @Nullable String postalCode; - - public @Nullable String getPostalCode() { - return postalCode; - } - - public void setPostalCode(@Nullable String setterArg) { - this.postalCode = setterArg; - } - - private @Nullable String country; - - public @Nullable String getCountry() { - return country; - } - - public void setCountry(@Nullable String setterArg) { - this.country = setterArg; - } - - public static final class Builder { - - private @Nullable String formatted; - - public @NonNull Builder setFormatted(@Nullable String setterArg) { - this.formatted = setterArg; - return this; - } - - private @Nullable String streetAddress; - - public @NonNull Builder setStreetAddress(@Nullable String setterArg) { - this.streetAddress = setterArg; - return this; - } - - private @Nullable String locality; - - public @NonNull Builder setLocality(@Nullable String setterArg) { - this.locality = setterArg; - return this; - } - - private @Nullable String region; - - public @NonNull Builder setRegion(@Nullable String setterArg) { - this.region = setterArg; - return this; - } - - private @Nullable String postalCode; - - public @NonNull Builder setPostalCode(@Nullable String setterArg) { - this.postalCode = setterArg; - return this; - } - - private @Nullable String country; - - public @NonNull Builder setCountry(@Nullable String setterArg) { - this.country = setterArg; - return this; - } - - public @NonNull AddressInterface build() { - AddressInterface pigeonReturn = new AddressInterface(); - pigeonReturn.setFormatted(formatted); - pigeonReturn.setStreetAddress(streetAddress); - pigeonReturn.setLocality(locality); - pigeonReturn.setRegion(region); - pigeonReturn.setPostalCode(postalCode); - pigeonReturn.setCountry(country); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(6); - toListResult.add(formatted); - toListResult.add(streetAddress); - toListResult.add(locality); - toListResult.add(region); - toListResult.add(postalCode); - toListResult.add(country); - return toListResult; - } - - static @NonNull AddressInterface fromList(@NonNull ArrayList list) { - AddressInterface pigeonResult = new AddressInterface(); - Object formatted = list.get(0); - pigeonResult.setFormatted((String) formatted); - Object streetAddress = list.get(1); - pigeonResult.setStreetAddress((String) streetAddress); - Object locality = list.get(2); - pigeonResult.setLocality((String) locality); - Object region = list.get(3); - pigeonResult.setRegion((String) region); - Object postalCode = list.get(4); - pigeonResult.setPostalCode((String) postalCode); - Object country = list.get(5); - pigeonResult.setCountry((String) country); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class OpenIdUserInterface { - private @Nullable String id; - - public @Nullable String getId() { - return id; - } - - public void setId(@Nullable String setterArg) { - this.id = setterArg; - } - - private @Nullable String name; - - public @Nullable String getName() { - return name; - } - - public void setName(@Nullable String setterArg) { - this.name = setterArg; - } - - private @Nullable String preferredUsername; - - public @Nullable String getPreferredUsername() { - return preferredUsername; - } - - public void setPreferredUsername(@Nullable String setterArg) { - this.preferredUsername = setterArg; - } - - private @Nullable String givenName; - - public @Nullable String getGivenName() { - return givenName; - } - - public void setGivenName(@Nullable String setterArg) { - this.givenName = setterArg; - } - - private @Nullable String familyName; - - public @Nullable String getFamilyName() { - return familyName; - } - - public void setFamilyName(@Nullable String setterArg) { - this.familyName = setterArg; - } - - private @Nullable String middleName; - - public @Nullable String getMiddleName() { - return middleName; - } - - public void setMiddleName(@Nullable String setterArg) { - this.middleName = setterArg; - } - - private @Nullable String nickname; - - public @Nullable String getNickname() { - return nickname; - } - - public void setNickname(@Nullable String setterArg) { - this.nickname = setterArg; - } - - private @Nullable String picture; - - public @Nullable String getPicture() { - return picture; - } - - public void setPicture(@Nullable String setterArg) { - this.picture = setterArg; - } - - private @Nullable String website; - - public @Nullable String getWebsite() { - return website; - } - - public void setWebsite(@Nullable String setterArg) { - this.website = setterArg; - } - - private @Nullable String email; - - public @Nullable String getEmail() { - return email; - } - - public void setEmail(@Nullable String setterArg) { - this.email = setterArg; - } - - private @Nullable Boolean emailVerified; - - public @Nullable Boolean getEmailVerified() { - return emailVerified; - } - - public void setEmailVerified(@Nullable Boolean setterArg) { - this.emailVerified = setterArg; - } - - private @Nullable String gender; - - public @Nullable String getGender() { - return gender; - } - - public void setGender(@Nullable String setterArg) { - this.gender = setterArg; - } - - private @Nullable String zoneinfo; - - public @Nullable String getZoneinfo() { - return zoneinfo; - } - - public void setZoneinfo(@Nullable String setterArg) { - this.zoneinfo = setterArg; - } - - private @Nullable String locale; - - public @Nullable String getLocale() { - return locale; - } - - public void setLocale(@Nullable String setterArg) { - this.locale = setterArg; - } - - private @Nullable String phoneNumber; - - public @Nullable String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - } - - private @Nullable Boolean phoneNumberVerified; - - public @Nullable Boolean getPhoneNumberVerified() { - return phoneNumberVerified; - } - - public void setPhoneNumberVerified(@Nullable Boolean setterArg) { - this.phoneNumberVerified = setterArg; - } - - private @Nullable AddressInterface address; - - public @Nullable AddressInterface getAddress() { - return address; - } - - public void setAddress(@Nullable AddressInterface setterArg) { - this.address = setterArg; - } - - private @Nullable String birthdate; - - public @Nullable String getBirthdate() { - return birthdate; - } - - public void setBirthdate(@Nullable String setterArg) { - this.birthdate = setterArg; - } - - private @Nullable String externalId; - - public @Nullable String getExternalId() { - return externalId; - } - - public void setExternalId(@Nullable String setterArg) { - this.externalId = setterArg; - } - - public static final class Builder { - - private @Nullable String id; - - public @NonNull Builder setId(@Nullable String setterArg) { - this.id = setterArg; - return this; - } - - private @Nullable String name; - - public @NonNull Builder setName(@Nullable String setterArg) { - this.name = setterArg; - return this; - } - - private @Nullable String preferredUsername; - - public @NonNull Builder setPreferredUsername(@Nullable String setterArg) { - this.preferredUsername = setterArg; - return this; - } - - private @Nullable String givenName; - - public @NonNull Builder setGivenName(@Nullable String setterArg) { - this.givenName = setterArg; - return this; - } - - private @Nullable String familyName; - - public @NonNull Builder setFamilyName(@Nullable String setterArg) { - this.familyName = setterArg; - return this; - } - - private @Nullable String middleName; - - public @NonNull Builder setMiddleName(@Nullable String setterArg) { - this.middleName = setterArg; - return this; - } - - private @Nullable String nickname; - - public @NonNull Builder setNickname(@Nullable String setterArg) { - this.nickname = setterArg; - return this; - } - - private @Nullable String picture; - - public @NonNull Builder setPicture(@Nullable String setterArg) { - this.picture = setterArg; - return this; - } - - private @Nullable String website; - - public @NonNull Builder setWebsite(@Nullable String setterArg) { - this.website = setterArg; - return this; - } - - private @Nullable String email; - - public @NonNull Builder setEmail(@Nullable String setterArg) { - this.email = setterArg; - return this; - } - - private @Nullable Boolean emailVerified; - - public @NonNull Builder setEmailVerified(@Nullable Boolean setterArg) { - this.emailVerified = setterArg; - return this; - } - - private @Nullable String gender; - - public @NonNull Builder setGender(@Nullable String setterArg) { - this.gender = setterArg; - return this; - } - - private @Nullable String zoneinfo; - - public @NonNull Builder setZoneinfo(@Nullable String setterArg) { - this.zoneinfo = setterArg; - return this; - } - - private @Nullable String locale; - - public @NonNull Builder setLocale(@Nullable String setterArg) { - this.locale = setterArg; - return this; - } - - private @Nullable String phoneNumber; - - public @NonNull Builder setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - return this; - } - - private @Nullable Boolean phoneNumberVerified; - - public @NonNull Builder setPhoneNumberVerified(@Nullable Boolean setterArg) { - this.phoneNumberVerified = setterArg; - return this; - } - - private @Nullable AddressInterface address; - - public @NonNull Builder setAddress(@Nullable AddressInterface setterArg) { - this.address = setterArg; - return this; - } - - private @Nullable String birthdate; - - public @NonNull Builder setBirthdate(@Nullable String setterArg) { - this.birthdate = setterArg; - return this; - } - - private @Nullable String externalId; - - public @NonNull Builder setExternalId(@Nullable String setterArg) { - this.externalId = setterArg; - return this; - } - - public @NonNull OpenIdUserInterface build() { - OpenIdUserInterface pigeonReturn = new OpenIdUserInterface(); - pigeonReturn.setId(id); - pigeonReturn.setName(name); - pigeonReturn.setPreferredUsername(preferredUsername); - pigeonReturn.setGivenName(givenName); - pigeonReturn.setFamilyName(familyName); - pigeonReturn.setMiddleName(middleName); - pigeonReturn.setNickname(nickname); - pigeonReturn.setPicture(picture); - pigeonReturn.setWebsite(website); - pigeonReturn.setEmail(email); - pigeonReturn.setEmailVerified(emailVerified); - pigeonReturn.setGender(gender); - pigeonReturn.setZoneinfo(zoneinfo); - pigeonReturn.setLocale(locale); - pigeonReturn.setPhoneNumber(phoneNumber); - pigeonReturn.setPhoneNumberVerified(phoneNumberVerified); - pigeonReturn.setAddress(address); - pigeonReturn.setBirthdate(birthdate); - pigeonReturn.setExternalId(externalId); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(19); - toListResult.add(id); - toListResult.add(name); - toListResult.add(preferredUsername); - toListResult.add(givenName); - toListResult.add(familyName); - toListResult.add(middleName); - toListResult.add(nickname); - toListResult.add(picture); - toListResult.add(website); - toListResult.add(email); - toListResult.add(emailVerified); - toListResult.add(gender); - toListResult.add(zoneinfo); - toListResult.add(locale); - toListResult.add(phoneNumber); - toListResult.add(phoneNumberVerified); - toListResult.add((address == null) ? null : address.toList()); - toListResult.add(birthdate); - toListResult.add(externalId); - return toListResult; - } - - static @NonNull OpenIdUserInterface fromList(@NonNull ArrayList list) { - OpenIdUserInterface pigeonResult = new OpenIdUserInterface(); - Object id = list.get(0); - pigeonResult.setId((String) id); - Object name = list.get(1); - pigeonResult.setName((String) name); - Object preferredUsername = list.get(2); - pigeonResult.setPreferredUsername((String) preferredUsername); - Object givenName = list.get(3); - pigeonResult.setGivenName((String) givenName); - Object familyName = list.get(4); - pigeonResult.setFamilyName((String) familyName); - Object middleName = list.get(5); - pigeonResult.setMiddleName((String) middleName); - Object nickname = list.get(6); - pigeonResult.setNickname((String) nickname); - Object picture = list.get(7); - pigeonResult.setPicture((String) picture); - Object website = list.get(8); - pigeonResult.setWebsite((String) website); - Object email = list.get(9); - pigeonResult.setEmail((String) email); - Object emailVerified = list.get(10); - pigeonResult.setEmailVerified((Boolean) emailVerified); - Object gender = list.get(11); - pigeonResult.setGender((String) gender); - Object zoneinfo = list.get(12); - pigeonResult.setZoneinfo((String) zoneinfo); - Object locale = list.get(13); - pigeonResult.setLocale((String) locale); - Object phoneNumber = list.get(14); - pigeonResult.setPhoneNumber((String) phoneNumber); - Object phoneNumberVerified = list.get(15); - pigeonResult.setPhoneNumberVerified((Boolean) phoneNumberVerified); - Object address = list.get(16); - pigeonResult.setAddress((address == null) ? null : AddressInterface.fromList((ArrayList) address)); - Object birthdate = list.get(17); - pigeonResult.setBirthdate((String) birthdate); - Object externalId = list.get(18); - pigeonResult.setExternalId((String) externalId); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class AuthTokenInterface { - private @Nullable String idToken; - - public @Nullable String getIdToken() { - return idToken; - } - - public void setIdToken(@Nullable String setterArg) { - this.idToken = setterArg; - } - - private @NonNull String accessToken; - - public @NonNull String getAccessToken() { - return accessToken; - } - - public void setAccessToken(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"accessToken\" is null."); - } - this.accessToken = setterArg; - } - - private @Nullable String refreshToken; - - public @Nullable String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(@Nullable String setterArg) { - this.refreshToken = setterArg; - } - - private @Nullable String tokenType; - - public @Nullable String getTokenType() { - return tokenType; - } - - public void setTokenType(@Nullable String setterArg) { - this.tokenType = setterArg; - } - - private @Nullable Long expiresIn; - - public @Nullable Long getExpiresIn() { - return expiresIn; - } - - public void setExpiresIn(@Nullable Long setterArg) { - this.expiresIn = setterArg; - } - - private @Nullable OpenIdUserInterface user; - - public @Nullable OpenIdUserInterface getUser() { - return user; - } - - public void setUser(@Nullable OpenIdUserInterface setterArg) { - this.user = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private AuthTokenInterface() {} - - public static final class Builder { - - private @Nullable String idToken; - - public @NonNull Builder setIdToken(@Nullable String setterArg) { - this.idToken = setterArg; - return this; - } - - private @Nullable String accessToken; - - public @NonNull Builder setAccessToken(@NonNull String setterArg) { - this.accessToken = setterArg; - return this; - } - - private @Nullable String refreshToken; - - public @NonNull Builder setRefreshToken(@Nullable String setterArg) { - this.refreshToken = setterArg; - return this; - } - - private @Nullable String tokenType; - - public @NonNull Builder setTokenType(@Nullable String setterArg) { - this.tokenType = setterArg; - return this; - } - - private @Nullable Long expiresIn; - - public @NonNull Builder setExpiresIn(@Nullable Long setterArg) { - this.expiresIn = setterArg; - return this; - } - - private @Nullable OpenIdUserInterface user; - - public @NonNull Builder setUser(@Nullable OpenIdUserInterface setterArg) { - this.user = setterArg; - return this; - } - - public @NonNull AuthTokenInterface build() { - AuthTokenInterface pigeonReturn = new AuthTokenInterface(); - pigeonReturn.setIdToken(idToken); - pigeonReturn.setAccessToken(accessToken); - pigeonReturn.setRefreshToken(refreshToken); - pigeonReturn.setTokenType(tokenType); - pigeonReturn.setExpiresIn(expiresIn); - pigeonReturn.setUser(user); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(6); - toListResult.add(idToken); - toListResult.add(accessToken); - toListResult.add(refreshToken); - toListResult.add(tokenType); - toListResult.add(expiresIn); - toListResult.add((user == null) ? null : user.toList()); - return toListResult; - } - - static @NonNull AuthTokenInterface fromList(@NonNull ArrayList list) { - AuthTokenInterface pigeonResult = new AuthTokenInterface(); - Object idToken = list.get(0); - pigeonResult.setIdToken((String) idToken); - Object accessToken = list.get(1); - pigeonResult.setAccessToken((String) accessToken); - Object refreshToken = list.get(2); - pigeonResult.setRefreshToken((String) refreshToken); - Object tokenType = list.get(3); - pigeonResult.setTokenType((String) tokenType); - Object expiresIn = list.get(4); - pigeonResult.setExpiresIn((expiresIn == null) ? null : ((expiresIn instanceof Integer) ? (Integer) expiresIn : (Long) expiresIn)); - Object user = list.get(5); - pigeonResult.setUser((user == null) ? null : OpenIdUserInterface.fromList((ArrayList) user)); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class LoginWithPasswordRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @Nullable String email; - - public @Nullable String getEmail() { - return email; - } - - public void setEmail(@Nullable String setterArg) { - this.email = setterArg; - } - - private @Nullable String phoneNumber; - - public @Nullable String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - } - - private @NonNull String password; - - public @NonNull String getPassword() { - return password; - } - - public void setPassword(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"password\" is null."); - } - this.password = setterArg; - } - - private @Nullable List scope; - - public @Nullable List getScope() { - return scope; - } - - public void setScope(@Nullable List setterArg) { - this.scope = setterArg; - } - - private @NonNull ErrorCodesInterface errorCodes; - - public @NonNull ErrorCodesInterface getErrorCodes() { - return errorCodes; - } - - public void setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"errorCodes\" is null."); - } - this.errorCodes = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private LoginWithPasswordRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable String email; - - public @NonNull Builder setEmail(@Nullable String setterArg) { - this.email = setterArg; - return this; - } - - private @Nullable String phoneNumber; - - public @NonNull Builder setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - return this; - } - - private @Nullable String password; - - public @NonNull Builder setPassword(@NonNull String setterArg) { - this.password = setterArg; - return this; - } - - private @Nullable List scope; - - public @NonNull Builder setScope(@Nullable List setterArg) { - this.scope = setterArg; - return this; - } - - private @Nullable ErrorCodesInterface errorCodes; - - public @NonNull Builder setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - this.errorCodes = setterArg; - return this; - } - - public @NonNull LoginWithPasswordRequestInterface build() { - LoginWithPasswordRequestInterface pigeonReturn = new LoginWithPasswordRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setEmail(email); - pigeonReturn.setPhoneNumber(phoneNumber); - pigeonReturn.setPassword(password); - pigeonReturn.setScope(scope); - pigeonReturn.setErrorCodes(errorCodes); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(6); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add(email); - toListResult.add(phoneNumber); - toListResult.add(password); - toListResult.add(scope); - toListResult.add((errorCodes == null) ? null : errorCodes.toList()); - return toListResult; - } - - static @NonNull LoginWithPasswordRequestInterface fromList(@NonNull ArrayList list) { - LoginWithPasswordRequestInterface pigeonResult = new LoginWithPasswordRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object email = list.get(1); - pigeonResult.setEmail((String) email); - Object phoneNumber = list.get(2); - pigeonResult.setPhoneNumber((String) phoneNumber); - Object password = list.get(3); - pigeonResult.setPassword((String) password); - Object scope = list.get(4); - pigeonResult.setScope((List) scope); - Object errorCodes = list.get(5); - pigeonResult.setErrorCodes((errorCodes == null) ? null : ErrorCodesInterface.fromList((ArrayList) errorCodes)); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class LoginWithProviderRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @NonNull String provider; - - public @NonNull String getProvider() { - return provider; - } - - public void setProvider(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"provider\" is null."); - } - this.provider = setterArg; - } - - private @NonNull String origin; - - public @NonNull String getOrigin() { - return origin; - } - - public void setOrigin(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"origin\" is null."); - } - this.origin = setterArg; - } - - private @Nullable List scope; - - public @Nullable List getScope() { - return scope; - } - - public void setScope(@Nullable List setterArg) { - this.scope = setterArg; - } - - private @NonNull ErrorCodesInterface errorCodes; - - public @NonNull ErrorCodesInterface getErrorCodes() { - return errorCodes; - } - - public void setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"errorCodes\" is null."); - } - this.errorCodes = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private LoginWithProviderRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable String provider; - - public @NonNull Builder setProvider(@NonNull String setterArg) { - this.provider = setterArg; - return this; - } - - private @Nullable String origin; - - public @NonNull Builder setOrigin(@NonNull String setterArg) { - this.origin = setterArg; - return this; - } - - private @Nullable List scope; - - public @NonNull Builder setScope(@Nullable List setterArg) { - this.scope = setterArg; - return this; - } - - private @Nullable ErrorCodesInterface errorCodes; - - public @NonNull Builder setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - this.errorCodes = setterArg; - return this; - } - - public @NonNull LoginWithProviderRequestInterface build() { - LoginWithProviderRequestInterface pigeonReturn = new LoginWithProviderRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setProvider(provider); - pigeonReturn.setOrigin(origin); - pigeonReturn.setScope(scope); - pigeonReturn.setErrorCodes(errorCodes); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(5); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add(provider); - toListResult.add(origin); - toListResult.add(scope); - toListResult.add((errorCodes == null) ? null : errorCodes.toList()); - return toListResult; - } - - static @NonNull LoginWithProviderRequestInterface fromList(@NonNull ArrayList list) { - LoginWithProviderRequestInterface pigeonResult = new LoginWithProviderRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object provider = list.get(1); - pigeonResult.setProvider((String) provider); - Object origin = list.get(2); - pigeonResult.setOrigin((String) origin); - Object scope = list.get(3); - pigeonResult.setScope((List) scope); - Object errorCodes = list.get(4); - pigeonResult.setErrorCodes((errorCodes == null) ? null : ErrorCodesInterface.fromList((ArrayList) errorCodes)); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class RefreshAccessTokenRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @NonNull AuthTokenInterface authToken; - - public @NonNull AuthTokenInterface getAuthToken() { - return authToken; - } - - public void setAuthToken(@NonNull AuthTokenInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"authToken\" is null."); - } - this.authToken = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private RefreshAccessTokenRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable AuthTokenInterface authToken; - - public @NonNull Builder setAuthToken(@NonNull AuthTokenInterface setterArg) { - this.authToken = setterArg; - return this; - } - - public @NonNull RefreshAccessTokenRequestInterface build() { - RefreshAccessTokenRequestInterface pigeonReturn = new RefreshAccessTokenRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setAuthToken(authToken); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add((authToken == null) ? null : authToken.toList()); - return toListResult; - } - - static @NonNull RefreshAccessTokenRequestInterface fromList(@NonNull ArrayList list) { - RefreshAccessTokenRequestInterface pigeonResult = new RefreshAccessTokenRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object authToken = list.get(1); - pigeonResult.setAuthToken((authToken == null) ? null : AuthTokenInterface.fromList((ArrayList) authToken)); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class LoginSummaryInterface { - private @Nullable Double firstLogin; - - public @Nullable Double getFirstLogin() { - return firstLogin; - } - - public void setFirstLogin(@Nullable Double setterArg) { - this.firstLogin = setterArg; - } - - private @Nullable Double lastLogin; - - public @Nullable Double getLastLogin() { - return lastLogin; - } - - public void setLastLogin(@Nullable Double setterArg) { - this.lastLogin = setterArg; - } - - private @Nullable Long total; - - public @Nullable Long getTotal() { - return total; - } - - public void setTotal(@Nullable Long setterArg) { - this.total = setterArg; - } - - private @Nullable List origins; - - public @Nullable List getOrigins() { - return origins; - } - - public void setOrigins(@Nullable List setterArg) { - this.origins = setterArg; - } - - private @Nullable List devices; - - public @Nullable List getDevices() { - return devices; - } - - public void setDevices(@Nullable List setterArg) { - this.devices = setterArg; - } - - private @Nullable String lastProvider; - - public @Nullable String getLastProvider() { - return lastProvider; - } - - public void setLastProvider(@Nullable String setterArg) { - this.lastProvider = setterArg; - } - - public static final class Builder { - - private @Nullable Double firstLogin; - - public @NonNull Builder setFirstLogin(@Nullable Double setterArg) { - this.firstLogin = setterArg; - return this; - } - - private @Nullable Double lastLogin; - - public @NonNull Builder setLastLogin(@Nullable Double setterArg) { - this.lastLogin = setterArg; - return this; - } - - private @Nullable Long total; - - public @NonNull Builder setTotal(@Nullable Long setterArg) { - this.total = setterArg; - return this; - } - - private @Nullable List origins; - - public @NonNull Builder setOrigins(@Nullable List setterArg) { - this.origins = setterArg; - return this; - } - - private @Nullable List devices; - - public @NonNull Builder setDevices(@Nullable List setterArg) { - this.devices = setterArg; - return this; - } - - private @Nullable String lastProvider; - - public @NonNull Builder setLastProvider(@Nullable String setterArg) { - this.lastProvider = setterArg; - return this; - } - - public @NonNull LoginSummaryInterface build() { - LoginSummaryInterface pigeonReturn = new LoginSummaryInterface(); - pigeonReturn.setFirstLogin(firstLogin); - pigeonReturn.setLastLogin(lastLogin); - pigeonReturn.setTotal(total); - pigeonReturn.setOrigins(origins); - pigeonReturn.setDevices(devices); - pigeonReturn.setLastProvider(lastProvider); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(6); - toListResult.add(firstLogin); - toListResult.add(lastLogin); - toListResult.add(total); - toListResult.add(origins); - toListResult.add(devices); - toListResult.add(lastProvider); - return toListResult; - } - - static @NonNull LoginSummaryInterface fromList(@NonNull ArrayList list) { - LoginSummaryInterface pigeonResult = new LoginSummaryInterface(); - Object firstLogin = list.get(0); - pigeonResult.setFirstLogin((Double) firstLogin); - Object lastLogin = list.get(1); - pigeonResult.setLastLogin((Double) lastLogin); - Object total = list.get(2); - pigeonResult.setTotal((total == null) ? null : ((total instanceof Integer) ? (Integer) total : (Long) total)); - Object origins = list.get(3); - pigeonResult.setOrigins((List) origins); - Object devices = list.get(4); - pigeonResult.setDevices((List) devices); - Object lastProvider = list.get(5); - pigeonResult.setLastProvider((String) lastProvider); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class EmailsInterface { - private @Nullable List verified; - - public @Nullable List getVerified() { - return verified; - } - - public void setVerified(@Nullable List setterArg) { - this.verified = setterArg; - } - - private @Nullable List unverified; - - public @Nullable List getUnverified() { - return unverified; - } - - public void setUnverified(@Nullable List setterArg) { - this.unverified = setterArg; - } - - public static final class Builder { - - private @Nullable List verified; - - public @NonNull Builder setVerified(@Nullable List setterArg) { - this.verified = setterArg; - return this; - } - - private @Nullable List unverified; - - public @NonNull Builder setUnverified(@Nullable List setterArg) { - this.unverified = setterArg; - return this; - } - - public @NonNull EmailsInterface build() { - EmailsInterface pigeonReturn = new EmailsInterface(); - pigeonReturn.setVerified(verified); - pigeonReturn.setUnverified(unverified); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add(verified); - toListResult.add(unverified); - return toListResult; - } - - static @NonNull EmailsInterface fromList(@NonNull ArrayList list) { - EmailsInterface pigeonResult = new EmailsInterface(); - Object verified = list.get(0); - pigeonResult.setVerified((List) verified); - Object unverified = list.get(1); - pigeonResult.setUnverified((List) unverified); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class ProfileInterface { - private @Nullable String uid; - - public @Nullable String getUid() { - return uid; - } - - public void setUid(@Nullable String setterArg) { - this.uid = setterArg; - } - - private @Nullable String givenName; - - public @Nullable String getGivenName() { - return givenName; - } - - public void setGivenName(@Nullable String setterArg) { - this.givenName = setterArg; - } - - private @Nullable String middleName; - - public @Nullable String getMiddleName() { - return middleName; - } - - public void setMiddleName(@Nullable String setterArg) { - this.middleName = setterArg; - } - - private @Nullable String familyName; - - public @Nullable String getFamilyName() { - return familyName; - } - - public void setFamilyName(@Nullable String setterArg) { - this.familyName = setterArg; - } - - private @Nullable String name; - - public @Nullable String getName() { - return name; - } - - public void setName(@Nullable String setterArg) { - this.name = setterArg; - } - - private @Nullable String nickname; - - public @Nullable String getNickname() { - return nickname; - } - - public void setNickname(@Nullable String setterArg) { - this.nickname = setterArg; - } - - private @Nullable String birthdate; - - public @Nullable String getBirthdate() { - return birthdate; - } - - public void setBirthdate(@Nullable String setterArg) { - this.birthdate = setterArg; - } - - private @Nullable String profileURL; - - public @Nullable String getProfileURL() { - return profileURL; - } - - public void setProfileURL(@Nullable String setterArg) { - this.profileURL = setterArg; - } - - private @Nullable String picture; - - public @Nullable String getPicture() { - return picture; - } - - public void setPicture(@Nullable String setterArg) { - this.picture = setterArg; - } - - private @Nullable String externalId; - - public @Nullable String getExternalId() { - return externalId; - } - - public void setExternalId(@Nullable String setterArg) { - this.externalId = setterArg; - } - - private @Nullable List authTypes; - - public @Nullable List getAuthTypes() { - return authTypes; - } - - public void setAuthTypes(@Nullable List setterArg) { - this.authTypes = setterArg; - } - - private @Nullable LoginSummaryInterface loginSummary; - - public @Nullable LoginSummaryInterface getLoginSummary() { - return loginSummary; - } - - public void setLoginSummary(@Nullable LoginSummaryInterface setterArg) { - this.loginSummary = setterArg; - } - - private @Nullable String username; - - public @Nullable String getUsername() { - return username; - } - - public void setUsername(@Nullable String setterArg) { - this.username = setterArg; - } - - private @Nullable String gender; - - public @Nullable String getGender() { - return gender; - } - - public void setGender(@Nullable String setterArg) { - this.gender = setterArg; - } - - private @Nullable String email; - - public @Nullable String getEmail() { - return email; - } - - public void setEmail(@Nullable String setterArg) { - this.email = setterArg; - } - - private @Nullable Boolean emailVerified; - - public @Nullable Boolean getEmailVerified() { - return emailVerified; - } - - public void setEmailVerified(@Nullable Boolean setterArg) { - this.emailVerified = setterArg; - } - - private @Nullable EmailsInterface emails; - - public @Nullable EmailsInterface getEmails() { - return emails; - } - - public void setEmails(@Nullable EmailsInterface setterArg) { - this.emails = setterArg; - } - - private @Nullable String phoneNumber; - - public @Nullable String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - } - - private @Nullable Boolean phoneNumberVerified; - - public @Nullable Boolean getPhoneNumberVerified() { - return phoneNumberVerified; - } - - public void setPhoneNumberVerified(@Nullable Boolean setterArg) { - this.phoneNumberVerified = setterArg; - } - - private @Nullable List addresses; - - public @Nullable List getAddresses() { - return addresses; - } - - public void setAddresses(@Nullable List setterArg) { - this.addresses = setterArg; - } - - private @Nullable String locale; - - public @Nullable String getLocale() { - return locale; - } - - public void setLocale(@Nullable String setterArg) { - this.locale = setterArg; - } - - private @Nullable String bio; - - public @Nullable String getBio() { - return bio; - } - - public void setBio(@Nullable String setterArg) { - this.bio = setterArg; - } - - private @Nullable Map customFields; - - public @Nullable Map getCustomFields() { - return customFields; - } - - public void setCustomFields(@Nullable Map setterArg) { - this.customFields = setterArg; - } - - private @Nullable Map consents; - - public @Nullable Map getConsents() { - return consents; - } - - public void setConsents(@Nullable Map setterArg) { - this.consents = setterArg; - } - - private @Nullable String createdAt; - - public @Nullable String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(@Nullable String setterArg) { - this.createdAt = setterArg; - } - - private @Nullable String updatedAt; - - public @Nullable String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(@Nullable String setterArg) { - this.updatedAt = setterArg; - } - - private @Nullable Boolean liteOnly; - - public @Nullable Boolean getLiteOnly() { - return liteOnly; - } - - public void setLiteOnly(@Nullable Boolean setterArg) { - this.liteOnly = setterArg; - } - - private @Nullable String company; - - public @Nullable String getCompany() { - return company; - } - - public void setCompany(@Nullable String setterArg) { - this.company = setterArg; - } - - public static final class Builder { - - private @Nullable String uid; - - public @NonNull Builder setUid(@Nullable String setterArg) { - this.uid = setterArg; - return this; - } - - private @Nullable String givenName; - - public @NonNull Builder setGivenName(@Nullable String setterArg) { - this.givenName = setterArg; - return this; - } - - private @Nullable String middleName; - - public @NonNull Builder setMiddleName(@Nullable String setterArg) { - this.middleName = setterArg; - return this; - } - - private @Nullable String familyName; - - public @NonNull Builder setFamilyName(@Nullable String setterArg) { - this.familyName = setterArg; - return this; - } - - private @Nullable String name; - - public @NonNull Builder setName(@Nullable String setterArg) { - this.name = setterArg; - return this; - } - - private @Nullable String nickname; - - public @NonNull Builder setNickname(@Nullable String setterArg) { - this.nickname = setterArg; - return this; - } - - private @Nullable String birthdate; - - public @NonNull Builder setBirthdate(@Nullable String setterArg) { - this.birthdate = setterArg; - return this; - } - - private @Nullable String profileURL; - - public @NonNull Builder setProfileURL(@Nullable String setterArg) { - this.profileURL = setterArg; - return this; - } - - private @Nullable String picture; - - public @NonNull Builder setPicture(@Nullable String setterArg) { - this.picture = setterArg; - return this; - } - - private @Nullable String externalId; - - public @NonNull Builder setExternalId(@Nullable String setterArg) { - this.externalId = setterArg; - return this; - } - - private @Nullable List authTypes; - - public @NonNull Builder setAuthTypes(@Nullable List setterArg) { - this.authTypes = setterArg; - return this; - } - - private @Nullable LoginSummaryInterface loginSummary; - - public @NonNull Builder setLoginSummary(@Nullable LoginSummaryInterface setterArg) { - this.loginSummary = setterArg; - return this; - } - - private @Nullable String username; - - public @NonNull Builder setUsername(@Nullable String setterArg) { - this.username = setterArg; - return this; - } - - private @Nullable String gender; - - public @NonNull Builder setGender(@Nullable String setterArg) { - this.gender = setterArg; - return this; - } - - private @Nullable String email; - - public @NonNull Builder setEmail(@Nullable String setterArg) { - this.email = setterArg; - return this; - } - - private @Nullable Boolean emailVerified; - - public @NonNull Builder setEmailVerified(@Nullable Boolean setterArg) { - this.emailVerified = setterArg; - return this; - } - - private @Nullable EmailsInterface emails; - - public @NonNull Builder setEmails(@Nullable EmailsInterface setterArg) { - this.emails = setterArg; - return this; - } - - private @Nullable String phoneNumber; - - public @NonNull Builder setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - return this; - } - - private @Nullable Boolean phoneNumberVerified; - - public @NonNull Builder setPhoneNumberVerified(@Nullable Boolean setterArg) { - this.phoneNumberVerified = setterArg; - return this; - } - - private @Nullable List addresses; - - public @NonNull Builder setAddresses(@Nullable List setterArg) { - this.addresses = setterArg; - return this; - } - - private @Nullable String locale; - - public @NonNull Builder setLocale(@Nullable String setterArg) { - this.locale = setterArg; - return this; - } - - private @Nullable String bio; - - public @NonNull Builder setBio(@Nullable String setterArg) { - this.bio = setterArg; - return this; - } - - private @Nullable Map customFields; - - public @NonNull Builder setCustomFields(@Nullable Map setterArg) { - this.customFields = setterArg; - return this; - } - - private @Nullable Map consents; - - public @NonNull Builder setConsents(@Nullable Map setterArg) { - this.consents = setterArg; - return this; - } - - private @Nullable String createdAt; - - public @NonNull Builder setCreatedAt(@Nullable String setterArg) { - this.createdAt = setterArg; - return this; - } - - private @Nullable String updatedAt; - - public @NonNull Builder setUpdatedAt(@Nullable String setterArg) { - this.updatedAt = setterArg; - return this; - } - - private @Nullable Boolean liteOnly; - - public @NonNull Builder setLiteOnly(@Nullable Boolean setterArg) { - this.liteOnly = setterArg; - return this; - } - - private @Nullable String company; - - public @NonNull Builder setCompany(@Nullable String setterArg) { - this.company = setterArg; - return this; - } - - public @NonNull ProfileInterface build() { - ProfileInterface pigeonReturn = new ProfileInterface(); - pigeonReturn.setUid(uid); - pigeonReturn.setGivenName(givenName); - pigeonReturn.setMiddleName(middleName); - pigeonReturn.setFamilyName(familyName); - pigeonReturn.setName(name); - pigeonReturn.setNickname(nickname); - pigeonReturn.setBirthdate(birthdate); - pigeonReturn.setProfileURL(profileURL); - pigeonReturn.setPicture(picture); - pigeonReturn.setExternalId(externalId); - pigeonReturn.setAuthTypes(authTypes); - pigeonReturn.setLoginSummary(loginSummary); - pigeonReturn.setUsername(username); - pigeonReturn.setGender(gender); - pigeonReturn.setEmail(email); - pigeonReturn.setEmailVerified(emailVerified); - pigeonReturn.setEmails(emails); - pigeonReturn.setPhoneNumber(phoneNumber); - pigeonReturn.setPhoneNumberVerified(phoneNumberVerified); - pigeonReturn.setAddresses(addresses); - pigeonReturn.setLocale(locale); - pigeonReturn.setBio(bio); - pigeonReturn.setCustomFields(customFields); - pigeonReturn.setConsents(consents); - pigeonReturn.setCreatedAt(createdAt); - pigeonReturn.setUpdatedAt(updatedAt); - pigeonReturn.setLiteOnly(liteOnly); - pigeonReturn.setCompany(company); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(28); - toListResult.add(uid); - toListResult.add(givenName); - toListResult.add(middleName); - toListResult.add(familyName); - toListResult.add(name); - toListResult.add(nickname); - toListResult.add(birthdate); - toListResult.add(profileURL); - toListResult.add(picture); - toListResult.add(externalId); - toListResult.add(authTypes); - toListResult.add((loginSummary == null) ? null : loginSummary.toList()); - toListResult.add(username); - toListResult.add(gender); - toListResult.add(email); - toListResult.add(emailVerified); - toListResult.add((emails == null) ? null : emails.toList()); - toListResult.add(phoneNumber); - toListResult.add(phoneNumberVerified); - toListResult.add(addresses); - toListResult.add(locale); - toListResult.add(bio); - toListResult.add(customFields); - toListResult.add(consents); - toListResult.add(createdAt); - toListResult.add(updatedAt); - toListResult.add(liteOnly); - toListResult.add(company); - return toListResult; - } - - static @NonNull ProfileInterface fromList(@NonNull ArrayList list) { - ProfileInterface pigeonResult = new ProfileInterface(); - Object uid = list.get(0); - pigeonResult.setUid((String) uid); - Object givenName = list.get(1); - pigeonResult.setGivenName((String) givenName); - Object middleName = list.get(2); - pigeonResult.setMiddleName((String) middleName); - Object familyName = list.get(3); - pigeonResult.setFamilyName((String) familyName); - Object name = list.get(4); - pigeonResult.setName((String) name); - Object nickname = list.get(5); - pigeonResult.setNickname((String) nickname); - Object birthdate = list.get(6); - pigeonResult.setBirthdate((String) birthdate); - Object profileURL = list.get(7); - pigeonResult.setProfileURL((String) profileURL); - Object picture = list.get(8); - pigeonResult.setPicture((String) picture); - Object externalId = list.get(9); - pigeonResult.setExternalId((String) externalId); - Object authTypes = list.get(10); - pigeonResult.setAuthTypes((List) authTypes); - Object loginSummary = list.get(11); - pigeonResult.setLoginSummary((loginSummary == null) ? null : LoginSummaryInterface.fromList((ArrayList) loginSummary)); - Object username = list.get(12); - pigeonResult.setUsername((String) username); - Object gender = list.get(13); - pigeonResult.setGender((String) gender); - Object email = list.get(14); - pigeonResult.setEmail((String) email); - Object emailVerified = list.get(15); - pigeonResult.setEmailVerified((Boolean) emailVerified); - Object emails = list.get(16); - pigeonResult.setEmails((emails == null) ? null : EmailsInterface.fromList((ArrayList) emails)); - Object phoneNumber = list.get(17); - pigeonResult.setPhoneNumber((String) phoneNumber); - Object phoneNumberVerified = list.get(18); - pigeonResult.setPhoneNumberVerified((Boolean) phoneNumberVerified); - Object addresses = list.get(19); - pigeonResult.setAddresses((List) addresses); - Object locale = list.get(20); - pigeonResult.setLocale((String) locale); - Object bio = list.get(21); - pigeonResult.setBio((String) bio); - Object customFields = list.get(22); - pigeonResult.setCustomFields((Map) customFields); - Object consents = list.get(23); - pigeonResult.setConsents((Map) consents); - Object createdAt = list.get(24); - pigeonResult.setCreatedAt((String) createdAt); - Object updatedAt = list.get(25); - pigeonResult.setUpdatedAt((String) updatedAt); - Object liteOnly = list.get(26); - pigeonResult.setLiteOnly((Boolean) liteOnly); - Object company = list.get(27); - pigeonResult.setCompany((String) company); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class GetProfileRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @NonNull AuthTokenInterface authToken; - - public @NonNull AuthTokenInterface getAuthToken() { - return authToken; - } - - public void setAuthToken(@NonNull AuthTokenInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"authToken\" is null."); - } - this.authToken = setterArg; - } - - private @NonNull ErrorCodesInterface errorCodes; - - public @NonNull ErrorCodesInterface getErrorCodes() { - return errorCodes; - } - - public void setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"errorCodes\" is null."); - } - this.errorCodes = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private GetProfileRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable AuthTokenInterface authToken; - - public @NonNull Builder setAuthToken(@NonNull AuthTokenInterface setterArg) { - this.authToken = setterArg; - return this; - } - - private @Nullable ErrorCodesInterface errorCodes; - - public @NonNull Builder setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - this.errorCodes = setterArg; - return this; - } - - public @NonNull GetProfileRequestInterface build() { - GetProfileRequestInterface pigeonReturn = new GetProfileRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setAuthToken(authToken); - pigeonReturn.setErrorCodes(errorCodes); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(3); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add((authToken == null) ? null : authToken.toList()); - toListResult.add((errorCodes == null) ? null : errorCodes.toList()); - return toListResult; - } - - static @NonNull GetProfileRequestInterface fromList(@NonNull ArrayList list) { - GetProfileRequestInterface pigeonResult = new GetProfileRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object authToken = list.get(1); - pigeonResult.setAuthToken((authToken == null) ? null : AuthTokenInterface.fromList((ArrayList) authToken)); - Object errorCodes = list.get(2); - pigeonResult.setErrorCodes((errorCodes == null) ? null : ErrorCodesInterface.fromList((ArrayList) errorCodes)); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class UpdateProfileRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @NonNull AuthTokenInterface authToken; - - public @NonNull AuthTokenInterface getAuthToken() { - return authToken; - } - - public void setAuthToken(@NonNull AuthTokenInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"authToken\" is null."); - } - this.authToken = setterArg; - } - - private @NonNull ProfileInterface profile; - - public @NonNull ProfileInterface getProfile() { - return profile; - } - - public void setProfile(@NonNull ProfileInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"profile\" is null."); - } - this.profile = setterArg; - } - - private @NonNull ErrorCodesInterface errorCodes; - - public @NonNull ErrorCodesInterface getErrorCodes() { - return errorCodes; - } - - public void setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"errorCodes\" is null."); - } - this.errorCodes = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private UpdateProfileRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable AuthTokenInterface authToken; - - public @NonNull Builder setAuthToken(@NonNull AuthTokenInterface setterArg) { - this.authToken = setterArg; - return this; - } - - private @Nullable ProfileInterface profile; - - public @NonNull Builder setProfile(@NonNull ProfileInterface setterArg) { - this.profile = setterArg; - return this; - } - - private @Nullable ErrorCodesInterface errorCodes; - - public @NonNull Builder setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - this.errorCodes = setterArg; - return this; - } - - public @NonNull UpdateProfileRequestInterface build() { - UpdateProfileRequestInterface pigeonReturn = new UpdateProfileRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setAuthToken(authToken); - pigeonReturn.setProfile(profile); - pigeonReturn.setErrorCodes(errorCodes); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(4); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add((authToken == null) ? null : authToken.toList()); - toListResult.add((profile == null) ? null : profile.toList()); - toListResult.add((errorCodes == null) ? null : errorCodes.toList()); - return toListResult; - } - - static @NonNull UpdateProfileRequestInterface fromList(@NonNull ArrayList list) { - UpdateProfileRequestInterface pigeonResult = new UpdateProfileRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object authToken = list.get(1); - pigeonResult.setAuthToken((authToken == null) ? null : AuthTokenInterface.fromList((ArrayList) authToken)); - Object profile = list.get(2); - pigeonResult.setProfile((profile == null) ? null : ProfileInterface.fromList((ArrayList) profile)); - Object errorCodes = list.get(3); - pigeonResult.setErrorCodes((errorCodes == null) ? null : ErrorCodesInterface.fromList((ArrayList) errorCodes)); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class RequestPasswordResetRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @Nullable String email; - - public @Nullable String getEmail() { - return email; - } - - public void setEmail(@Nullable String setterArg) { - this.email = setterArg; - } - - private @Nullable String phoneNumber; - - public @Nullable String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - } - - private @Nullable String redirectUrl; - - public @Nullable String getRedirectUrl() { - return redirectUrl; - } - - public void setRedirectUrl(@Nullable String setterArg) { - this.redirectUrl = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private RequestPasswordResetRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable String email; - - public @NonNull Builder setEmail(@Nullable String setterArg) { - this.email = setterArg; - return this; - } - - private @Nullable String phoneNumber; - - public @NonNull Builder setPhoneNumber(@Nullable String setterArg) { - this.phoneNumber = setterArg; - return this; - } - - private @Nullable String redirectUrl; - - public @NonNull Builder setRedirectUrl(@Nullable String setterArg) { - this.redirectUrl = setterArg; - return this; - } - - public @NonNull RequestPasswordResetRequestInterface build() { - RequestPasswordResetRequestInterface pigeonReturn = new RequestPasswordResetRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setEmail(email); - pigeonReturn.setPhoneNumber(phoneNumber); - pigeonReturn.setRedirectUrl(redirectUrl); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(4); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add(email); - toListResult.add(phoneNumber); - toListResult.add(redirectUrl); - return toListResult; - } - - static @NonNull RequestPasswordResetRequestInterface fromList(@NonNull ArrayList list) { - RequestPasswordResetRequestInterface pigeonResult = new RequestPasswordResetRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object email = list.get(1); - pigeonResult.setEmail((String) email); - Object phoneNumber = list.get(2); - pigeonResult.setPhoneNumber((String) phoneNumber); - Object redirectUrl = list.get(3); - pigeonResult.setRedirectUrl((String) redirectUrl); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class UpdatePasswordWithAccessTokenRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @NonNull AuthTokenInterface authToken; - - public @NonNull AuthTokenInterface getAuthToken() { - return authToken; - } - - public void setAuthToken(@NonNull AuthTokenInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"authToken\" is null."); - } - this.authToken = setterArg; - } - - private @NonNull String oldPassword; - - public @NonNull String getOldPassword() { - return oldPassword; - } - - public void setOldPassword(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"oldPassword\" is null."); - } - this.oldPassword = setterArg; - } - - private @NonNull String password; - - public @NonNull String getPassword() { - return password; - } - - public void setPassword(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"password\" is null."); - } - this.password = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private UpdatePasswordWithAccessTokenRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable AuthTokenInterface authToken; - - public @NonNull Builder setAuthToken(@NonNull AuthTokenInterface setterArg) { - this.authToken = setterArg; - return this; - } - - private @Nullable String oldPassword; - - public @NonNull Builder setOldPassword(@NonNull String setterArg) { - this.oldPassword = setterArg; - return this; - } - - private @Nullable String password; - - public @NonNull Builder setPassword(@NonNull String setterArg) { - this.password = setterArg; - return this; - } - - public @NonNull UpdatePasswordWithAccessTokenRequestInterface build() { - UpdatePasswordWithAccessTokenRequestInterface pigeonReturn = new UpdatePasswordWithAccessTokenRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setAuthToken(authToken); - pigeonReturn.setOldPassword(oldPassword); - pigeonReturn.setPassword(password); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(4); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add((authToken == null) ? null : authToken.toList()); - toListResult.add(oldPassword); - toListResult.add(password); - return toListResult; - } - - static @NonNull UpdatePasswordWithAccessTokenRequestInterface fromList(@NonNull ArrayList list) { - UpdatePasswordWithAccessTokenRequestInterface pigeonResult = new UpdatePasswordWithAccessTokenRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object authToken = list.get(1); - pigeonResult.setAuthToken((authToken == null) ? null : AuthTokenInterface.fromList((ArrayList) authToken)); - Object oldPassword = list.get(2); - pigeonResult.setOldPassword((String) oldPassword); - Object password = list.get(3); - pigeonResult.setPassword((String) password); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class UpdatePasswordWithFreshAccessTokenRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @NonNull AuthTokenInterface freshAuthToken; - - public @NonNull AuthTokenInterface getFreshAuthToken() { - return freshAuthToken; - } - - public void setFreshAuthToken(@NonNull AuthTokenInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"freshAuthToken\" is null."); - } - this.freshAuthToken = setterArg; - } - - private @NonNull String password; - - public @NonNull String getPassword() { - return password; - } - - public void setPassword(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"password\" is null."); - } - this.password = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private UpdatePasswordWithFreshAccessTokenRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable AuthTokenInterface freshAuthToken; - - public @NonNull Builder setFreshAuthToken(@NonNull AuthTokenInterface setterArg) { - this.freshAuthToken = setterArg; - return this; - } - - private @Nullable String password; - - public @NonNull Builder setPassword(@NonNull String setterArg) { - this.password = setterArg; - return this; - } - - public @NonNull UpdatePasswordWithFreshAccessTokenRequestInterface build() { - UpdatePasswordWithFreshAccessTokenRequestInterface pigeonReturn = new UpdatePasswordWithFreshAccessTokenRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setFreshAuthToken(freshAuthToken); - pigeonReturn.setPassword(password); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(3); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add((freshAuthToken == null) ? null : freshAuthToken.toList()); - toListResult.add(password); - return toListResult; - } - - static @NonNull UpdatePasswordWithFreshAccessTokenRequestInterface fromList(@NonNull ArrayList list) { - UpdatePasswordWithFreshAccessTokenRequestInterface pigeonResult = new UpdatePasswordWithFreshAccessTokenRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object freshAuthToken = list.get(1); - pigeonResult.setFreshAuthToken((freshAuthToken == null) ? null : AuthTokenInterface.fromList((ArrayList) freshAuthToken)); - Object password = list.get(2); - pigeonResult.setPassword((String) password); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class UpdatePasswordWithEmailRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @NonNull String email; - - public @NonNull String getEmail() { - return email; - } - - public void setEmail(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"email\" is null."); - } - this.email = setterArg; - } - - private @NonNull String verificationCode; - - public @NonNull String getVerificationCode() { - return verificationCode; - } - - public void setVerificationCode(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"verificationCode\" is null."); - } - this.verificationCode = setterArg; - } - - private @NonNull String password; - - public @NonNull String getPassword() { - return password; - } - - public void setPassword(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"password\" is null."); - } - this.password = setterArg; - } - - private @NonNull ErrorCodesInterface errorCodes; - - public @NonNull ErrorCodesInterface getErrorCodes() { - return errorCodes; - } - - public void setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"errorCodes\" is null."); - } - this.errorCodes = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private UpdatePasswordWithEmailRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable String email; - - public @NonNull Builder setEmail(@NonNull String setterArg) { - this.email = setterArg; - return this; - } - - private @Nullable String verificationCode; - - public @NonNull Builder setVerificationCode(@NonNull String setterArg) { - this.verificationCode = setterArg; - return this; - } - - private @Nullable String password; - - public @NonNull Builder setPassword(@NonNull String setterArg) { - this.password = setterArg; - return this; - } - - private @Nullable ErrorCodesInterface errorCodes; - - public @NonNull Builder setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - this.errorCodes = setterArg; - return this; - } - - public @NonNull UpdatePasswordWithEmailRequestInterface build() { - UpdatePasswordWithEmailRequestInterface pigeonReturn = new UpdatePasswordWithEmailRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setEmail(email); - pigeonReturn.setVerificationCode(verificationCode); - pigeonReturn.setPassword(password); - pigeonReturn.setErrorCodes(errorCodes); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(5); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add(email); - toListResult.add(verificationCode); - toListResult.add(password); - toListResult.add((errorCodes == null) ? null : errorCodes.toList()); - return toListResult; - } - - static @NonNull UpdatePasswordWithEmailRequestInterface fromList(@NonNull ArrayList list) { - UpdatePasswordWithEmailRequestInterface pigeonResult = new UpdatePasswordWithEmailRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object email = list.get(1); - pigeonResult.setEmail((String) email); - Object verificationCode = list.get(2); - pigeonResult.setVerificationCode((String) verificationCode); - Object password = list.get(3); - pigeonResult.setPassword((String) password); - Object errorCodes = list.get(4); - pigeonResult.setErrorCodes((errorCodes == null) ? null : ErrorCodesInterface.fromList((ArrayList) errorCodes)); - return pigeonResult; - } - } - - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class UpdatePasswordWithPhoneNumberRequestInterface { - private @NonNull ReachFiveKeyInterface reachFiveKey; - - public @NonNull ReachFiveKeyInterface getReachFiveKey() { - return reachFiveKey; - } - - public void setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"reachFiveKey\" is null."); - } - this.reachFiveKey = setterArg; - } - - private @NonNull String phoneNumber; - - public @NonNull String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"phoneNumber\" is null."); - } - this.phoneNumber = setterArg; - } - - private @NonNull String verificationCode; - - public @NonNull String getVerificationCode() { - return verificationCode; - } - - public void setVerificationCode(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"verificationCode\" is null."); - } - this.verificationCode = setterArg; - } - - private @NonNull String password; - - public @NonNull String getPassword() { - return password; - } - - public void setPassword(@NonNull String setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"password\" is null."); - } - this.password = setterArg; - } - - private @NonNull ErrorCodesInterface errorCodes; - - public @NonNull ErrorCodesInterface getErrorCodes() { - return errorCodes; - } - - public void setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"errorCodes\" is null."); - } - this.errorCodes = setterArg; - } - - /** Constructor is private to enforce null safety; use Builder. */ - private UpdatePasswordWithPhoneNumberRequestInterface() {} - - public static final class Builder { - - private @Nullable ReachFiveKeyInterface reachFiveKey; - - public @NonNull Builder setReachFiveKey(@NonNull ReachFiveKeyInterface setterArg) { - this.reachFiveKey = setterArg; - return this; - } - - private @Nullable String phoneNumber; - - public @NonNull Builder setPhoneNumber(@NonNull String setterArg) { - this.phoneNumber = setterArg; - return this; - } - - private @Nullable String verificationCode; - - public @NonNull Builder setVerificationCode(@NonNull String setterArg) { - this.verificationCode = setterArg; - return this; - } - - private @Nullable String password; - - public @NonNull Builder setPassword(@NonNull String setterArg) { - this.password = setterArg; - return this; - } - - private @Nullable ErrorCodesInterface errorCodes; - - public @NonNull Builder setErrorCodes(@NonNull ErrorCodesInterface setterArg) { - this.errorCodes = setterArg; - return this; - } - - public @NonNull UpdatePasswordWithPhoneNumberRequestInterface build() { - UpdatePasswordWithPhoneNumberRequestInterface pigeonReturn = new UpdatePasswordWithPhoneNumberRequestInterface(); - pigeonReturn.setReachFiveKey(reachFiveKey); - pigeonReturn.setPhoneNumber(phoneNumber); - pigeonReturn.setVerificationCode(verificationCode); - pigeonReturn.setPassword(password); - pigeonReturn.setErrorCodes(errorCodes); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(5); - toListResult.add((reachFiveKey == null) ? null : reachFiveKey.toList()); - toListResult.add(phoneNumber); - toListResult.add(verificationCode); - toListResult.add(password); - toListResult.add((errorCodes == null) ? null : errorCodes.toList()); - return toListResult; - } - - static @NonNull UpdatePasswordWithPhoneNumberRequestInterface fromList(@NonNull ArrayList list) { - UpdatePasswordWithPhoneNumberRequestInterface pigeonResult = new UpdatePasswordWithPhoneNumberRequestInterface(); - Object reachFiveKey = list.get(0); - pigeonResult.setReachFiveKey((reachFiveKey == null) ? null : ReachFiveKeyInterface.fromList((ArrayList) reachFiveKey)); - Object phoneNumber = list.get(1); - pigeonResult.setPhoneNumber((String) phoneNumber); - Object verificationCode = list.get(2); - pigeonResult.setVerificationCode((String) verificationCode); - Object password = list.get(3); - pigeonResult.setPassword((String) password); - Object errorCodes = list.get(4); - pigeonResult.setErrorCodes((errorCodes == null) ? null : ErrorCodesInterface.fromList((ArrayList) errorCodes)); - return pigeonResult; - } - } - - public interface Result { - void success(T result); - - void error(Throwable error); - } - - private static class ReachFiveHostApiCodec extends StandardMessageCodec { - public static final ReachFiveHostApiCodec INSTANCE = new ReachFiveHostApiCodec(); - - private ReachFiveHostApiCodec() {} - - @Override - protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { - switch (type) { - case (byte) 128: - return AddressInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 129: - return AuthTokenInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 130: - return ConsentInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 131: - return EmailsInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 132: - return ErrorCodesInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 133: - return GetProfileRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 134: - return LoginSummaryInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 135: - return LoginWithPasswordRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 136: - return LoginWithProviderRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 137: - return OpenIdUserInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 138: - return ProfileAddressInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 139: - return ProfileInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 140: - return ProfileSignupRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 141: - return ProviderCreatorInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 142: - return ReachFiveConfigInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 143: - return ReachFiveKeyInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 144: - return RefreshAccessTokenRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 145: - return RequestPasswordResetRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 146: - return SdkConfigInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 147: - return SignupRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 148: - return UpdatePasswordWithAccessTokenRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 149: - return UpdatePasswordWithEmailRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 150: - return UpdatePasswordWithFreshAccessTokenRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 151: - return UpdatePasswordWithPhoneNumberRequestInterface.fromList((ArrayList) readValue(buffer)); - case (byte) 152: - return UpdateProfileRequestInterface.fromList((ArrayList) readValue(buffer)); - default: - return super.readValueOfType(type, buffer); - } - } - - @Override - protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof AddressInterface) { - stream.write(128); - writeValue(stream, ((AddressInterface) value).toList()); - } else if (value instanceof AuthTokenInterface) { - stream.write(129); - writeValue(stream, ((AuthTokenInterface) value).toList()); - } else if (value instanceof ConsentInterface) { - stream.write(130); - writeValue(stream, ((ConsentInterface) value).toList()); - } else if (value instanceof EmailsInterface) { - stream.write(131); - writeValue(stream, ((EmailsInterface) value).toList()); - } else if (value instanceof ErrorCodesInterface) { - stream.write(132); - writeValue(stream, ((ErrorCodesInterface) value).toList()); - } else if (value instanceof GetProfileRequestInterface) { - stream.write(133); - writeValue(stream, ((GetProfileRequestInterface) value).toList()); - } else if (value instanceof LoginSummaryInterface) { - stream.write(134); - writeValue(stream, ((LoginSummaryInterface) value).toList()); - } else if (value instanceof LoginWithPasswordRequestInterface) { - stream.write(135); - writeValue(stream, ((LoginWithPasswordRequestInterface) value).toList()); - } else if (value instanceof LoginWithProviderRequestInterface) { - stream.write(136); - writeValue(stream, ((LoginWithProviderRequestInterface) value).toList()); - } else if (value instanceof OpenIdUserInterface) { - stream.write(137); - writeValue(stream, ((OpenIdUserInterface) value).toList()); - } else if (value instanceof ProfileAddressInterface) { - stream.write(138); - writeValue(stream, ((ProfileAddressInterface) value).toList()); - } else if (value instanceof ProfileInterface) { - stream.write(139); - writeValue(stream, ((ProfileInterface) value).toList()); - } else if (value instanceof ProfileSignupRequestInterface) { - stream.write(140); - writeValue(stream, ((ProfileSignupRequestInterface) value).toList()); - } else if (value instanceof ProviderCreatorInterface) { - stream.write(141); - writeValue(stream, ((ProviderCreatorInterface) value).toList()); - } else if (value instanceof ReachFiveConfigInterface) { - stream.write(142); - writeValue(stream, ((ReachFiveConfigInterface) value).toList()); - } else if (value instanceof ReachFiveKeyInterface) { - stream.write(143); - writeValue(stream, ((ReachFiveKeyInterface) value).toList()); - } else if (value instanceof RefreshAccessTokenRequestInterface) { - stream.write(144); - writeValue(stream, ((RefreshAccessTokenRequestInterface) value).toList()); - } else if (value instanceof RequestPasswordResetRequestInterface) { - stream.write(145); - writeValue(stream, ((RequestPasswordResetRequestInterface) value).toList()); - } else if (value instanceof SdkConfigInterface) { - stream.write(146); - writeValue(stream, ((SdkConfigInterface) value).toList()); - } else if (value instanceof SignupRequestInterface) { - stream.write(147); - writeValue(stream, ((SignupRequestInterface) value).toList()); - } else if (value instanceof UpdatePasswordWithAccessTokenRequestInterface) { - stream.write(148); - writeValue(stream, ((UpdatePasswordWithAccessTokenRequestInterface) value).toList()); - } else if (value instanceof UpdatePasswordWithEmailRequestInterface) { - stream.write(149); - writeValue(stream, ((UpdatePasswordWithEmailRequestInterface) value).toList()); - } else if (value instanceof UpdatePasswordWithFreshAccessTokenRequestInterface) { - stream.write(150); - writeValue(stream, ((UpdatePasswordWithFreshAccessTokenRequestInterface) value).toList()); - } else if (value instanceof UpdatePasswordWithPhoneNumberRequestInterface) { - stream.write(151); - writeValue(stream, ((UpdatePasswordWithPhoneNumberRequestInterface) value).toList()); - } else if (value instanceof UpdateProfileRequestInterface) { - stream.write(152); - writeValue(stream, ((UpdateProfileRequestInterface) value).toList()); - } else { - super.writeValue(stream, value); - } - } - } - - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ - public interface ReachFiveHostApi { - - void initialize(@NonNull ReachFiveKeyInterface reachFiveKey, Result result); - - void signup(@NonNull SignupRequestInterface request, Result result); - - void loginWithPassword(@NonNull LoginWithPasswordRequestInterface request, Result result); - - void loginWithProvider(@NonNull LoginWithProviderRequestInterface request, Result result); - - void logout(@NonNull ReachFiveKeyInterface reachFiveKey, Result result); - - void getProfile(@NonNull GetProfileRequestInterface request, Result result); - - void updateProfile(@NonNull UpdateProfileRequestInterface request, Result result); - - void refreshAccessToken(@NonNull RefreshAccessTokenRequestInterface request, Result result); - - void requestPasswordReset(@NonNull RequestPasswordResetRequestInterface request, Result result); - - void updatePasswordWithAccessToken(@NonNull UpdatePasswordWithAccessTokenRequestInterface request, Result result); - - void updatePasswordWithFreshAccessToken(@NonNull UpdatePasswordWithFreshAccessTokenRequestInterface request, Result result); - - void updatePasswordWithEmail(@NonNull UpdatePasswordWithEmailRequestInterface request, Result result); - - void updatePasswordWithPhoneNumber(@NonNull UpdatePasswordWithPhoneNumberRequestInterface request, Result result); - - /** The codec used by ReachFiveHostApi. */ - static MessageCodec getCodec() { - return ReachFiveHostApiCodec.INSTANCE; - } - /**Sets up an instance of `ReachFiveHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(BinaryMessenger binaryMessenger, ReachFiveHostApi api) { - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.initialize", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - ReachFiveKeyInterface reachFiveKeyArg = (ReachFiveKeyInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(ReachFiveConfigInterface result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.initialize(reachFiveKeyArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.signup", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - SignupRequestInterface requestArg = (SignupRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(AuthTokenInterface result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.signup(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.loginWithPassword", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - LoginWithPasswordRequestInterface requestArg = (LoginWithPasswordRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(AuthTokenInterface result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.loginWithPassword(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.loginWithProvider", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - LoginWithProviderRequestInterface requestArg = (LoginWithProviderRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(AuthTokenInterface result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.loginWithProvider(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.logout", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - ReachFiveKeyInterface reachFiveKeyArg = (ReachFiveKeyInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { - wrapped.add(0, null); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.logout(reachFiveKeyArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.getProfile", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - GetProfileRequestInterface requestArg = (GetProfileRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(ProfileInterface result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.getProfile(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.updateProfile", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - UpdateProfileRequestInterface requestArg = (UpdateProfileRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(ProfileInterface result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.updateProfile(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.refreshAccessToken", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - RefreshAccessTokenRequestInterface requestArg = (RefreshAccessTokenRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(AuthTokenInterface result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.refreshAccessToken(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.requestPasswordReset", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - RequestPasswordResetRequestInterface requestArg = (RequestPasswordResetRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { - wrapped.add(0, null); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.requestPasswordReset(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithAccessToken", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - UpdatePasswordWithAccessTokenRequestInterface requestArg = (UpdatePasswordWithAccessTokenRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { - wrapped.add(0, null); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.updatePasswordWithAccessToken(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithFreshAccessToken", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - UpdatePasswordWithFreshAccessTokenRequestInterface requestArg = (UpdatePasswordWithFreshAccessTokenRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { - wrapped.add(0, null); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.updatePasswordWithFreshAccessToken(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithEmail", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - UpdatePasswordWithEmailRequestInterface requestArg = (UpdatePasswordWithEmailRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { - wrapped.add(0, null); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.updatePasswordWithEmail(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithPhoneNumber", getCodec()); - if (api != null) { - channel.setMessageHandler( - (message, reply) -> { - ArrayList wrapped = new ArrayList(); - ArrayList args = (ArrayList) message; - UpdatePasswordWithPhoneNumberRequestInterface requestArg = (UpdatePasswordWithPhoneNumberRequestInterface) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { - wrapped.add(0, null); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.updatePasswordWithPhoneNumber(requestArg, resultCallback); - }); - } else { - channel.setMessageHandler(null); - } - } - } - } -} diff --git a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/Converters.kt b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/Converters.kt index a4d4c32..c9d4da7 100644 --- a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/Converters.kt +++ b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/Converters.kt @@ -6,18 +6,12 @@ import co.reachfive.identity.sdk.core.models.requests.* import co.reachfive.identity.sdk.facebook.FacebookProvider import co.reachfive.identity.sdk.google.GoogleProvider import co.reachfive.identity.sdk.webview.WebViewProvider -import tech.bam.flutter_reach_five.android.ReachFiveApi.ConsentInterface -import tech.bam.flutter_reach_five.android.ReachFiveApi.EmailsInterface -import tech.bam.flutter_reach_five.android.ReachFiveApi.LoginSummaryInterface -import tech.bam.flutter_reach_five.android.ReachFiveApi.ProfileAddressInterface -import tech.bam.flutter_reach_five.android.ReachFiveApi.ProfileAddressTypeInterface -import tech.bam.flutter_reach_five.android.ReachFiveApi.ProfileInterface class Converters { companion object { fun parseError( reachFiveError: ReachFiveError, - errorCodesInterface: ReachFiveApi.ErrorCodesInterface, + errorCodesInterface: ErrorCodesInterface, defaultFlutterError: FlutterError ): FlutterError { if (reachFiveError.data?.errorMessageKey == "error.email.alreadyInUse") { @@ -79,23 +73,21 @@ class Converters { fun authTokenToInterface( authToken: AuthToken - ): ReachFiveApi.AuthTokenInterface { + ): AuthTokenInterface { val user = authToken.user - return ReachFiveApi - .AuthTokenInterface - .Builder() - .setIdToken(authToken.idToken) - .setAccessToken(authToken.accessToken) - .setRefreshToken(authToken.refreshToken) - .setTokenType(authToken.tokenType) - .setExpiresIn(authToken.expiresIn?.toLong()) - .setUser(if (user != null) openIdUserToInterface(user) else null) - .build() + return AuthTokenInterface( + idToken = authToken.idToken, + accessToken = authToken.accessToken, + refreshToken = authToken.refreshToken, + tokenType = authToken.tokenType, + expiresIn = authToken.expiresIn?.toLong(), + user = if (user != null) openIdUserToInterface(user) else null + ) } fun authTokenFromInterface( - authTokenInterface: ReachFiveApi.AuthTokenInterface + authTokenInterface: AuthTokenInterface ): AuthToken { val user = authTokenInterface.user @@ -109,40 +101,36 @@ class Converters { ) } - fun openIdUserToInterface( + private fun openIdUserToInterface( openIdUser: OpenIdUser - ): ReachFiveApi.OpenIdUserInterface { + ): OpenIdUserInterface { val address = openIdUser.address - return ReachFiveApi - .OpenIdUserInterface - .Builder() - .setId(openIdUser.id) - .setName(openIdUser.name) - .setPreferredUsername(openIdUser.preferredUsername) - .setGivenName(openIdUser.givenName) - .setFamilyName(openIdUser.familyName) - .setMiddleName(openIdUser.middleName) - .setNickname(openIdUser.nickname) - .setPicture(openIdUser.picture) - .setWebsite(openIdUser.website) - .setEmail(openIdUser.email) - .setEmailVerified(openIdUser.emailVerified) - .setGender(openIdUser.gender) - .setZoneinfo(openIdUser.zoneinfo) - .setLocale(openIdUser.locale) - .setPhoneNumber(openIdUser.phoneNumber) - .setPhoneNumberVerified(openIdUser.phoneNumberVerified) - .setAddress( - if (address != null) addressToInterface(address) else null - ) - .setBirthdate(openIdUser.birthdate) - .setExternalId(openIdUser.externalId) - .build() + return OpenIdUserInterface( + id = openIdUser.id, + name = openIdUser.name, + preferredUsername = openIdUser.preferredUsername, + givenName = openIdUser.givenName, + familyName = openIdUser.familyName, + middleName = openIdUser.middleName, + nickname = openIdUser.nickname, + picture = openIdUser.picture, + website = openIdUser.website, + email = openIdUser.email, + emailVerified = openIdUser.emailVerified, + gender = openIdUser.gender, + zoneinfo = openIdUser.zoneinfo, + locale = openIdUser.locale, + phoneNumber = openIdUser.phoneNumber, + phoneNumberVerified = openIdUser.phoneNumberVerified, + address = if (address != null) addressToInterface(address) else null, + birthdate = openIdUser.birthdate, + externalId = openIdUser.externalId + ) } - fun openIdUserFromInterface( - openIdUserInterface: ReachFiveApi.OpenIdUserInterface + private fun openIdUserFromInterface( + openIdUserInterface: OpenIdUserInterface ): OpenIdUser { val address = openIdUserInterface.address @@ -169,22 +157,21 @@ class Converters { ) } - fun addressToInterface( + private fun addressToInterface( address: Address - ): ReachFiveApi.AddressInterface { - return ReachFiveApi.AddressInterface - .Builder() - .setFormatted(address.formatted) - .setStreetAddress(address.streetAddress) - .setLocality(address.locality) - .setRegion(address.region) - .setPostalCode(address.postalCode) - .setCountry(address.country) - .build() + ): AddressInterface { + return AddressInterface( + formatted = address.formatted, + streetAddress = address.streetAddress, + locality = address.locality, + region = address.region, + postalCode = address.postalCode, + country = address.country, + ) } - fun addressFromInterface( - addressInterface: ReachFiveApi.AddressInterface + private fun addressFromInterface( + addressInterface: AddressInterface ): Address { return Address( formatted = addressInterface.formatted, @@ -197,41 +184,45 @@ class Converters { } fun signupRequestFromInterface( - profileSignupRequestInterface: ReachFiveApi.ProfileSignupRequestInterface + profileSignupRequestInterface: ProfileSignupRequestInterface ): ProfileSignupRequest { - val addresses = profileSignupRequestInterface.addresses?.map { addressRequest -> - profileAddressFromInterface(addressRequest) + val addresses = profileSignupRequestInterface.addresses?.mapNotNull { addressRequest -> + if (addressRequest != null) profileAddressFromInterface(addressRequest) else null } val consents = profileSignupRequestInterface.consents?.mapValues { consentRequestMapEntry -> - consentFromInterface(consentRequestMapEntry.value) + val consentRequestMapEntryValue = consentRequestMapEntry.value + if (consentRequestMapEntryValue != null) consentFromInterface(consentRequestMapEntryValue) else null } + @Suppress("UNCHECKED_CAST") return ProfileSignupRequest( - email = profileSignupRequestInterface.email, - password = profileSignupRequestInterface.password, - phoneNumber = profileSignupRequestInterface.phoneNumber, - givenName = profileSignupRequestInterface.givenName, - middleName = profileSignupRequestInterface.middleName, - familyName = profileSignupRequestInterface.familyName, - name = profileSignupRequestInterface.name, - nickname = profileSignupRequestInterface.nickname, - birthdate = profileSignupRequestInterface.birthdate, - profileURL = profileSignupRequestInterface.profileURL, - picture = profileSignupRequestInterface.picture, - username = profileSignupRequestInterface.username, - gender = profileSignupRequestInterface.gender, - company = profileSignupRequestInterface.company, - addresses = addresses, - locale = profileSignupRequestInterface.locale, - bio = profileSignupRequestInterface.bio, - customFields = profileSignupRequestInterface.customFields, - consents = consents, - liteOnly = profileSignupRequestInterface.liteOnly + password = profileSignupRequestInterface.password, + email = profileSignupRequestInterface.email, + phoneNumber = profileSignupRequestInterface.phoneNumber, + givenName = profileSignupRequestInterface.givenName, + middleName = profileSignupRequestInterface.middleName, + familyName = profileSignupRequestInterface.familyName, + name = profileSignupRequestInterface.name, + nickname = profileSignupRequestInterface.nickname, + birthdate = profileSignupRequestInterface.birthdate, + profileURL = profileSignupRequestInterface.profileURL, + picture = profileSignupRequestInterface.picture, + username = profileSignupRequestInterface.username, + gender = profileSignupRequestInterface.gender, + company = profileSignupRequestInterface.company, + addresses = addresses, + locale = profileSignupRequestInterface.locale, + bio = profileSignupRequestInterface.bio, + customFields = profileSignupRequestInterface.customFields?.filter { + mapEntry -> mapEntry.key == null || mapEntry.value == null } as Map, + consents = consents?.filter { + mapEntry -> mapEntry.key == null || mapEntry.value == null } as Map, + liteOnly = profileSignupRequestInterface.liteOnly, ) } - fun addressTypeToInterface( + private fun addressTypeToInterface( addressType: ProfileAddressType? ): ProfileAddressTypeInterface? { return when (addressType) { @@ -241,7 +232,7 @@ class Converters { } } - fun addressTypeFromInterface( + private fun addressTypeFromInterface( addressTypeInterface: ProfileAddressTypeInterface? ): ProfileAddressType? { return when (addressTypeInterface) { @@ -251,29 +242,29 @@ class Converters { } } - fun profileAddressToInterface( + private fun profileAddressToInterface( profileAddress: ProfileAddress ): ProfileAddressInterface { val addressType = addressTypeToInterface(profileAddress.addressType) - return ProfileAddressInterface.Builder() - .setTitle(profileAddress.title) - .setIsDefault(profileAddress.isDefault) - .setAddressType(addressType) - .setStreetAddress(profileAddress.streetAddress) - .setLocality(profileAddress.locality) - .setRegion(profileAddress.region) - .setPostalCode(profileAddress.postalCode) - .setCountry(profileAddress.country) - .setRaw(profileAddress.raw) - .setDeliveryNote(profileAddress.deliveryNote) - .setRecipient(profileAddress.recipient) - .setCompany(profileAddress.company) - .setPhoneNumber(profileAddress.phoneNumber) - .build() + return ProfileAddressInterface( + title = profileAddress.title, + isDefault = profileAddress.isDefault, + addressType = addressType, + streetAddress = profileAddress.streetAddress, + locality = profileAddress.locality, + region = profileAddress.region, + postalCode = profileAddress.postalCode, + country = profileAddress.country, + raw = profileAddress.raw, + deliveryNote = profileAddress.deliveryNote, + recipient = profileAddress.recipient, + company = profileAddress.company, + phoneNumber = profileAddress.phoneNumber + ) } - fun profileAddressFromInterface( + private fun profileAddressFromInterface( profileAddressInterface: ProfileAddressInterface ): ProfileAddress { val addressType = addressTypeFromInterface(profileAddressInterface.addressType) @@ -295,18 +286,18 @@ class Converters { ) } - fun consentToInterface( + private fun consentToInterface( consent: Consent ): ConsentInterface { - return ConsentInterface.Builder() - .setGranted(consent.granted) - .setConsentType(consent.consentType) - .setDate(consent.date) - .build() + return ConsentInterface( + granted = consent.granted, + consentType = consent.consentType, + date = consent.date, + ) } - fun consentFromInterface( + private fun consentFromInterface( consentInterface: ConsentInterface ): Consent { @@ -318,56 +309,56 @@ class Converters { } fun providerCreatorFromInterface( - providerCreatorInterface: ReachFiveApi.ProviderCreatorInterface + providerCreatorInterface: ProviderCreatorInterface ): ProviderCreator { return when (providerCreatorInterface.type) { - ReachFiveApi.ProviderCreatorTypeInterface.GOOGLE -> GoogleProvider() - ReachFiveApi.ProviderCreatorTypeInterface.FACEBOOK -> FacebookProvider() - ReachFiveApi.ProviderCreatorTypeInterface.WEBVIEW -> WebViewProvider() + ProviderCreatorTypeInterface.GOOGLE -> GoogleProvider() + ProviderCreatorTypeInterface.FACEBOOK -> FacebookProvider() + ProviderCreatorTypeInterface.WEBVIEW -> WebViewProvider() } } - fun loginSummaryToInterface( + private fun loginSummaryToInterface( loginSummary: LoginSummary ): LoginSummaryInterface { - return LoginSummaryInterface.Builder() - .setFirstLogin(loginSummary.firstLogin?.toDouble()) - .setLastLogin(loginSummary.lastLogin?.toDouble()) - .setTotal(loginSummary.total?.toLong()) - .setOrigins(loginSummary.origins) - .setDevices(loginSummary.devices) - .setLastProvider(loginSummary.lastProvider) - .build() + return LoginSummaryInterface( + firstLogin = loginSummary.firstLogin?.toDouble(), + lastLogin = loginSummary.lastLogin?.toDouble(), + total = loginSummary.total?.toLong(), + origins = loginSummary.origins, + devices = loginSummary.devices, + lastProvider = loginSummary.lastProvider, + ) } - fun loginSummaryFromInterface( + private fun loginSummaryFromInterface( loginSummaryInterface: LoginSummaryInterface ): LoginSummary { return LoginSummary( firstLogin = loginSummaryInterface.firstLogin?.toLong(), lastLogin = loginSummaryInterface.lastLogin?.toLong(), total = loginSummaryInterface.total?.toInt(), - origins = loginSummaryInterface.origins, - devices = loginSummaryInterface.devices, + origins = loginSummaryInterface.origins?.filterNotNull(), + devices = loginSummaryInterface.devices?.filterNotNull(), lastProvider = loginSummaryInterface.lastProvider ) } - fun emailsToInterface( + private fun emailsToInterface( emails: Emails ): EmailsInterface { - return EmailsInterface.Builder() - .setVerified(emails.verified) - .setUnverified(emails.unverified) - .build() + return EmailsInterface( + verified = emails.verified, + unverified = emails.unverified + ) } - fun emailsFromInterface( + private fun emailsFromInterface( emailsInterface: EmailsInterface ): Emails { return Emails( - verified = emailsInterface.verified, - unverified = emailsInterface.unverified + verified = emailsInterface.verified?.filterNotNull(), + unverified = emailsInterface.unverified?.filterNotNull() ) } @@ -386,36 +377,37 @@ class Converters { consentToInterface(consentMapEntry.value) } - return ProfileInterface.Builder() - .setUid(profile.uid) - .setGivenName(profile.givenName) - .setMiddleName(profile.middleName) - .setFamilyName(profile.familyName) - .setName(profile.name) - .setNickname(profile.nickname) - .setBirthdate(profile.birthdate) - .setProfileURL(profile.profileURL) - .setPicture(profile.picture) - .setExternalId(profile.externalId) - .setAuthTypes(profile.authTypes) - .setLoginSummary(if (loginSummary != null) loginSummaryToInterface(loginSummary) else null) - .setUsername(profile.username) - .setGender(profile.gender) - .setEmail(profile.email) - .setEmailVerified(profile.emailVerified) - .setEmails(if (emails != null) emailsToInterface(emails) else null) - .setPhoneNumber(profile.phoneNumber) - .setPhoneNumberVerified(profile.phoneNumberVerified) - .setAddresses(addresses) - .setLocale(profile.locale) - .setBio(profile.bio) - .setCustomFields(profile.customFields) - .setConsents(consents) - .setCreatedAt(profile.createdAt) - .setUpdatedAt(profile.updatedAt) - .setLiteOnly(profile.liteOnly) - .setCompany(profile.company) - .build() + return ProfileInterface( + uid = profile.uid, + givenName = profile.givenName, + middleName = profile.middleName, + familyName = profile.familyName, + name = profile.name, + nickname = profile.nickname, + birthdate = profile.birthdate, + profileURL = profile.profileURL, + picture = profile.picture, + externalId = profile.externalId, + authTypes = profile.authTypes, + loginSummary = if (loginSummary != null) loginSummaryToInterface(loginSummary) else null, + username = profile.username, + gender = profile.gender, + email = profile.email, + emailVerified = profile.emailVerified, + emails = if (emails != null) emailsToInterface(emails) else null, + phoneNumber = profile.phoneNumber, + phoneNumberVerified = profile.phoneNumberVerified, + addresses = addresses, + locale = profile.locale, + bio = profile.bio, + customFields = profile.customFields?.toMap(), + consents = consents?.toMap(), + createdAt = profile.createdAt, + updatedAt = profile.updatedAt, + liteOnly = profile.liteOnly, + company = profile.company, + + ) } fun profileFromInterface( @@ -425,14 +417,16 @@ class Converters { val emailsInterface = profileInterface.emails - val addresses = profileInterface.addresses?.map { address -> - profileAddressFromInterface(address) + val addresses = profileInterface.addresses?.mapNotNull { address -> + if (address != null) profileAddressFromInterface(address) else null } val consents = profileInterface.consents?.mapValues { consentInterfaceMapEntry -> - consentFromInterface(consentInterfaceMapEntry.value) + val consentInterfaceMapEntryValue = consentInterfaceMapEntry.value + if (consentInterfaceMapEntryValue != null) consentFromInterface(consentInterfaceMapEntryValue) else null } + @Suppress("UNCHECKED_CAST") return Profile( uid = profileInterface.uid, givenName = profileInterface.givenName, @@ -444,7 +438,7 @@ class Converters { profileURL = profileInterface.profileURL, picture = profileInterface.picture, externalId = profileInterface.externalId, - authTypes = profileInterface.authTypes, + authTypes = profileInterface.authTypes?.filterNotNull(), loginSummary = if (loginSummaryInterface != null) loginSummaryFromInterface(loginSummaryInterface) else null, username = profileInterface.username, gender = profileInterface.gender, @@ -456,8 +450,10 @@ class Converters { addresses = addresses, locale = profileInterface.locale, bio = profileInterface.bio, - customFields = profileInterface.customFields, - consents = consents, + customFields = profileInterface.customFields?.filter { + mapEntry -> mapEntry.key == null || mapEntry.value == null } as Map, + consents = consents?.filter { + mapEntry -> mapEntry.key == null || mapEntry.value == null } as Map, createdAt = profileInterface.createdAt, updatedAt = profileInterface.updatedAt, liteOnly = profileInterface.liteOnly, diff --git a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/FlutterError.kt b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/FlutterError.kt deleted file mode 100644 index 4cc1ea2..0000000 --- a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/FlutterError.kt +++ /dev/null @@ -1,12 +0,0 @@ -package tech.bam.flutter_reach_five.android - -class FlutterError constructor(code: String, message: String?, details: Any?) : - RuntimeException(message) { - private val code: String - private val details: Any? - - init { - this.code = code - this.details = details - } -} \ No newline at end of file diff --git a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/FlutterReachFivePlugin.kt b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/FlutterReachFivePlugin.kt index 25aef22..0760304 100644 --- a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/FlutterReachFivePlugin.kt +++ b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/FlutterReachFivePlugin.kt @@ -13,7 +13,7 @@ import co.reachfive.identity.sdk.core.utils.Failure import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding import io.flutter.plugin.common.PluginRegistry -class FlutterReachFivePlugin : FlutterPlugin, PluginRegistry.ActivityResultListener, ActivityAware, ReachFiveApi.ReachFiveHostApi +class FlutterReachFivePlugin : FlutterPlugin, PluginRegistry.ActivityResultListener, ActivityAware, ReachFiveHostApi { private var context: Context? = null private var activity: Activity? = null @@ -23,15 +23,15 @@ class FlutterReachFivePlugin : FlutterPlugin, PluginRegistry.ActivityResultListe private var loginWithProviderReachFiveInstance: ReachFive? = null private var onLoginWithProviderSuccess: Success? = null private var onLoginWithProviderFailure: Failure? = null - private var errorCodes: ReachFiveApi.ErrorCodesInterface? = null + private var errorCodes: ErrorCodesInterface? = null override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { - ReachFiveApi.ReachFiveHostApi.setup(flutterPluginBinding.binaryMessenger, this) + ReachFiveHostApi.setUp(flutterPluginBinding.binaryMessenger, this) context = flutterPluginBinding.applicationContext } override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { - ReachFiveApi.ReachFiveHostApi.setup(binding.binaryMessenger, null) + ReachFiveHostApi.setUp(binding.binaryMessenger, null) context = null } @@ -112,15 +112,15 @@ class FlutterReachFivePlugin : FlutterPlugin, PluginRegistry.ActivityResultListe return true } - private fun getReachFiveInstanceKey(reachFiveKey: ReachFiveApi.ReachFiveKeyInterface): String { + private fun getReachFiveInstanceKey(reachFiveKey: ReachFiveKeyInterface): String { var key = reachFiveKey.sdkConfig.domain + reachFiveKey.sdkConfig.clientId + reachFiveKey.sdkConfig.androidScheme reachFiveKey.providerCreators.forEach { providerCreatorInterface -> - key += providerCreatorInterface.type.name + key += providerCreatorInterface?.type?.name } return key } - private fun getReachFiveInstance(reachFiveKey: ReachFiveApi.ReachFiveKeyInterface): ReachFive { + private fun getReachFiveInstance(reachFiveKey: ReachFiveKeyInterface): ReachFive { val reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey = reachFiveKey) return reachFiveInstances[reachFiveInstanceKey] @@ -131,10 +131,10 @@ class FlutterReachFivePlugin : FlutterPlugin, PluginRegistry.ActivityResultListe ) } - private fun loadSocialProviders(reachFive: ReachFive, reachFiveKey: ReachFiveApi.ReachFiveKeyInterface, result: ReachFiveApi.Result) { + private fun loadSocialProviders(reachFive: ReachFive, reachFiveKey: ReachFiveKeyInterface, callback: (Result) -> Unit) { val context = this.context if(context == null) { - result.error(Error("No android context attached to your application")) + callback(Result.failure(Error("No android context attached to your application"))) return } @@ -144,451 +144,423 @@ class FlutterReachFivePlugin : FlutterPlugin, PluginRegistry.ActivityResultListe context, success = { providers -> this.reachFiveInstances[reachFiveInstanceKey] = reachFive - result.success( - ReachFiveApi.ReachFiveConfigInterface - .Builder() - .setReachFiveKey(reachFiveKey) - .setProviders(providers.map { - provider -> - provider.name - }) - .build() - ) + callback(Result.success( + ReachFiveConfigInterface( + reachFiveKey = reachFiveKey, + providers = providers.map { + provider -> provider.name + }, + ) + )) }, - failure = { - error -> result.error( - FlutterError( - code= "loading_social_providers_error_code", - message= error.message, - details= null - ) + failure = { error -> callback( + Result.failure( + FlutterError( + code= "loading_social_providers_error_code", + message= error.message, + details= null + ) + ) )} ) } - override fun initialize(reachFiveKey: ReachFiveApi.ReachFiveKeyInterface, result: ReachFiveApi.Result) { + override fun initialize(reachFiveKey: ReachFiveKeyInterface, callback: (Result) -> Unit) { val reachFive = ReachFive( - sdkConfig = SdkConfig( - domain = reachFiveKey.sdkConfig.domain, - clientId = reachFiveKey.sdkConfig.clientId, - scheme = reachFiveKey.sdkConfig.androidScheme - ), - providersCreators = reachFiveKey.providerCreators.map { providerCreatorInterface -> - Converters.providerCreatorFromInterface(providerCreatorInterface) - } + sdkConfig = SdkConfig( + domain = reachFiveKey.sdkConfig.domain, + clientId = reachFiveKey.sdkConfig.clientId, + scheme = reachFiveKey.sdkConfig.androidScheme + ), + providersCreators = reachFiveKey.providerCreators.mapNotNull { providerCreatorInterface -> + if (providerCreatorInterface != null) Converters.providerCreatorFromInterface(providerCreatorInterface) else null + } ) + + reachFive.initialize( - success = { - loadSocialProviders( - reachFive = reachFive, - reachFiveKey = reachFiveKey, - result = result - ) - }, - failure = { - error -> result.error( - FlutterError( - code= "initialization_error_code", - message= error.message, - details= null - ) - )} + success = { + loadSocialProviders( + reachFive = reachFive, + reachFiveKey = reachFiveKey, + callback = callback + ) + }, + failure = { error -> callback( + Result.failure( + FlutterError( + code= "initialization_error_code", + message= error.message, + details= null + ) + ) + )} ) } - override fun signup( - request: ReachFiveApi.SignupRequestInterface, - result: ReachFiveApi.Result - ) { + override fun signup(request: SignupRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } val signupRequest = Converters.signupRequestFromInterface(request.profile) reachFive.signup( - profile = signupRequest, - scope = request.scope?.toList() ?: listOf(), - success = { authToken -> - result.success(Converters.authTokenToInterface(authToken)) - }, - failure = { - error -> result.error( - Converters.parseError( - reachFiveError = error, - errorCodesInterface = request.errorCodes, - defaultFlutterError = FlutterError( - code= "sign_up_error_code", - message= error.message, - details= null - ) - ) - )} + profile = signupRequest, + scope = request.scope?.filterNotNull() ?: listOf(), + success = { authToken -> + callback(Result.success(Converters.authTokenToInterface(authToken))) + }, + failure = { + error -> callback( + Result.failure( + Converters.parseError( + reachFiveError = error, + errorCodesInterface = request.errorCodes, + defaultFlutterError = FlutterError( + code= "sign_up_error_code", + message= error.message, + details= null + ) + ) + ) + )} ) } - override fun loginWithPassword( - request: ReachFiveApi.LoginWithPasswordRequestInterface, - result: ReachFiveApi.Result - ) { + override fun loginWithPassword(request: LoginWithPasswordRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } reachFive.loginWithPassword( - email = request.email, - phoneNumber = request.phoneNumber, - password = request.password, - scope = request.scope?.toList() ?: listOf(), - success = { authToken -> - result.success(Converters.authTokenToInterface(authToken)) - }, - failure = { - error -> result.error( - Converters.parseError( - reachFiveError = error, - errorCodesInterface = request.errorCodes, - defaultFlutterError = FlutterError( - code= "login_with_password_error_code", - message= error.message, - details= null - ) - ) - )} + email = request.email, + phoneNumber = request.phoneNumber, + password = request.password, + scope = request.scope?.filterNotNull() ?: listOf(), + success = { authToken -> + callback(Result.success(Converters.authTokenToInterface(authToken))) + }, + failure = { + error -> callback( + Result.failure( + Converters.parseError( + reachFiveError = error, + errorCodesInterface = request.errorCodes, + defaultFlutterError = FlutterError( + code= "login_with_password_error_code", + message= error.message, + details= null + ) + ) + ) + )} ) } - override fun loginWithProvider( - request: ReachFiveApi.LoginWithProviderRequestInterface, - result: ReachFiveApi.Result - ) { + override fun loginWithProvider(request: LoginWithProviderRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } val provider = reachFive.getProvider(request.provider) if(provider == null) { - result.error(Error("This provider is not available in this reachFive instance")) + callback(Result.failure(Error("This provider is not available in this reachFive instance"))) return } val activity = this.activity if(activity == null) { - result.error( - FlutterError( - code= "not_available_provider_error_code", - message= "The provider was not found in your reachFive instance", - details= null + callback(Result.failure( + FlutterError( + code= "not_available_provider_error_code", + message= "The provider was not found in your reachFive instance", + details= null + ) )) return } this.loginWithProviderReachFiveInstance = reachFive this.onLoginWithProviderSuccess = { - authToken -> - result.success(Converters.authTokenToInterface(authToken)) + authToken -> + callback(Result.success(Converters.authTokenToInterface(authToken))) } this.onLoginWithProviderFailure = { - error -> result.error(error) + error -> callback(Result.failure(error)) } this.errorCodes = request.errorCodes provider.login( - origin = request.origin, - scope = request.scope?.toList() ?: listOf(), - activity = activity + origin = request.origin, + scope = request.scope?.filterNotNull() ?: listOf(), + activity = activity ) } - override fun logout( - reachFiveKey: ReachFiveApi.ReachFiveKeyInterface, - result: ReachFiveApi.Result - ) { + override fun logout(reachFiveKey: ReachFiveKeyInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } reachFive.logout( - success = { - result.success(null) - }, - failure = { - error -> result.error( - FlutterError( - code= "logout_error_code", - message= error.message, - details= null - ) - )} + success = { + unit -> + callback(Result.success(unit)) + }, + failure = { + error -> callback(Result.failure( + FlutterError( + code= "logout_error_code", + message= error.message, + details= null + )) + )} ) } - override fun getProfile( - request: ReachFiveApi.GetProfileRequestInterface, - result: ReachFiveApi.Result - ) { + override fun getProfile(request: GetProfileRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } reachFive.getProfile( - authToken = Converters.authTokenFromInterface(request.authToken), - success = { - profile -> - result.success(Converters.profileToInterface(profile)) - }, - failure = { - error -> result.error( - Converters.parseError( - reachFiveError = error, - errorCodesInterface = request.errorCodes, - defaultFlutterError = FlutterError( - code= "get_profile_error_code", - message= error.message, - details= null - ) - ) - )} + authToken = Converters.authTokenFromInterface(request.authToken), + success = { + profile -> + callback(Result.success(Converters.profileToInterface(profile))) + }, + failure = { + error -> callback(Result.failure( + Converters.parseError( + reachFiveError = error, + errorCodesInterface = request.errorCodes, + defaultFlutterError = FlutterError( + code= "get_profile_error_code", + message= error.message, + details= null + ) + )) + )} ) } - override fun updateProfile( - request: ReachFiveApi.UpdateProfileRequestInterface, - result: ReachFiveApi.Result - ) { + override fun updateProfile(request: UpdateProfileRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } reachFive.updateProfile( - authToken = Converters.authTokenFromInterface(request.authToken), - profile = Converters.profileFromInterface(request.profile), - success = { - profile -> - result.success(Converters.profileToInterface(profile)) - }, - failure = { - error -> result.error( - Converters.parseError( - reachFiveError = error, - errorCodesInterface = request.errorCodes, - defaultFlutterError = FlutterError( - code= "update_profile_error_code", - message= error.message, - details= null - ) - ) - )} + authToken = Converters.authTokenFromInterface(request.authToken), + profile = Converters.profileFromInterface(request.profile), + success = { + profile -> + callback(Result.success(Converters.profileToInterface(profile))) + }, + failure = { + error -> callback(Result.failure( + Converters.parseError( + reachFiveError = error, + errorCodesInterface = request.errorCodes, + defaultFlutterError = FlutterError( + code= "update_profile_error_code", + message= error.message, + details= null + ) + )) + )} ) } - override fun refreshAccessToken( - request: ReachFiveApi.RefreshAccessTokenRequestInterface, - result: ReachFiveApi.Result - ) { + override fun refreshAccessToken(request: RefreshAccessTokenRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } val requestAuthToken = request.authToken reachFive.refreshAccessToken( - authToken = Converters.authTokenFromInterface(requestAuthToken), - success = { authToken -> - result.success(Converters.authTokenToInterface(authToken)) - }, - failure = { - error -> result.error( - FlutterError( - code= "refresh_access_token_error_code", - message= error.message, - details= null - ) - )} + authToken = Converters.authTokenFromInterface(requestAuthToken), + success = { authToken -> + callback(Result.success(Converters.authTokenToInterface(authToken))) + }, + failure = { + error -> callback(Result.failure( + FlutterError( + code= "refresh_access_token_error_code", + message= error.message, + details= null + )) + )} ) } - override fun requestPasswordReset( - request: ReachFiveApi.RequestPasswordResetRequestInterface, - result: ReachFiveApi.Result - ) { + override fun requestPasswordReset(request: RequestPasswordResetRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } - + reachFive.requestPasswordReset( - email = request.email, - phoneNumber = request.phoneNumber, - redirectUrl = request.redirectUrl, - success = { result.success(null)}, - failure = { - error -> result.error( - FlutterError( - code= "request_password_reset_error_code", - message= error.message, - details= null - ) - )} + email = request.email, + phoneNumber = request.phoneNumber, + redirectUrl = request.redirectUrl, + success = { unit -> callback(Result.success(unit))}, + failure = { + error -> callback(Result.failure( + FlutterError( + code= "request_password_reset_error_code", + message= error.message, + details= null + )) + )} ) } - override fun updatePasswordWithAccessToken( - request: ReachFiveApi.UpdatePasswordWithAccessTokenRequestInterface, - result: ReachFiveApi.Result - ) { + override fun updatePasswordWithAccessToken(request: UpdatePasswordWithAccessTokenRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } reachFive.updatePassword( - updatePasswordRequest = AccessTokenParams( - authToken = Converters.authTokenFromInterface(request.authToken), - oldPassword = request.oldPassword, - password = request.password - ), - success = { result.success(null) }, - failure = { - error -> result.error( - FlutterError( - code= "update_password_with_access_token_error_code", - message= error.message, - details= null - ) - )} + updatePasswordRequest = AccessTokenParams( + authToken = Converters.authTokenFromInterface(request.authToken), + oldPassword = request.oldPassword, + password = request.password + ), + success = { unit -> callback(Result.success(unit)) }, + failure = { + error -> callback(Result.failure( + FlutterError( + code= "update_password_with_access_token_error_code", + message= error.message, + details= null + )) + )} ) } - override fun updatePasswordWithFreshAccessToken( - request: ReachFiveApi.UpdatePasswordWithFreshAccessTokenRequestInterface, - result: ReachFiveApi.Result - ) { + override fun updatePasswordWithFreshAccessToken(request: UpdatePasswordWithFreshAccessTokenRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } reachFive.updatePassword( - updatePasswordRequest = FreshAccessTokenParams( - freshAuthToken = Converters.authTokenFromInterface(request.freshAuthToken), - password = request.password - ), - success = { result.success(null) }, - failure = { - error -> result.error( - FlutterError( - code= "update_password_with_fresh_access_token_error_code", - message= error.message, - details= null - ) - )} + updatePasswordRequest = FreshAccessTokenParams( + freshAuthToken = Converters.authTokenFromInterface(request.freshAuthToken), + password = request.password + ), + success = { unit -> callback(Result.success(unit)) }, + failure = { + error -> callback(Result.failure( + FlutterError( + code= "update_password_with_fresh_access_token_error_code", + message= error.message, + details= null + )) + )} ) } - override fun updatePasswordWithEmail( - request: ReachFiveApi.UpdatePasswordWithEmailRequestInterface, - result: ReachFiveApi.Result - ) { + override fun updatePasswordWithEmail(request: UpdatePasswordWithEmailRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } reachFive.updatePassword( - updatePasswordRequest = EmailParams( - email = request.email, - verificationCode = request.verificationCode, - password = request.password - ), - success = { result.success(null) }, - failure = { - error -> result.error( - Converters.parseError( - reachFiveError = error, - errorCodesInterface = request.errorCodes, - defaultFlutterError = FlutterError( - code= "update_password_with_email_request_error_code", - message= error.message, - details= null - ) - ) - )} + updatePasswordRequest = EmailParams( + email = request.email, + verificationCode = request.verificationCode, + password = request.password + ), + success = { unit -> callback(Result.success(unit)) }, + failure = { + error -> callback(Result.failure( + Converters.parseError( + reachFiveError = error, + errorCodesInterface = request.errorCodes, + defaultFlutterError = FlutterError( + code= "update_password_with_email_request_error_code", + message= error.message, + details= null + ) + )) + )} ) } - override fun updatePasswordWithPhoneNumber( - request: ReachFiveApi.UpdatePasswordWithPhoneNumberRequestInterface, - result: ReachFiveApi.Result - ) { + override fun updatePasswordWithPhoneNumber(request: UpdatePasswordWithPhoneNumberRequestInterface, callback: (Result) -> Unit) { val reachFive: ReachFive try { reachFive = getReachFiveInstance(reachFiveKey = request.reachFiveKey) } catch (error: FlutterError) { - result.error(error) + callback(Result.failure(error)) return } reachFive.updatePassword( - updatePasswordRequest = SmsParams( - phoneNumber = request.phoneNumber, - verificationCode = request.verificationCode, - password = request.password - ), - success = { result.success(null) }, - failure = { - error -> result.error( - Converters.parseError( - reachFiveError = error, - errorCodesInterface = request.errorCodes, - defaultFlutterError = FlutterError( - code= "update_password_with_phone_number_request_error_code", - message= error.message, - details= null - ) - ) - )} + updatePasswordRequest = SmsParams( + phoneNumber = request.phoneNumber, + verificationCode = request.verificationCode, + password = request.password + ), + success = { unit -> callback(Result.success(unit)) }, + failure = { + error -> callback(Result.failure( + Converters.parseError( + reachFiveError = error, + errorCodesInterface = request.errorCodes, + defaultFlutterError = FlutterError( + code= "update_password_with_phone_number_request_error_code", + message= error.message, + details= null + ) + )) + )} ) } } diff --git a/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/ReachFiveApi.kt b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/ReachFiveApi.kt new file mode 100644 index 0000000..0484bd9 --- /dev/null +++ b/flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/ReachFiveApi.kt @@ -0,0 +1,1490 @@ +// Autogenerated from Pigeon (v9.2.4), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +package tech.bam.flutter_reach_five.android + +import android.util.Log +import io.flutter.plugin.common.BasicMessageChannel +import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.MessageCodec +import io.flutter.plugin.common.StandardMessageCodec +import java.io.ByteArrayOutputStream +import java.nio.ByteBuffer + +private fun wrapResult(result: Any?): List { + return listOf(result) +} + +private fun wrapError(exception: Throwable): List { + if (exception is FlutterError) { + return listOf( + exception.code, + exception.message, + exception.details + ) + } else { + return listOf( + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) + ) + } +} + +/** + * Error class for passing custom error details to Flutter via a thrown PlatformException. + * @property code The error code. + * @property message The error message. + * @property details The error details. Must be a datatype supported by the api codec. + */ +class FlutterError ( + val code: String, + override val message: String? = null, + val details: Any? = null +) : Throwable() + +enum class ProviderCreatorTypeInterface(val raw: Int) { + GOOGLE(0), + FACEBOOK(1), + WEBVIEW(2); + + companion object { + fun ofRaw(raw: Int): ProviderCreatorTypeInterface? { + return values().firstOrNull { it.raw == raw } + } + } +} + +enum class ProfileAddressTypeInterface(val raw: Int) { + BILLING(0), + DELIVERY(1); + + companion object { + fun ofRaw(raw: Int): ProfileAddressTypeInterface? { + return values().firstOrNull { it.raw == raw } + } + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class ErrorCodesInterface ( + val emailAlreadyInUseCode: String, + val invalidEmailOrPasswordCode: String, + val invalidVerificationCode: String, + val invalidGrant: String, + val userCancelledOrClosedTheWebFlow: String, + val socialAccountEmailAlreadyInUse: String + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): ErrorCodesInterface { + val emailAlreadyInUseCode = list[0] as String + val invalidEmailOrPasswordCode = list[1] as String + val invalidVerificationCode = list[2] as String + val invalidGrant = list[3] as String + val userCancelledOrClosedTheWebFlow = list[4] as String + val socialAccountEmailAlreadyInUse = list[5] as String + return ErrorCodesInterface(emailAlreadyInUseCode, invalidEmailOrPasswordCode, invalidVerificationCode, invalidGrant, userCancelledOrClosedTheWebFlow, socialAccountEmailAlreadyInUse) + } + } + fun toList(): List { + return listOf( + emailAlreadyInUseCode, + invalidEmailOrPasswordCode, + invalidVerificationCode, + invalidGrant, + userCancelledOrClosedTheWebFlow, + socialAccountEmailAlreadyInUse, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class SdkConfigInterface ( + val domain: String, + val clientId: String, + val androidScheme: String, + val iosScheme: String + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): SdkConfigInterface { + val domain = list[0] as String + val clientId = list[1] as String + val androidScheme = list[2] as String + val iosScheme = list[3] as String + return SdkConfigInterface(domain, clientId, androidScheme, iosScheme) + } + } + fun toList(): List { + return listOf( + domain, + clientId, + androidScheme, + iosScheme, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class ProviderCreatorInterface ( + val type: ProviderCreatorTypeInterface + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): ProviderCreatorInterface { + val type = ProviderCreatorTypeInterface.ofRaw(list[0] as Int)!! + return ProviderCreatorInterface(type) + } + } + fun toList(): List { + return listOf( + type.raw, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class ReachFiveKeyInterface ( + val sdkConfig: SdkConfigInterface, + val providerCreators: List + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): ReachFiveKeyInterface { + val sdkConfig = SdkConfigInterface.fromList(list[0] as List) + val providerCreators = list[1] as List + return ReachFiveKeyInterface(sdkConfig, providerCreators) + } + } + fun toList(): List { + return listOf( + sdkConfig.toList(), + providerCreators, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class ReachFiveConfigInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val providers: List + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): ReachFiveConfigInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val providers = list[1] as List + return ReachFiveConfigInterface(reachFiveKey, providers) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + providers, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class ProfileAddressInterface ( + val title: String? = null, + val isDefault: Boolean? = null, + val addressType: ProfileAddressTypeInterface? = null, + val streetAddress: String? = null, + val locality: String? = null, + val region: String? = null, + val postalCode: String? = null, + val country: String? = null, + val raw: String? = null, + val deliveryNote: String? = null, + val recipient: String? = null, + val company: String? = null, + val phoneNumber: String? = null + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): ProfileAddressInterface { + val title = list[0] as String? + val isDefault = list[1] as Boolean? + val addressType: ProfileAddressTypeInterface? = (list[2] as Int?)?.let { + ProfileAddressTypeInterface.ofRaw(it) + } + val streetAddress = list[3] as String? + val locality = list[4] as String? + val region = list[5] as String? + val postalCode = list[6] as String? + val country = list[7] as String? + val raw = list[8] as String? + val deliveryNote = list[9] as String? + val recipient = list[10] as String? + val company = list[11] as String? + val phoneNumber = list[12] as String? + return ProfileAddressInterface(title, isDefault, addressType, streetAddress, locality, region, postalCode, country, raw, deliveryNote, recipient, company, phoneNumber) + } + } + fun toList(): List { + return listOf( + title, + isDefault, + addressType?.raw, + streetAddress, + locality, + region, + postalCode, + country, + raw, + deliveryNote, + recipient, + company, + phoneNumber, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class ConsentInterface ( + val granted: Boolean, + val consentType: String? = null, + val date: String + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): ConsentInterface { + val granted = list[0] as Boolean + val consentType = list[1] as String? + val date = list[2] as String + return ConsentInterface(granted, consentType, date) + } + } + fun toList(): List { + return listOf( + granted, + consentType, + date, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class ProfileSignupRequestInterface ( + val password: String, + val email: String? = null, + val phoneNumber: String? = null, + val givenName: String? = null, + val middleName: String? = null, + val familyName: String? = null, + val name: String? = null, + val nickname: String? = null, + val birthdate: String? = null, + val profileURL: String? = null, + val picture: String? = null, + val username: String? = null, + val gender: String? = null, + val company: String? = null, + val addresses: List? = null, + val locale: String? = null, + val bio: String? = null, + val customFields: Map? = null, + val consents: Map? = null, + val liteOnly: Boolean? = null + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): ProfileSignupRequestInterface { + val password = list[0] as String + val email = list[1] as String? + val phoneNumber = list[2] as String? + val givenName = list[3] as String? + val middleName = list[4] as String? + val familyName = list[5] as String? + val name = list[6] as String? + val nickname = list[7] as String? + val birthdate = list[8] as String? + val profileURL = list[9] as String? + val picture = list[10] as String? + val username = list[11] as String? + val gender = list[12] as String? + val company = list[13] as String? + val addresses = list[14] as List? + val locale = list[15] as String? + val bio = list[16] as String? + val customFields = list[17] as Map? + val consents = list[18] as Map? + val liteOnly = list[19] as Boolean? + return ProfileSignupRequestInterface(password, email, phoneNumber, givenName, middleName, familyName, name, nickname, birthdate, profileURL, picture, username, gender, company, addresses, locale, bio, customFields, consents, liteOnly) + } + } + fun toList(): List { + return listOf( + password, + email, + phoneNumber, + givenName, + middleName, + familyName, + name, + nickname, + birthdate, + profileURL, + picture, + username, + gender, + company, + addresses, + locale, + bio, + customFields, + consents, + liteOnly, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class SignupRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val profile: ProfileSignupRequestInterface, + val redirectUrl: String? = null, + val scope: List? = null, + val errorCodes: ErrorCodesInterface + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): SignupRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val profile = ProfileSignupRequestInterface.fromList(list[1] as List) + val redirectUrl = list[2] as String? + val scope = list[3] as List? + val errorCodes = ErrorCodesInterface.fromList(list[4] as List) + return SignupRequestInterface(reachFiveKey, profile, redirectUrl, scope, errorCodes) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + profile.toList(), + redirectUrl, + scope, + errorCodes.toList(), + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class AddressInterface ( + val formatted: String? = null, + val streetAddress: String? = null, + val locality: String? = null, + val region: String? = null, + val postalCode: String? = null, + val country: String? = null + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): AddressInterface { + val formatted = list[0] as String? + val streetAddress = list[1] as String? + val locality = list[2] as String? + val region = list[3] as String? + val postalCode = list[4] as String? + val country = list[5] as String? + return AddressInterface(formatted, streetAddress, locality, region, postalCode, country) + } + } + fun toList(): List { + return listOf( + formatted, + streetAddress, + locality, + region, + postalCode, + country, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class OpenIdUserInterface ( + val id: String? = null, + val name: String? = null, + val preferredUsername: String? = null, + val givenName: String? = null, + val familyName: String? = null, + val middleName: String? = null, + val nickname: String? = null, + val picture: String? = null, + val website: String? = null, + val email: String? = null, + val emailVerified: Boolean? = null, + val gender: String? = null, + val zoneinfo: String? = null, + val locale: String? = null, + val phoneNumber: String? = null, + val phoneNumberVerified: Boolean? = null, + val address: AddressInterface? = null, + val birthdate: String? = null, + val externalId: String? = null + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): OpenIdUserInterface { + val id = list[0] as String? + val name = list[1] as String? + val preferredUsername = list[2] as String? + val givenName = list[3] as String? + val familyName = list[4] as String? + val middleName = list[5] as String? + val nickname = list[6] as String? + val picture = list[7] as String? + val website = list[8] as String? + val email = list[9] as String? + val emailVerified = list[10] as Boolean? + val gender = list[11] as String? + val zoneinfo = list[12] as String? + val locale = list[13] as String? + val phoneNumber = list[14] as String? + val phoneNumberVerified = list[15] as Boolean? + val address: AddressInterface? = (list[16] as List?)?.let { + AddressInterface.fromList(it) + } + val birthdate = list[17] as String? + val externalId = list[18] as String? + return OpenIdUserInterface(id, name, preferredUsername, givenName, familyName, middleName, nickname, picture, website, email, emailVerified, gender, zoneinfo, locale, phoneNumber, phoneNumberVerified, address, birthdate, externalId) + } + } + fun toList(): List { + return listOf( + id, + name, + preferredUsername, + givenName, + familyName, + middleName, + nickname, + picture, + website, + email, + emailVerified, + gender, + zoneinfo, + locale, + phoneNumber, + phoneNumberVerified, + address?.toList(), + birthdate, + externalId, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class AuthTokenInterface ( + val idToken: String? = null, + val accessToken: String, + val refreshToken: String? = null, + val tokenType: String? = null, + val expiresIn: Long? = null, + val user: OpenIdUserInterface? = null + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): AuthTokenInterface { + val idToken = list[0] as String? + val accessToken = list[1] as String + val refreshToken = list[2] as String? + val tokenType = list[3] as String? + val expiresIn = list[4].let { if (it is Int) it.toLong() else it as Long? } + val user: OpenIdUserInterface? = (list[5] as List?)?.let { + OpenIdUserInterface.fromList(it) + } + return AuthTokenInterface(idToken, accessToken, refreshToken, tokenType, expiresIn, user) + } + } + fun toList(): List { + return listOf( + idToken, + accessToken, + refreshToken, + tokenType, + expiresIn, + user?.toList(), + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class LoginWithPasswordRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val email: String? = null, + val phoneNumber: String? = null, + val password: String, + val scope: List? = null, + val errorCodes: ErrorCodesInterface + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): LoginWithPasswordRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val email = list[1] as String? + val phoneNumber = list[2] as String? + val password = list[3] as String + val scope = list[4] as List? + val errorCodes = ErrorCodesInterface.fromList(list[5] as List) + return LoginWithPasswordRequestInterface(reachFiveKey, email, phoneNumber, password, scope, errorCodes) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + email, + phoneNumber, + password, + scope, + errorCodes.toList(), + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class LoginWithProviderRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val provider: String, + val origin: String, + val scope: List? = null, + val errorCodes: ErrorCodesInterface + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): LoginWithProviderRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val provider = list[1] as String + val origin = list[2] as String + val scope = list[3] as List? + val errorCodes = ErrorCodesInterface.fromList(list[4] as List) + return LoginWithProviderRequestInterface(reachFiveKey, provider, origin, scope, errorCodes) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + provider, + origin, + scope, + errorCodes.toList(), + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class RefreshAccessTokenRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val authToken: AuthTokenInterface + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): RefreshAccessTokenRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val authToken = AuthTokenInterface.fromList(list[1] as List) + return RefreshAccessTokenRequestInterface(reachFiveKey, authToken) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + authToken.toList(), + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class LoginSummaryInterface ( + val firstLogin: Double? = null, + val lastLogin: Double? = null, + val total: Long? = null, + val origins: List? = null, + val devices: List? = null, + val lastProvider: String? = null + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): LoginSummaryInterface { + val firstLogin = list[0] as Double? + val lastLogin = list[1] as Double? + val total = list[2].let { if (it is Int) it.toLong() else it as Long? } + val origins = list[3] as List? + val devices = list[4] as List? + val lastProvider = list[5] as String? + return LoginSummaryInterface(firstLogin, lastLogin, total, origins, devices, lastProvider) + } + } + fun toList(): List { + return listOf( + firstLogin, + lastLogin, + total, + origins, + devices, + lastProvider, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class EmailsInterface ( + val verified: List? = null, + val unverified: List? = null + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): EmailsInterface { + val verified = list[0] as List? + val unverified = list[1] as List? + return EmailsInterface(verified, unverified) + } + } + fun toList(): List { + return listOf( + verified, + unverified, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class ProfileInterface ( + val uid: String? = null, + val givenName: String? = null, + val middleName: String? = null, + val familyName: String? = null, + val name: String? = null, + val nickname: String? = null, + val birthdate: String? = null, + val profileURL: String? = null, + val picture: String? = null, + val externalId: String? = null, + val authTypes: List? = null, + val loginSummary: LoginSummaryInterface? = null, + val username: String? = null, + val gender: String? = null, + val email: String? = null, + val emailVerified: Boolean? = null, + val emails: EmailsInterface? = null, + val phoneNumber: String? = null, + val phoneNumberVerified: Boolean? = null, + val addresses: List? = null, + val locale: String? = null, + val bio: String? = null, + val customFields: Map? = null, + val consents: Map? = null, + val createdAt: String? = null, + val updatedAt: String? = null, + val liteOnly: Boolean? = null, + val company: String? = null + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): ProfileInterface { + val uid = list[0] as String? + val givenName = list[1] as String? + val middleName = list[2] as String? + val familyName = list[3] as String? + val name = list[4] as String? + val nickname = list[5] as String? + val birthdate = list[6] as String? + val profileURL = list[7] as String? + val picture = list[8] as String? + val externalId = list[9] as String? + val authTypes = list[10] as List? + val loginSummary: LoginSummaryInterface? = (list[11] as List?)?.let { + LoginSummaryInterface.fromList(it) + } + val username = list[12] as String? + val gender = list[13] as String? + val email = list[14] as String? + val emailVerified = list[15] as Boolean? + val emails: EmailsInterface? = (list[16] as List?)?.let { + EmailsInterface.fromList(it) + } + val phoneNumber = list[17] as String? + val phoneNumberVerified = list[18] as Boolean? + val addresses = list[19] as List? + val locale = list[20] as String? + val bio = list[21] as String? + val customFields = list[22] as Map? + val consents = list[23] as Map? + val createdAt = list[24] as String? + val updatedAt = list[25] as String? + val liteOnly = list[26] as Boolean? + val company = list[27] as String? + return ProfileInterface(uid, givenName, middleName, familyName, name, nickname, birthdate, profileURL, picture, externalId, authTypes, loginSummary, username, gender, email, emailVerified, emails, phoneNumber, phoneNumberVerified, addresses, locale, bio, customFields, consents, createdAt, updatedAt, liteOnly, company) + } + } + fun toList(): List { + return listOf( + uid, + givenName, + middleName, + familyName, + name, + nickname, + birthdate, + profileURL, + picture, + externalId, + authTypes, + loginSummary?.toList(), + username, + gender, + email, + emailVerified, + emails?.toList(), + phoneNumber, + phoneNumberVerified, + addresses, + locale, + bio, + customFields, + consents, + createdAt, + updatedAt, + liteOnly, + company, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class GetProfileRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val authToken: AuthTokenInterface, + val errorCodes: ErrorCodesInterface + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): GetProfileRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val authToken = AuthTokenInterface.fromList(list[1] as List) + val errorCodes = ErrorCodesInterface.fromList(list[2] as List) + return GetProfileRequestInterface(reachFiveKey, authToken, errorCodes) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + authToken.toList(), + errorCodes.toList(), + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class UpdateProfileRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val authToken: AuthTokenInterface, + val profile: ProfileInterface, + val errorCodes: ErrorCodesInterface + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): UpdateProfileRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val authToken = AuthTokenInterface.fromList(list[1] as List) + val profile = ProfileInterface.fromList(list[2] as List) + val errorCodes = ErrorCodesInterface.fromList(list[3] as List) + return UpdateProfileRequestInterface(reachFiveKey, authToken, profile, errorCodes) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + authToken.toList(), + profile.toList(), + errorCodes.toList(), + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class RequestPasswordResetRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val email: String? = null, + val phoneNumber: String? = null, + val redirectUrl: String? = null + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): RequestPasswordResetRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val email = list[1] as String? + val phoneNumber = list[2] as String? + val redirectUrl = list[3] as String? + return RequestPasswordResetRequestInterface(reachFiveKey, email, phoneNumber, redirectUrl) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + email, + phoneNumber, + redirectUrl, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class UpdatePasswordWithAccessTokenRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val authToken: AuthTokenInterface, + val oldPassword: String, + val password: String + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): UpdatePasswordWithAccessTokenRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val authToken = AuthTokenInterface.fromList(list[1] as List) + val oldPassword = list[2] as String + val password = list[3] as String + return UpdatePasswordWithAccessTokenRequestInterface(reachFiveKey, authToken, oldPassword, password) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + authToken.toList(), + oldPassword, + password, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class UpdatePasswordWithFreshAccessTokenRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val freshAuthToken: AuthTokenInterface, + val password: String + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): UpdatePasswordWithFreshAccessTokenRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val freshAuthToken = AuthTokenInterface.fromList(list[1] as List) + val password = list[2] as String + return UpdatePasswordWithFreshAccessTokenRequestInterface(reachFiveKey, freshAuthToken, password) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + freshAuthToken.toList(), + password, + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class UpdatePasswordWithEmailRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val email: String, + val verificationCode: String, + val password: String, + val errorCodes: ErrorCodesInterface + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): UpdatePasswordWithEmailRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val email = list[1] as String + val verificationCode = list[2] as String + val password = list[3] as String + val errorCodes = ErrorCodesInterface.fromList(list[4] as List) + return UpdatePasswordWithEmailRequestInterface(reachFiveKey, email, verificationCode, password, errorCodes) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + email, + verificationCode, + password, + errorCodes.toList(), + ) + } +} + +/** Generated class from Pigeon that represents data sent in messages. */ +data class UpdatePasswordWithPhoneNumberRequestInterface ( + val reachFiveKey: ReachFiveKeyInterface, + val phoneNumber: String, + val verificationCode: String, + val password: String, + val errorCodes: ErrorCodesInterface + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): UpdatePasswordWithPhoneNumberRequestInterface { + val reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as List) + val phoneNumber = list[1] as String + val verificationCode = list[2] as String + val password = list[3] as String + val errorCodes = ErrorCodesInterface.fromList(list[4] as List) + return UpdatePasswordWithPhoneNumberRequestInterface(reachFiveKey, phoneNumber, verificationCode, password, errorCodes) + } + } + fun toList(): List { + return listOf( + reachFiveKey.toList(), + phoneNumber, + verificationCode, + password, + errorCodes.toList(), + ) + } +} + +@Suppress("UNCHECKED_CAST") +private object ReachFiveHostApiCodec : StandardMessageCodec() { + override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { + return when (type) { + 128.toByte() -> { + return (readValue(buffer) as? List)?.let { + AddressInterface.fromList(it) + } + } + 129.toByte() -> { + return (readValue(buffer) as? List)?.let { + AuthTokenInterface.fromList(it) + } + } + 130.toByte() -> { + return (readValue(buffer) as? List)?.let { + ConsentInterface.fromList(it) + } + } + 131.toByte() -> { + return (readValue(buffer) as? List)?.let { + EmailsInterface.fromList(it) + } + } + 132.toByte() -> { + return (readValue(buffer) as? List)?.let { + ErrorCodesInterface.fromList(it) + } + } + 133.toByte() -> { + return (readValue(buffer) as? List)?.let { + GetProfileRequestInterface.fromList(it) + } + } + 134.toByte() -> { + return (readValue(buffer) as? List)?.let { + LoginSummaryInterface.fromList(it) + } + } + 135.toByte() -> { + return (readValue(buffer) as? List)?.let { + LoginWithPasswordRequestInterface.fromList(it) + } + } + 136.toByte() -> { + return (readValue(buffer) as? List)?.let { + LoginWithProviderRequestInterface.fromList(it) + } + } + 137.toByte() -> { + return (readValue(buffer) as? List)?.let { + OpenIdUserInterface.fromList(it) + } + } + 138.toByte() -> { + return (readValue(buffer) as? List)?.let { + ProfileAddressInterface.fromList(it) + } + } + 139.toByte() -> { + return (readValue(buffer) as? List)?.let { + ProfileInterface.fromList(it) + } + } + 140.toByte() -> { + return (readValue(buffer) as? List)?.let { + ProfileSignupRequestInterface.fromList(it) + } + } + 141.toByte() -> { + return (readValue(buffer) as? List)?.let { + ProviderCreatorInterface.fromList(it) + } + } + 142.toByte() -> { + return (readValue(buffer) as? List)?.let { + ReachFiveConfigInterface.fromList(it) + } + } + 143.toByte() -> { + return (readValue(buffer) as? List)?.let { + ReachFiveKeyInterface.fromList(it) + } + } + 144.toByte() -> { + return (readValue(buffer) as? List)?.let { + RefreshAccessTokenRequestInterface.fromList(it) + } + } + 145.toByte() -> { + return (readValue(buffer) as? List)?.let { + RequestPasswordResetRequestInterface.fromList(it) + } + } + 146.toByte() -> { + return (readValue(buffer) as? List)?.let { + SdkConfigInterface.fromList(it) + } + } + 147.toByte() -> { + return (readValue(buffer) as? List)?.let { + SignupRequestInterface.fromList(it) + } + } + 148.toByte() -> { + return (readValue(buffer) as? List)?.let { + UpdatePasswordWithAccessTokenRequestInterface.fromList(it) + } + } + 149.toByte() -> { + return (readValue(buffer) as? List)?.let { + UpdatePasswordWithEmailRequestInterface.fromList(it) + } + } + 150.toByte() -> { + return (readValue(buffer) as? List)?.let { + UpdatePasswordWithFreshAccessTokenRequestInterface.fromList(it) + } + } + 151.toByte() -> { + return (readValue(buffer) as? List)?.let { + UpdatePasswordWithPhoneNumberRequestInterface.fromList(it) + } + } + 152.toByte() -> { + return (readValue(buffer) as? List)?.let { + UpdateProfileRequestInterface.fromList(it) + } + } + else -> super.readValueOfType(type, buffer) + } + } + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + when (value) { + is AddressInterface -> { + stream.write(128) + writeValue(stream, value.toList()) + } + is AuthTokenInterface -> { + stream.write(129) + writeValue(stream, value.toList()) + } + is ConsentInterface -> { + stream.write(130) + writeValue(stream, value.toList()) + } + is EmailsInterface -> { + stream.write(131) + writeValue(stream, value.toList()) + } + is ErrorCodesInterface -> { + stream.write(132) + writeValue(stream, value.toList()) + } + is GetProfileRequestInterface -> { + stream.write(133) + writeValue(stream, value.toList()) + } + is LoginSummaryInterface -> { + stream.write(134) + writeValue(stream, value.toList()) + } + is LoginWithPasswordRequestInterface -> { + stream.write(135) + writeValue(stream, value.toList()) + } + is LoginWithProviderRequestInterface -> { + stream.write(136) + writeValue(stream, value.toList()) + } + is OpenIdUserInterface -> { + stream.write(137) + writeValue(stream, value.toList()) + } + is ProfileAddressInterface -> { + stream.write(138) + writeValue(stream, value.toList()) + } + is ProfileInterface -> { + stream.write(139) + writeValue(stream, value.toList()) + } + is ProfileSignupRequestInterface -> { + stream.write(140) + writeValue(stream, value.toList()) + } + is ProviderCreatorInterface -> { + stream.write(141) + writeValue(stream, value.toList()) + } + is ReachFiveConfigInterface -> { + stream.write(142) + writeValue(stream, value.toList()) + } + is ReachFiveKeyInterface -> { + stream.write(143) + writeValue(stream, value.toList()) + } + is RefreshAccessTokenRequestInterface -> { + stream.write(144) + writeValue(stream, value.toList()) + } + is RequestPasswordResetRequestInterface -> { + stream.write(145) + writeValue(stream, value.toList()) + } + is SdkConfigInterface -> { + stream.write(146) + writeValue(stream, value.toList()) + } + is SignupRequestInterface -> { + stream.write(147) + writeValue(stream, value.toList()) + } + is UpdatePasswordWithAccessTokenRequestInterface -> { + stream.write(148) + writeValue(stream, value.toList()) + } + is UpdatePasswordWithEmailRequestInterface -> { + stream.write(149) + writeValue(stream, value.toList()) + } + is UpdatePasswordWithFreshAccessTokenRequestInterface -> { + stream.write(150) + writeValue(stream, value.toList()) + } + is UpdatePasswordWithPhoneNumberRequestInterface -> { + stream.write(151) + writeValue(stream, value.toList()) + } + is UpdateProfileRequestInterface -> { + stream.write(152) + writeValue(stream, value.toList()) + } + else -> super.writeValue(stream, value) + } + } +} + +/** Generated interface from Pigeon that represents a handler of messages from Flutter. */ +interface ReachFiveHostApi { + fun initialize(reachFiveKey: ReachFiveKeyInterface, callback: (Result) -> Unit) + fun signup(request: SignupRequestInterface, callback: (Result) -> Unit) + fun loginWithPassword(request: LoginWithPasswordRequestInterface, callback: (Result) -> Unit) + fun loginWithProvider(request: LoginWithProviderRequestInterface, callback: (Result) -> Unit) + fun logout(reachFiveKey: ReachFiveKeyInterface, callback: (Result) -> Unit) + fun getProfile(request: GetProfileRequestInterface, callback: (Result) -> Unit) + fun updateProfile(request: UpdateProfileRequestInterface, callback: (Result) -> Unit) + fun refreshAccessToken(request: RefreshAccessTokenRequestInterface, callback: (Result) -> Unit) + fun requestPasswordReset(request: RequestPasswordResetRequestInterface, callback: (Result) -> Unit) + fun updatePasswordWithAccessToken(request: UpdatePasswordWithAccessTokenRequestInterface, callback: (Result) -> Unit) + fun updatePasswordWithFreshAccessToken(request: UpdatePasswordWithFreshAccessTokenRequestInterface, callback: (Result) -> Unit) + fun updatePasswordWithEmail(request: UpdatePasswordWithEmailRequestInterface, callback: (Result) -> Unit) + fun updatePasswordWithPhoneNumber(request: UpdatePasswordWithPhoneNumberRequestInterface, callback: (Result) -> Unit) + + companion object { + /** The codec used by ReachFiveHostApi. */ + val codec: MessageCodec by lazy { + ReachFiveHostApiCodec + } + /** Sets up an instance of `ReachFiveHostApi` to handle messages through the `binaryMessenger`. */ + @Suppress("UNCHECKED_CAST") + fun setUp(binaryMessenger: BinaryMessenger, api: ReachFiveHostApi?) { + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.initialize", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val reachFiveKeyArg = args[0] as ReachFiveKeyInterface + api.initialize(reachFiveKeyArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.signup", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as SignupRequestInterface + api.signup(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.loginWithPassword", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as LoginWithPasswordRequestInterface + api.loginWithPassword(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.loginWithProvider", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as LoginWithProviderRequestInterface + api.loginWithProvider(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.logout", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val reachFiveKeyArg = args[0] as ReachFiveKeyInterface + api.logout(reachFiveKeyArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.getProfile", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as GetProfileRequestInterface + api.getProfile(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.updateProfile", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as UpdateProfileRequestInterface + api.updateProfile(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.refreshAccessToken", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as RefreshAccessTokenRequestInterface + api.refreshAccessToken(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.requestPasswordReset", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as RequestPasswordResetRequestInterface + api.requestPasswordReset(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithAccessToken", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as UpdatePasswordWithAccessTokenRequestInterface + api.updatePasswordWithAccessToken(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithFreshAccessToken", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as UpdatePasswordWithFreshAccessTokenRequestInterface + api.updatePasswordWithFreshAccessToken(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithEmail", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as UpdatePasswordWithEmailRequestInterface + api.updatePasswordWithEmail(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithPhoneNumber", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val requestArg = args[0] as UpdatePasswordWithPhoneNumberRequestInterface + api.updatePasswordWithPhoneNumber(requestArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + } + } +} diff --git a/flutter_reach_five_android/lib/flutter_reach_five_android.dart b/flutter_reach_five_android/lib/flutter_reach_five_android.dart index dba02a6..f8600f9 100644 --- a/flutter_reach_five_android/lib/flutter_reach_five_android.dart +++ b/flutter_reach_five_android/lib/flutter_reach_five_android.dart @@ -10,21 +10,19 @@ class FlutterReachFiveAndroid extends FlutterReachFivePlatform { Never parseError(Object error, StackTrace stackTrace) { if (error is PlatformException) { final errorCode = error.code; - if (errorCode.contains(errorCodesInterface.emailAlreadyInUseCode)) { + if (errorCode == errorCodesInterface.emailAlreadyInUseCode) { throw EmailAlreadyInUseExceptionInterface(); - } else if (errorCode - .contains(errorCodesInterface.invalidEmailOrPasswordCode)) { + } else if (errorCode == errorCodesInterface.invalidEmailOrPasswordCode) { throw InvalidEmailOrPasswordExceptionInterface(); - } else if (errorCode - .contains(errorCodesInterface.invalidVerificationCode)) { + } else if (errorCode == errorCodesInterface.invalidVerificationCode) { throw InvalidVerificationCodeExceptionInterface(); - } else if (errorCode.contains(errorCodesInterface.invalidGrant)) { + } else if (errorCode == errorCodesInterface.invalidGrant) { throw InvalidGrantCodeExceptionInterface(); - } else if (errorCode - .contains(errorCodesInterface.userCancelledOrClosedTheWebFlow)) { + } else if (errorCode == + errorCodesInterface.userCancelledOrClosedTheWebFlow) { throw UserCancelledOrClosedTheWebFlowCodeExceptionInterface(); - } else if (errorCode - .contains(errorCodesInterface.socialAccountEmailAlreadyInUse)) { + } else if (errorCode == + errorCodesInterface.socialAccountEmailAlreadyInUse) { throw SocialAccountEmailAlreadyInUseExceptionInterface(); } } diff --git a/flutter_reach_five_android/test/flutter_reach_five_android_test.dart b/flutter_reach_five_android/test/flutter_reach_five_android_test.dart index cb03b55..a533c19 100644 --- a/flutter_reach_five_android/test/flutter_reach_five_android_test.dart +++ b/flutter_reach_five_android/test/flutter_reach_five_android_test.dart @@ -66,7 +66,7 @@ void main() { test('$EmailAlreadyInUseExceptionInterface', () { final exception = PlatformException( - code: 'Error - ${errorCodesInterface.emailAlreadyInUseCode}', + code: errorCodesInterface.emailAlreadyInUseCode, message: 'FlutterError', ); @@ -84,7 +84,7 @@ void main() { test('$InvalidEmailOrPasswordExceptionInterface', () { final exception = PlatformException( - code: 'Error - ${errorCodesInterface.invalidEmailOrPasswordCode}', + code: errorCodesInterface.invalidEmailOrPasswordCode, message: 'FlutterError', ); @@ -102,7 +102,7 @@ void main() { test('$InvalidVerificationCodeExceptionInterface', () { final exception = PlatformException( - code: 'Error ${errorCodesInterface.invalidVerificationCode}', + code: errorCodesInterface.invalidVerificationCode, message: 'FlutterError', ); @@ -120,7 +120,7 @@ void main() { test('$InvalidGrantCodeExceptionInterface', () { final exception = PlatformException( - code: 'Error - ${errorCodesInterface.invalidGrant}', + code: errorCodesInterface.invalidGrant, message: 'FlutterError', ); @@ -138,8 +138,7 @@ void main() { test('$UserCancelledOrClosedTheWebFlowCodeExceptionInterface', () { final exception = PlatformException( - code: - 'Error - ${errorCodesInterface.userCancelledOrClosedTheWebFlow}', + code: errorCodesInterface.userCancelledOrClosedTheWebFlow, message: 'FlutterError', ); @@ -160,7 +159,7 @@ void main() { test('$SocialAccountEmailAlreadyInUseExceptionInterface', () { final exception = PlatformException( - code: 'Error - ${errorCodesInterface.socialAccountEmailAlreadyInUse}', + code: errorCodesInterface.socialAccountEmailAlreadyInUse, message: 'FlutterError', ); diff --git a/flutter_reach_five_ios/ios/Classes/Converters.swift b/flutter_reach_five_ios/ios/Classes/Converters.swift index 7f6a46e..f0051d9 100644 --- a/flutter_reach_five_ios/ios/Classes/Converters.swift +++ b/flutter_reach_five_ios/ios/Classes/Converters.swift @@ -29,7 +29,7 @@ extension CustomField { } } -public class Converters { +class Converters { static public func parseError( reachFiveError: ReachFiveError, @@ -91,18 +91,18 @@ public class Converters { authToken: AuthToken ) -> AuthTokenInterface { - let expriresIn = authToken.expiresIn as NSNumber? + let expriresIn = authToken.expiresIn let user = authToken.user != nil ? openIdUserToInterface(openIdUser: authToken.user!) : nil - return AuthTokenInterface.make( - withIdToken: authToken.idToken, + return AuthTokenInterface( + idToken: authToken.idToken, accessToken: authToken.accessToken, refreshToken: authToken.refreshToken, tokenType: authToken.tokenType, - expiresIn: expriresIn, + expiresIn: expriresIn != nil ? Int64(expriresIn!) : nil, user: user ) } @@ -111,7 +111,7 @@ public class Converters { authTokenInterface: AuthTokenInterface ) -> AuthToken { - let expriresIn = authTokenInterface.expiresIn as? Int + let expriresIn = authTokenInterface.expiresIn let user = authTokenInterface.user != nil ? openIdUserFromInterface( @@ -124,7 +124,7 @@ public class Converters { accessToken: authTokenInterface.accessToken, refreshToken: authTokenInterface.refreshToken, tokenType: authTokenInterface.tokenType, - expiresIn: expriresIn, + expiresIn: expriresIn != nil ? Int(expriresIn!) : nil, user: user ) } @@ -141,8 +141,8 @@ public class Converters { ? addressToInterface(address: openIdUser.address!) : nil - return OpenIdUserInterface.make( - withId: openIdUser.id, + return OpenIdUserInterface( + id: openIdUser.id, name: openIdUser.name, preferredUsername: openIdUser.preferredUsername, givenName: openIdUser.givenName, @@ -152,12 +152,12 @@ public class Converters { picture: openIdUser.picture, website: openIdUser.website, email: openIdUser.email, - emailVerified: emailVerified, + emailVerified: emailVerified?.boolValue, gender: openIdUser.gender, zoneinfo: openIdUser.zoneinfo, locale: openIdUser.locale, phoneNumber: openIdUser.phoneNumber, - phoneNumberVerified: phoneNumberVerified, + phoneNumberVerified: phoneNumberVerified?.boolValue, address: address, birthdate: nil, externalId: nil @@ -185,12 +185,12 @@ public class Converters { picture: openIdUserInterface.picture, website: openIdUserInterface.website, email: openIdUserInterface.email, - emailVerified: openIdUserInterface.emailVerified?.boolValue, + emailVerified: openIdUserInterface.emailVerified, gender: openIdUserInterface.gender, zoneinfo: openIdUserInterface.zoneinfo, locale: openIdUserInterface.locale, phoneNumber: openIdUserInterface.phoneNumber, - phoneNumberVerified: openIdUserInterface.phoneNumberVerified?.boolValue, + phoneNumberVerified: openIdUserInterface.phoneNumberVerified, address: address ) } @@ -199,8 +199,8 @@ public class Converters { address: ProfileAddress ) -> AddressInterface { - AddressInterface.make( - withFormatted: address.raw, + AddressInterface( + formatted: address.raw, streetAddress: address.streetAddress, locality: address.locality, region: address.region, @@ -236,10 +236,13 @@ public class Converters { let addresses = profileSignupRequestInterface.addresses? .map({ addressRequest in - profileAddressFromInterface( - profileAddressInterface: addressRequest - ) - }) + addressRequest != nil ? profileAddressFromInterface( + profileAddressInterface: addressRequest! + ) : nil + }).filter({ + address in + address != nil + }) as? Array var consents = profileSignupRequestInterface.consents != nil ? [String: Consent]() @@ -247,9 +250,11 @@ public class Converters { profileSignupRequestInterface.consents?.forEach({ key, consentInterface in - consents![key] = consentFromInterface( - consentInterface: consentInterface - ) + if (key != nil && consentInterface != nil) { + consents![key!] = consentFromInterface( + consentInterface: consentInterface! + ) + } }) return ProfileSignupRequest( @@ -271,7 +276,7 @@ public class Converters { bio: profileSignupRequestInterface.bio, consents: consents, company: profileSignupRequestInterface.company, - liteOnly: profileSignupRequestInterface.liteOnly?.boolValue + liteOnly: profileSignupRequestInterface.liteOnly ) } @@ -296,8 +301,6 @@ public class Converters { return "billing" case ProfileAddressTypeInterface.delivery: return "delivery" - @unknown default: - return nil } } @@ -311,9 +314,9 @@ public class Converters { addressType: profileAddress.addressType ) - return ProfileAddressInterface.make( - withTitle: profileAddress.title, - isDefault: isDefault, + return ProfileAddressInterface( + title: profileAddress.title, + isDefault: isDefault?.boolValue, addressType: addressType, streetAddress: profileAddress.streetAddress, locality: profileAddress.locality, @@ -332,13 +335,13 @@ public class Converters { profileAddressInterface: ProfileAddressInterface ) -> ProfileAddress { - let addressType = addressTypeFromInterface( - addressTypeInterface: profileAddressInterface.addressType - ) + let addressType = profileAddressInterface.addressType != nil ? addressTypeFromInterface( + addressTypeInterface: profileAddressInterface.addressType! + ) : nil return ProfileAddress( title: profileAddressInterface.title, - isDefault: profileAddressInterface.isDefault?.boolValue, + isDefault: profileAddressInterface.isDefault, addressType: addressType, streetAddress: profileAddressInterface.streetAddress, locality: profileAddressInterface.locality, @@ -352,29 +355,42 @@ public class Converters { phoneNumber: profileAddressInterface.phoneNumber ) } - + static public func consentToInterface( consent: Consent ) -> ConsentInterface { - - ConsentInterface.make( - withGranted: NSNumber.init(booleanLiteral: consent.granted), + return ConsentInterface( + granted: consent.granted, consentType: consent.consentType, date: consent.date ) } + static public func consentsToInterface( + consents: [String: Consent] + ) -> [String?: ConsentInterface?] { + return consents.mapValues {consent in consentToInterface(consent: consent)} + } + static public func consentFromInterface( consentInterface: ConsentInterface ) -> Consent { - - Consent( - granted: consentInterface.granted.boolValue, + return Consent( + granted: consentInterface.granted, consentType: consentInterface.consentType, date: consentInterface.date ) } + static public func consentsFromInterface( + consentsInterface: [String?: ConsentInterface?] + ) -> [String: Consent]? { + return consentsInterface.mapValues { consent in + consent != nil ? consentFromInterface(consentInterface: consent!) : nil }.filter({(key, consent) in + key != nil && consent != nil + }) as? [String : Consent] + } + static public func providerCreatorFromInterface( providerCreatorInterface: ProviderCreatorInterface ) -> ProviderCreator? { @@ -385,22 +401,17 @@ public class Converters { return FacebookProvider() case ProviderCreatorTypeInterface.webview: return WebViewProvider() - @unknown default: - return nil + } } static public func loginSummaryToInterface( loginSummary: LoginSummary ) -> LoginSummaryInterface { - let firstLogin = loginSummary.firstLogin != nil ? NSNumber.init(floatLiteral: Double(loginSummary.firstLogin!)) : nil - let lastLogin = loginSummary.lastLogin != nil ? NSNumber.init(floatLiteral: Double(loginSummary.lastLogin!)) : nil - let total = loginSummary.total != nil ? NSNumber.init(value: loginSummary.total!) : nil - - return LoginSummaryInterface.make( - withFirstLogin: firstLogin, - lastLogin: lastLogin, - total: total, + return LoginSummaryInterface( + firstLogin: loginSummary.firstLogin != nil ? Double(loginSummary.firstLogin!) : nil, + lastLogin: loginSummary.lastLogin != nil ? Double(loginSummary.lastLogin!) : nil, + total: loginSummary.total != nil ? Int64(loginSummary.total!) : nil, origins: loginSummary.origins, devices: loginSummary.devices, lastProvider: loginSummary.lastProvider @@ -410,13 +421,18 @@ public class Converters { static public func loginSummaryFromInterface( loginSummaryInterface: LoginSummaryInterface ) -> LoginSummary { - - LoginSummary( - firstLogin: loginSummaryInterface.firstLogin?.intValue, - lastLogin: loginSummaryInterface.lastLogin?.intValue, - total: loginSummaryInterface.total?.intValue, - origins: loginSummaryInterface.origins, - devices: loginSummaryInterface.devices, + return LoginSummary( + firstLogin: loginSummaryInterface.firstLogin != nil ? Int(loginSummaryInterface.firstLogin!) : nil, + lastLogin: loginSummaryInterface.lastLogin != nil ? Int(loginSummaryInterface.lastLogin!) : nil, + total: loginSummaryInterface.total != nil ? Int(loginSummaryInterface.total!) : nil, + origins: loginSummaryInterface.origins?.filter({ + origin in + origin != nil + }) as? [String], + devices: loginSummaryInterface.devices?.filter({ + device in + device != nil + }) as? [String], lastProvider: loginSummaryInterface.lastProvider ) } @@ -425,8 +441,8 @@ public class Converters { emails: Emails ) -> EmailsInterface { - EmailsInterface.make( - withVerified: emails.verified, + return EmailsInterface( + verified: emails.verified, unverified: emails.unverified ) } @@ -435,9 +451,15 @@ public class Converters { emailsInterface: EmailsInterface ) -> Emails { - Emails( - verified: emailsInterface.verified, - unverified: emailsInterface.unverified + return Emails( + verified: emailsInterface.verified?.filter({ + origin in + origin != nil + }) as? [String], + unverified: emailsInterface.unverified?.filter({ + origin in + origin != nil + }) as? [String] ) } @@ -455,8 +477,8 @@ public class Converters { profileAddressToInterface(profileAddress: profileAddress) }) - return ProfileInterface.make( - withUid: profile.uid, + return ProfileInterface( + uid: profile.uid, givenName: profile.givenName, middleName: profile.middleName, familyName: profile.familyName, @@ -471,18 +493,18 @@ public class Converters { username: profile.username, gender: profile.gender, email: profile.email, - emailVerified: emailVerified, + emailVerified: emailVerified?.boolValue, emails: emails, phoneNumber: profile.phoneNumber, - phoneNumberVerified: phoneNumberVerified, + phoneNumberVerified: phoneNumberVerified?.boolValue, addresses: addresses, locale: profile.locale, bio: profile.bio, - customFields: profile.customFields?.mapValues {customField in customField.value}, - consents: profile.consents?.mapValues {consent in consentToInterface(consent: consent)}, + customFields: profile.customFields?.mapValues {customField in customField.value} as? [String? : Any?], + consents: profile.consents != nil ? consentsToInterface(consents: profile.consents!) : nil, createdAt: nil, updatedAt: nil, - liteOnly: liteOnly, + liteOnly: liteOnly?.boolValue, company: nil ) } @@ -492,11 +514,24 @@ public class Converters { ) -> Profile { let loginSummary = profileInterface.loginSummary != nil ? loginSummaryFromInterface(loginSummaryInterface: profileInterface.loginSummary!) : nil let emails = profileInterface.emails != nil ? emailsFromInterface(emailsInterface: profileInterface.emails!) : nil + + let authTypes = profileInterface.authTypes?.filter({ + authType in + authType != nil + }) as? [String] let addresses = profileInterface.addresses? .map({ profileAddressInterface in - profileAddressFromInterface(profileAddressInterface: profileAddressInterface) - }) + profileAddressInterface != nil ? + profileAddressFromInterface(profileAddressInterface: profileAddressInterface!) : nil + }).filter({ + address in + address != nil + }) as? [ProfileAddress] + + let consents = profileInterface.consents != nil ? consentsFromInterface(consentsInterface: profileInterface.consents!) : nil + + let customFields = try? profileInterface.customFields?.mapValues { customFieldInterface in try CustomField(value: customFieldInterface as Any)} as? [String: CustomField] return Profile( uid: profileInterface.uid, @@ -509,24 +544,26 @@ public class Converters { profileURL: profileInterface.profileURL, picture: profileInterface.picture, externalId: profileInterface.externalId, - authTypes: profileInterface.authTypes, + authTypes: authTypes, loginSummary: loginSummary, username: profileInterface.username, gender: profileInterface.gender, email: profileInterface.email, - emailVerified: profileInterface.emailVerified?.boolValue, + emailVerified: profileInterface.emailVerified, emails: emails, phoneNumber: profileInterface.phoneNumber, - phoneNumberVerified: profileInterface.phoneNumberVerified?.boolValue, + phoneNumberVerified: profileInterface.phoneNumberVerified, addresses: addresses, locale: profileInterface.locale, bio: profileInterface.bio, - customFields: try? profileInterface.customFields?.mapValues { customFieldInterface in try CustomField(value: customFieldInterface)}, - consents: profileInterface.consents?.mapValues { consent in consentFromInterface(consentInterface: consent) }, + customFields: customFields, + consents: consents, createdAt: profileInterface.createdAt, updatedAt: profileInterface.updatedAt, company: profileInterface.company, - liteOnly: profileInterface.liteOnly?.boolValue + liteOnly: profileInterface.liteOnly ) } } + +extension FlutterError: Error {} diff --git a/flutter_reach_five_ios/ios/Classes/ReachFiveApi.swift b/flutter_reach_five_ios/ios/Classes/ReachFiveApi.swift new file mode 100644 index 0000000..d904c4c --- /dev/null +++ b/flutter_reach_five_ios/ios/Classes/ReachFiveApi.swift @@ -0,0 +1,1471 @@ +// Autogenerated from Pigeon (v9.2.4), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +import Foundation +#if os(iOS) +import Flutter +#elseif os(macOS) +import FlutterMacOS +#else +#error("Unsupported platform.") +#endif + +private func wrapResult(_ result: Any?) -> [Any?] { + return [result] +} + +private func wrapError(_ error: Any) -> [Any?] { + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details + ] + } + return [ + "\(error)", + "\(type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)" + ] +} + +private func nilOrValue(_ value: Any?) -> T? { + if value is NSNull { return nil } + return (value as Any) as! T? +} + +enum ProviderCreatorTypeInterface: Int { + case google = 0 + case facebook = 1 + case webview = 2 +} + +enum ProfileAddressTypeInterface: Int { + case billing = 0 + case delivery = 1 +} + +/// Generated class from Pigeon that represents data sent in messages. +struct ErrorCodesInterface { + var emailAlreadyInUseCode: String + var invalidEmailOrPasswordCode: String + var invalidVerificationCode: String + var invalidGrant: String + var userCancelledOrClosedTheWebFlow: String + var socialAccountEmailAlreadyInUse: String + + static func fromList(_ list: [Any]) -> ErrorCodesInterface? { + let emailAlreadyInUseCode = list[0] as! String + let invalidEmailOrPasswordCode = list[1] as! String + let invalidVerificationCode = list[2] as! String + let invalidGrant = list[3] as! String + let userCancelledOrClosedTheWebFlow = list[4] as! String + let socialAccountEmailAlreadyInUse = list[5] as! String + + return ErrorCodesInterface( + emailAlreadyInUseCode: emailAlreadyInUseCode, + invalidEmailOrPasswordCode: invalidEmailOrPasswordCode, + invalidVerificationCode: invalidVerificationCode, + invalidGrant: invalidGrant, + userCancelledOrClosedTheWebFlow: userCancelledOrClosedTheWebFlow, + socialAccountEmailAlreadyInUse: socialAccountEmailAlreadyInUse + ) + } + func toList() -> [Any?] { + return [ + emailAlreadyInUseCode, + invalidEmailOrPasswordCode, + invalidVerificationCode, + invalidGrant, + userCancelledOrClosedTheWebFlow, + socialAccountEmailAlreadyInUse, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SdkConfigInterface { + var domain: String + var clientId: String + var androidScheme: String + var iosScheme: String + + static func fromList(_ list: [Any]) -> SdkConfigInterface? { + let domain = list[0] as! String + let clientId = list[1] as! String + let androidScheme = list[2] as! String + let iosScheme = list[3] as! String + + return SdkConfigInterface( + domain: domain, + clientId: clientId, + androidScheme: androidScheme, + iosScheme: iosScheme + ) + } + func toList() -> [Any?] { + return [ + domain, + clientId, + androidScheme, + iosScheme, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct ProviderCreatorInterface { + var type: ProviderCreatorTypeInterface + + static func fromList(_ list: [Any]) -> ProviderCreatorInterface? { + let type = ProviderCreatorTypeInterface(rawValue: list[0] as! Int)! + + return ProviderCreatorInterface( + type: type + ) + } + func toList() -> [Any?] { + return [ + type.rawValue, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct ReachFiveKeyInterface { + var sdkConfig: SdkConfigInterface + var providerCreators: [ProviderCreatorInterface?] + + static func fromList(_ list: [Any]) -> ReachFiveKeyInterface? { + let sdkConfig = SdkConfigInterface.fromList(list[0] as! [Any])! + let providerCreators = list[1] as! [ProviderCreatorInterface?] + + return ReachFiveKeyInterface( + sdkConfig: sdkConfig, + providerCreators: providerCreators + ) + } + func toList() -> [Any?] { + return [ + sdkConfig.toList(), + providerCreators, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct ReachFiveConfigInterface { + var reachFiveKey: ReachFiveKeyInterface + var providers: [String?] + + static func fromList(_ list: [Any]) -> ReachFiveConfigInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let providers = list[1] as! [String?] + + return ReachFiveConfigInterface( + reachFiveKey: reachFiveKey, + providers: providers + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + providers, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct ProfileAddressInterface { + var title: String? = nil + var isDefault: Bool? = nil + var addressType: ProfileAddressTypeInterface? = nil + var streetAddress: String? = nil + var locality: String? = nil + var region: String? = nil + var postalCode: String? = nil + var country: String? = nil + var raw: String? = nil + var deliveryNote: String? = nil + var recipient: String? = nil + var company: String? = nil + var phoneNumber: String? = nil + + static func fromList(_ list: [Any]) -> ProfileAddressInterface? { + let title: String? = nilOrValue(list[0]) + let isDefault: Bool? = nilOrValue(list[1]) + var addressType: ProfileAddressTypeInterface? = nil + let addressTypeEnumVal: Int? = nilOrValue(list[2]) + if let addressTypeRawValue = addressTypeEnumVal { + addressType = ProfileAddressTypeInterface(rawValue: addressTypeRawValue)! + } + let streetAddress: String? = nilOrValue(list[3]) + let locality: String? = nilOrValue(list[4]) + let region: String? = nilOrValue(list[5]) + let postalCode: String? = nilOrValue(list[6]) + let country: String? = nilOrValue(list[7]) + let raw: String? = nilOrValue(list[8]) + let deliveryNote: String? = nilOrValue(list[9]) + let recipient: String? = nilOrValue(list[10]) + let company: String? = nilOrValue(list[11]) + let phoneNumber: String? = nilOrValue(list[12]) + + return ProfileAddressInterface( + title: title, + isDefault: isDefault, + addressType: addressType, + streetAddress: streetAddress, + locality: locality, + region: region, + postalCode: postalCode, + country: country, + raw: raw, + deliveryNote: deliveryNote, + recipient: recipient, + company: company, + phoneNumber: phoneNumber + ) + } + func toList() -> [Any?] { + return [ + title, + isDefault, + addressType?.rawValue, + streetAddress, + locality, + region, + postalCode, + country, + raw, + deliveryNote, + recipient, + company, + phoneNumber, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct ConsentInterface { + var granted: Bool + var consentType: String? = nil + var date: String + + static func fromList(_ list: [Any]) -> ConsentInterface? { + let granted = list[0] as! Bool + let consentType: String? = nilOrValue(list[1]) + let date = list[2] as! String + + return ConsentInterface( + granted: granted, + consentType: consentType, + date: date + ) + } + func toList() -> [Any?] { + return [ + granted, + consentType, + date, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct ProfileSignupRequestInterface { + var password: String + var email: String? = nil + var phoneNumber: String? = nil + var givenName: String? = nil + var middleName: String? = nil + var familyName: String? = nil + var name: String? = nil + var nickname: String? = nil + var birthdate: String? = nil + var profileURL: String? = nil + var picture: String? = nil + var username: String? = nil + var gender: String? = nil + var company: String? = nil + var addresses: [ProfileAddressInterface?]? = nil + var locale: String? = nil + var bio: String? = nil + var customFields: [String?: Any?]? = nil + var consents: [String?: ConsentInterface?]? = nil + var liteOnly: Bool? = nil + + static func fromList(_ list: [Any]) -> ProfileSignupRequestInterface? { + let password = list[0] as! String + let email: String? = nilOrValue(list[1]) + let phoneNumber: String? = nilOrValue(list[2]) + let givenName: String? = nilOrValue(list[3]) + let middleName: String? = nilOrValue(list[4]) + let familyName: String? = nilOrValue(list[5]) + let name: String? = nilOrValue(list[6]) + let nickname: String? = nilOrValue(list[7]) + let birthdate: String? = nilOrValue(list[8]) + let profileURL: String? = nilOrValue(list[9]) + let picture: String? = nilOrValue(list[10]) + let username: String? = nilOrValue(list[11]) + let gender: String? = nilOrValue(list[12]) + let company: String? = nilOrValue(list[13]) + let addresses: [ProfileAddressInterface?]? = nilOrValue(list[14]) + let locale: String? = nilOrValue(list[15]) + let bio: String? = nilOrValue(list[16]) + let customFields: [String?: Any?]? = nilOrValue(list[17]) + let consents: [String?: ConsentInterface?]? = nilOrValue(list[18]) + let liteOnly: Bool? = nilOrValue(list[19]) + + return ProfileSignupRequestInterface( + password: password, + email: email, + phoneNumber: phoneNumber, + givenName: givenName, + middleName: middleName, + familyName: familyName, + name: name, + nickname: nickname, + birthdate: birthdate, + profileURL: profileURL, + picture: picture, + username: username, + gender: gender, + company: company, + addresses: addresses, + locale: locale, + bio: bio, + customFields: customFields, + consents: consents, + liteOnly: liteOnly + ) + } + func toList() -> [Any?] { + return [ + password, + email, + phoneNumber, + givenName, + middleName, + familyName, + name, + nickname, + birthdate, + profileURL, + picture, + username, + gender, + company, + addresses, + locale, + bio, + customFields, + consents, + liteOnly, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SignupRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var profile: ProfileSignupRequestInterface + var redirectUrl: String? = nil + var scope: [String?]? = nil + var errorCodes: ErrorCodesInterface + + static func fromList(_ list: [Any]) -> SignupRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let profile = ProfileSignupRequestInterface.fromList(list[1] as! [Any])! + let redirectUrl: String? = nilOrValue(list[2]) + let scope: [String?]? = nilOrValue(list[3]) + let errorCodes = ErrorCodesInterface.fromList(list[4] as! [Any])! + + return SignupRequestInterface( + reachFiveKey: reachFiveKey, + profile: profile, + redirectUrl: redirectUrl, + scope: scope, + errorCodes: errorCodes + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + profile.toList(), + redirectUrl, + scope, + errorCodes.toList(), + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct AddressInterface { + var formatted: String? = nil + var streetAddress: String? = nil + var locality: String? = nil + var region: String? = nil + var postalCode: String? = nil + var country: String? = nil + + static func fromList(_ list: [Any]) -> AddressInterface? { + let formatted: String? = nilOrValue(list[0]) + let streetAddress: String? = nilOrValue(list[1]) + let locality: String? = nilOrValue(list[2]) + let region: String? = nilOrValue(list[3]) + let postalCode: String? = nilOrValue(list[4]) + let country: String? = nilOrValue(list[5]) + + return AddressInterface( + formatted: formatted, + streetAddress: streetAddress, + locality: locality, + region: region, + postalCode: postalCode, + country: country + ) + } + func toList() -> [Any?] { + return [ + formatted, + streetAddress, + locality, + region, + postalCode, + country, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct OpenIdUserInterface { + var id: String? = nil + var name: String? = nil + var preferredUsername: String? = nil + var givenName: String? = nil + var familyName: String? = nil + var middleName: String? = nil + var nickname: String? = nil + var picture: String? = nil + var website: String? = nil + var email: String? = nil + var emailVerified: Bool? = nil + var gender: String? = nil + var zoneinfo: String? = nil + var locale: String? = nil + var phoneNumber: String? = nil + var phoneNumberVerified: Bool? = nil + var address: AddressInterface? = nil + var birthdate: String? = nil + var externalId: String? = nil + + static func fromList(_ list: [Any]) -> OpenIdUserInterface? { + let id: String? = nilOrValue(list[0]) + let name: String? = nilOrValue(list[1]) + let preferredUsername: String? = nilOrValue(list[2]) + let givenName: String? = nilOrValue(list[3]) + let familyName: String? = nilOrValue(list[4]) + let middleName: String? = nilOrValue(list[5]) + let nickname: String? = nilOrValue(list[6]) + let picture: String? = nilOrValue(list[7]) + let website: String? = nilOrValue(list[8]) + let email: String? = nilOrValue(list[9]) + let emailVerified: Bool? = nilOrValue(list[10]) + let gender: String? = nilOrValue(list[11]) + let zoneinfo: String? = nilOrValue(list[12]) + let locale: String? = nilOrValue(list[13]) + let phoneNumber: String? = nilOrValue(list[14]) + let phoneNumberVerified: Bool? = nilOrValue(list[15]) + var address: AddressInterface? = nil + if let addressList = list[16] as! [Any]? { + address = AddressInterface.fromList(addressList) + } + let birthdate: String? = nilOrValue(list[17]) + let externalId: String? = nilOrValue(list[18]) + + return OpenIdUserInterface( + id: id, + name: name, + preferredUsername: preferredUsername, + givenName: givenName, + familyName: familyName, + middleName: middleName, + nickname: nickname, + picture: picture, + website: website, + email: email, + emailVerified: emailVerified, + gender: gender, + zoneinfo: zoneinfo, + locale: locale, + phoneNumber: phoneNumber, + phoneNumberVerified: phoneNumberVerified, + address: address, + birthdate: birthdate, + externalId: externalId + ) + } + func toList() -> [Any?] { + return [ + id, + name, + preferredUsername, + givenName, + familyName, + middleName, + nickname, + picture, + website, + email, + emailVerified, + gender, + zoneinfo, + locale, + phoneNumber, + phoneNumberVerified, + address?.toList(), + birthdate, + externalId, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct AuthTokenInterface { + var idToken: String? = nil + var accessToken: String + var refreshToken: String? = nil + var tokenType: String? = nil + var expiresIn: Int64? = nil + var user: OpenIdUserInterface? = nil + + static func fromList(_ list: [Any]) -> AuthTokenInterface? { + let idToken: String? = nilOrValue(list[0]) + let accessToken = list[1] as! String + let refreshToken: String? = nilOrValue(list[2]) + let tokenType: String? = nilOrValue(list[3]) + let expiresIn: Int64? = list[4] is NSNull ? nil : (list[4] is Int64? ? list[4] as! Int64? : Int64(list[4] as! Int32)) + var user: OpenIdUserInterface? = nil + if let userList = list[5] as! [Any]? { + user = OpenIdUserInterface.fromList(userList) + } + + return AuthTokenInterface( + idToken: idToken, + accessToken: accessToken, + refreshToken: refreshToken, + tokenType: tokenType, + expiresIn: expiresIn, + user: user + ) + } + func toList() -> [Any?] { + return [ + idToken, + accessToken, + refreshToken, + tokenType, + expiresIn, + user?.toList(), + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct LoginWithPasswordRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var email: String? = nil + var phoneNumber: String? = nil + var password: String + var scope: [String?]? = nil + var errorCodes: ErrorCodesInterface + + static func fromList(_ list: [Any]) -> LoginWithPasswordRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let email: String? = nilOrValue(list[1]) + let phoneNumber: String? = nilOrValue(list[2]) + let password = list[3] as! String + let scope: [String?]? = nilOrValue(list[4]) + let errorCodes = ErrorCodesInterface.fromList(list[5] as! [Any])! + + return LoginWithPasswordRequestInterface( + reachFiveKey: reachFiveKey, + email: email, + phoneNumber: phoneNumber, + password: password, + scope: scope, + errorCodes: errorCodes + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + email, + phoneNumber, + password, + scope, + errorCodes.toList(), + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct LoginWithProviderRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var provider: String + var origin: String + var scope: [String?]? = nil + var errorCodes: ErrorCodesInterface + + static func fromList(_ list: [Any]) -> LoginWithProviderRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let provider = list[1] as! String + let origin = list[2] as! String + let scope: [String?]? = nilOrValue(list[3]) + let errorCodes = ErrorCodesInterface.fromList(list[4] as! [Any])! + + return LoginWithProviderRequestInterface( + reachFiveKey: reachFiveKey, + provider: provider, + origin: origin, + scope: scope, + errorCodes: errorCodes + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + provider, + origin, + scope, + errorCodes.toList(), + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct RefreshAccessTokenRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var authToken: AuthTokenInterface + + static func fromList(_ list: [Any]) -> RefreshAccessTokenRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let authToken = AuthTokenInterface.fromList(list[1] as! [Any])! + + return RefreshAccessTokenRequestInterface( + reachFiveKey: reachFiveKey, + authToken: authToken + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + authToken.toList(), + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct LoginSummaryInterface { + var firstLogin: Double? = nil + var lastLogin: Double? = nil + var total: Int64? = nil + var origins: [String?]? = nil + var devices: [String?]? = nil + var lastProvider: String? = nil + + static func fromList(_ list: [Any]) -> LoginSummaryInterface? { + let firstLogin: Double? = nilOrValue(list[0]) + let lastLogin: Double? = nilOrValue(list[1]) + let total: Int64? = list[2] is NSNull ? nil : (list[2] is Int64? ? list[2] as! Int64? : Int64(list[2] as! Int32)) + let origins: [String?]? = nilOrValue(list[3]) + let devices: [String?]? = nilOrValue(list[4]) + let lastProvider: String? = nilOrValue(list[5]) + + return LoginSummaryInterface( + firstLogin: firstLogin, + lastLogin: lastLogin, + total: total, + origins: origins, + devices: devices, + lastProvider: lastProvider + ) + } + func toList() -> [Any?] { + return [ + firstLogin, + lastLogin, + total, + origins, + devices, + lastProvider, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct EmailsInterface { + var verified: [String?]? = nil + var unverified: [String?]? = nil + + static func fromList(_ list: [Any]) -> EmailsInterface? { + let verified: [String?]? = nilOrValue(list[0]) + let unverified: [String?]? = nilOrValue(list[1]) + + return EmailsInterface( + verified: verified, + unverified: unverified + ) + } + func toList() -> [Any?] { + return [ + verified, + unverified, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct ProfileInterface { + var uid: String? = nil + var givenName: String? = nil + var middleName: String? = nil + var familyName: String? = nil + var name: String? = nil + var nickname: String? = nil + var birthdate: String? = nil + var profileURL: String? = nil + var picture: String? = nil + var externalId: String? = nil + var authTypes: [String?]? = nil + var loginSummary: LoginSummaryInterface? = nil + var username: String? = nil + var gender: String? = nil + var email: String? = nil + var emailVerified: Bool? = nil + var emails: EmailsInterface? = nil + var phoneNumber: String? = nil + var phoneNumberVerified: Bool? = nil + var addresses: [ProfileAddressInterface?]? = nil + var locale: String? = nil + var bio: String? = nil + var customFields: [String?: Any?]? = nil + var consents: [String?: ConsentInterface?]? = nil + var createdAt: String? = nil + var updatedAt: String? = nil + var liteOnly: Bool? = nil + var company: String? = nil + + static func fromList(_ list: [Any]) -> ProfileInterface? { + let uid: String? = nilOrValue(list[0]) + let givenName: String? = nilOrValue(list[1]) + let middleName: String? = nilOrValue(list[2]) + let familyName: String? = nilOrValue(list[3]) + let name: String? = nilOrValue(list[4]) + let nickname: String? = nilOrValue(list[5]) + let birthdate: String? = nilOrValue(list[6]) + let profileURL: String? = nilOrValue(list[7]) + let picture: String? = nilOrValue(list[8]) + let externalId: String? = nilOrValue(list[9]) + let authTypes: [String?]? = nilOrValue(list[10]) + var loginSummary: LoginSummaryInterface? = nil + if let loginSummaryList = list[11] as! [Any]? { + loginSummary = LoginSummaryInterface.fromList(loginSummaryList) + } + let username: String? = nilOrValue(list[12]) + let gender: String? = nilOrValue(list[13]) + let email: String? = nilOrValue(list[14]) + let emailVerified: Bool? = nilOrValue(list[15]) + var emails: EmailsInterface? = nil + if let emailsList = list[16] as! [Any]? { + emails = EmailsInterface.fromList(emailsList) + } + let phoneNumber: String? = nilOrValue(list[17]) + let phoneNumberVerified: Bool? = nilOrValue(list[18]) + let addresses: [ProfileAddressInterface?]? = nilOrValue(list[19]) + let locale: String? = nilOrValue(list[20]) + let bio: String? = nilOrValue(list[21]) + let customFields: [String?: Any?]? = nilOrValue(list[22]) + let consents: [String?: ConsentInterface?]? = nilOrValue(list[23]) + let createdAt: String? = nilOrValue(list[24]) + let updatedAt: String? = nilOrValue(list[25]) + let liteOnly: Bool? = nilOrValue(list[26]) + let company: String? = nilOrValue(list[27]) + + return ProfileInterface( + uid: uid, + givenName: givenName, + middleName: middleName, + familyName: familyName, + name: name, + nickname: nickname, + birthdate: birthdate, + profileURL: profileURL, + picture: picture, + externalId: externalId, + authTypes: authTypes, + loginSummary: loginSummary, + username: username, + gender: gender, + email: email, + emailVerified: emailVerified, + emails: emails, + phoneNumber: phoneNumber, + phoneNumberVerified: phoneNumberVerified, + addresses: addresses, + locale: locale, + bio: bio, + customFields: customFields, + consents: consents, + createdAt: createdAt, + updatedAt: updatedAt, + liteOnly: liteOnly, + company: company + ) + } + func toList() -> [Any?] { + return [ + uid, + givenName, + middleName, + familyName, + name, + nickname, + birthdate, + profileURL, + picture, + externalId, + authTypes, + loginSummary?.toList(), + username, + gender, + email, + emailVerified, + emails?.toList(), + phoneNumber, + phoneNumberVerified, + addresses, + locale, + bio, + customFields, + consents, + createdAt, + updatedAt, + liteOnly, + company, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct GetProfileRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var authToken: AuthTokenInterface + var errorCodes: ErrorCodesInterface + + static func fromList(_ list: [Any]) -> GetProfileRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let authToken = AuthTokenInterface.fromList(list[1] as! [Any])! + let errorCodes = ErrorCodesInterface.fromList(list[2] as! [Any])! + + return GetProfileRequestInterface( + reachFiveKey: reachFiveKey, + authToken: authToken, + errorCodes: errorCodes + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + authToken.toList(), + errorCodes.toList(), + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct UpdateProfileRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var authToken: AuthTokenInterface + var profile: ProfileInterface + var errorCodes: ErrorCodesInterface + + static func fromList(_ list: [Any]) -> UpdateProfileRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let authToken = AuthTokenInterface.fromList(list[1] as! [Any])! + let profile = ProfileInterface.fromList(list[2] as! [Any])! + let errorCodes = ErrorCodesInterface.fromList(list[3] as! [Any])! + + return UpdateProfileRequestInterface( + reachFiveKey: reachFiveKey, + authToken: authToken, + profile: profile, + errorCodes: errorCodes + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + authToken.toList(), + profile.toList(), + errorCodes.toList(), + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct RequestPasswordResetRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var email: String? = nil + var phoneNumber: String? = nil + var redirectUrl: String? = nil + + static func fromList(_ list: [Any]) -> RequestPasswordResetRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let email: String? = nilOrValue(list[1]) + let phoneNumber: String? = nilOrValue(list[2]) + let redirectUrl: String? = nilOrValue(list[3]) + + return RequestPasswordResetRequestInterface( + reachFiveKey: reachFiveKey, + email: email, + phoneNumber: phoneNumber, + redirectUrl: redirectUrl + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + email, + phoneNumber, + redirectUrl, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct UpdatePasswordWithAccessTokenRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var authToken: AuthTokenInterface + var oldPassword: String + var password: String + + static func fromList(_ list: [Any]) -> UpdatePasswordWithAccessTokenRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let authToken = AuthTokenInterface.fromList(list[1] as! [Any])! + let oldPassword = list[2] as! String + let password = list[3] as! String + + return UpdatePasswordWithAccessTokenRequestInterface( + reachFiveKey: reachFiveKey, + authToken: authToken, + oldPassword: oldPassword, + password: password + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + authToken.toList(), + oldPassword, + password, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct UpdatePasswordWithFreshAccessTokenRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var freshAuthToken: AuthTokenInterface + var password: String + + static func fromList(_ list: [Any]) -> UpdatePasswordWithFreshAccessTokenRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let freshAuthToken = AuthTokenInterface.fromList(list[1] as! [Any])! + let password = list[2] as! String + + return UpdatePasswordWithFreshAccessTokenRequestInterface( + reachFiveKey: reachFiveKey, + freshAuthToken: freshAuthToken, + password: password + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + freshAuthToken.toList(), + password, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct UpdatePasswordWithEmailRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var email: String + var verificationCode: String + var password: String + var errorCodes: ErrorCodesInterface + + static func fromList(_ list: [Any]) -> UpdatePasswordWithEmailRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let email = list[1] as! String + let verificationCode = list[2] as! String + let password = list[3] as! String + let errorCodes = ErrorCodesInterface.fromList(list[4] as! [Any])! + + return UpdatePasswordWithEmailRequestInterface( + reachFiveKey: reachFiveKey, + email: email, + verificationCode: verificationCode, + password: password, + errorCodes: errorCodes + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + email, + verificationCode, + password, + errorCodes.toList(), + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct UpdatePasswordWithPhoneNumberRequestInterface { + var reachFiveKey: ReachFiveKeyInterface + var phoneNumber: String + var verificationCode: String + var password: String + var errorCodes: ErrorCodesInterface + + static func fromList(_ list: [Any]) -> UpdatePasswordWithPhoneNumberRequestInterface? { + let reachFiveKey = ReachFiveKeyInterface.fromList(list[0] as! [Any])! + let phoneNumber = list[1] as! String + let verificationCode = list[2] as! String + let password = list[3] as! String + let errorCodes = ErrorCodesInterface.fromList(list[4] as! [Any])! + + return UpdatePasswordWithPhoneNumberRequestInterface( + reachFiveKey: reachFiveKey, + phoneNumber: phoneNumber, + verificationCode: verificationCode, + password: password, + errorCodes: errorCodes + ) + } + func toList() -> [Any?] { + return [ + reachFiveKey.toList(), + phoneNumber, + verificationCode, + password, + errorCodes.toList(), + ] + } +} + +private class ReachFiveHostApiCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 128: + return AddressInterface.fromList(self.readValue() as! [Any]) + case 129: + return AuthTokenInterface.fromList(self.readValue() as! [Any]) + case 130: + return ConsentInterface.fromList(self.readValue() as! [Any]) + case 131: + return EmailsInterface.fromList(self.readValue() as! [Any]) + case 132: + return ErrorCodesInterface.fromList(self.readValue() as! [Any]) + case 133: + return GetProfileRequestInterface.fromList(self.readValue() as! [Any]) + case 134: + return LoginSummaryInterface.fromList(self.readValue() as! [Any]) + case 135: + return LoginWithPasswordRequestInterface.fromList(self.readValue() as! [Any]) + case 136: + return LoginWithProviderRequestInterface.fromList(self.readValue() as! [Any]) + case 137: + return OpenIdUserInterface.fromList(self.readValue() as! [Any]) + case 138: + return ProfileAddressInterface.fromList(self.readValue() as! [Any]) + case 139: + return ProfileInterface.fromList(self.readValue() as! [Any]) + case 140: + return ProfileSignupRequestInterface.fromList(self.readValue() as! [Any]) + case 141: + return ProviderCreatorInterface.fromList(self.readValue() as! [Any]) + case 142: + return ReachFiveConfigInterface.fromList(self.readValue() as! [Any]) + case 143: + return ReachFiveKeyInterface.fromList(self.readValue() as! [Any]) + case 144: + return RefreshAccessTokenRequestInterface.fromList(self.readValue() as! [Any]) + case 145: + return RequestPasswordResetRequestInterface.fromList(self.readValue() as! [Any]) + case 146: + return SdkConfigInterface.fromList(self.readValue() as! [Any]) + case 147: + return SignupRequestInterface.fromList(self.readValue() as! [Any]) + case 148: + return UpdatePasswordWithAccessTokenRequestInterface.fromList(self.readValue() as! [Any]) + case 149: + return UpdatePasswordWithEmailRequestInterface.fromList(self.readValue() as! [Any]) + case 150: + return UpdatePasswordWithFreshAccessTokenRequestInterface.fromList(self.readValue() as! [Any]) + case 151: + return UpdatePasswordWithPhoneNumberRequestInterface.fromList(self.readValue() as! [Any]) + case 152: + return UpdateProfileRequestInterface.fromList(self.readValue() as! [Any]) + default: + return super.readValue(ofType: type) + } + } +} + +private class ReachFiveHostApiCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? AddressInterface { + super.writeByte(128) + super.writeValue(value.toList()) + } else if let value = value as? AuthTokenInterface { + super.writeByte(129) + super.writeValue(value.toList()) + } else if let value = value as? ConsentInterface { + super.writeByte(130) + super.writeValue(value.toList()) + } else if let value = value as? EmailsInterface { + super.writeByte(131) + super.writeValue(value.toList()) + } else if let value = value as? ErrorCodesInterface { + super.writeByte(132) + super.writeValue(value.toList()) + } else if let value = value as? GetProfileRequestInterface { + super.writeByte(133) + super.writeValue(value.toList()) + } else if let value = value as? LoginSummaryInterface { + super.writeByte(134) + super.writeValue(value.toList()) + } else if let value = value as? LoginWithPasswordRequestInterface { + super.writeByte(135) + super.writeValue(value.toList()) + } else if let value = value as? LoginWithProviderRequestInterface { + super.writeByte(136) + super.writeValue(value.toList()) + } else if let value = value as? OpenIdUserInterface { + super.writeByte(137) + super.writeValue(value.toList()) + } else if let value = value as? ProfileAddressInterface { + super.writeByte(138) + super.writeValue(value.toList()) + } else if let value = value as? ProfileInterface { + super.writeByte(139) + super.writeValue(value.toList()) + } else if let value = value as? ProfileSignupRequestInterface { + super.writeByte(140) + super.writeValue(value.toList()) + } else if let value = value as? ProviderCreatorInterface { + super.writeByte(141) + super.writeValue(value.toList()) + } else if let value = value as? ReachFiveConfigInterface { + super.writeByte(142) + super.writeValue(value.toList()) + } else if let value = value as? ReachFiveKeyInterface { + super.writeByte(143) + super.writeValue(value.toList()) + } else if let value = value as? RefreshAccessTokenRequestInterface { + super.writeByte(144) + super.writeValue(value.toList()) + } else if let value = value as? RequestPasswordResetRequestInterface { + super.writeByte(145) + super.writeValue(value.toList()) + } else if let value = value as? SdkConfigInterface { + super.writeByte(146) + super.writeValue(value.toList()) + } else if let value = value as? SignupRequestInterface { + super.writeByte(147) + super.writeValue(value.toList()) + } else if let value = value as? UpdatePasswordWithAccessTokenRequestInterface { + super.writeByte(148) + super.writeValue(value.toList()) + } else if let value = value as? UpdatePasswordWithEmailRequestInterface { + super.writeByte(149) + super.writeValue(value.toList()) + } else if let value = value as? UpdatePasswordWithFreshAccessTokenRequestInterface { + super.writeByte(150) + super.writeValue(value.toList()) + } else if let value = value as? UpdatePasswordWithPhoneNumberRequestInterface { + super.writeByte(151) + super.writeValue(value.toList()) + } else if let value = value as? UpdateProfileRequestInterface { + super.writeByte(152) + super.writeValue(value.toList()) + } else { + super.writeValue(value) + } + } +} + +private class ReachFiveHostApiCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return ReachFiveHostApiCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return ReachFiveHostApiCodecWriter(data: data) + } +} + +class ReachFiveHostApiCodec: FlutterStandardMessageCodec { + static let shared = ReachFiveHostApiCodec(readerWriter: ReachFiveHostApiCodecReaderWriter()) +} + +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol ReachFiveHostApi { + func initialize(reachFiveKey: ReachFiveKeyInterface, completion: @escaping (Result) -> Void) + func signup(request: SignupRequestInterface, completion: @escaping (Result) -> Void) + func loginWithPassword(request: LoginWithPasswordRequestInterface, completion: @escaping (Result) -> Void) + func loginWithProvider(request: LoginWithProviderRequestInterface, completion: @escaping (Result) -> Void) + func logout(reachFiveKey: ReachFiveKeyInterface, completion: @escaping (Result) -> Void) + func getProfile(request: GetProfileRequestInterface, completion: @escaping (Result) -> Void) + func updateProfile(request: UpdateProfileRequestInterface, completion: @escaping (Result) -> Void) + func refreshAccessToken(request: RefreshAccessTokenRequestInterface, completion: @escaping (Result) -> Void) + func requestPasswordReset(request: RequestPasswordResetRequestInterface, completion: @escaping (Result) -> Void) + func updatePasswordWithAccessToken(request: UpdatePasswordWithAccessTokenRequestInterface, completion: @escaping (Result) -> Void) + func updatePasswordWithFreshAccessToken(request: UpdatePasswordWithFreshAccessTokenRequestInterface, completion: @escaping (Result) -> Void) + func updatePasswordWithEmail(request: UpdatePasswordWithEmailRequestInterface, completion: @escaping (Result) -> Void) + func updatePasswordWithPhoneNumber(request: UpdatePasswordWithPhoneNumberRequestInterface, completion: @escaping (Result) -> Void) +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class ReachFiveHostApiSetup { + /// The codec used by ReachFiveHostApi. + static var codec: FlutterStandardMessageCodec { ReachFiveHostApiCodec.shared } + /// Sets up an instance of `ReachFiveHostApi` to handle messages through the `binaryMessenger`. + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: ReachFiveHostApi?) { + let initializeChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.initialize", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + initializeChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let reachFiveKeyArg = args[0] as! ReachFiveKeyInterface + api.initialize(reachFiveKey: reachFiveKeyArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + initializeChannel.setMessageHandler(nil) + } + let signupChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.signup", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + signupChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! SignupRequestInterface + api.signup(request: requestArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + signupChannel.setMessageHandler(nil) + } + let loginWithPasswordChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.loginWithPassword", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loginWithPasswordChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! LoginWithPasswordRequestInterface + api.loginWithPassword(request: requestArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + loginWithPasswordChannel.setMessageHandler(nil) + } + let loginWithProviderChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.loginWithProvider", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + loginWithProviderChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! LoginWithProviderRequestInterface + api.loginWithProvider(request: requestArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + loginWithProviderChannel.setMessageHandler(nil) + } + let logoutChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.logout", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + logoutChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let reachFiveKeyArg = args[0] as! ReachFiveKeyInterface + api.logout(reachFiveKey: reachFiveKeyArg) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + logoutChannel.setMessageHandler(nil) + } + let getProfileChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.getProfile", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getProfileChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! GetProfileRequestInterface + api.getProfile(request: requestArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + getProfileChannel.setMessageHandler(nil) + } + let updateProfileChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.updateProfile", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateProfileChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! UpdateProfileRequestInterface + api.updateProfile(request: requestArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + updateProfileChannel.setMessageHandler(nil) + } + let refreshAccessTokenChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.refreshAccessToken", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + refreshAccessTokenChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! RefreshAccessTokenRequestInterface + api.refreshAccessToken(request: requestArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + refreshAccessTokenChannel.setMessageHandler(nil) + } + let requestPasswordResetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.requestPasswordReset", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + requestPasswordResetChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! RequestPasswordResetRequestInterface + api.requestPasswordReset(request: requestArg) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + requestPasswordResetChannel.setMessageHandler(nil) + } + let updatePasswordWithAccessTokenChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithAccessToken", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updatePasswordWithAccessTokenChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! UpdatePasswordWithAccessTokenRequestInterface + api.updatePasswordWithAccessToken(request: requestArg) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + updatePasswordWithAccessTokenChannel.setMessageHandler(nil) + } + let updatePasswordWithFreshAccessTokenChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithFreshAccessToken", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updatePasswordWithFreshAccessTokenChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! UpdatePasswordWithFreshAccessTokenRequestInterface + api.updatePasswordWithFreshAccessToken(request: requestArg) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + updatePasswordWithFreshAccessTokenChannel.setMessageHandler(nil) + } + let updatePasswordWithEmailChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithEmail", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updatePasswordWithEmailChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! UpdatePasswordWithEmailRequestInterface + api.updatePasswordWithEmail(request: requestArg) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + updatePasswordWithEmailChannel.setMessageHandler(nil) + } + let updatePasswordWithPhoneNumberChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithPhoneNumber", binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updatePasswordWithPhoneNumberChannel.setMessageHandler { message, reply in + let args = message as! [Any] + let requestArg = args[0] as! UpdatePasswordWithPhoneNumberRequestInterface + api.updatePasswordWithPhoneNumber(request: requestArg) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + updatePasswordWithPhoneNumberChannel.setMessageHandler(nil) + } + } +} diff --git a/flutter_reach_five_ios/ios/Classes/SwiftFlutterReachFivePlugin.swift b/flutter_reach_five_ios/ios/Classes/SwiftFlutterReachFivePlugin.swift index 3a87ecf..19454cb 100644 --- a/flutter_reach_five_ios/ios/Classes/SwiftFlutterReachFivePlugin.swift +++ b/flutter_reach_five_ios/ios/Classes/SwiftFlutterReachFivePlugin.swift @@ -17,27 +17,27 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost let messenger : FlutterBinaryMessenger = registrar.messenger() let api : ReachFiveHostApi & NSObjectProtocol = SwiftFlutterReachFivePlugin.init() - ReachFiveHostApiSetup(messenger, api); - + ReachFiveHostApiSetup.setUp(binaryMessenger: messenger, api: api); } private func getReachFiveInstanceKey(reachFiveKey: ReachFiveKeyInterface) -> String { var key: String = reachFiveKey.sdkConfig.domain + reachFiveKey.sdkConfig.clientId + reachFiveKey.sdkConfig.iosScheme reachFiveKey.providerCreators.forEach({ providerCreator in - key += Converters.providerCreatorFromInterface( - providerCreatorInterface: providerCreator - )?.name ?? "" + key += (providerCreator != nil ? Converters.providerCreatorFromInterface( + providerCreatorInterface: providerCreator! + )?.name : nil) ?? "" }) return key } - - public func initializeReachFiveKey(_ reachFiveKey: ReachFiveKeyInterface, completion: @escaping (ReachFiveConfigInterface?, FlutterError?) -> Void) { + + func initialize(reachFiveKey: ReachFiveKeyInterface, completion: @escaping (Result) -> Void) { let providersCreators = reachFiveKey.providerCreators.map({ providerCreatorInterface in + providerCreatorInterface != nil ? Converters.providerCreatorFromInterface( - providerCreatorInterface: providerCreatorInterface - ) + providerCreatorInterface: providerCreatorInterface! + ) : nil }).filter({ providerCreator in providerCreator != nil @@ -60,36 +60,33 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost .onSuccess { providers in self.reachFiveInstances[reachFiveInstanceKey] = reachFive completion( - ReachFiveConfigInterface.make( - withReachFiveKey: reachFiveKey, - providers: providers.map({ - provider in - provider.name - }) - ), - nil + Result.success( + ReachFiveConfigInterface( + reachFiveKey: reachFiveKey, + providers: providers.map({ + provider in + provider.name + }) + ) + ) ) } .onFailure { error in completion( - nil, - FlutterError( + Result.failure(FlutterError( code: "initialization_error_code", message: error.message(), details: nil - ) + )) ) } } - public func signupRequest(_ request: SignupRequestInterface, completion: @escaping (AuthTokenInterface?, FlutterError?) -> Void) { + func signup(request: SignupRequestInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nil, - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } @@ -97,21 +94,27 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost profileSignupRequestInterface: request.profile ) - reachFive.signup( + let signupCall = reachFive.signup( profile: signupRequest, redirectUrl: request.redirectUrl, - scope: request.scope - ).onSuccess( + scope: request.scope?.filter({scopeValue in + scopeValue != nil}) as? [String] + ) + + signupCall.onSuccess( callback: { authToken in completion( - Converters.authTokenToInterface(authToken: authToken), - nil + Result.success( + Converters.authTokenToInterface(authToken: authToken) + ) ) } - ).onFailure( + ) + + signupCall.onFailure( callback: { error in completion( - nil, + Result.failure( Converters.parseError( reachFiveError: error, errorCodesInterface: request.errorCodes, @@ -121,38 +124,44 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost details: nil ) ) + ) ) } ) + } - public func login(withPasswordRequest request: LoginWithPasswordRequestInterface, completion: @escaping (AuthTokenInterface?, FlutterError?) -> Void) { + func loginWithPassword(request: LoginWithPasswordRequestInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nil, - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } - reachFive.loginWithPassword( + let loginWithPasswordCall = reachFive.loginWithPassword( email: request.email, phoneNumber: request.phoneNumber, password: request.password, - scope: request.scope - ).onSuccess( + scope: request.scope?.filter({scopeValue in + scopeValue != nil}) as? [String] + ) + + loginWithPasswordCall.onSuccess( callback: { authToken in completion( - Converters.authTokenToInterface(authToken: authToken), - nil + Result.success( + Converters.authTokenToInterface(authToken: authToken) + ) ) + } - ).onFailure( + ) + + loginWithPasswordCall.onFailure( callback: { error in completion( - nil, + Result.failure( Converters.parseError( reachFiveError: error, errorCodesInterface: request.errorCodes, @@ -162,101 +171,102 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost details: nil ) ) + ) ) } ) } - public func login(withProviderRequest request: LoginWithProviderRequestInterface, completion: @escaping (AuthTokenInterface?, FlutterError?) -> Void) { - let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) - guard let reachFive = reachFiveInstances[reachFiveInstanceKey] - else { - completion( - nil, - nonInitializedFlutterError - ) - return - } + func loginWithProvider(request: LoginWithProviderRequestInterface, completion: @escaping (Result) -> Void) { + let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) + guard let reachFive = reachFiveInstances[reachFiveInstanceKey] + else { + completion(Result.failure(nonInitializedFlutterError)) + return + } - let viewController = ((UIApplication.shared.delegate?.window!)!).rootViewController + let viewController = ((UIApplication.shared.delegate?.window!)!).rootViewController - guard let provider = reachFive.getProvider(name: request.provider) - else { + guard let provider = reachFive.getProvider(name: request.provider) + else { + completion(Result.failure( + FlutterError( + code: "not_available_provider_error_code", + message: "The provider was not found in your reachFive instance", + details: nil + ) + )) + return + } + + let loginWithProviderCall = provider.login( + scope: request.scope?.filter({scopeValue in + scopeValue != nil}) as? [String], + origin: request.origin, + viewController: viewController + ) + + loginWithProviderCall.onSuccess( + callback: { authToken in completion( - nil, - FlutterError( - code: "not_available_provider_error_code", - message: "The provider was not found in your reachFive instance", - details: nil + Result.success( + Converters.authTokenToInterface(authToken: authToken) ) ) - return } - - provider.login( - scope: request.scope, - origin: request.origin, - viewController: viewController - ).onSuccess( - callback: { authToken in - completion( - Converters.authTokenToInterface(authToken: authToken), - nil - ) - } - ).onFailure( - callback: { error in - completion( - nil, - Converters.parseError( - reachFiveError: error, - errorCodesInterface: request.errorCodes, - defaultFlutterError: FlutterError( - code: "login_with_provider_error_code", - message: error.message(), - details: nil - ) - ) + ) + + loginWithProviderCall.onFailure( + callback: { error in + completion( + Result.failure( + Converters.parseError( + reachFiveError: error, + errorCodesInterface: request.errorCodes, + defaultFlutterError: FlutterError( + code: "login_with_provider_error_code", + message: error.message(), + details: nil + ) + ) ) - } - ) - } + ) + } + ) + } - public func logoutReachFiveKey(_ reachFiveKey: ReachFiveKeyInterface, completion: @escaping (FlutterError?) -> Void) { + func logout(reachFiveKey: ReachFiveKeyInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } reachFive.logout().onSuccess( - callback: { _ in - completion(nil) + callback: { unit in + completion(Result.success(unit)) } ).onFailure( callback: { error in completion( - FlutterError( - code: "logout_error_code", - message: error.message(), - details: nil + Result.failure( + FlutterError( + code: "logout_error_code", + message: error.message(), + details: nil + ) ) ) } ) } - public func getProfileRequest(_ request: GetProfileRequestInterface, completion: @escaping (ProfileInterface?, FlutterError?) -> Void) { + func getProfile(request: GetProfileRequestInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nil, - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } @@ -268,14 +278,15 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost .onSuccess( callback: { profile in completion( - Converters.profileToInterface(profile: profile), - nil + Result.success( + Converters.profileToInterface(profile: profile) + ) ) } ).onFailure( callback: { error in completion( - nil, + Result.failure( Converters.parseError( reachFiveError: error, errorCodesInterface: request.errorCodes, @@ -285,19 +296,17 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost details: nil ) ) + ) ) } ) } - - public func updateProfileRequest(_ request: UpdateProfileRequestInterface, completion: @escaping (ProfileInterface?, FlutterError?) -> Void) { + + func updateProfile(request: UpdateProfileRequestInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nil, - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } @@ -313,14 +322,15 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost .onSuccess( callback: { profile in completion( - Converters.profileToInterface(profile: profile), - nil + Result.success( + Converters.profileToInterface(profile: profile) + ) ) } ).onFailure( callback: { error in completion( - nil, + Result.failure( Converters.parseError( reachFiveError: error, errorCodesInterface: request.errorCodes, @@ -330,19 +340,17 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost details: nil ) ) + ) ) } ) } - public func refreshAccessTokenRequest(_ request: RefreshAccessTokenRequestInterface, completion: @escaping (AuthTokenInterface?, FlutterError?) -> Void) { + func refreshAccessToken(request: RefreshAccessTokenRequestInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nil, - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } @@ -355,31 +363,31 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost ).onSuccess( callback: { authToken in completion( - Converters.authTokenToInterface(authToken: authToken), - nil + Result.success( + Converters.authTokenToInterface(authToken: authToken) + ) ) } ).onFailure( callback: { error in completion( - nil, - FlutterError( - code: "refresh_access_token_error_code", - message: error.message(), - details: nil + Result.failure( + FlutterError( + code: "refresh_access_token_error_code", + message: error.message(), + details: nil + ) ) ) } ) } - public func requestPasswordResetRequest(_ request: RequestPasswordResetRequestInterface, completion: @escaping (FlutterError?) -> Void) { + func requestPasswordReset(request: RequestPasswordResetRequestInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } @@ -388,29 +396,29 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost phoneNumber: request.phoneNumber, redirectUrl: request.redirectUrl ).onSuccess( - callback: {_ in - completion(nil) + callback: { unit in + completion(Result.success(unit)) } ).onFailure( callback: {error in completion( - FlutterError( - code: "request_password_reset_error_code", - message: error.message(), - details: nil + Result.failure( + FlutterError( + code: "request_password_reset_error_code", + message: error.message(), + details: nil + ) ) ) } ) } - public func updatePassword(withAccessTokenRequest request: UpdatePasswordWithAccessTokenRequestInterface, completion: @escaping (FlutterError?) -> Void) { + func updatePasswordWithAccessToken(request: UpdatePasswordWithAccessTokenRequestInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } @@ -423,29 +431,29 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost oldPassword: request.oldPassword ) ).onSuccess( - callback: {_ in - completion(nil) + callback: { unit in + completion(Result.success(unit)) } ).onFailure( callback: {error in completion( - FlutterError( - code: "update_password_with_access_token_error_code", - message: error.message(), - details: nil + Result.failure( + FlutterError( + code: "update_password_with_access_token_error_code", + message: error.message(), + details: nil + ) ) ) } ) } - public func updatePassword(withFreshAccessTokenRequest request: UpdatePasswordWithFreshAccessTokenRequestInterface, completion: @escaping (FlutterError?) -> Void) { + func updatePasswordWithFreshAccessToken(request: UpdatePasswordWithFreshAccessTokenRequestInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } @@ -457,29 +465,29 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost password: request.password ) ).onSuccess( - callback: {_ in - completion(nil) + callback: { unit in + completion(Result.success(unit)) } ).onFailure( callback: {error in completion( - FlutterError( - code: "update_password_with_fresh_access_token_error_code", - message: error.message(), - details: nil + Result.failure( + FlutterError( + code: "update_password_with_fresh_access_token_error_code", + message: error.message(), + details: nil + ) ) ) } ) } - public func updatePassword(withEmailRequest request: UpdatePasswordWithEmailRequestInterface, completion: @escaping (FlutterError?) -> Void) { + func updatePasswordWithEmail(request: UpdatePasswordWithEmailRequestInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } @@ -490,12 +498,13 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost password: request.password ) ).onSuccess( - callback: {_ in - completion(nil) + callback: { unit in + completion(Result.success(unit)) } ).onFailure( callback: {error in completion( + Result.failure( Converters.parseError( reachFiveError: error, errorCodesInterface: request.errorCodes, @@ -505,18 +514,18 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost details: nil ) ) + + ) ) } ) } - public func updatePassword(withPhoneNumberRequest request: UpdatePasswordWithPhoneNumberRequestInterface, completion: @escaping (FlutterError?) -> Void) { + func updatePasswordWithPhoneNumber(request: UpdatePasswordWithPhoneNumberRequestInterface, completion: @escaping (Result) -> Void) { let reachFiveInstanceKey = getReachFiveInstanceKey(reachFiveKey: request.reachFiveKey) guard let reachFive = reachFiveInstances[reachFiveInstanceKey] else { - completion( - nonInitializedFlutterError - ) + completion(Result.failure(nonInitializedFlutterError)) return } @@ -527,26 +536,27 @@ public class SwiftFlutterReachFivePlugin: NSObject, FlutterPlugin, ReachFiveHost password: request.password ) ).onSuccess( - callback: {_ in - completion(nil) + callback: { unit in + completion(Result.success(unit)) } ).onFailure( callback: {error in completion( - Converters.parseError( - reachFiveError: error, - errorCodesInterface: request.errorCodes, - defaultFlutterError: FlutterError( - code: "update_password_with_phone_number_request_error_code", - message: error.message(), - details: nil - ) + Result.failure( + Converters.parseError( + reachFiveError: error, + errorCodesInterface: request.errorCodes, + defaultFlutterError: FlutterError( + code: "update_password_with_phone_number_request_error_code", + message: error.message(), + details: nil + ) + ) ) ) } ) } - } extension UIViewController: ASWebAuthenticationPresentationContextProviding { diff --git a/flutter_reach_five_ios/ios/Classes/flutter_reach_five_ios.h b/flutter_reach_five_ios/ios/Classes/flutter_reach_five_ios.h deleted file mode 100644 index c909d8e..0000000 --- a/flutter_reach_five_ios/ios/Classes/flutter_reach_five_ios.h +++ /dev/null @@ -1 +0,0 @@ -#import "reach_five_api.h" diff --git a/flutter_reach_five_ios/ios/Classes/reach_five_api.h b/flutter_reach_five_ios/ios/Classes/reach_five_api.h deleted file mode 100644 index 0f53ad7..0000000 --- a/flutter_reach_five_ios/ios/Classes/reach_five_api.h +++ /dev/null @@ -1,512 +0,0 @@ -// Autogenerated from Pigeon (v9.1.0), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -#import - -@protocol FlutterBinaryMessenger; -@protocol FlutterMessageCodec; -@class FlutterError; -@class FlutterStandardTypedData; - -NS_ASSUME_NONNULL_BEGIN - -typedef NS_ENUM(NSUInteger, ProviderCreatorTypeInterface) { - ProviderCreatorTypeInterfaceGoogle = 0, - ProviderCreatorTypeInterfaceFacebook = 1, - ProviderCreatorTypeInterfaceWebview = 2, -}; - -typedef NS_ENUM(NSUInteger, ProfileAddressTypeInterface) { - ProfileAddressTypeInterfaceBilling = 0, - ProfileAddressTypeInterfaceDelivery = 1, -}; - -@class ErrorCodesInterface; -@class SdkConfigInterface; -@class ProviderCreatorInterface; -@class ReachFiveKeyInterface; -@class ReachFiveConfigInterface; -@class ProfileAddressInterface; -@class ConsentInterface; -@class ProfileSignupRequestInterface; -@class SignupRequestInterface; -@class AddressInterface; -@class OpenIdUserInterface; -@class AuthTokenInterface; -@class LoginWithPasswordRequestInterface; -@class LoginWithProviderRequestInterface; -@class RefreshAccessTokenRequestInterface; -@class LoginSummaryInterface; -@class EmailsInterface; -@class ProfileInterface; -@class GetProfileRequestInterface; -@class UpdateProfileRequestInterface; -@class RequestPasswordResetRequestInterface; -@class UpdatePasswordWithAccessTokenRequestInterface; -@class UpdatePasswordWithFreshAccessTokenRequestInterface; -@class UpdatePasswordWithEmailRequestInterface; -@class UpdatePasswordWithPhoneNumberRequestInterface; - -@interface ErrorCodesInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithEmailAlreadyInUseCode:(NSString *)emailAlreadyInUseCode - invalidEmailOrPasswordCode:(NSString *)invalidEmailOrPasswordCode - invalidVerificationCode:(NSString *)invalidVerificationCode - invalidGrant:(NSString *)invalidGrant - userCancelledOrClosedTheWebFlow:(NSString *)userCancelledOrClosedTheWebFlow - socialAccountEmailAlreadyInUse:(NSString *)socialAccountEmailAlreadyInUse; -@property(nonatomic, copy) NSString * emailAlreadyInUseCode; -@property(nonatomic, copy) NSString * invalidEmailOrPasswordCode; -@property(nonatomic, copy) NSString * invalidVerificationCode; -@property(nonatomic, copy) NSString * invalidGrant; -@property(nonatomic, copy) NSString * userCancelledOrClosedTheWebFlow; -@property(nonatomic, copy) NSString * socialAccountEmailAlreadyInUse; -@end - -@interface SdkConfigInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithDomain:(NSString *)domain - clientId:(NSString *)clientId - androidScheme:(NSString *)androidScheme - iosScheme:(NSString *)iosScheme; -@property(nonatomic, copy) NSString * domain; -@property(nonatomic, copy) NSString * clientId; -@property(nonatomic, copy) NSString * androidScheme; -@property(nonatomic, copy) NSString * iosScheme; -@end - -@interface ProviderCreatorInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithType:(ProviderCreatorTypeInterface)type; -@property(nonatomic, assign) ProviderCreatorTypeInterface type; -@end - -@interface ReachFiveKeyInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithSdkConfig:(SdkConfigInterface *)sdkConfig - providerCreators:(NSArray *)providerCreators; -@property(nonatomic, strong) SdkConfigInterface * sdkConfig; -@property(nonatomic, strong) NSArray * providerCreators; -@end - -@interface ReachFiveConfigInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - providers:(NSArray *)providers; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, strong) NSArray * providers; -@end - -@interface ProfileAddressInterface : NSObject -+ (instancetype)makeWithTitle:(nullable NSString *)title - isDefault:(nullable NSNumber *)isDefault - addressType:(ProfileAddressTypeInterface)addressType - streetAddress:(nullable NSString *)streetAddress - locality:(nullable NSString *)locality - region:(nullable NSString *)region - postalCode:(nullable NSString *)postalCode - country:(nullable NSString *)country - raw:(nullable NSString *)raw - deliveryNote:(nullable NSString *)deliveryNote - recipient:(nullable NSString *)recipient - company:(nullable NSString *)company - phoneNumber:(nullable NSString *)phoneNumber; -@property(nonatomic, copy, nullable) NSString * title; -@property(nonatomic, strong, nullable) NSNumber * isDefault; -@property(nonatomic, assign) ProfileAddressTypeInterface addressType; -@property(nonatomic, copy, nullable) NSString * streetAddress; -@property(nonatomic, copy, nullable) NSString * locality; -@property(nonatomic, copy, nullable) NSString * region; -@property(nonatomic, copy, nullable) NSString * postalCode; -@property(nonatomic, copy, nullable) NSString * country; -@property(nonatomic, copy, nullable) NSString * raw; -@property(nonatomic, copy, nullable) NSString * deliveryNote; -@property(nonatomic, copy, nullable) NSString * recipient; -@property(nonatomic, copy, nullable) NSString * company; -@property(nonatomic, copy, nullable) NSString * phoneNumber; -@end - -@interface ConsentInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithGranted:(NSNumber *)granted - consentType:(nullable NSString *)consentType - date:(NSString *)date; -@property(nonatomic, strong) NSNumber * granted; -@property(nonatomic, copy, nullable) NSString * consentType; -@property(nonatomic, copy) NSString * date; -@end - -@interface ProfileSignupRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPassword:(NSString *)password - email:(nullable NSString *)email - phoneNumber:(nullable NSString *)phoneNumber - givenName:(nullable NSString *)givenName - middleName:(nullable NSString *)middleName - familyName:(nullable NSString *)familyName - name:(nullable NSString *)name - nickname:(nullable NSString *)nickname - birthdate:(nullable NSString *)birthdate - profileURL:(nullable NSString *)profileURL - picture:(nullable NSString *)picture - username:(nullable NSString *)username - gender:(nullable NSString *)gender - company:(nullable NSString *)company - addresses:(nullable NSArray *)addresses - locale:(nullable NSString *)locale - bio:(nullable NSString *)bio - customFields:(nullable NSDictionary *)customFields - consents:(nullable NSDictionary *)consents - liteOnly:(nullable NSNumber *)liteOnly; -@property(nonatomic, copy) NSString * password; -@property(nonatomic, copy, nullable) NSString * email; -@property(nonatomic, copy, nullable) NSString * phoneNumber; -@property(nonatomic, copy, nullable) NSString * givenName; -@property(nonatomic, copy, nullable) NSString * middleName; -@property(nonatomic, copy, nullable) NSString * familyName; -@property(nonatomic, copy, nullable) NSString * name; -@property(nonatomic, copy, nullable) NSString * nickname; -@property(nonatomic, copy, nullable) NSString * birthdate; -@property(nonatomic, copy, nullable) NSString * profileURL; -@property(nonatomic, copy, nullable) NSString * picture; -@property(nonatomic, copy, nullable) NSString * username; -@property(nonatomic, copy, nullable) NSString * gender; -@property(nonatomic, copy, nullable) NSString * company; -@property(nonatomic, strong, nullable) NSArray * addresses; -@property(nonatomic, copy, nullable) NSString * locale; -@property(nonatomic, copy, nullable) NSString * bio; -@property(nonatomic, strong, nullable) NSDictionary * customFields; -@property(nonatomic, strong, nullable) NSDictionary * consents; -@property(nonatomic, strong, nullable) NSNumber * liteOnly; -@end - -@interface SignupRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - profile:(ProfileSignupRequestInterface *)profile - redirectUrl:(nullable NSString *)redirectUrl - scope:(nullable NSArray *)scope - errorCodes:(ErrorCodesInterface *)errorCodes; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, strong) ProfileSignupRequestInterface * profile; -@property(nonatomic, copy, nullable) NSString * redirectUrl; -@property(nonatomic, strong, nullable) NSArray * scope; -@property(nonatomic, strong) ErrorCodesInterface * errorCodes; -@end - -@interface AddressInterface : NSObject -+ (instancetype)makeWithFormatted:(nullable NSString *)formatted - streetAddress:(nullable NSString *)streetAddress - locality:(nullable NSString *)locality - region:(nullable NSString *)region - postalCode:(nullable NSString *)postalCode - country:(nullable NSString *)country; -@property(nonatomic, copy, nullable) NSString * formatted; -@property(nonatomic, copy, nullable) NSString * streetAddress; -@property(nonatomic, copy, nullable) NSString * locality; -@property(nonatomic, copy, nullable) NSString * region; -@property(nonatomic, copy, nullable) NSString * postalCode; -@property(nonatomic, copy, nullable) NSString * country; -@end - -@interface OpenIdUserInterface : NSObject -+ (instancetype)makeWithId:(nullable NSString *)id - name:(nullable NSString *)name - preferredUsername:(nullable NSString *)preferredUsername - givenName:(nullable NSString *)givenName - familyName:(nullable NSString *)familyName - middleName:(nullable NSString *)middleName - nickname:(nullable NSString *)nickname - picture:(nullable NSString *)picture - website:(nullable NSString *)website - email:(nullable NSString *)email - emailVerified:(nullable NSNumber *)emailVerified - gender:(nullable NSString *)gender - zoneinfo:(nullable NSString *)zoneinfo - locale:(nullable NSString *)locale - phoneNumber:(nullable NSString *)phoneNumber - phoneNumberVerified:(nullable NSNumber *)phoneNumberVerified - address:(nullable AddressInterface *)address - birthdate:(nullable NSString *)birthdate - externalId:(nullable NSString *)externalId; -@property(nonatomic, copy, nullable) NSString * id; -@property(nonatomic, copy, nullable) NSString * name; -@property(nonatomic, copy, nullable) NSString * preferredUsername; -@property(nonatomic, copy, nullable) NSString * givenName; -@property(nonatomic, copy, nullable) NSString * familyName; -@property(nonatomic, copy, nullable) NSString * middleName; -@property(nonatomic, copy, nullable) NSString * nickname; -@property(nonatomic, copy, nullable) NSString * picture; -@property(nonatomic, copy, nullable) NSString * website; -@property(nonatomic, copy, nullable) NSString * email; -@property(nonatomic, strong, nullable) NSNumber * emailVerified; -@property(nonatomic, copy, nullable) NSString * gender; -@property(nonatomic, copy, nullable) NSString * zoneinfo; -@property(nonatomic, copy, nullable) NSString * locale; -@property(nonatomic, copy, nullable) NSString * phoneNumber; -@property(nonatomic, strong, nullable) NSNumber * phoneNumberVerified; -@property(nonatomic, strong, nullable) AddressInterface * address; -@property(nonatomic, copy, nullable) NSString * birthdate; -@property(nonatomic, copy, nullable) NSString * externalId; -@end - -@interface AuthTokenInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithIdToken:(nullable NSString *)idToken - accessToken:(NSString *)accessToken - refreshToken:(nullable NSString *)refreshToken - tokenType:(nullable NSString *)tokenType - expiresIn:(nullable NSNumber *)expiresIn - user:(nullable OpenIdUserInterface *)user; -@property(nonatomic, copy, nullable) NSString * idToken; -@property(nonatomic, copy) NSString * accessToken; -@property(nonatomic, copy, nullable) NSString * refreshToken; -@property(nonatomic, copy, nullable) NSString * tokenType; -@property(nonatomic, strong, nullable) NSNumber * expiresIn; -@property(nonatomic, strong, nullable) OpenIdUserInterface * user; -@end - -@interface LoginWithPasswordRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - email:(nullable NSString *)email - phoneNumber:(nullable NSString *)phoneNumber - password:(NSString *)password - scope:(nullable NSArray *)scope - errorCodes:(ErrorCodesInterface *)errorCodes; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, copy, nullable) NSString * email; -@property(nonatomic, copy, nullable) NSString * phoneNumber; -@property(nonatomic, copy) NSString * password; -@property(nonatomic, strong, nullable) NSArray * scope; -@property(nonatomic, strong) ErrorCodesInterface * errorCodes; -@end - -@interface LoginWithProviderRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - provider:(NSString *)provider - origin:(NSString *)origin - scope:(nullable NSArray *)scope - errorCodes:(ErrorCodesInterface *)errorCodes; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, copy) NSString * provider; -@property(nonatomic, copy) NSString * origin; -@property(nonatomic, strong, nullable) NSArray * scope; -@property(nonatomic, strong) ErrorCodesInterface * errorCodes; -@end - -@interface RefreshAccessTokenRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - authToken:(AuthTokenInterface *)authToken; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, strong) AuthTokenInterface * authToken; -@end - -@interface LoginSummaryInterface : NSObject -+ (instancetype)makeWithFirstLogin:(nullable NSNumber *)firstLogin - lastLogin:(nullable NSNumber *)lastLogin - total:(nullable NSNumber *)total - origins:(nullable NSArray *)origins - devices:(nullable NSArray *)devices - lastProvider:(nullable NSString *)lastProvider; -@property(nonatomic, strong, nullable) NSNumber * firstLogin; -@property(nonatomic, strong, nullable) NSNumber * lastLogin; -@property(nonatomic, strong, nullable) NSNumber * total; -@property(nonatomic, strong, nullable) NSArray * origins; -@property(nonatomic, strong, nullable) NSArray * devices; -@property(nonatomic, copy, nullable) NSString * lastProvider; -@end - -@interface EmailsInterface : NSObject -+ (instancetype)makeWithVerified:(nullable NSArray *)verified - unverified:(nullable NSArray *)unverified; -@property(nonatomic, strong, nullable) NSArray * verified; -@property(nonatomic, strong, nullable) NSArray * unverified; -@end - -@interface ProfileInterface : NSObject -+ (instancetype)makeWithUid:(nullable NSString *)uid - givenName:(nullable NSString *)givenName - middleName:(nullable NSString *)middleName - familyName:(nullable NSString *)familyName - name:(nullable NSString *)name - nickname:(nullable NSString *)nickname - birthdate:(nullable NSString *)birthdate - profileURL:(nullable NSString *)profileURL - picture:(nullable NSString *)picture - externalId:(nullable NSString *)externalId - authTypes:(nullable NSArray *)authTypes - loginSummary:(nullable LoginSummaryInterface *)loginSummary - username:(nullable NSString *)username - gender:(nullable NSString *)gender - email:(nullable NSString *)email - emailVerified:(nullable NSNumber *)emailVerified - emails:(nullable EmailsInterface *)emails - phoneNumber:(nullable NSString *)phoneNumber - phoneNumberVerified:(nullable NSNumber *)phoneNumberVerified - addresses:(nullable NSArray *)addresses - locale:(nullable NSString *)locale - bio:(nullable NSString *)bio - customFields:(nullable NSDictionary *)customFields - consents:(nullable NSDictionary *)consents - createdAt:(nullable NSString *)createdAt - updatedAt:(nullable NSString *)updatedAt - liteOnly:(nullable NSNumber *)liteOnly - company:(nullable NSString *)company; -@property(nonatomic, copy, nullable) NSString * uid; -@property(nonatomic, copy, nullable) NSString * givenName; -@property(nonatomic, copy, nullable) NSString * middleName; -@property(nonatomic, copy, nullable) NSString * familyName; -@property(nonatomic, copy, nullable) NSString * name; -@property(nonatomic, copy, nullable) NSString * nickname; -@property(nonatomic, copy, nullable) NSString * birthdate; -@property(nonatomic, copy, nullable) NSString * profileURL; -@property(nonatomic, copy, nullable) NSString * picture; -@property(nonatomic, copy, nullable) NSString * externalId; -@property(nonatomic, strong, nullable) NSArray * authTypes; -@property(nonatomic, strong, nullable) LoginSummaryInterface * loginSummary; -@property(nonatomic, copy, nullable) NSString * username; -@property(nonatomic, copy, nullable) NSString * gender; -@property(nonatomic, copy, nullable) NSString * email; -@property(nonatomic, strong, nullable) NSNumber * emailVerified; -@property(nonatomic, strong, nullable) EmailsInterface * emails; -@property(nonatomic, copy, nullable) NSString * phoneNumber; -@property(nonatomic, strong, nullable) NSNumber * phoneNumberVerified; -@property(nonatomic, strong, nullable) NSArray * addresses; -@property(nonatomic, copy, nullable) NSString * locale; -@property(nonatomic, copy, nullable) NSString * bio; -@property(nonatomic, strong, nullable) NSDictionary * customFields; -@property(nonatomic, strong, nullable) NSDictionary * consents; -@property(nonatomic, copy, nullable) NSString * createdAt; -@property(nonatomic, copy, nullable) NSString * updatedAt; -@property(nonatomic, strong, nullable) NSNumber * liteOnly; -@property(nonatomic, copy, nullable) NSString * company; -@end - -@interface GetProfileRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - authToken:(AuthTokenInterface *)authToken - errorCodes:(ErrorCodesInterface *)errorCodes; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, strong) AuthTokenInterface * authToken; -@property(nonatomic, strong) ErrorCodesInterface * errorCodes; -@end - -@interface UpdateProfileRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - authToken:(AuthTokenInterface *)authToken - profile:(ProfileInterface *)profile - errorCodes:(ErrorCodesInterface *)errorCodes; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, strong) AuthTokenInterface * authToken; -@property(nonatomic, strong) ProfileInterface * profile; -@property(nonatomic, strong) ErrorCodesInterface * errorCodes; -@end - -@interface RequestPasswordResetRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - email:(nullable NSString *)email - phoneNumber:(nullable NSString *)phoneNumber - redirectUrl:(nullable NSString *)redirectUrl; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, copy, nullable) NSString * email; -@property(nonatomic, copy, nullable) NSString * phoneNumber; -@property(nonatomic, copy, nullable) NSString * redirectUrl; -@end - -@interface UpdatePasswordWithAccessTokenRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - authToken:(AuthTokenInterface *)authToken - oldPassword:(NSString *)oldPassword - password:(NSString *)password; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, strong) AuthTokenInterface * authToken; -@property(nonatomic, copy) NSString * oldPassword; -@property(nonatomic, copy) NSString * password; -@end - -@interface UpdatePasswordWithFreshAccessTokenRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - freshAuthToken:(AuthTokenInterface *)freshAuthToken - password:(NSString *)password; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, strong) AuthTokenInterface * freshAuthToken; -@property(nonatomic, copy) NSString * password; -@end - -@interface UpdatePasswordWithEmailRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - email:(NSString *)email - verificationCode:(NSString *)verificationCode - password:(NSString *)password - errorCodes:(ErrorCodesInterface *)errorCodes; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, copy) NSString * email; -@property(nonatomic, copy) NSString * verificationCode; -@property(nonatomic, copy) NSString * password; -@property(nonatomic, strong) ErrorCodesInterface * errorCodes; -@end - -@interface UpdatePasswordWithPhoneNumberRequestInterface : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - phoneNumber:(NSString *)phoneNumber - verificationCode:(NSString *)verificationCode - password:(NSString *)password - errorCodes:(ErrorCodesInterface *)errorCodes; -@property(nonatomic, strong) ReachFiveKeyInterface * reachFiveKey; -@property(nonatomic, copy) NSString * phoneNumber; -@property(nonatomic, copy) NSString * verificationCode; -@property(nonatomic, copy) NSString * password; -@property(nonatomic, strong) ErrorCodesInterface * errorCodes; -@end - -/// The codec used by ReachFiveHostApi. -NSObject *ReachFiveHostApiGetCodec(void); - -@protocol ReachFiveHostApi -- (void)initializeReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey completion:(void (^)(ReachFiveConfigInterface *_Nullable, FlutterError *_Nullable))completion; -- (void)signupRequest:(SignupRequestInterface *)request completion:(void (^)(AuthTokenInterface *_Nullable, FlutterError *_Nullable))completion; -- (void)loginWithPasswordRequest:(LoginWithPasswordRequestInterface *)request completion:(void (^)(AuthTokenInterface *_Nullable, FlutterError *_Nullable))completion; -- (void)loginWithProviderRequest:(LoginWithProviderRequestInterface *)request completion:(void (^)(AuthTokenInterface *_Nullable, FlutterError *_Nullable))completion; -- (void)logoutReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey completion:(void (^)(FlutterError *_Nullable))completion; -- (void)getProfileRequest:(GetProfileRequestInterface *)request completion:(void (^)(ProfileInterface *_Nullable, FlutterError *_Nullable))completion; -- (void)updateProfileRequest:(UpdateProfileRequestInterface *)request completion:(void (^)(ProfileInterface *_Nullable, FlutterError *_Nullable))completion; -- (void)refreshAccessTokenRequest:(RefreshAccessTokenRequestInterface *)request completion:(void (^)(AuthTokenInterface *_Nullable, FlutterError *_Nullable))completion; -- (void)requestPasswordResetRequest:(RequestPasswordResetRequestInterface *)request completion:(void (^)(FlutterError *_Nullable))completion; -- (void)updatePasswordWithAccessTokenRequest:(UpdatePasswordWithAccessTokenRequestInterface *)request completion:(void (^)(FlutterError *_Nullable))completion; -- (void)updatePasswordWithFreshAccessTokenRequest:(UpdatePasswordWithFreshAccessTokenRequestInterface *)request completion:(void (^)(FlutterError *_Nullable))completion; -- (void)updatePasswordWithEmailRequest:(UpdatePasswordWithEmailRequestInterface *)request completion:(void (^)(FlutterError *_Nullable))completion; -- (void)updatePasswordWithPhoneNumberRequest:(UpdatePasswordWithPhoneNumberRequestInterface *)request completion:(void (^)(FlutterError *_Nullable))completion; -@end - -extern void ReachFiveHostApiSetup(id binaryMessenger, NSObject *_Nullable api); - -NS_ASSUME_NONNULL_END diff --git a/flutter_reach_five_ios/ios/Classes/reach_five_api.m b/flutter_reach_five_ios/ios/Classes/reach_five_api.m deleted file mode 100644 index 49ea0d2..0000000 --- a/flutter_reach_five_ios/ios/Classes/reach_five_api.m +++ /dev/null @@ -1,1725 +0,0 @@ -// Autogenerated from Pigeon (v9.1.0), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -#import "reach_five_api.h" -#import - -#if !__has_feature(objc_arc) -#error File requires ARC to be enabled. -#endif - -static NSArray *wrapResult(id result, FlutterError *error) { - if (error) { - return @[ - error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] - ]; - } - return @[ result ?: [NSNull null] ]; -} -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { - id result = array[key]; - return (result == [NSNull null]) ? nil : result; -} - -@interface ErrorCodesInterface () -+ (ErrorCodesInterface *)fromList:(NSArray *)list; -+ (nullable ErrorCodesInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface SdkConfigInterface () -+ (SdkConfigInterface *)fromList:(NSArray *)list; -+ (nullable SdkConfigInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface ProviderCreatorInterface () -+ (ProviderCreatorInterface *)fromList:(NSArray *)list; -+ (nullable ProviderCreatorInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface ReachFiveKeyInterface () -+ (ReachFiveKeyInterface *)fromList:(NSArray *)list; -+ (nullable ReachFiveKeyInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface ReachFiveConfigInterface () -+ (ReachFiveConfigInterface *)fromList:(NSArray *)list; -+ (nullable ReachFiveConfigInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface ProfileAddressInterface () -+ (ProfileAddressInterface *)fromList:(NSArray *)list; -+ (nullable ProfileAddressInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface ConsentInterface () -+ (ConsentInterface *)fromList:(NSArray *)list; -+ (nullable ConsentInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface ProfileSignupRequestInterface () -+ (ProfileSignupRequestInterface *)fromList:(NSArray *)list; -+ (nullable ProfileSignupRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface SignupRequestInterface () -+ (SignupRequestInterface *)fromList:(NSArray *)list; -+ (nullable SignupRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface AddressInterface () -+ (AddressInterface *)fromList:(NSArray *)list; -+ (nullable AddressInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface OpenIdUserInterface () -+ (OpenIdUserInterface *)fromList:(NSArray *)list; -+ (nullable OpenIdUserInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface AuthTokenInterface () -+ (AuthTokenInterface *)fromList:(NSArray *)list; -+ (nullable AuthTokenInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface LoginWithPasswordRequestInterface () -+ (LoginWithPasswordRequestInterface *)fromList:(NSArray *)list; -+ (nullable LoginWithPasswordRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface LoginWithProviderRequestInterface () -+ (LoginWithProviderRequestInterface *)fromList:(NSArray *)list; -+ (nullable LoginWithProviderRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface RefreshAccessTokenRequestInterface () -+ (RefreshAccessTokenRequestInterface *)fromList:(NSArray *)list; -+ (nullable RefreshAccessTokenRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface LoginSummaryInterface () -+ (LoginSummaryInterface *)fromList:(NSArray *)list; -+ (nullable LoginSummaryInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface EmailsInterface () -+ (EmailsInterface *)fromList:(NSArray *)list; -+ (nullable EmailsInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface ProfileInterface () -+ (ProfileInterface *)fromList:(NSArray *)list; -+ (nullable ProfileInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface GetProfileRequestInterface () -+ (GetProfileRequestInterface *)fromList:(NSArray *)list; -+ (nullable GetProfileRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface UpdateProfileRequestInterface () -+ (UpdateProfileRequestInterface *)fromList:(NSArray *)list; -+ (nullable UpdateProfileRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface RequestPasswordResetRequestInterface () -+ (RequestPasswordResetRequestInterface *)fromList:(NSArray *)list; -+ (nullable RequestPasswordResetRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface UpdatePasswordWithAccessTokenRequestInterface () -+ (UpdatePasswordWithAccessTokenRequestInterface *)fromList:(NSArray *)list; -+ (nullable UpdatePasswordWithAccessTokenRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface UpdatePasswordWithFreshAccessTokenRequestInterface () -+ (UpdatePasswordWithFreshAccessTokenRequestInterface *)fromList:(NSArray *)list; -+ (nullable UpdatePasswordWithFreshAccessTokenRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface UpdatePasswordWithEmailRequestInterface () -+ (UpdatePasswordWithEmailRequestInterface *)fromList:(NSArray *)list; -+ (nullable UpdatePasswordWithEmailRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface UpdatePasswordWithPhoneNumberRequestInterface () -+ (UpdatePasswordWithPhoneNumberRequestInterface *)fromList:(NSArray *)list; -+ (nullable UpdatePasswordWithPhoneNumberRequestInterface *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@implementation ErrorCodesInterface -+ (instancetype)makeWithEmailAlreadyInUseCode:(NSString *)emailAlreadyInUseCode - invalidEmailOrPasswordCode:(NSString *)invalidEmailOrPasswordCode - invalidVerificationCode:(NSString *)invalidVerificationCode - invalidGrant:(NSString *)invalidGrant - userCancelledOrClosedTheWebFlow:(NSString *)userCancelledOrClosedTheWebFlow - socialAccountEmailAlreadyInUse:(NSString *)socialAccountEmailAlreadyInUse { - ErrorCodesInterface* pigeonResult = [[ErrorCodesInterface alloc] init]; - pigeonResult.emailAlreadyInUseCode = emailAlreadyInUseCode; - pigeonResult.invalidEmailOrPasswordCode = invalidEmailOrPasswordCode; - pigeonResult.invalidVerificationCode = invalidVerificationCode; - pigeonResult.invalidGrant = invalidGrant; - pigeonResult.userCancelledOrClosedTheWebFlow = userCancelledOrClosedTheWebFlow; - pigeonResult.socialAccountEmailAlreadyInUse = socialAccountEmailAlreadyInUse; - return pigeonResult; -} -+ (ErrorCodesInterface *)fromList:(NSArray *)list { - ErrorCodesInterface *pigeonResult = [[ErrorCodesInterface alloc] init]; - pigeonResult.emailAlreadyInUseCode = GetNullableObjectAtIndex(list, 0); - NSAssert(pigeonResult.emailAlreadyInUseCode != nil, @""); - pigeonResult.invalidEmailOrPasswordCode = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.invalidEmailOrPasswordCode != nil, @""); - pigeonResult.invalidVerificationCode = GetNullableObjectAtIndex(list, 2); - NSAssert(pigeonResult.invalidVerificationCode != nil, @""); - pigeonResult.invalidGrant = GetNullableObjectAtIndex(list, 3); - NSAssert(pigeonResult.invalidGrant != nil, @""); - pigeonResult.userCancelledOrClosedTheWebFlow = GetNullableObjectAtIndex(list, 4); - NSAssert(pigeonResult.userCancelledOrClosedTheWebFlow != nil, @""); - pigeonResult.socialAccountEmailAlreadyInUse = GetNullableObjectAtIndex(list, 5); - NSAssert(pigeonResult.socialAccountEmailAlreadyInUse != nil, @""); - return pigeonResult; -} -+ (nullable ErrorCodesInterface *)nullableFromList:(NSArray *)list { - return (list) ? [ErrorCodesInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.emailAlreadyInUseCode ?: [NSNull null]), - (self.invalidEmailOrPasswordCode ?: [NSNull null]), - (self.invalidVerificationCode ?: [NSNull null]), - (self.invalidGrant ?: [NSNull null]), - (self.userCancelledOrClosedTheWebFlow ?: [NSNull null]), - (self.socialAccountEmailAlreadyInUse ?: [NSNull null]), - ]; -} -@end - -@implementation SdkConfigInterface -+ (instancetype)makeWithDomain:(NSString *)domain - clientId:(NSString *)clientId - androidScheme:(NSString *)androidScheme - iosScheme:(NSString *)iosScheme { - SdkConfigInterface* pigeonResult = [[SdkConfigInterface alloc] init]; - pigeonResult.domain = domain; - pigeonResult.clientId = clientId; - pigeonResult.androidScheme = androidScheme; - pigeonResult.iosScheme = iosScheme; - return pigeonResult; -} -+ (SdkConfigInterface *)fromList:(NSArray *)list { - SdkConfigInterface *pigeonResult = [[SdkConfigInterface alloc] init]; - pigeonResult.domain = GetNullableObjectAtIndex(list, 0); - NSAssert(pigeonResult.domain != nil, @""); - pigeonResult.clientId = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.clientId != nil, @""); - pigeonResult.androidScheme = GetNullableObjectAtIndex(list, 2); - NSAssert(pigeonResult.androidScheme != nil, @""); - pigeonResult.iosScheme = GetNullableObjectAtIndex(list, 3); - NSAssert(pigeonResult.iosScheme != nil, @""); - return pigeonResult; -} -+ (nullable SdkConfigInterface *)nullableFromList:(NSArray *)list { - return (list) ? [SdkConfigInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.domain ?: [NSNull null]), - (self.clientId ?: [NSNull null]), - (self.androidScheme ?: [NSNull null]), - (self.iosScheme ?: [NSNull null]), - ]; -} -@end - -@implementation ProviderCreatorInterface -+ (instancetype)makeWithType:(ProviderCreatorTypeInterface)type { - ProviderCreatorInterface* pigeonResult = [[ProviderCreatorInterface alloc] init]; - pigeonResult.type = type; - return pigeonResult; -} -+ (ProviderCreatorInterface *)fromList:(NSArray *)list { - ProviderCreatorInterface *pigeonResult = [[ProviderCreatorInterface alloc] init]; - pigeonResult.type = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable ProviderCreatorInterface *)nullableFromList:(NSArray *)list { - return (list) ? [ProviderCreatorInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.type), - ]; -} -@end - -@implementation ReachFiveKeyInterface -+ (instancetype)makeWithSdkConfig:(SdkConfigInterface *)sdkConfig - providerCreators:(NSArray *)providerCreators { - ReachFiveKeyInterface* pigeonResult = [[ReachFiveKeyInterface alloc] init]; - pigeonResult.sdkConfig = sdkConfig; - pigeonResult.providerCreators = providerCreators; - return pigeonResult; -} -+ (ReachFiveKeyInterface *)fromList:(NSArray *)list { - ReachFiveKeyInterface *pigeonResult = [[ReachFiveKeyInterface alloc] init]; - pigeonResult.sdkConfig = [SdkConfigInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.sdkConfig != nil, @""); - pigeonResult.providerCreators = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.providerCreators != nil, @""); - return pigeonResult; -} -+ (nullable ReachFiveKeyInterface *)nullableFromList:(NSArray *)list { - return (list) ? [ReachFiveKeyInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.sdkConfig ? [self.sdkConfig toList] : [NSNull null]), - (self.providerCreators ?: [NSNull null]), - ]; -} -@end - -@implementation ReachFiveConfigInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - providers:(NSArray *)providers { - ReachFiveConfigInterface* pigeonResult = [[ReachFiveConfigInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.providers = providers; - return pigeonResult; -} -+ (ReachFiveConfigInterface *)fromList:(NSArray *)list { - ReachFiveConfigInterface *pigeonResult = [[ReachFiveConfigInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.providers = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.providers != nil, @""); - return pigeonResult; -} -+ (nullable ReachFiveConfigInterface *)nullableFromList:(NSArray *)list { - return (list) ? [ReachFiveConfigInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.providers ?: [NSNull null]), - ]; -} -@end - -@implementation ProfileAddressInterface -+ (instancetype)makeWithTitle:(nullable NSString *)title - isDefault:(nullable NSNumber *)isDefault - addressType:(ProfileAddressTypeInterface)addressType - streetAddress:(nullable NSString *)streetAddress - locality:(nullable NSString *)locality - region:(nullable NSString *)region - postalCode:(nullable NSString *)postalCode - country:(nullable NSString *)country - raw:(nullable NSString *)raw - deliveryNote:(nullable NSString *)deliveryNote - recipient:(nullable NSString *)recipient - company:(nullable NSString *)company - phoneNumber:(nullable NSString *)phoneNumber { - ProfileAddressInterface* pigeonResult = [[ProfileAddressInterface alloc] init]; - pigeonResult.title = title; - pigeonResult.isDefault = isDefault; - pigeonResult.addressType = addressType; - pigeonResult.streetAddress = streetAddress; - pigeonResult.locality = locality; - pigeonResult.region = region; - pigeonResult.postalCode = postalCode; - pigeonResult.country = country; - pigeonResult.raw = raw; - pigeonResult.deliveryNote = deliveryNote; - pigeonResult.recipient = recipient; - pigeonResult.company = company; - pigeonResult.phoneNumber = phoneNumber; - return pigeonResult; -} -+ (ProfileAddressInterface *)fromList:(NSArray *)list { - ProfileAddressInterface *pigeonResult = [[ProfileAddressInterface alloc] init]; - pigeonResult.title = GetNullableObjectAtIndex(list, 0); - pigeonResult.isDefault = GetNullableObjectAtIndex(list, 1); - pigeonResult.addressType = [GetNullableObjectAtIndex(list, 2) integerValue]; - pigeonResult.streetAddress = GetNullableObjectAtIndex(list, 3); - pigeonResult.locality = GetNullableObjectAtIndex(list, 4); - pigeonResult.region = GetNullableObjectAtIndex(list, 5); - pigeonResult.postalCode = GetNullableObjectAtIndex(list, 6); - pigeonResult.country = GetNullableObjectAtIndex(list, 7); - pigeonResult.raw = GetNullableObjectAtIndex(list, 8); - pigeonResult.deliveryNote = GetNullableObjectAtIndex(list, 9); - pigeonResult.recipient = GetNullableObjectAtIndex(list, 10); - pigeonResult.company = GetNullableObjectAtIndex(list, 11); - pigeonResult.phoneNumber = GetNullableObjectAtIndex(list, 12); - return pigeonResult; -} -+ (nullable ProfileAddressInterface *)nullableFromList:(NSArray *)list { - return (list) ? [ProfileAddressInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.title ?: [NSNull null]), - (self.isDefault ?: [NSNull null]), - @(self.addressType), - (self.streetAddress ?: [NSNull null]), - (self.locality ?: [NSNull null]), - (self.region ?: [NSNull null]), - (self.postalCode ?: [NSNull null]), - (self.country ?: [NSNull null]), - (self.raw ?: [NSNull null]), - (self.deliveryNote ?: [NSNull null]), - (self.recipient ?: [NSNull null]), - (self.company ?: [NSNull null]), - (self.phoneNumber ?: [NSNull null]), - ]; -} -@end - -@implementation ConsentInterface -+ (instancetype)makeWithGranted:(NSNumber *)granted - consentType:(nullable NSString *)consentType - date:(NSString *)date { - ConsentInterface* pigeonResult = [[ConsentInterface alloc] init]; - pigeonResult.granted = granted; - pigeonResult.consentType = consentType; - pigeonResult.date = date; - return pigeonResult; -} -+ (ConsentInterface *)fromList:(NSArray *)list { - ConsentInterface *pigeonResult = [[ConsentInterface alloc] init]; - pigeonResult.granted = GetNullableObjectAtIndex(list, 0); - NSAssert(pigeonResult.granted != nil, @""); - pigeonResult.consentType = GetNullableObjectAtIndex(list, 1); - pigeonResult.date = GetNullableObjectAtIndex(list, 2); - NSAssert(pigeonResult.date != nil, @""); - return pigeonResult; -} -+ (nullable ConsentInterface *)nullableFromList:(NSArray *)list { - return (list) ? [ConsentInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.granted ?: [NSNull null]), - (self.consentType ?: [NSNull null]), - (self.date ?: [NSNull null]), - ]; -} -@end - -@implementation ProfileSignupRequestInterface -+ (instancetype)makeWithPassword:(NSString *)password - email:(nullable NSString *)email - phoneNumber:(nullable NSString *)phoneNumber - givenName:(nullable NSString *)givenName - middleName:(nullable NSString *)middleName - familyName:(nullable NSString *)familyName - name:(nullable NSString *)name - nickname:(nullable NSString *)nickname - birthdate:(nullable NSString *)birthdate - profileURL:(nullable NSString *)profileURL - picture:(nullable NSString *)picture - username:(nullable NSString *)username - gender:(nullable NSString *)gender - company:(nullable NSString *)company - addresses:(nullable NSArray *)addresses - locale:(nullable NSString *)locale - bio:(nullable NSString *)bio - customFields:(nullable NSDictionary *)customFields - consents:(nullable NSDictionary *)consents - liteOnly:(nullable NSNumber *)liteOnly { - ProfileSignupRequestInterface* pigeonResult = [[ProfileSignupRequestInterface alloc] init]; - pigeonResult.password = password; - pigeonResult.email = email; - pigeonResult.phoneNumber = phoneNumber; - pigeonResult.givenName = givenName; - pigeonResult.middleName = middleName; - pigeonResult.familyName = familyName; - pigeonResult.name = name; - pigeonResult.nickname = nickname; - pigeonResult.birthdate = birthdate; - pigeonResult.profileURL = profileURL; - pigeonResult.picture = picture; - pigeonResult.username = username; - pigeonResult.gender = gender; - pigeonResult.company = company; - pigeonResult.addresses = addresses; - pigeonResult.locale = locale; - pigeonResult.bio = bio; - pigeonResult.customFields = customFields; - pigeonResult.consents = consents; - pigeonResult.liteOnly = liteOnly; - return pigeonResult; -} -+ (ProfileSignupRequestInterface *)fromList:(NSArray *)list { - ProfileSignupRequestInterface *pigeonResult = [[ProfileSignupRequestInterface alloc] init]; - pigeonResult.password = GetNullableObjectAtIndex(list, 0); - NSAssert(pigeonResult.password != nil, @""); - pigeonResult.email = GetNullableObjectAtIndex(list, 1); - pigeonResult.phoneNumber = GetNullableObjectAtIndex(list, 2); - pigeonResult.givenName = GetNullableObjectAtIndex(list, 3); - pigeonResult.middleName = GetNullableObjectAtIndex(list, 4); - pigeonResult.familyName = GetNullableObjectAtIndex(list, 5); - pigeonResult.name = GetNullableObjectAtIndex(list, 6); - pigeonResult.nickname = GetNullableObjectAtIndex(list, 7); - pigeonResult.birthdate = GetNullableObjectAtIndex(list, 8); - pigeonResult.profileURL = GetNullableObjectAtIndex(list, 9); - pigeonResult.picture = GetNullableObjectAtIndex(list, 10); - pigeonResult.username = GetNullableObjectAtIndex(list, 11); - pigeonResult.gender = GetNullableObjectAtIndex(list, 12); - pigeonResult.company = GetNullableObjectAtIndex(list, 13); - pigeonResult.addresses = GetNullableObjectAtIndex(list, 14); - pigeonResult.locale = GetNullableObjectAtIndex(list, 15); - pigeonResult.bio = GetNullableObjectAtIndex(list, 16); - pigeonResult.customFields = GetNullableObjectAtIndex(list, 17); - pigeonResult.consents = GetNullableObjectAtIndex(list, 18); - pigeonResult.liteOnly = GetNullableObjectAtIndex(list, 19); - return pigeonResult; -} -+ (nullable ProfileSignupRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [ProfileSignupRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.password ?: [NSNull null]), - (self.email ?: [NSNull null]), - (self.phoneNumber ?: [NSNull null]), - (self.givenName ?: [NSNull null]), - (self.middleName ?: [NSNull null]), - (self.familyName ?: [NSNull null]), - (self.name ?: [NSNull null]), - (self.nickname ?: [NSNull null]), - (self.birthdate ?: [NSNull null]), - (self.profileURL ?: [NSNull null]), - (self.picture ?: [NSNull null]), - (self.username ?: [NSNull null]), - (self.gender ?: [NSNull null]), - (self.company ?: [NSNull null]), - (self.addresses ?: [NSNull null]), - (self.locale ?: [NSNull null]), - (self.bio ?: [NSNull null]), - (self.customFields ?: [NSNull null]), - (self.consents ?: [NSNull null]), - (self.liteOnly ?: [NSNull null]), - ]; -} -@end - -@implementation SignupRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - profile:(ProfileSignupRequestInterface *)profile - redirectUrl:(nullable NSString *)redirectUrl - scope:(nullable NSArray *)scope - errorCodes:(ErrorCodesInterface *)errorCodes { - SignupRequestInterface* pigeonResult = [[SignupRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.profile = profile; - pigeonResult.redirectUrl = redirectUrl; - pigeonResult.scope = scope; - pigeonResult.errorCodes = errorCodes; - return pigeonResult; -} -+ (SignupRequestInterface *)fromList:(NSArray *)list { - SignupRequestInterface *pigeonResult = [[SignupRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.profile = [ProfileSignupRequestInterface nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - NSAssert(pigeonResult.profile != nil, @""); - pigeonResult.redirectUrl = GetNullableObjectAtIndex(list, 2); - pigeonResult.scope = GetNullableObjectAtIndex(list, 3); - pigeonResult.errorCodes = [ErrorCodesInterface nullableFromList:(GetNullableObjectAtIndex(list, 4))]; - NSAssert(pigeonResult.errorCodes != nil, @""); - return pigeonResult; -} -+ (nullable SignupRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [SignupRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.profile ? [self.profile toList] : [NSNull null]), - (self.redirectUrl ?: [NSNull null]), - (self.scope ?: [NSNull null]), - (self.errorCodes ? [self.errorCodes toList] : [NSNull null]), - ]; -} -@end - -@implementation AddressInterface -+ (instancetype)makeWithFormatted:(nullable NSString *)formatted - streetAddress:(nullable NSString *)streetAddress - locality:(nullable NSString *)locality - region:(nullable NSString *)region - postalCode:(nullable NSString *)postalCode - country:(nullable NSString *)country { - AddressInterface* pigeonResult = [[AddressInterface alloc] init]; - pigeonResult.formatted = formatted; - pigeonResult.streetAddress = streetAddress; - pigeonResult.locality = locality; - pigeonResult.region = region; - pigeonResult.postalCode = postalCode; - pigeonResult.country = country; - return pigeonResult; -} -+ (AddressInterface *)fromList:(NSArray *)list { - AddressInterface *pigeonResult = [[AddressInterface alloc] init]; - pigeonResult.formatted = GetNullableObjectAtIndex(list, 0); - pigeonResult.streetAddress = GetNullableObjectAtIndex(list, 1); - pigeonResult.locality = GetNullableObjectAtIndex(list, 2); - pigeonResult.region = GetNullableObjectAtIndex(list, 3); - pigeonResult.postalCode = GetNullableObjectAtIndex(list, 4); - pigeonResult.country = GetNullableObjectAtIndex(list, 5); - return pigeonResult; -} -+ (nullable AddressInterface *)nullableFromList:(NSArray *)list { - return (list) ? [AddressInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.formatted ?: [NSNull null]), - (self.streetAddress ?: [NSNull null]), - (self.locality ?: [NSNull null]), - (self.region ?: [NSNull null]), - (self.postalCode ?: [NSNull null]), - (self.country ?: [NSNull null]), - ]; -} -@end - -@implementation OpenIdUserInterface -+ (instancetype)makeWithId:(nullable NSString *)id - name:(nullable NSString *)name - preferredUsername:(nullable NSString *)preferredUsername - givenName:(nullable NSString *)givenName - familyName:(nullable NSString *)familyName - middleName:(nullable NSString *)middleName - nickname:(nullable NSString *)nickname - picture:(nullable NSString *)picture - website:(nullable NSString *)website - email:(nullable NSString *)email - emailVerified:(nullable NSNumber *)emailVerified - gender:(nullable NSString *)gender - zoneinfo:(nullable NSString *)zoneinfo - locale:(nullable NSString *)locale - phoneNumber:(nullable NSString *)phoneNumber - phoneNumberVerified:(nullable NSNumber *)phoneNumberVerified - address:(nullable AddressInterface *)address - birthdate:(nullable NSString *)birthdate - externalId:(nullable NSString *)externalId { - OpenIdUserInterface* pigeonResult = [[OpenIdUserInterface alloc] init]; - pigeonResult.id = id; - pigeonResult.name = name; - pigeonResult.preferredUsername = preferredUsername; - pigeonResult.givenName = givenName; - pigeonResult.familyName = familyName; - pigeonResult.middleName = middleName; - pigeonResult.nickname = nickname; - pigeonResult.picture = picture; - pigeonResult.website = website; - pigeonResult.email = email; - pigeonResult.emailVerified = emailVerified; - pigeonResult.gender = gender; - pigeonResult.zoneinfo = zoneinfo; - pigeonResult.locale = locale; - pigeonResult.phoneNumber = phoneNumber; - pigeonResult.phoneNumberVerified = phoneNumberVerified; - pigeonResult.address = address; - pigeonResult.birthdate = birthdate; - pigeonResult.externalId = externalId; - return pigeonResult; -} -+ (OpenIdUserInterface *)fromList:(NSArray *)list { - OpenIdUserInterface *pigeonResult = [[OpenIdUserInterface alloc] init]; - pigeonResult.id = GetNullableObjectAtIndex(list, 0); - pigeonResult.name = GetNullableObjectAtIndex(list, 1); - pigeonResult.preferredUsername = GetNullableObjectAtIndex(list, 2); - pigeonResult.givenName = GetNullableObjectAtIndex(list, 3); - pigeonResult.familyName = GetNullableObjectAtIndex(list, 4); - pigeonResult.middleName = GetNullableObjectAtIndex(list, 5); - pigeonResult.nickname = GetNullableObjectAtIndex(list, 6); - pigeonResult.picture = GetNullableObjectAtIndex(list, 7); - pigeonResult.website = GetNullableObjectAtIndex(list, 8); - pigeonResult.email = GetNullableObjectAtIndex(list, 9); - pigeonResult.emailVerified = GetNullableObjectAtIndex(list, 10); - pigeonResult.gender = GetNullableObjectAtIndex(list, 11); - pigeonResult.zoneinfo = GetNullableObjectAtIndex(list, 12); - pigeonResult.locale = GetNullableObjectAtIndex(list, 13); - pigeonResult.phoneNumber = GetNullableObjectAtIndex(list, 14); - pigeonResult.phoneNumberVerified = GetNullableObjectAtIndex(list, 15); - pigeonResult.address = [AddressInterface nullableFromList:(GetNullableObjectAtIndex(list, 16))]; - pigeonResult.birthdate = GetNullableObjectAtIndex(list, 17); - pigeonResult.externalId = GetNullableObjectAtIndex(list, 18); - return pigeonResult; -} -+ (nullable OpenIdUserInterface *)nullableFromList:(NSArray *)list { - return (list) ? [OpenIdUserInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.id ?: [NSNull null]), - (self.name ?: [NSNull null]), - (self.preferredUsername ?: [NSNull null]), - (self.givenName ?: [NSNull null]), - (self.familyName ?: [NSNull null]), - (self.middleName ?: [NSNull null]), - (self.nickname ?: [NSNull null]), - (self.picture ?: [NSNull null]), - (self.website ?: [NSNull null]), - (self.email ?: [NSNull null]), - (self.emailVerified ?: [NSNull null]), - (self.gender ?: [NSNull null]), - (self.zoneinfo ?: [NSNull null]), - (self.locale ?: [NSNull null]), - (self.phoneNumber ?: [NSNull null]), - (self.phoneNumberVerified ?: [NSNull null]), - (self.address ? [self.address toList] : [NSNull null]), - (self.birthdate ?: [NSNull null]), - (self.externalId ?: [NSNull null]), - ]; -} -@end - -@implementation AuthTokenInterface -+ (instancetype)makeWithIdToken:(nullable NSString *)idToken - accessToken:(NSString *)accessToken - refreshToken:(nullable NSString *)refreshToken - tokenType:(nullable NSString *)tokenType - expiresIn:(nullable NSNumber *)expiresIn - user:(nullable OpenIdUserInterface *)user { - AuthTokenInterface* pigeonResult = [[AuthTokenInterface alloc] init]; - pigeonResult.idToken = idToken; - pigeonResult.accessToken = accessToken; - pigeonResult.refreshToken = refreshToken; - pigeonResult.tokenType = tokenType; - pigeonResult.expiresIn = expiresIn; - pigeonResult.user = user; - return pigeonResult; -} -+ (AuthTokenInterface *)fromList:(NSArray *)list { - AuthTokenInterface *pigeonResult = [[AuthTokenInterface alloc] init]; - pigeonResult.idToken = GetNullableObjectAtIndex(list, 0); - pigeonResult.accessToken = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.accessToken != nil, @""); - pigeonResult.refreshToken = GetNullableObjectAtIndex(list, 2); - pigeonResult.tokenType = GetNullableObjectAtIndex(list, 3); - pigeonResult.expiresIn = GetNullableObjectAtIndex(list, 4); - pigeonResult.user = [OpenIdUserInterface nullableFromList:(GetNullableObjectAtIndex(list, 5))]; - return pigeonResult; -} -+ (nullable AuthTokenInterface *)nullableFromList:(NSArray *)list { - return (list) ? [AuthTokenInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.idToken ?: [NSNull null]), - (self.accessToken ?: [NSNull null]), - (self.refreshToken ?: [NSNull null]), - (self.tokenType ?: [NSNull null]), - (self.expiresIn ?: [NSNull null]), - (self.user ? [self.user toList] : [NSNull null]), - ]; -} -@end - -@implementation LoginWithPasswordRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - email:(nullable NSString *)email - phoneNumber:(nullable NSString *)phoneNumber - password:(NSString *)password - scope:(nullable NSArray *)scope - errorCodes:(ErrorCodesInterface *)errorCodes { - LoginWithPasswordRequestInterface* pigeonResult = [[LoginWithPasswordRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.email = email; - pigeonResult.phoneNumber = phoneNumber; - pigeonResult.password = password; - pigeonResult.scope = scope; - pigeonResult.errorCodes = errorCodes; - return pigeonResult; -} -+ (LoginWithPasswordRequestInterface *)fromList:(NSArray *)list { - LoginWithPasswordRequestInterface *pigeonResult = [[LoginWithPasswordRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.email = GetNullableObjectAtIndex(list, 1); - pigeonResult.phoneNumber = GetNullableObjectAtIndex(list, 2); - pigeonResult.password = GetNullableObjectAtIndex(list, 3); - NSAssert(pigeonResult.password != nil, @""); - pigeonResult.scope = GetNullableObjectAtIndex(list, 4); - pigeonResult.errorCodes = [ErrorCodesInterface nullableFromList:(GetNullableObjectAtIndex(list, 5))]; - NSAssert(pigeonResult.errorCodes != nil, @""); - return pigeonResult; -} -+ (nullable LoginWithPasswordRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [LoginWithPasswordRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.email ?: [NSNull null]), - (self.phoneNumber ?: [NSNull null]), - (self.password ?: [NSNull null]), - (self.scope ?: [NSNull null]), - (self.errorCodes ? [self.errorCodes toList] : [NSNull null]), - ]; -} -@end - -@implementation LoginWithProviderRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - provider:(NSString *)provider - origin:(NSString *)origin - scope:(nullable NSArray *)scope - errorCodes:(ErrorCodesInterface *)errorCodes { - LoginWithProviderRequestInterface* pigeonResult = [[LoginWithProviderRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.provider = provider; - pigeonResult.origin = origin; - pigeonResult.scope = scope; - pigeonResult.errorCodes = errorCodes; - return pigeonResult; -} -+ (LoginWithProviderRequestInterface *)fromList:(NSArray *)list { - LoginWithProviderRequestInterface *pigeonResult = [[LoginWithProviderRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.provider = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.provider != nil, @""); - pigeonResult.origin = GetNullableObjectAtIndex(list, 2); - NSAssert(pigeonResult.origin != nil, @""); - pigeonResult.scope = GetNullableObjectAtIndex(list, 3); - pigeonResult.errorCodes = [ErrorCodesInterface nullableFromList:(GetNullableObjectAtIndex(list, 4))]; - NSAssert(pigeonResult.errorCodes != nil, @""); - return pigeonResult; -} -+ (nullable LoginWithProviderRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [LoginWithProviderRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.provider ?: [NSNull null]), - (self.origin ?: [NSNull null]), - (self.scope ?: [NSNull null]), - (self.errorCodes ? [self.errorCodes toList] : [NSNull null]), - ]; -} -@end - -@implementation RefreshAccessTokenRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - authToken:(AuthTokenInterface *)authToken { - RefreshAccessTokenRequestInterface* pigeonResult = [[RefreshAccessTokenRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.authToken = authToken; - return pigeonResult; -} -+ (RefreshAccessTokenRequestInterface *)fromList:(NSArray *)list { - RefreshAccessTokenRequestInterface *pigeonResult = [[RefreshAccessTokenRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.authToken = [AuthTokenInterface nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - NSAssert(pigeonResult.authToken != nil, @""); - return pigeonResult; -} -+ (nullable RefreshAccessTokenRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [RefreshAccessTokenRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.authToken ? [self.authToken toList] : [NSNull null]), - ]; -} -@end - -@implementation LoginSummaryInterface -+ (instancetype)makeWithFirstLogin:(nullable NSNumber *)firstLogin - lastLogin:(nullable NSNumber *)lastLogin - total:(nullable NSNumber *)total - origins:(nullable NSArray *)origins - devices:(nullable NSArray *)devices - lastProvider:(nullable NSString *)lastProvider { - LoginSummaryInterface* pigeonResult = [[LoginSummaryInterface alloc] init]; - pigeonResult.firstLogin = firstLogin; - pigeonResult.lastLogin = lastLogin; - pigeonResult.total = total; - pigeonResult.origins = origins; - pigeonResult.devices = devices; - pigeonResult.lastProvider = lastProvider; - return pigeonResult; -} -+ (LoginSummaryInterface *)fromList:(NSArray *)list { - LoginSummaryInterface *pigeonResult = [[LoginSummaryInterface alloc] init]; - pigeonResult.firstLogin = GetNullableObjectAtIndex(list, 0); - pigeonResult.lastLogin = GetNullableObjectAtIndex(list, 1); - pigeonResult.total = GetNullableObjectAtIndex(list, 2); - pigeonResult.origins = GetNullableObjectAtIndex(list, 3); - pigeonResult.devices = GetNullableObjectAtIndex(list, 4); - pigeonResult.lastProvider = GetNullableObjectAtIndex(list, 5); - return pigeonResult; -} -+ (nullable LoginSummaryInterface *)nullableFromList:(NSArray *)list { - return (list) ? [LoginSummaryInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.firstLogin ?: [NSNull null]), - (self.lastLogin ?: [NSNull null]), - (self.total ?: [NSNull null]), - (self.origins ?: [NSNull null]), - (self.devices ?: [NSNull null]), - (self.lastProvider ?: [NSNull null]), - ]; -} -@end - -@implementation EmailsInterface -+ (instancetype)makeWithVerified:(nullable NSArray *)verified - unverified:(nullable NSArray *)unverified { - EmailsInterface* pigeonResult = [[EmailsInterface alloc] init]; - pigeonResult.verified = verified; - pigeonResult.unverified = unverified; - return pigeonResult; -} -+ (EmailsInterface *)fromList:(NSArray *)list { - EmailsInterface *pigeonResult = [[EmailsInterface alloc] init]; - pigeonResult.verified = GetNullableObjectAtIndex(list, 0); - pigeonResult.unverified = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable EmailsInterface *)nullableFromList:(NSArray *)list { - return (list) ? [EmailsInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.verified ?: [NSNull null]), - (self.unverified ?: [NSNull null]), - ]; -} -@end - -@implementation ProfileInterface -+ (instancetype)makeWithUid:(nullable NSString *)uid - givenName:(nullable NSString *)givenName - middleName:(nullable NSString *)middleName - familyName:(nullable NSString *)familyName - name:(nullable NSString *)name - nickname:(nullable NSString *)nickname - birthdate:(nullable NSString *)birthdate - profileURL:(nullable NSString *)profileURL - picture:(nullable NSString *)picture - externalId:(nullable NSString *)externalId - authTypes:(nullable NSArray *)authTypes - loginSummary:(nullable LoginSummaryInterface *)loginSummary - username:(nullable NSString *)username - gender:(nullable NSString *)gender - email:(nullable NSString *)email - emailVerified:(nullable NSNumber *)emailVerified - emails:(nullable EmailsInterface *)emails - phoneNumber:(nullable NSString *)phoneNumber - phoneNumberVerified:(nullable NSNumber *)phoneNumberVerified - addresses:(nullable NSArray *)addresses - locale:(nullable NSString *)locale - bio:(nullable NSString *)bio - customFields:(nullable NSDictionary *)customFields - consents:(nullable NSDictionary *)consents - createdAt:(nullable NSString *)createdAt - updatedAt:(nullable NSString *)updatedAt - liteOnly:(nullable NSNumber *)liteOnly - company:(nullable NSString *)company { - ProfileInterface* pigeonResult = [[ProfileInterface alloc] init]; - pigeonResult.uid = uid; - pigeonResult.givenName = givenName; - pigeonResult.middleName = middleName; - pigeonResult.familyName = familyName; - pigeonResult.name = name; - pigeonResult.nickname = nickname; - pigeonResult.birthdate = birthdate; - pigeonResult.profileURL = profileURL; - pigeonResult.picture = picture; - pigeonResult.externalId = externalId; - pigeonResult.authTypes = authTypes; - pigeonResult.loginSummary = loginSummary; - pigeonResult.username = username; - pigeonResult.gender = gender; - pigeonResult.email = email; - pigeonResult.emailVerified = emailVerified; - pigeonResult.emails = emails; - pigeonResult.phoneNumber = phoneNumber; - pigeonResult.phoneNumberVerified = phoneNumberVerified; - pigeonResult.addresses = addresses; - pigeonResult.locale = locale; - pigeonResult.bio = bio; - pigeonResult.customFields = customFields; - pigeonResult.consents = consents; - pigeonResult.createdAt = createdAt; - pigeonResult.updatedAt = updatedAt; - pigeonResult.liteOnly = liteOnly; - pigeonResult.company = company; - return pigeonResult; -} -+ (ProfileInterface *)fromList:(NSArray *)list { - ProfileInterface *pigeonResult = [[ProfileInterface alloc] init]; - pigeonResult.uid = GetNullableObjectAtIndex(list, 0); - pigeonResult.givenName = GetNullableObjectAtIndex(list, 1); - pigeonResult.middleName = GetNullableObjectAtIndex(list, 2); - pigeonResult.familyName = GetNullableObjectAtIndex(list, 3); - pigeonResult.name = GetNullableObjectAtIndex(list, 4); - pigeonResult.nickname = GetNullableObjectAtIndex(list, 5); - pigeonResult.birthdate = GetNullableObjectAtIndex(list, 6); - pigeonResult.profileURL = GetNullableObjectAtIndex(list, 7); - pigeonResult.picture = GetNullableObjectAtIndex(list, 8); - pigeonResult.externalId = GetNullableObjectAtIndex(list, 9); - pigeonResult.authTypes = GetNullableObjectAtIndex(list, 10); - pigeonResult.loginSummary = [LoginSummaryInterface nullableFromList:(GetNullableObjectAtIndex(list, 11))]; - pigeonResult.username = GetNullableObjectAtIndex(list, 12); - pigeonResult.gender = GetNullableObjectAtIndex(list, 13); - pigeonResult.email = GetNullableObjectAtIndex(list, 14); - pigeonResult.emailVerified = GetNullableObjectAtIndex(list, 15); - pigeonResult.emails = [EmailsInterface nullableFromList:(GetNullableObjectAtIndex(list, 16))]; - pigeonResult.phoneNumber = GetNullableObjectAtIndex(list, 17); - pigeonResult.phoneNumberVerified = GetNullableObjectAtIndex(list, 18); - pigeonResult.addresses = GetNullableObjectAtIndex(list, 19); - pigeonResult.locale = GetNullableObjectAtIndex(list, 20); - pigeonResult.bio = GetNullableObjectAtIndex(list, 21); - pigeonResult.customFields = GetNullableObjectAtIndex(list, 22); - pigeonResult.consents = GetNullableObjectAtIndex(list, 23); - pigeonResult.createdAt = GetNullableObjectAtIndex(list, 24); - pigeonResult.updatedAt = GetNullableObjectAtIndex(list, 25); - pigeonResult.liteOnly = GetNullableObjectAtIndex(list, 26); - pigeonResult.company = GetNullableObjectAtIndex(list, 27); - return pigeonResult; -} -+ (nullable ProfileInterface *)nullableFromList:(NSArray *)list { - return (list) ? [ProfileInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.uid ?: [NSNull null]), - (self.givenName ?: [NSNull null]), - (self.middleName ?: [NSNull null]), - (self.familyName ?: [NSNull null]), - (self.name ?: [NSNull null]), - (self.nickname ?: [NSNull null]), - (self.birthdate ?: [NSNull null]), - (self.profileURL ?: [NSNull null]), - (self.picture ?: [NSNull null]), - (self.externalId ?: [NSNull null]), - (self.authTypes ?: [NSNull null]), - (self.loginSummary ? [self.loginSummary toList] : [NSNull null]), - (self.username ?: [NSNull null]), - (self.gender ?: [NSNull null]), - (self.email ?: [NSNull null]), - (self.emailVerified ?: [NSNull null]), - (self.emails ? [self.emails toList] : [NSNull null]), - (self.phoneNumber ?: [NSNull null]), - (self.phoneNumberVerified ?: [NSNull null]), - (self.addresses ?: [NSNull null]), - (self.locale ?: [NSNull null]), - (self.bio ?: [NSNull null]), - (self.customFields ?: [NSNull null]), - (self.consents ?: [NSNull null]), - (self.createdAt ?: [NSNull null]), - (self.updatedAt ?: [NSNull null]), - (self.liteOnly ?: [NSNull null]), - (self.company ?: [NSNull null]), - ]; -} -@end - -@implementation GetProfileRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - authToken:(AuthTokenInterface *)authToken - errorCodes:(ErrorCodesInterface *)errorCodes { - GetProfileRequestInterface* pigeonResult = [[GetProfileRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.authToken = authToken; - pigeonResult.errorCodes = errorCodes; - return pigeonResult; -} -+ (GetProfileRequestInterface *)fromList:(NSArray *)list { - GetProfileRequestInterface *pigeonResult = [[GetProfileRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.authToken = [AuthTokenInterface nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - NSAssert(pigeonResult.authToken != nil, @""); - pigeonResult.errorCodes = [ErrorCodesInterface nullableFromList:(GetNullableObjectAtIndex(list, 2))]; - NSAssert(pigeonResult.errorCodes != nil, @""); - return pigeonResult; -} -+ (nullable GetProfileRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [GetProfileRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.authToken ? [self.authToken toList] : [NSNull null]), - (self.errorCodes ? [self.errorCodes toList] : [NSNull null]), - ]; -} -@end - -@implementation UpdateProfileRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - authToken:(AuthTokenInterface *)authToken - profile:(ProfileInterface *)profile - errorCodes:(ErrorCodesInterface *)errorCodes { - UpdateProfileRequestInterface* pigeonResult = [[UpdateProfileRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.authToken = authToken; - pigeonResult.profile = profile; - pigeonResult.errorCodes = errorCodes; - return pigeonResult; -} -+ (UpdateProfileRequestInterface *)fromList:(NSArray *)list { - UpdateProfileRequestInterface *pigeonResult = [[UpdateProfileRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.authToken = [AuthTokenInterface nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - NSAssert(pigeonResult.authToken != nil, @""); - pigeonResult.profile = [ProfileInterface nullableFromList:(GetNullableObjectAtIndex(list, 2))]; - NSAssert(pigeonResult.profile != nil, @""); - pigeonResult.errorCodes = [ErrorCodesInterface nullableFromList:(GetNullableObjectAtIndex(list, 3))]; - NSAssert(pigeonResult.errorCodes != nil, @""); - return pigeonResult; -} -+ (nullable UpdateProfileRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [UpdateProfileRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.authToken ? [self.authToken toList] : [NSNull null]), - (self.profile ? [self.profile toList] : [NSNull null]), - (self.errorCodes ? [self.errorCodes toList] : [NSNull null]), - ]; -} -@end - -@implementation RequestPasswordResetRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - email:(nullable NSString *)email - phoneNumber:(nullable NSString *)phoneNumber - redirectUrl:(nullable NSString *)redirectUrl { - RequestPasswordResetRequestInterface* pigeonResult = [[RequestPasswordResetRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.email = email; - pigeonResult.phoneNumber = phoneNumber; - pigeonResult.redirectUrl = redirectUrl; - return pigeonResult; -} -+ (RequestPasswordResetRequestInterface *)fromList:(NSArray *)list { - RequestPasswordResetRequestInterface *pigeonResult = [[RequestPasswordResetRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.email = GetNullableObjectAtIndex(list, 1); - pigeonResult.phoneNumber = GetNullableObjectAtIndex(list, 2); - pigeonResult.redirectUrl = GetNullableObjectAtIndex(list, 3); - return pigeonResult; -} -+ (nullable RequestPasswordResetRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [RequestPasswordResetRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.email ?: [NSNull null]), - (self.phoneNumber ?: [NSNull null]), - (self.redirectUrl ?: [NSNull null]), - ]; -} -@end - -@implementation UpdatePasswordWithAccessTokenRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - authToken:(AuthTokenInterface *)authToken - oldPassword:(NSString *)oldPassword - password:(NSString *)password { - UpdatePasswordWithAccessTokenRequestInterface* pigeonResult = [[UpdatePasswordWithAccessTokenRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.authToken = authToken; - pigeonResult.oldPassword = oldPassword; - pigeonResult.password = password; - return pigeonResult; -} -+ (UpdatePasswordWithAccessTokenRequestInterface *)fromList:(NSArray *)list { - UpdatePasswordWithAccessTokenRequestInterface *pigeonResult = [[UpdatePasswordWithAccessTokenRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.authToken = [AuthTokenInterface nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - NSAssert(pigeonResult.authToken != nil, @""); - pigeonResult.oldPassword = GetNullableObjectAtIndex(list, 2); - NSAssert(pigeonResult.oldPassword != nil, @""); - pigeonResult.password = GetNullableObjectAtIndex(list, 3); - NSAssert(pigeonResult.password != nil, @""); - return pigeonResult; -} -+ (nullable UpdatePasswordWithAccessTokenRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [UpdatePasswordWithAccessTokenRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.authToken ? [self.authToken toList] : [NSNull null]), - (self.oldPassword ?: [NSNull null]), - (self.password ?: [NSNull null]), - ]; -} -@end - -@implementation UpdatePasswordWithFreshAccessTokenRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - freshAuthToken:(AuthTokenInterface *)freshAuthToken - password:(NSString *)password { - UpdatePasswordWithFreshAccessTokenRequestInterface* pigeonResult = [[UpdatePasswordWithFreshAccessTokenRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.freshAuthToken = freshAuthToken; - pigeonResult.password = password; - return pigeonResult; -} -+ (UpdatePasswordWithFreshAccessTokenRequestInterface *)fromList:(NSArray *)list { - UpdatePasswordWithFreshAccessTokenRequestInterface *pigeonResult = [[UpdatePasswordWithFreshAccessTokenRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.freshAuthToken = [AuthTokenInterface nullableFromList:(GetNullableObjectAtIndex(list, 1))]; - NSAssert(pigeonResult.freshAuthToken != nil, @""); - pigeonResult.password = GetNullableObjectAtIndex(list, 2); - NSAssert(pigeonResult.password != nil, @""); - return pigeonResult; -} -+ (nullable UpdatePasswordWithFreshAccessTokenRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [UpdatePasswordWithFreshAccessTokenRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.freshAuthToken ? [self.freshAuthToken toList] : [NSNull null]), - (self.password ?: [NSNull null]), - ]; -} -@end - -@implementation UpdatePasswordWithEmailRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - email:(NSString *)email - verificationCode:(NSString *)verificationCode - password:(NSString *)password - errorCodes:(ErrorCodesInterface *)errorCodes { - UpdatePasswordWithEmailRequestInterface* pigeonResult = [[UpdatePasswordWithEmailRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.email = email; - pigeonResult.verificationCode = verificationCode; - pigeonResult.password = password; - pigeonResult.errorCodes = errorCodes; - return pigeonResult; -} -+ (UpdatePasswordWithEmailRequestInterface *)fromList:(NSArray *)list { - UpdatePasswordWithEmailRequestInterface *pigeonResult = [[UpdatePasswordWithEmailRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.email = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.email != nil, @""); - pigeonResult.verificationCode = GetNullableObjectAtIndex(list, 2); - NSAssert(pigeonResult.verificationCode != nil, @""); - pigeonResult.password = GetNullableObjectAtIndex(list, 3); - NSAssert(pigeonResult.password != nil, @""); - pigeonResult.errorCodes = [ErrorCodesInterface nullableFromList:(GetNullableObjectAtIndex(list, 4))]; - NSAssert(pigeonResult.errorCodes != nil, @""); - return pigeonResult; -} -+ (nullable UpdatePasswordWithEmailRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [UpdatePasswordWithEmailRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.email ?: [NSNull null]), - (self.verificationCode ?: [NSNull null]), - (self.password ?: [NSNull null]), - (self.errorCodes ? [self.errorCodes toList] : [NSNull null]), - ]; -} -@end - -@implementation UpdatePasswordWithPhoneNumberRequestInterface -+ (instancetype)makeWithReachFiveKey:(ReachFiveKeyInterface *)reachFiveKey - phoneNumber:(NSString *)phoneNumber - verificationCode:(NSString *)verificationCode - password:(NSString *)password - errorCodes:(ErrorCodesInterface *)errorCodes { - UpdatePasswordWithPhoneNumberRequestInterface* pigeonResult = [[UpdatePasswordWithPhoneNumberRequestInterface alloc] init]; - pigeonResult.reachFiveKey = reachFiveKey; - pigeonResult.phoneNumber = phoneNumber; - pigeonResult.verificationCode = verificationCode; - pigeonResult.password = password; - pigeonResult.errorCodes = errorCodes; - return pigeonResult; -} -+ (UpdatePasswordWithPhoneNumberRequestInterface *)fromList:(NSArray *)list { - UpdatePasswordWithPhoneNumberRequestInterface *pigeonResult = [[UpdatePasswordWithPhoneNumberRequestInterface alloc] init]; - pigeonResult.reachFiveKey = [ReachFiveKeyInterface nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - NSAssert(pigeonResult.reachFiveKey != nil, @""); - pigeonResult.phoneNumber = GetNullableObjectAtIndex(list, 1); - NSAssert(pigeonResult.phoneNumber != nil, @""); - pigeonResult.verificationCode = GetNullableObjectAtIndex(list, 2); - NSAssert(pigeonResult.verificationCode != nil, @""); - pigeonResult.password = GetNullableObjectAtIndex(list, 3); - NSAssert(pigeonResult.password != nil, @""); - pigeonResult.errorCodes = [ErrorCodesInterface nullableFromList:(GetNullableObjectAtIndex(list, 4))]; - NSAssert(pigeonResult.errorCodes != nil, @""); - return pigeonResult; -} -+ (nullable UpdatePasswordWithPhoneNumberRequestInterface *)nullableFromList:(NSArray *)list { - return (list) ? [UpdatePasswordWithPhoneNumberRequestInterface fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - (self.reachFiveKey ? [self.reachFiveKey toList] : [NSNull null]), - (self.phoneNumber ?: [NSNull null]), - (self.verificationCode ?: [NSNull null]), - (self.password ?: [NSNull null]), - (self.errorCodes ? [self.errorCodes toList] : [NSNull null]), - ]; -} -@end - -@interface ReachFiveHostApiCodecReader : FlutterStandardReader -@end -@implementation ReachFiveHostApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [AddressInterface fromList:[self readValue]]; - case 129: - return [AuthTokenInterface fromList:[self readValue]]; - case 130: - return [ConsentInterface fromList:[self readValue]]; - case 131: - return [EmailsInterface fromList:[self readValue]]; - case 132: - return [ErrorCodesInterface fromList:[self readValue]]; - case 133: - return [GetProfileRequestInterface fromList:[self readValue]]; - case 134: - return [LoginSummaryInterface fromList:[self readValue]]; - case 135: - return [LoginWithPasswordRequestInterface fromList:[self readValue]]; - case 136: - return [LoginWithProviderRequestInterface fromList:[self readValue]]; - case 137: - return [OpenIdUserInterface fromList:[self readValue]]; - case 138: - return [ProfileAddressInterface fromList:[self readValue]]; - case 139: - return [ProfileInterface fromList:[self readValue]]; - case 140: - return [ProfileSignupRequestInterface fromList:[self readValue]]; - case 141: - return [ProviderCreatorInterface fromList:[self readValue]]; - case 142: - return [ReachFiveConfigInterface fromList:[self readValue]]; - case 143: - return [ReachFiveKeyInterface fromList:[self readValue]]; - case 144: - return [RefreshAccessTokenRequestInterface fromList:[self readValue]]; - case 145: - return [RequestPasswordResetRequestInterface fromList:[self readValue]]; - case 146: - return [SdkConfigInterface fromList:[self readValue]]; - case 147: - return [SignupRequestInterface fromList:[self readValue]]; - case 148: - return [UpdatePasswordWithAccessTokenRequestInterface fromList:[self readValue]]; - case 149: - return [UpdatePasswordWithEmailRequestInterface fromList:[self readValue]]; - case 150: - return [UpdatePasswordWithFreshAccessTokenRequestInterface fromList:[self readValue]]; - case 151: - return [UpdatePasswordWithPhoneNumberRequestInterface fromList:[self readValue]]; - case 152: - return [UpdateProfileRequestInterface fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface ReachFiveHostApiCodecWriter : FlutterStandardWriter -@end -@implementation ReachFiveHostApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[AddressInterface class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[AuthTokenInterface class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[ConsentInterface class]]) { - [self writeByte:130]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[EmailsInterface class]]) { - [self writeByte:131]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[ErrorCodesInterface class]]) { - [self writeByte:132]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[GetProfileRequestInterface class]]) { - [self writeByte:133]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[LoginSummaryInterface class]]) { - [self writeByte:134]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[LoginWithPasswordRequestInterface class]]) { - [self writeByte:135]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[LoginWithProviderRequestInterface class]]) { - [self writeByte:136]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[OpenIdUserInterface class]]) { - [self writeByte:137]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[ProfileAddressInterface class]]) { - [self writeByte:138]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[ProfileInterface class]]) { - [self writeByte:139]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[ProfileSignupRequestInterface class]]) { - [self writeByte:140]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[ProviderCreatorInterface class]]) { - [self writeByte:141]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[ReachFiveConfigInterface class]]) { - [self writeByte:142]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[ReachFiveKeyInterface class]]) { - [self writeByte:143]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[RefreshAccessTokenRequestInterface class]]) { - [self writeByte:144]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[RequestPasswordResetRequestInterface class]]) { - [self writeByte:145]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SdkConfigInterface class]]) { - [self writeByte:146]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SignupRequestInterface class]]) { - [self writeByte:147]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[UpdatePasswordWithAccessTokenRequestInterface class]]) { - [self writeByte:148]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[UpdatePasswordWithEmailRequestInterface class]]) { - [self writeByte:149]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[UpdatePasswordWithFreshAccessTokenRequestInterface class]]) { - [self writeByte:150]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[UpdatePasswordWithPhoneNumberRequestInterface class]]) { - [self writeByte:151]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[UpdateProfileRequestInterface class]]) { - [self writeByte:152]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface ReachFiveHostApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation ReachFiveHostApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[ReachFiveHostApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[ReachFiveHostApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *ReachFiveHostApiGetCodec() { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - ReachFiveHostApiCodecReaderWriter *readerWriter = [[ReachFiveHostApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - -void ReachFiveHostApiSetup(id binaryMessenger, NSObject *api) { - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.initialize" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(initializeReachFiveKey:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(initializeReachFiveKey:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - ReachFiveKeyInterface *arg_reachFiveKey = GetNullableObjectAtIndex(args, 0); - [api initializeReachFiveKey:arg_reachFiveKey completion:^(ReachFiveConfigInterface *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.signup" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(signupRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(signupRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - SignupRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api signupRequest:arg_request completion:^(AuthTokenInterface *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.loginWithPassword" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(loginWithPasswordRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(loginWithPasswordRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - LoginWithPasswordRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api loginWithPasswordRequest:arg_request completion:^(AuthTokenInterface *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.loginWithProvider" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(loginWithProviderRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(loginWithProviderRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - LoginWithProviderRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api loginWithProviderRequest:arg_request completion:^(AuthTokenInterface *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.logout" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(logoutReachFiveKey:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(logoutReachFiveKey:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - ReachFiveKeyInterface *arg_reachFiveKey = GetNullableObjectAtIndex(args, 0); - [api logoutReachFiveKey:arg_reachFiveKey completion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.getProfile" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(getProfileRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(getProfileRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - GetProfileRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api getProfileRequest:arg_request completion:^(ProfileInterface *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.updateProfile" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateProfileRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(updateProfileRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - UpdateProfileRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api updateProfileRequest:arg_request completion:^(ProfileInterface *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.refreshAccessToken" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(refreshAccessTokenRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(refreshAccessTokenRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - RefreshAccessTokenRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api refreshAccessTokenRequest:arg_request completion:^(AuthTokenInterface *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.requestPasswordReset" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(requestPasswordResetRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(requestPasswordResetRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - RequestPasswordResetRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api requestPasswordResetRequest:arg_request completion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithAccessToken" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updatePasswordWithAccessTokenRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(updatePasswordWithAccessTokenRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - UpdatePasswordWithAccessTokenRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api updatePasswordWithAccessTokenRequest:arg_request completion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithFreshAccessToken" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updatePasswordWithFreshAccessTokenRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(updatePasswordWithFreshAccessTokenRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - UpdatePasswordWithFreshAccessTokenRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api updatePasswordWithFreshAccessTokenRequest:arg_request completion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithEmail" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updatePasswordWithEmailRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(updatePasswordWithEmailRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - UpdatePasswordWithEmailRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api updatePasswordWithEmailRequest:arg_request completion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.ReachFiveHostApi.updatePasswordWithPhoneNumber" - binaryMessenger:binaryMessenger - codec:ReachFiveHostApiGetCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updatePasswordWithPhoneNumberRequest:completion:)], @"ReachFiveHostApi api (%@) doesn't respond to @selector(updatePasswordWithPhoneNumberRequest:completion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - UpdatePasswordWithPhoneNumberRequestInterface *arg_request = GetNullableObjectAtIndex(args, 0); - [api updatePasswordWithPhoneNumberRequest:arg_request completion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} diff --git a/flutter_reach_five_platform_interface/lib/src/reach_five.g.dart b/flutter_reach_five_platform_interface/lib/src/reach_five.g.dart index af66df7..0c2d288 100644 --- a/flutter_reach_five_platform_interface/lib/src/reach_five.g.dart +++ b/flutter_reach_five_platform_interface/lib/src/reach_five.g.dart @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v9.1.0), do not edit directly. +// Autogenerated from Pigeon (v9.2.4), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import diff --git a/flutter_reach_five_platform_interface/pigeons/reach_five.dart b/flutter_reach_five_platform_interface/pigeons/reach_five.dart index ed2c17c..3f87c1c 100644 --- a/flutter_reach_five_platform_interface/pigeons/reach_five.dart +++ b/flutter_reach_five_platform_interface/pigeons/reach_five.dart @@ -3,14 +3,13 @@ import 'package:pigeon/pigeon.dart'; @ConfigurePigeon( PigeonOptions( dartOut: 'lib/src/reach_five.g.dart', - javaOut: - '../flutter_reach_five_android/android/src/main/java/tech/bam/flutter_reach_five/android/ReachFiveApi.java', - javaOptions: JavaOptions( + kotlinOut: + '../flutter_reach_five_android/android/src/main/kotlin/tech/bam/flutter_reach_five/android/ReachFiveApi.kt', + kotlinOptions: KotlinOptions( package: 'tech.bam.flutter_reach_five.android', - className: 'ReachFiveApi', ), - objcHeaderOut: '../flutter_reach_five_ios/ios/Classes/reach_five_api.h', - objcSourceOut: '../flutter_reach_five_ios/ios/Classes/reach_five_api.m', + swiftOut: '../flutter_reach_five_ios/ios/Classes/ReachFiveApi.swift', + swiftOptions: SwiftOptions(), ), ) class ErrorCodesInterface { diff --git a/flutter_reach_five_platform_interface/pubspec.yaml b/flutter_reach_five_platform_interface/pubspec.yaml index 80264b5..a7525cd 100644 --- a/flutter_reach_five_platform_interface/pubspec.yaml +++ b/flutter_reach_five_platform_interface/pubspec.yaml @@ -16,4 +16,4 @@ dev_dependencies: flutter_test: sdk: flutter mocktail: ^0.3.0 - pigeon: ^9.1.0 + pigeon: ^9.2.4